Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
mmc::Validation Class Reference
Inheritance diagram for mmc::Validation:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 Validation (fhicl::ParameterSet const &p)
 
 Validation (Validation const &)=delete
 
 Validation (Validation &&)=delete
 
Validationoperator= (Validation const &)=delete
 
Validationoperator= (Validation &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () override
 
void endJob () override
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Member Functions

template<class T >
void tset (T &tree, std::string const branch_name, double const value)
 
double phi (simb::MCParticle const *particle) const
 
double theta (simb::MCParticle const *particle) const
 
int GetMCTruth (const art::Event &evt, std::vector< simb::MCTruth > &mctruth)
 
void print_truth_info (art::Event const &e, bool const &print_hit_details) const
 

Private Attributes

art::ServiceHandle< art::TFileServicetfs_
 
art::ServiceHandle< cheat::BackTrackerbt_
 
TTree * event_tree_
 
TTree * flshit_tree_
 
TTree * cellhit_tree_
 
std::map< std::string, double > et_
 
std::map< std::string, double > flsht_
 
std::map< std::string, double > cht_
 
const double branch_default_value_
 
const double to_degrees_
 

Detailed Description

Definition at line 32 of file Validation_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

mmc::Validation::Validation ( fhicl::ParameterSet const &  p)
explicit

Definition at line 69 of file Validation_module.cc.

69  :
70  EDAnalyzer(p),
71  branch_default_value_(-9999),
72  to_degrees_(180.0 / TMath::Pi())
73 {}
const char * p
Definition: xmltok.h:285
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
const double branch_default_value_
const double to_degrees_
mmc::Validation::Validation ( Validation const &  )
delete
mmc::Validation::Validation ( Validation &&  )
delete

Member Function Documentation

void mmc::Validation::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 75 of file Validation_module.cc.

References compare_h5_caf::branch, branch_default_value_, bt_, cellhit_tree_, om::cerr, cht_, std::cos(), dE, dx, allTimeWatchdog::endl, et_, event_tree_, flshit_tree_, flsht_, art::DataViewImpl::getByLabel(), GetMCTruth(), cheat::BackTracker::HaveTruthInfo(), hits(), MECModelEnuComparisons::i, cheat::BackTracker::IsNoise(), simb::MCParticle::Mass(), simb::MCParticle::NumberDaughters(), simb::MCParticle::P(), cheat::BackTracker::ParticleNavigator(), cheat::BackTracker::ParticleToFLSHit(), phi(), sim::ParticleNavigator::Primary(), sim::ParticleNavigator::size(), theta(), simb::MCParticle::TrackId(), and tset().

76 {
77  //print_truth_info(e,true);
78 
79  // Initialize all branches to default value
80  for (auto & branch : et_)
82 
83  //-------------------------------------------------------
84  // MC info
85  if (bt_->HaveTruthInfo())
86  {
87  tset(et_, "is_mc", true);
88 
89  // First, get info from backtracker -------------------
91  tset(et_, "mc_bt_n_particles", pn.size());
92  if (pn.size() == 1)
93  {
94  sim::Particle const* bt_particle = pn.Primary(0);
95  tset(et_, "mc_bt_phi", phi(bt_particle));
96  tset(et_, "mc_bt_theta", theta(bt_particle));
97  tset(et_, "mc_bt_cos_theta", cos(theta(bt_particle)));
98  tset(et_, "mc_bt_beta", bt_particle->P(0) / bt_particle->Mass());
99  tset(et_, "mc_bt_n_daughters", bt_particle->NumberDaughters());
100 
101  // FLSHits ----------------------
102  double dx, dE, dEBirks, dEdx, dEBirksdx;
103  double Edep = 0;
104  double EBirksdep = 0;
105  double pathLength = 0;
106  const std::vector<sim::FLSHit>& flshits = bt_->ParticleToFLSHit(bt_particle->TrackId());
107  for (const auto flshit : flshits)
108  {
109  //Initialize branches
110  for (auto & branch : flsht_)
111  branch.second = branch_default_value_;
112 
113  // Get this hit's values
114  dx = flshit.GetTotalPathLength();
115  dE = flshit.GetEdep();
116  dEBirks = flshit.GetEdepBirks();
117  dEdx = dE / dx;
118  dEBirksdx = dEBirks / dx;
119 
120  tset(flsht_, "hit_dx", dx);
121  tset(flsht_, "hit_dE", dE);
122  tset(flsht_, "hit_dEBirks", dEBirks);
123  tset(flsht_, "hit_dEdx", dEdx);
124  tset(flsht_, "hit_dEBirksdx", dEBirksdx);
125 
126  tset(flsht_, "mc_bt_beta", bt_particle->P(0) / bt_particle->Mass());
127 
128  flshit_tree_->Fill();
129 
130  // Increment event-level totals
131  Edep += dE;
132  EBirksdep += dEBirks;
133  pathLength += dx;
134  } // loop over flshits
135  tset(et_, "mc_bt_dE", Edep);
136  tset(et_, "mc_bt_dEBirks", EBirksdep);
137  tset(et_, "mc_bt_pathlength", pathLength);
138 
139  // CellHits --------------------------------
141  e.getByLabel("calhit", hits);
142  std::vector<art::Ptr<rb::CellHit> > hitptrs;
143  for (unsigned i = 0; i < hits->size(); ++i)
144  hitptrs.emplace_back(hits, i);
145 
146  for (auto const& hitptr : hitptrs)
147  {
148  if (bt_->IsNoise(hitptr)) continue;
149 
150  //Initialize branches
151  for (auto & branch : cht_)
152  branch.second = branch_default_value_;
153 
154  tset(cht_, "view", hitptr->View());
155  tset(cht_, "plane", hitptr->Plane());
156  tset(cht_, "cell", hitptr->Cell());
157  tset(cht_, "tns", hitptr->TNS());
158  tset(cht_, "adc", hitptr->ADC()); //Rob: returns ADC(3)-ADC(0)
159 
160  tset(cht_, "mc_bt_beta", bt_particle->P(0) / bt_particle->Mass());
161 
162  cellhit_tree_->Fill();
163  }
164 
165  } else {
166  std::cerr << "\n\tParticle navigator contains "
167  << pn.size() << " particles. Check MCTruth info.\n"
168  << std::endl;
169  }
170 
171  // Then, get info from MCTruth a la Event Display -----
172  std::vector<simb::MCTruth> mctruth;
173  GetMCTruth(e, mctruth);
174  simb::MCParticle const mct_particle = mctruth[0].GetParticle(0); //unwise?
175  tset(et_, "mc_truth_phi", phi(&mct_particle));
176  tset(et_, "mc_truth_theta", theta(&mct_particle));
177  tset(et_, "mc_truth_cos_theta", cos(theta(&mct_particle)));
178  tset(et_, "mc_truth_beta", mct_particle.P(0) / mct_particle.Mass());
179 
180  } else {
181  tset(et_, "is_mc", false);
182  }
183  event_tree_->Fill();
184 }
std::map< std::string, double > flsht_
const sim::ParticleNavigator & ParticleNavigator() const
Get a reference to the ParticleNavigator.
Definition: BackTracker.h:744
size_type size() const
std::vector< sim::FLSHit > ParticleToFLSHit(const int &trackID) const
All the FLSHits that were created by the track id trackID, sorted from most to least light...
double Mass() const
Definition: MCParticle.h:238
OStream cerr
Definition: OStream.cxx:7
double dE
int NumberDaughters() const
Definition: MCParticle.h:216
bool IsNoise(const art::Ptr< rb::CellHit > &hit) const
Is this hit not associated with any particles?
int TrackId() const
Definition: MCParticle.h:209
void tset(T &tree, std::string const branch_name, double const value)
void hits()
Definition: readHits.C:15
double dx[NP][NC]
const sim::Particle * Primary(const int) const
double P(const int i=0) const
Definition: MCParticle.h:233
double theta(simb::MCParticle const *particle) const
const double branch_default_value_
std::map< std::string, double > et_
bool HaveTruthInfo() const
Is this a file with truth info in? (Is BackTracker going to be any use to you?)
Definition: BackTracker.h:133
T cos(T number)
Definition: d0nt_math.hpp:78
Float_t e
Definition: plot.C:35
std::map< std::string, double > cht_
double phi(simb::MCParticle const *particle) const
art::ServiceHandle< cheat::BackTracker > bt_
int GetMCTruth(const art::Event &evt, std::vector< simb::MCTruth > &mctruth)
void mmc::Validation::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 186 of file Validation_module.cc.

References cellhit_tree_, cht_, et_, event_tree_, flshit_tree_, flsht_, art::TFileDirectory::make(), and tfs_.

187 {
188  // FLSHit-Based Tree
189  std::vector<std::string> flshit_tree_names =
190  {"hit_dx",
191  "hit_dE",
192  "hit_dEBirks",
193  "hit_dEdx",
194  "hit_dEBirksdx",
195  "mc_bt_beta"};
196  flshit_tree_ = tfs_->make<TTree>("FLSHit", "Monopole FLSHit Tree");
197  for (auto const& name : flshit_tree_names)
198  flshit_tree_->Branch(name.c_str(), &flsht_[name], (name + "/D").c_str());
199 
200  // CellHit-Based Tree
201  std::vector<std::string> cellhit_tree_names =
202  {"view",
203  "plane",
204  "cell",
205  "tns",
206  "adc",
207  "mc_bt_beta"};
208  cellhit_tree_ = tfs_->make<TTree>("CellHit", "Monopole CellHit Tree");
209  for (auto const& name : cellhit_tree_names)
210  cellhit_tree_->Branch(name.c_str(), &cht_[name], (name + "/D").c_str());
211 
212  // Event-Based Tree
213  std::vector<std::string> event_tree_names =
214  {"is_mc",
215  "mc_bt_phi",
216  "mc_bt_theta",
217  "mc_bt_cos_theta",
218  "mc_bt_beta",
219  "mc_bt_n_particles",
220  "mc_bt_n_daughters",
221  "mc_bt_pathlength",
222  "mc_bt_dE",
223  "mc_bt_dEBirks",
224  "mc_truth_phi",
225  "mc_truth_theta",
226  "mc_truth_cos_theta",
227  "mc_truth_beta"};
228  event_tree_ = tfs_->make<TTree>("Event", "Monopole Event Tree");
229  for (auto const& name : event_tree_names)
230  event_tree_->Branch(name.c_str(), &et_[name], (name + "/D").c_str());
231 }
const XML_Char * name
Definition: expat.h:151
std::map< std::string, double > flsht_
art::ServiceHandle< art::TFileService > tfs_
T * make(ARGS...args) const
std::map< std::string, double > et_
std::map< std::string, double > cht_
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDAnalyzer::currentContext ( ) const
protectedinherited
void mmc::Validation::endJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 233 of file Validation_module.cc.

References tset().

234 {
235 }
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
int mmc::Validation::GetMCTruth ( const art::Event evt,
std::vector< simb::MCTruth > &  mctruth 
)
private

Definition at line 265 of file Validation_module.cc.

References art::DataViewImpl::getManyByType(), and print_truth_info().

Referenced by analyze().

267 {
268  mctruth.clear();
269 
270  // going to use getManyByType so that we don't have to
271  // worry about using a module label
272  std::vector< art::Handle< std::vector<simb::MCTruth> > > tcol;
273 
274  evt.getManyByType(tcol);
275  for(size_t mctc = 0; mctc < tcol.size(); ++mctc)
276  {
277  for(size_t mct = 0; mct < tcol[mctc]->size(); ++mct)
278  {
279  mctruth.push_back(tcol[mctc]->at(mct));
280  }
281  }
282 
283  return mctruth.size();
284 }
void getManyByType(std::vector< Handle< PROD >> &results) const
Definition: DataViewImpl.h:446
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
Validation& mmc::Validation::operator= ( Validation const &  )
delete
Validation& mmc::Validation::operator= ( Validation &&  )
delete
double mmc::Validation::phi ( simb::MCParticle const *  particle) const
private

Definition at line 251 of file Validation_module.cc.

References std::atan2(), simb::MCParticle::Px(), and simb::MCParticle::Py().

Referenced by analyze(), and print_truth_info().

252 {
253  double Px(particle->Px()), Py(particle->Py());
254  return std::atan2(Py, Px);
255 }
T atan2(T number)
Definition: d0nt_math.hpp:72
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void mmc::Validation::print_truth_info ( art::Event const &  e,
bool const &  print_hit_details 
) const
private

Definition at line 288 of file Validation_module.cc.

References beta, bt_, om::cout, DEFINE_ART_MODULE(), dx, simb::MCParticle::E(), allTimeWatchdog::endl, art::Event::event(), sim::FLSHit::GetPlaneID(), cheat::BackTracker::HaveTruthInfo(), simb::MCParticle::Mass(), simb::MCParticle::NumberTrajectoryPoints(), simb::MCParticle::P(), cheat::BackTracker::ParticleNavigator(), cheat::BackTracker::ParticleToFLSHit(), phi(), simb::MCParticle::Px(), simb::MCParticle::Py(), simb::MCParticle::Pz(), simb::MCParticle::T(), theta(), simb::MCParticle::TrackId(), registry_explorer::v, simb::MCParticle::Vx(), simb::MCParticle::Vy(), and simb::MCParticle::Vz().

Referenced by GetMCTruth().

289 {
290  if (bt_->HaveTruthInfo())
291  {
293  unsigned n_particle = 0;
294 
295  for (auto p_handle : pn)
296  {
297  const sim::Particle* particle = p_handle.second;
298  std::cout << "MF: MC Particle " << ++n_particle
299  << "\tEvent " << e.event()
300  << "\nMF: Mass = " << particle->Mass()
301  << "\nMF: N Trajectory Points = "
302  << particle->NumberTrajectoryPoints()
303  << std::endl;
304 
305  for (unsigned trajectory = 0;
306  trajectory != particle->NumberTrajectoryPoints(); ++trajectory)
307  {
308  double to_degrees = 180 / TMath::Pi();
309  std::cout << "MF: Trajectory " << trajectory
310  << "\nMF:\t Energy = " << particle->E(trajectory)
311  << "\nMF:\t Momentum = " << particle->P(trajectory)
312  << "\nMF:\t Beta = "
313  << particle->P(trajectory) / particle->Mass()
314  << "\nMF:\t Time = " << particle->T(trajectory)
315  << "\nMF:\t Phi = " << to_degrees * phi(particle)
316  << "\nMF:\t Theta = " << to_degrees * theta(particle)
317  << "\nMF:\t [Vx, Vy, Vz] = ["
318  << particle->Vx(trajectory) << ", "
319  << particle->Vy(trajectory) << ", "
320  << particle->Vz(trajectory) << "]"
321  << "\nMF:\t [Px, Py, Pz] = ["
322  << particle->Px(trajectory) << ", "
323  << particle->Py(trajectory) << ", "
324  << particle->Pz(trajectory) << "]"
325  << std::endl;
326  }
327 
328  if (print_hit_details)
329  {
330  std::vector<sim::FLSHit> fls_hits =
331  bt_->ParticleToFLSHit(particle->TrackId());
332  std::cout << "MF: Hits:" << std::endl;
333  std::sort(fls_hits.begin(), fls_hits.end(),
334  [](sim::FLSHit const& lhs, sim::FLSHit const& rhs)
335  { return lhs.GetPlaneID() < rhs.GetPlaneID(); });
336 
337  for (auto const& fls_hit : fls_hits)
338  {
339  float dt = fls_hit.GetExitT() - fls_hit.GetEntryT();
340  float dx = fls_hit.GetTotalPathLength();
341  float v = dx / dt * 1.0e7;
342  float beta = v / 3.0e8;
343  float dEdx = fls_hit.GetEdep() / dx;
344 
345  std::cout << "MF:\t [plane, cell, beta, dEdx, path, Edep] = ["
346  << fls_hit.GetPlaneID() << ", "
347  << fls_hit.GetCellID() << ", "
348  << beta << ", "
349  << dEdx << ", "
350  << fls_hit.GetTotalPathLength() << ", "
351  << fls_hit.GetEdep() << "]" << std::endl;
352 
353  for (int point = 0; point != fls_hit.GetNPoints(); ++point)
354  {
355  std::cout << "MF:\t\t [x, y, z] = ["
356  << fls_hit.GetX(point) << ", "
357  << fls_hit.GetY(point) << ", "
358  << fls_hit.GetZ(point) << "]" << std::endl;
359  }
360  }
361  }
362  }
363  }
364 }
double E(const int i=0) const
Definition: MCParticle.h:232
unsigned int NumberTrajectoryPoints() const
Definition: MCParticle.h:217
double Py(const int i=0) const
Definition: MCParticle.h:230
int GetPlaneID() const
Plane ID.
Definition: FLSHit.h:37
const sim::ParticleNavigator & ParticleNavigator() const
Get a reference to the ParticleNavigator.
Definition: BackTracker.h:744
std::vector< sim::FLSHit > ParticleToFLSHit(const int &trackID) const
All the FLSHits that were created by the track id trackID, sorted from most to least light...
double Mass() const
Definition: MCParticle.h:238
double Px(const int i=0) const
Definition: MCParticle.h:229
A single unit of energy deposition in the liquid scintillator.
Definition: FLSHit.h:19
Double_t beta
int TrackId() const
Definition: MCParticle.h:209
Definition: Cand.cxx:23
double dx[NP][NC]
double P(const int i=0) const
Definition: MCParticle.h:233
double theta(simb::MCParticle const *particle) const
double T(const int i=0) const
Definition: MCParticle.h:223
OStream cout
Definition: OStream.cxx:6
double Vx(const int i=0) const
Definition: MCParticle.h:220
bool HaveTruthInfo() const
Is this a file with truth info in? (Is BackTracker going to be any use to you?)
Definition: BackTracker.h:133
double Pz(const int i=0) const
Definition: MCParticle.h:231
double Vz(const int i=0) const
Definition: MCParticle.h:222
Float_t e
Definition: plot.C:35
double phi(simb::MCParticle const *particle) const
art::ServiceHandle< cheat::BackTracker > bt_
double Vy(const int i=0) const
Definition: MCParticle.h:221
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

double mmc::Validation::theta ( simb::MCParticle const *  particle) const
private

Definition at line 257 of file Validation_module.cc.

References std::atan2(), simb::MCParticle::Px(), simb::MCParticle::Py(), simb::MCParticle::Pz(), and std::sqrt().

Referenced by analyze(), and print_truth_info().

258 {
259  double Px(particle->Px()), Py(particle->Py()), Pz(particle->Pz());
260  double Pt = std::sqrt(Px * Px + Py * Py);
261  return std::atan2(Pt, Pz);
262 }
T sqrt(T number)
Definition: d0nt_math.hpp:156
T atan2(T number)
Definition: d0nt_math.hpp:72
template<class T >
void mmc::Validation::tset ( T tree,
std::string const  branch_name,
double const  value 
)
private

Definition at line 239 of file Validation_module.cc.

References ana::assert(), om::cerr, allTimeWatchdog::endl, and it.

Referenced by analyze(), and endJob().

240 {
241  auto it = tree.find(branch_name);
242  if (it == tree.end())
243  {
244  std::cerr << "\n\t Branch " << branch_name << " does not exist! \n"
245  << std::endl;
246  assert(false);
247  }
248  it->second = value;
249 }
set< int >::iterator it
OStream cerr
Definition: OStream.cxx:7
const XML_Char int const XML_Char * value
Definition: expat.h:331
assert(nhit_max >=nhit_nbins)
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

Referenced by art::RootOutput::RootOutput().

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

const double mmc::Validation::branch_default_value_
private

Definition at line 65 of file Validation_module.cc.

Referenced by analyze().

art::ServiceHandle<cheat::BackTracker> mmc::Validation::bt_
private

Definition at line 49 of file Validation_module.cc.

Referenced by analyze(), and print_truth_info().

TTree * mmc::Validation::cellhit_tree_
private

Definition at line 50 of file Validation_module.cc.

Referenced by analyze(), and beginJob().

std::map<std::string, double> mmc::Validation::cht_
private

Definition at line 51 of file Validation_module.cc.

Referenced by analyze(), and beginJob().

std::map<std::string, double> mmc::Validation::et_
private

Definition at line 51 of file Validation_module.cc.

Referenced by analyze(), and beginJob().

TTree* mmc::Validation::event_tree_
private

Definition at line 50 of file Validation_module.cc.

Referenced by analyze(), and beginJob().

TTree * mmc::Validation::flshit_tree_
private

Definition at line 50 of file Validation_module.cc.

Referenced by analyze(), and beginJob().

std::map<std::string, double> mmc::Validation::flsht_
private

Definition at line 51 of file Validation_module.cc.

Referenced by analyze(), and beginJob().

art::ServiceHandle<art::TFileService> mmc::Validation::tfs_
private

Definition at line 48 of file Validation_module.cc.

Referenced by beginJob().

const double mmc::Validation::to_degrees_
private

Definition at line 65 of file Validation_module.cc.


The documentation for this class was generated from the following file: