LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
ShowerQuality Class Reference
Inheritance diagram for ShowerQuality:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Classes

struct  TreeParams_t
 For convenience: struct to define a set of parameters per shower to be stored in TTree. More...
 

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 ShowerQuality (fhicl::ParameterSet const &p)
 
 ShowerQuality (ShowerQuality const &)=delete
 
 ShowerQuality (ShowerQuality &&)=delete
 
ShowerQualityoperator= (ShowerQuality const &)=delete
 
ShowerQualityoperator= (ShowerQuality &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () override
 
void SetShowerProducer (const std::string name)
 
void SetMCShowerProducer (const std::string name)
 
void SetSimChannelProducer (const std::string name)
 
void SetMaxEnergyCut (const double energy)
 Set maximum energy for MCShowers to be considered. More...
 
void SetMinEnergyCut (const double energy)
 Set minimum energy for MCShowers to be considered. More...
 
template<class T >
art::Handle< T > GetDataOrDie (art::Event const &e, std::string producer)
 
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< T > consumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > consumes (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< T > consumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > mayConsume (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< T > mayConsumeView (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

void InitializeAnaTree ()
 Function to prepare TTree. More...
 

Private Attributes

::btutil::MCMatchAlg fBTAlg
 Shower back tracking algorithm. More...
 
double _mc_energy_min
 Minimum MC shower energy cut. More...
 
double _mc_energy_max
 Maximum MC shower energy cut. More...
 
std::string fShowerProducer
 Shower Producer's Name. More...
 
std::string fMCShowerProducer
 MCShower Producer's Name. More...
 
std::string fSimChannelProducer
 SimChannel Producer's Name. More...
 
TH1D * hMatchCorrectness
 Matching correctness. More...
 
TH1D * hVtxDX
 X difference (reco-MC) in cm. More...
 
TH1D * hVtxDY
 Y difference (reco-MC) in cm. More...
 
TH1D * hVtxDZ
 Z difference (reco-MC) in cm. More...
 
TH1D * hVtxDR
 3D vtx distance between reco to MC in cm More...
 
TH1D * hDCosX
 Direction unit vector X component difference. More...
 
TH1D * hDCosY
 Direction unit vector Y component difference. More...
 
TH1D * hDCosZ
 Direction unit vector Z component difference. More...
 
TH1D * h3DAngleDiff
 Opening angle between reco & MC 3D direction. More...
 
TH2D * hEnergyCorr
 Energy correlation reco (x) vs. MC (y) More...
 
TH1D * hEnergyAssym
 Energy assym. parameter: (reco E - MC E) / (reco E + MC E) * 2. More...
 
TH1D * hEnergyDiff
 Energy difference: reco E - MC E. More...
 
TH1D * hMatchedClusterEff
 Matched 3D shower's cluster efficiency (combined across planes) More...
 
TH1D * hMatchedClusterPur
 Matched 3D shower's cluster purity (combined across planes) More...
 
std::map< int, TH1D * > mDEDX
 dEdx per particle per PDG code More...
 
TH1D * hBestPlane
 Best plane id. More...
 
struct ShowerQuality::TreeParams_t fTreeParams
 
TTree * fTree
 Analysis TTree. More...
 

Detailed Description

Definition at line 38 of file ShowerQuality_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

ShowerQuality::ShowerQuality ( fhicl::ParameterSet const &  p)
explicit

Definition at line 170 of file ShowerQuality_module.cc.

References fTree, fhicl::ParameterSet::get(), h3DAngleDiff, hBestPlane, hDCosX, hDCosY, hDCosZ, hEnergyAssym, hEnergyCorr, hEnergyDiff, hMatchCorrectness, hMatchedClusterEff, hMatchedClusterPur, hVtxDR, hVtxDX, hVtxDY, hVtxDZ, mDEDX, SetMaxEnergyCut(), SetMCShowerProducer(), SetMinEnergyCut(), SetShowerProducer(), and SetSimChannelProducer().

171  :
172  EDAnalyzer(p) // ,
173  // More initializers here.
174 {
175 
176  //fShowerProducer = "";
177  //fMCShowerProducer = "";
178  //fSimChannelProducer = "";
179  SetShowerProducer(p.get<std::string>("ShowerProducer"));
180  SetMCShowerProducer(p.get<std::string>("MCShowerProducer"));
181  SetSimChannelProducer(p.get<std::string>("SimChannelProducer"));
182  SetMinEnergyCut(p.get<double>("MCShowerEnergyMin"));
183  SetMaxEnergyCut(p.get<double>("MCShowerEnergyMax"));
184 
185  hMatchCorrectness = nullptr;
186 
187  hVtxDX = nullptr;
188  hVtxDY = nullptr;
189  hVtxDZ = nullptr;
190  hVtxDR = nullptr;
191 
192  hDCosX = nullptr;
193  hDCosY = nullptr;
194  hDCosZ = nullptr;
195  h3DAngleDiff = nullptr;
196 
197  hEnergyCorr = nullptr;
198  hEnergyAssym = nullptr;
199  hEnergyDiff = nullptr;
200 
201  hMatchedClusterPur = nullptr;
202  hMatchedClusterEff = nullptr;
203 
204  mDEDX.clear();
205  hBestPlane = nullptr;
206 
207  fTree = nullptr;
208 }
TH1D * hMatchedClusterPur
Matched 3D shower&#39;s cluster purity (combined across planes)
TH1D * hVtxDR
3D vtx distance between reco to MC in cm
void SetSimChannelProducer(const std::string name)
void SetMinEnergyCut(const double energy)
Set minimum energy for MCShowers to be considered.
TH1D * h3DAngleDiff
Opening angle between reco & MC 3D direction.
TH1D * hVtxDZ
Z difference (reco-MC) in cm.
TH1D * hVtxDX
X difference (reco-MC) in cm.
TH1D * hDCosX
Direction unit vector X component difference.
TH1D * hVtxDY
Y difference (reco-MC) in cm.
std::map< int, TH1D * > mDEDX
dEdx per particle per PDG code
void SetShowerProducer(const std::string name)
TH1D * hEnergyAssym
Energy assym. parameter: (reco E - MC E) / (reco E + MC E) * 2.
TH1D * hEnergyDiff
Energy difference: reco E - MC E.
void SetMaxEnergyCut(const double energy)
Set maximum energy for MCShowers to be considered.
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
TH2D * hEnergyCorr
Energy correlation reco (x) vs. MC (y)
void SetMCShowerProducer(const std::string name)
TTree * fTree
Analysis TTree.
TH1D * hMatchCorrectness
Matching correctness.
TH1D * hDCosZ
Direction unit vector Z component difference.
TH1D * hMatchedClusterEff
Matched 3D shower&#39;s cluster efficiency (combined across planes)
TH1D * hDCosY
Direction unit vector Y component difference.
TH1D * hBestPlane
Best plane id.
ShowerQuality::ShowerQuality ( ShowerQuality const &  )
delete
ShowerQuality::ShowerQuality ( ShowerQuality &&  )
delete

Member Function Documentation

void ShowerQuality::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 332 of file ShowerQuality_module.cc.

References _mc_energy_max, _mc_energy_min, ShowerQuality::TreeParams_t::best_plane_id, btutil::MCMatchAlg::BTAlg(), btutil::MCMatchAlg::BuildMap(), ShowerQuality::TreeParams_t::cluster_eff, ShowerQuality::TreeParams_t::cluster_pur, btutil::MCMatchAlg::ClusterEP(), e, energy, fBTAlg, fMCShowerProducer, fShowerProducer, fSimChannelProducer, fTree, fTreeParams, h3DAngleDiff, hBestPlane, hDCosX, hDCosY, hDCosZ, hEnergyAssym, hEnergyCorr, hEnergyDiff, hMatchCorrectness, hMatchedClusterEff, hMatchedClusterPur, hVtxDR, hVtxDX, hVtxDY, hVtxDZ, art::Handle< T >::isValid(), ShowerQuality::TreeParams_t::match_correctness, ShowerQuality::TreeParams_t::mc_containment, ShowerQuality::TreeParams_t::mc_dcosx, ShowerQuality::TreeParams_t::mc_dcosy, ShowerQuality::TreeParams_t::mc_dcosz, ShowerQuality::TreeParams_t::mc_energy, ShowerQuality::TreeParams_t::mc_pdgid, ShowerQuality::TreeParams_t::mc_reco_anglediff, ShowerQuality::TreeParams_t::mc_reco_dist, ShowerQuality::TreeParams_t::mc_x, ShowerQuality::TreeParams_t::mc_y, ShowerQuality::TreeParams_t::mc_z, btutil::MCBTAlg::MCQ(), mDEDX, art::Handle< T >::provenance(), ShowerQuality::TreeParams_t::reco_dcosx, ShowerQuality::TreeParams_t::reco_dcosy, ShowerQuality::TreeParams_t::reco_dcosz, ShowerQuality::TreeParams_t::reco_dedx, ShowerQuality::TreeParams_t::reco_energy, ShowerQuality::TreeParams_t::reco_x, ShowerQuality::TreeParams_t::reco_y, ShowerQuality::TreeParams_t::reco_z, and btutil::MCMatchAlg::ShowerCorrectness().

333 {
334  //auto geo = larutil::Geometry::GetME();
335 
336  // Retrieve mcshower data product
337  auto mcsHandle = GetDataOrDie< std::vector<sim::MCShower > > (e,fMCShowerProducer);
338  auto resHandle = GetDataOrDie< std::vector<recob::Shower > > (e,fShowerProducer);
339  auto schHandle = GetDataOrDie< std::vector<sim::SimChannel> > (e,fSimChannelProducer);
340  const std::vector<sim::MCShower>& ev_mcs (*mcsHandle);
341  const std::vector<recob::Shower>& ev_shower (*resHandle);
342  const std::vector<sim::SimChannel>& ev_simch (*schHandle);
343 
344  if(!(ev_shower.size())) return;
345 
346  //auto clsHandle = GetDataOrDie<recob::Cluster> (e,fClusterProducer);
347 
348  //art::FindManyP<recob::Hit> hit_m (resHandle, e, fShowerProducer);
349 
350  // Get the whole clusters + associated clusters
352  art::FindManyP<recob::Cluster> cluster_m (resHandle, e, fShowerProducer);
353  e.get(cluster_m.at(0).front().id(),clsHandle);
354  if(!clsHandle.isValid()) throw ::showerreco::ShowerRecoException("Failed to retrieve cluster handle!");
355  const std::vector<recob::Cluster>& ev_cluster (*clsHandle);
356 
357  // Make clusters in terms of hit vector to feed into BT algorithm
358  art::FindManyP<recob::Hit> hit_m(clsHandle, e, clsHandle.provenance()->moduleLabel());
359  std::vector<std::vector<art::Ptr<recob::Hit> > > ev_cluster_hit;
360  ev_cluster_hit.reserve(clsHandle->size());
361  std::map<art::Ptr<recob::Cluster>,size_t> cluster_ptr_map;
362  for(size_t i=0; i<ev_cluster.size(); ++i) {
363  const art::Ptr<recob::Cluster> cluster_ptr(clsHandle,i);
364  cluster_ptr_map[cluster_ptr] = ev_cluster_hit.size();
365  ev_cluster_hit.push_back(hit_m.at(i));
366  }
367 
368  // Create ass_cluster_v index vector
369  std::vector<std::vector<unsigned int> > ass_cluster_v;
370  ass_cluster_v.reserve(ev_shower.size());
371  for(size_t shower_index=0; shower_index < ev_shower.size(); ++shower_index) {
372  ass_cluster_v.push_back(std::vector<unsigned int>());
373  for(auto const& p : cluster_m.at(shower_index))
374  ass_cluster_v.back().push_back(cluster_ptr_map[p]);
375  }
376 
377  // Create G4 track ID vector for which we are interested in
378  std::vector<std::vector<unsigned int> > g4_trackid_v;
379  std::vector<unsigned int> mc_index_v;
380  g4_trackid_v.reserve(ev_mcs.size());
381  for(size_t mc_index=0; mc_index<ev_mcs.size(); ++mc_index) {
382  auto const& mcs = ev_mcs[mc_index];
383  double energy = mcs.DetProfile().E();
384  std::vector<unsigned int> id_v;
385  id_v.reserve(mcs.DaughterTrackID().size());
386  if( _mc_energy_min < energy && energy < _mc_energy_max ) {
387  for(auto const& id : mcs.DaughterTrackID()) {
388  if(id == mcs.TrackID()) continue;
389  id_v.push_back(id);
390  }
391  id_v.push_back(mcs.TrackID());
392  g4_trackid_v.push_back(id_v);
393  mc_index_v.push_back(mc_index);
394  }
395  }
396 
397  if(!fBTAlg.BuildMap(g4_trackid_v, ev_simch, ev_cluster_hit)) {
398  std::cerr<<"\033[93m[ERROR]\033[00m <<ShowerQuality::analyze>> Failed to build back-tracking map for MC..."<<std::endl;
399  return;
400  }
401 
402  // Find the best-representative reco-ed Shower given an MCShower
403  std::vector<std::vector<double> > shower_mcq_vv(ev_shower.size(),std::vector<double>(mc_index_v.size(),0));
404 
405  for(size_t shower_index=0; shower_index < ass_cluster_v.size(); ++shower_index) {
406 
407  auto const& ass_cluster = ass_cluster_v[shower_index];
408 
409  std::vector< ::btutil::WireRange_t> w_v;
410 
411  for(auto const& cluster_index : ass_cluster) {
412 
413  auto const& ass_hit = ev_cluster_hit[cluster_index];
414 
415  w_v.reserve(ass_hit.size()+w_v.size());
416 
417  for(auto const& hit_ptr : ass_hit) {
418 
419  w_v.push_back( ::btutil::WireRange_t( hit_ptr->Channel(),
420  hit_ptr->StartTick(),
421  hit_ptr->EndTick() )
422  );
423  }
424  }
425 
426  auto mcq_v = fBTAlg.BTAlg().MCQ(w_v);
427 
428  auto& shower_mcq_v = shower_mcq_vv[shower_index];
429 
430  for(size_t mcs_index = 0; mcs_index < (mcq_v.size()-1); ++mcs_index) {
431 
432  shower_mcq_v[mcs_index] = mcq_v[mcs_index];
433 
434  }
435  }
436 
437  // Loop over MCShower and inspect corresponding shower quality
438  for(size_t mcs_index = 0; mcs_index < mc_index_v.size(); ++mcs_index) {
439 
440  auto const& mc_shower = ev_mcs[mc_index_v[mcs_index]];
441 
442  // Search for the best representative shower
443  size_t best_shower_index = shower_mcq_vv.size();
444  double max_mcq=0;
445  for(size_t shower_index = 0; shower_index < shower_mcq_vv.size(); ++shower_index) {
446 
447  if( shower_mcq_vv[shower_index][mcs_index] > max_mcq)
448  best_shower_index = shower_index;
449  }
450 
451  if(best_shower_index == shower_mcq_vv.size()) {
452  std::string msg;
453  std::cerr << "\033[93m[ERROR]\033[00m <<ShowerQuality::analyze>> "
454  << "Failed to find a corresponding shower for MCShower "
455  << mc_index_v[mcs_index]
456  << std::endl;
457  continue;
458  }
459 
460  auto const& reco_shower = ev_shower[best_shower_index];
461 
462  auto res = fBTAlg.ShowerCorrectness(ass_cluster_v[best_shower_index]);
463 
464  fTreeParams.match_correctness = res.second;
465 
467  std::cerr << "\033[93m[ERROR]\033[00m <<ShowerQuality::analyze>> "
468  << "Failed to find a corresponding MCShower for shower " << best_shower_index
469  << std::endl;
470  continue;
471  }
472 
473  // MC Info
474  fTreeParams.mc_x = mc_shower.DetProfile().X();
475  fTreeParams.mc_y = mc_shower.DetProfile().Y();
476  fTreeParams.mc_z = mc_shower.DetProfile().Z();
477 
478  fTreeParams.mc_energy = mc_shower.DetProfile().E();
479  fTreeParams.mc_pdgid = mc_shower.PdgCode();
480  fTreeParams.mc_containment = mc_shower.DetProfile().E() / mc_shower.Start().E();
481 
482  //fTreeParams.mc_dcosx = mc_shower.DetProfile().Px() / fTreeParams.mc_energy;
483  //fTreeParams.mc_dcosy = mc_shower.DetProfile().Py() / fTreeParams.mc_energy;
484  //fTreeParams.mc_dcosz = mc_shower.DetProfile().Pz() / fTreeParams.mc_energy;
485  fTreeParams.mc_dcosx = mc_shower.Start().Px() / mc_shower.Start().E();
486  fTreeParams.mc_dcosy = mc_shower.Start().Py() / mc_shower.Start().E();
487  fTreeParams.mc_dcosz = mc_shower.Start().Pz() / mc_shower.Start().E();
488 
489  // Reco vtx
490  fTreeParams.reco_x = reco_shower.ShowerStart()[0];
491  fTreeParams.reco_y = reco_shower.ShowerStart()[1];
492  fTreeParams.reco_z = reco_shower.ShowerStart()[2];
493 
494  // Reco angle
495  fTreeParams.reco_dcosx = reco_shower.Direction()[0];
496  fTreeParams.reco_dcosy = reco_shower.Direction()[1];
497  fTreeParams.reco_dcosz = reco_shower.Direction()[2];
498 
499  // Reco - MC angle diff
502  fTreeParams.reco_dcosz * fTreeParams.mc_dcosz ) / 3.14159265359 * 180.;
503  // Reco - MC vtx distance
506  pow(fTreeParams.reco_z - fTreeParams.mc_z,2) );
507 
508  // Reco cluster efficiency & purity
511  for(auto const& cluster_index : ass_cluster_v[best_shower_index]) {
512  auto ep = fBTAlg.ClusterEP(cluster_index, mcs_index);
513  if(ep.first==0 && ep.second==0) continue;
514  fTreeParams.cluster_eff *= ep.first;
515  fTreeParams.cluster_pur *= ep.second;
516  }
517 
518  // Reco energy & dedx info
519  fTreeParams.best_plane_id = reco_shower.best_plane();
520 
521  /*
522  int best_plane_index = -1;
523 
524  for(size_t i=0; i < ass_cluster_v[best_shower_index].size(); ++i) {
525 
526  size_t cluster_index = ass_cluster_v[best_shower_index][i];
527  //std::cout<<best_plane_index<<" : "<<ev_cluster->at(cluster_index).View()<<std::endl;
528  if( ev_cluster->at(cluster_index).View() == reco_shower.best_plane() ) {
529  best_plane_index = i;
530  break;
531  }
532  }
533 
534  if(best_plane_index < 0) {
535  throw ::showerreco::ShowerRecoException(Form("Failed to identify the best plane for shower %zu",
536  best_shower_index)
537  );
538  }
539  */
540 
541  fTreeParams.reco_energy = reco_shower.Energy().at(reco_shower.best_plane());
542  //fTreeParams.reco_dedx_U = reco_shower.dEdx().at(0);
543  //fTreeParams.reco_dedx_V = reco_shower.dEdx().at(1);
544  //fTreeParams.reco_dedx_Y = reco_shower.dEdx().at(2);
545  fTreeParams.reco_dedx = reco_shower.dEdx().at(reco_shower.best_plane());
546 
547  //
548  // Fill histograms
549  //
551 
556 
557  // Angular info
562 
564 
567 
569 
570  if(mDEDX.find(fTreeParams.mc_pdgid) == mDEDX.end())
571 
572  mDEDX.insert(std::make_pair(fTreeParams.mc_pdgid,
573  new TH1D(Form("hdEdx_PDG_%d",fTreeParams.mc_pdgid),
574  Form("Reco dE/dx for PDG = %d; dE/dx [MeV/cm]; Showers",fTreeParams.mc_pdgid),
575  100,0,50)
576  )
577  );
578 
581 
583 
585 
586  // Fill Tree
587  fTree->Fill();
588 
589  }
590 }
TH1D * hMatchedClusterPur
Matched 3D shower&#39;s cluster purity (combined across planes)
TH1D * hVtxDR
3D vtx distance between reco to MC in cm
TH1D * h3DAngleDiff
Opening angle between reco & MC 3D direction.
const MCBTAlg & BTAlg() const
BTAlgo getter.
Definition: MCMatchAlg.h:89
TH1D * hVtxDZ
Z difference (reco-MC) in cm.
std::string fMCShowerProducer
MCShower Producer&#39;s Name.
TH1D * hVtxDX
X difference (reco-MC) in cm.
TH1D * hDCosX
Direction unit vector X component difference.
TH1D * hVtxDY
Y difference (reco-MC) in cm.
bool BuildMap(const std::vector< unsigned int > &g4_trackid_v, const std::vector< sim::SimChannel > &simch_v, const std::vector< std::vector< art::Ptr< recob::Hit > > > &cluster_v)
Constructs needed information for Reco=>MC matching.
Definition: MCMatchAlg.cxx:12
std::map< int, TH1D * > mDEDX
dEdx per particle per PDG code
bool isValid() const
Definition: Handle.h:190
TH1D * hEnergyAssym
Energy assym. parameter: (reco E - MC E) / (reco E + MC E) * 2.
std::pair< double, double > ClusterEP(const size_t cluster_index, const size_t mcshower_index) const
For a specified cluster, compute cluster efficiency and purity in terms of specified MC object...
Definition: MCMatchAlg.cxx:189
TH1D * hEnergyDiff
Energy difference: reco E - MC E.
std::string fShowerProducer
Shower Producer&#39;s Name.
::btutil::MCMatchAlg fBTAlg
Shower back tracking algorithm.
Provenance const * provenance() const
Definition: Handle.h:204
double energy
Definition: plottest35.C:25
double _mc_energy_min
Minimum MC shower energy cut.
TH2D * hEnergyCorr
Energy correlation reco (x) vs. MC (y)
struct ShowerQuality::TreeParams_t fTreeParams
std::vector< double > MCQ(const WireRange_t &hit) const
Definition: MCBTAlg.cxx:95
TTree * fTree
Analysis TTree.
TH1D * hMatchCorrectness
Matching correctness.
TH1D * hDCosZ
Direction unit vector Z component difference.
double _mc_energy_max
Maximum MC shower energy cut.
TH1D * hMatchedClusterEff
Matched 3D shower&#39;s cluster efficiency (combined across planes)
std::pair< size_t, double > ShowerCorrectness(const std::vector< unsigned int > cluster_indices) const
Definition: MCMatchAlg.cxx:145
TH1D * hDCosY
Direction unit vector Y component difference.
Float_t e
Definition: plot.C:34
std::string fSimChannelProducer
SimChannel Producer&#39;s Name.
TH1D * hBestPlane
Best plane id.
void ShowerQuality::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 210 of file ShowerQuality_module.cc.

References fMCShowerProducer, fShowerProducer, fSimChannelProducer, fTree, h3DAngleDiff, hBestPlane, hDCosX, hDCosY, hDCosZ, hEnergyAssym, hEnergyCorr, hEnergyDiff, hMatchCorrectness, hMatchedClusterEff, hMatchedClusterPur, hVtxDR, hVtxDX, hVtxDY, hVtxDZ, InitializeAnaTree(), and art::TFileDirectory::make().

211 {
212 
213  if(fShowerProducer.empty() || fMCShowerProducer.empty() || fSimChannelProducer.empty()) {
214  std::string msg;
215  msg += "\033[93m[ERROR]\033[00m <<";
216  msg += __FUNCTION__;
217  msg += ">> Producer's name not set!";
218  std::cout<<msg.c_str()<<std::endl;
219  throw ::showerreco::ShowerRecoException(msg.c_str());
220  }
221 
224 
225  if(fTree) delete fTree;
226  fTree = tfs->make<TTree>("fShowerQualityTree","");
227 
228 
229  //
230  // Matching correctness histogram initialization
231  //
233  hMatchCorrectness = tfs->make<TH1D>("hMatchCorrectness",
234  "Shower 2D Cluster Matching Correctness; Correctness; Showers",
235  101,-0.005,1.005);
236 
237  //
238  // 3D Vtx (start point) MC/Reco comparison histogram initialization
239  //
240  if(hVtxDX) delete hVtxDX;
241  if(hVtxDY) delete hVtxDY;
242  if(hVtxDZ) delete hVtxDZ;
243  if(hVtxDR) delete hVtxDR;
244 
245  hVtxDX = tfs->make<TH1D>("hVtxDX",
246  "Reco - MC Start X [cm] Displacement; #DeltaX [cm]; Showers",
247  200,-100,100);
248 
249  hVtxDY = tfs->make<TH1D>("hVtxDY",
250  "Reco - MC Start Y [cm] Displacement; #DeltaY [cm]; Showers",
251  200,-100,100);
252 
253  hVtxDZ = tfs->make<TH1D>("hVtxDZ",
254  "Reco - MC Start Z [cm] Displacement; #DeltaZ [cm]; Showers",
255  200,-100,100);
256 
257  hVtxDR = tfs->make<TH1D>("hVtxDR",
258  "Reco - MC Start 3D Vtx Displacement; #DeltaR [cm]; Showers",
259  200,-100,100);
260 
261  //
262  // 3D Angular MC/Reco comparison histogram initialization
263  //
264  if(hDCosX) delete hDCosX;
265  if(hDCosY) delete hDCosY;
266  if(hDCosZ) delete hDCosZ;
267  if(h3DAngleDiff) delete h3DAngleDiff;
268 
269  hDCosX = tfs->make<TH1D>("hDCosX",
270  "Direction Unit Vector Reco - MC #DeltaX; #DeltaCosX; Showers",
271  100,-2,2);
272 
273  hDCosY = tfs->make<TH1D>("hDCosY",
274  "Direction Unit Vector Reco - MC #DeltaY; #DeltaCosY; Showers",
275  100,-2,2);
276 
277  hDCosZ = tfs->make<TH1D>("hDCosZ",
278  "Direction Unit Vector Reco - MC #DeltaZ; #DeltaCosZ; Showers",
279  100,-2,2);
280 
281  h3DAngleDiff = tfs->make<TH1D>("h3DAngleDiff",
282  "3D Opening Angle Between Reco & MC; Opening Angle [degrees]; Showers",
283  181,-0.5,180.5);
284 
285  //
286  // Energy MC/Reco comparison histogram initialization
287  //
288  if(hEnergyCorr) delete hEnergyCorr;
289  if(hEnergyAssym) delete hEnergyAssym;
290  if(hEnergyDiff) delete hEnergyDiff;
291 
292  hEnergyCorr = tfs->make<TH2D>("hEnergyCorr",
293  "Reco (x) vs. MC (y) Energy Comparison; Reco Energy [MeV]; MC Energy [MeV]",
294  200,0,1000,200,0,1000);
295 
296  hEnergyAssym = tfs->make<TH1D>("hEnergyAssym",
297  "MC - Reco Energy Fractional Difference; Assymetry; Showers",
298  201,-1.005,1.005);
299 
300  hEnergyDiff = tfs->make<TH1D>("hEnergyDiff",
301  "MC - Reco Energy Difference; Energy Difference [MeV]; Showers",
302  200,0,1000);
303 
304  //
305  // Shower cluster purity & efficiency histograms initialization
306  //
309 
310  hMatchedClusterEff = tfs->make<TH1D>("hMatchedClusterEff_PlaneCombo",
311  "Matched Shower Cluster's Charge Efficiency; Efficiency; Clusters",
312  101,-0.005,1.005);
313 
314  hMatchedClusterPur = tfs->make<TH1D>("hMatchedClusterPur_PlaneCombo",
315  "Matched Shower Cluster's Charge Purity; Purity; Clusters",
316  101,-0.005,1.005);
317 
318 
319  //
320  // Best plane ID histogram initialization
321  //
322  hBestPlane = tfs->make<TH1D>("hBestPlane",
323  "Best Plane (for energy & dE/dx estimate); Plane ID; Showers",
324  geo->Nplanes(),-0.5,geo->Nplanes()-0.5);
325 
327 
328 }
TH1D * hMatchedClusterPur
Matched 3D shower&#39;s cluster purity (combined across planes)
TH1D * hVtxDR
3D vtx distance between reco to MC in cm
TH1D * h3DAngleDiff
Opening angle between reco & MC 3D direction.
TH1D * hVtxDZ
Z difference (reco-MC) in cm.
std::string fMCShowerProducer
MCShower Producer&#39;s Name.
TH1D * hVtxDX
X difference (reco-MC) in cm.
TH1D * hDCosX
Direction unit vector X component difference.
TH1D * hVtxDY
Y difference (reco-MC) in cm.
TH1D * hEnergyAssym
Energy assym. parameter: (reco E - MC E) / (reco E + MC E) * 2.
TH1D * hEnergyDiff
Energy difference: reco E - MC E.
std::string fShowerProducer
Shower Producer&#39;s Name.
TH2D * hEnergyCorr
Energy correlation reco (x) vs. MC (y)
T * make(ARGS...args) const
void InitializeAnaTree()
Function to prepare TTree.
TTree * fTree
Analysis TTree.
TH1D * hMatchCorrectness
Matching correctness.
TH1D * hDCosZ
Direction unit vector Z component difference.
TH1D * hMatchedClusterEff
Matched 3D shower&#39;s cluster efficiency (combined across planes)
TH1D * hDCosY
Direction unit vector Y component difference.
std::string fSimChannelProducer
SimChannel Producer&#39;s Name.
Namespace collecting geometry-related classes utilities.
TH1D * hBestPlane
Best plane id.
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

Referenced by art::EDAnalyzer::doEvent(), and art::OutputModule::doWriteEvent().

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 147 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

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

Definition at line 162 of file Consumer.h.

163 {
164  if (!moduleContext_)
165  return;
166 
167  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
168 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
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 172 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

173 {
174  if (!moduleContext_)
175  return ViewToken<T>::invalid();
176 
177  consumables_[BT].emplace_back(ConsumableType::ViewElement,
178  TypeID{typeid(T)},
179  it.label(),
180  it.instance(),
181  it.process());
182  return ViewToken<T>{it};
183 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited

Definition at line 32 of file EngineCreator.cc.

References art::EngineCreator::rng().

34 {
35  return rng()->createEngine(
36  placeholder_schedule_id(), seed, kind_of_engine_to_make);
37 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited

Definition at line 40 of file EngineCreator.cc.

References art::EngineCreator::rng().

43 {
44  return rng()->createEngine(
45  placeholder_schedule_id(), seed, kind_of_engine_to_make, engine_label);
46 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
CurrentProcessingContext const * art::EDAnalyzer::currentContext ( ) const
protectedinherited

Definition at line 114 of file EDAnalyzer.cc.

References art::EDAnalyzer::current_context_.

Referenced by art::EDAnalyzer::workerType().

115  {
116  return current_context_.get();
117  }
CPC_exempt_ptr current_context_
Definition: EDAnalyzer.h:179
EngineCreator::seed_t EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited

Definition at line 49 of file EngineCreator.cc.

References fhicl::ParameterSet::get().

Referenced by art::MixFilter< T >::initEngine_().

52 {
53  auto const& explicit_seeds = pset.get<std::vector<int>>(key, {});
54  return explicit_seeds.empty() ? implicit_seed : explicit_seeds.front();
55 }
template<class T >
art::Handle<T> ShowerQuality::GetDataOrDie ( art::Event const &  e,
std::string  producer 
)
inline

Definition at line 72 of file ShowerQuality_module.cc.

References art::DataViewImpl::getByLabel(), and art::Handle< T >::isValid().

74  {
76  e.getByLabel(producer,h);
77  if(!h.isValid()) {
78  std::string msg;
79  msg += "Could not find a data product by: " + producer;
80  std::cout<<msg.c_str()<<std::endl;
82  }
83  return h;
84  }
bool isValid() const
Definition: Handle.h:190
Float_t e
Definition: plot.C:34
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_.

Referenced by art::OutputModule::doWriteEvent().

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:34
void ShowerQuality::InitializeAnaTree ( )
private

Function to prepare TTree.

Definition at line 592 of file ShowerQuality_module.cc.

References ShowerQuality::TreeParams_t::best_plane_id, ShowerQuality::TreeParams_t::cluster_eff, ShowerQuality::TreeParams_t::cluster_pur, DEFINE_ART_MODULE, fTree, fTreeParams, ShowerQuality::TreeParams_t::match_correctness, ShowerQuality::TreeParams_t::mc_containment, ShowerQuality::TreeParams_t::mc_dcosx, ShowerQuality::TreeParams_t::mc_dcosy, ShowerQuality::TreeParams_t::mc_dcosz, ShowerQuality::TreeParams_t::mc_energy, ShowerQuality::TreeParams_t::mc_pdgid, ShowerQuality::TreeParams_t::mc_reco_anglediff, ShowerQuality::TreeParams_t::mc_reco_dist, ShowerQuality::TreeParams_t::mc_x, ShowerQuality::TreeParams_t::mc_y, ShowerQuality::TreeParams_t::mc_z, ShowerQuality::TreeParams_t::reco_dcosx, ShowerQuality::TreeParams_t::reco_dcosy, ShowerQuality::TreeParams_t::reco_dcosz, ShowerQuality::TreeParams_t::reco_dedx, ShowerQuality::TreeParams_t::reco_dedx_U, ShowerQuality::TreeParams_t::reco_dedx_V, ShowerQuality::TreeParams_t::reco_dedx_Y, ShowerQuality::TreeParams_t::reco_energy, ShowerQuality::TreeParams_t::reco_x, ShowerQuality::TreeParams_t::reco_y, and ShowerQuality::TreeParams_t::reco_z.

Referenced by beginJob().

593 {
594 
595  fTree->Branch("reco_x",&fTreeParams.reco_x,"reco_x/D");
596  fTree->Branch("reco_y",&fTreeParams.reco_y,"reco_y/D");
597  fTree->Branch("reco_z",&fTreeParams.reco_z,"reco_z/D");
598  fTree->Branch("reco_dcosx",&fTreeParams.reco_dcosx,"reco_dcosx/D");
599  fTree->Branch("reco_dcosy",&fTreeParams.reco_dcosy,"reco_dcosy/D");
600  fTree->Branch("reco_dcosz",&fTreeParams.reco_dcosz,"reco_dcosz/D");
601  fTree->Branch("reco_energy",&fTreeParams.reco_energy,"reco_energy/D");
602 
603  fTree->Branch("best_plane_id",&fTreeParams.best_plane_id,"best_plane_id/i");
604 
605  fTree->Branch("mc_x",&fTreeParams.mc_x,"mc_x/D");
606  fTree->Branch("mc_y",&fTreeParams.mc_y,"mc_y/D");
607  fTree->Branch("mc_z",&fTreeParams.mc_z,"mc_z/D");
608  fTree->Branch("mc_dcosx",&fTreeParams.mc_dcosx,"mc_dcosx/D");
609  fTree->Branch("mc_dcosy",&fTreeParams.mc_dcosy,"mc_dcosy/D");
610  fTree->Branch("mc_dcosz",&fTreeParams.mc_dcosz,"mc_dcosz/D");
611  fTree->Branch("mc_energy",&fTreeParams.mc_energy,"mc_energy/D");
612 
613  fTree->Branch("reco_dedx",&fTreeParams.reco_dedx,"reco_dedx_/D");
614  fTree->Branch("reco_dedx_U",&fTreeParams.reco_dedx_U,"reco_dedx_U/D");
615  fTree->Branch("reco_dedx_V",&fTreeParams.reco_dedx_V,"reco_dedx_V/D");
616  fTree->Branch("reco_dedx_Y",&fTreeParams.reco_dedx_Y,"reco_dedx_Y/D");
617  fTree->Branch("mc_pdgid",&fTreeParams.mc_pdgid,"mc_pdgid/i");
618 
619  fTree->Branch("mc_reco_anglediff",&fTreeParams.mc_reco_anglediff,"mc_reco_anglediff/D");
620  fTree->Branch("mc_reco_dist",&fTreeParams.mc_reco_dist,"mc_reco_dist/D");
621 
622  fTree->Branch("mc_containment",&fTreeParams.mc_containment,"mc_containment/D");
623 
624  fTree->Branch("match_correctness",&fTreeParams.match_correctness,"match_correctness/D");
625  fTree->Branch("cluster_eff",&fTreeParams.cluster_eff,"cluster_eff/D");
626  fTree->Branch("cluster_pur",&fTreeParams.cluster_pur,"cluster_pur/D");
627 
628 }
struct ShowerQuality::TreeParams_t fTreeParams
TTree * fTree
Analysis TTree.
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 190 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

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

Definition at line 205 of file Consumer.h.

206 {
207  if (!moduleContext_)
208  return;
209 
210  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
211 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
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 215 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

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

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
ShowerQuality& ShowerQuality::operator= ( ShowerQuality const &  )
delete
ShowerQuality& ShowerQuality::operator= ( ShowerQuality &&  )
delete
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited

Definition at line 89 of file Consumer.cc.

References fhicl::ParameterSet::get_if_present().

Referenced by art::EDProducer::doBeginJob(), art::EDFilter::doBeginJob(), and art::EDAnalyzer::doBeginJob().

90 {
91  if (!moduleContext_)
92  return;
93 
94  pset.get_if_present("errorOnMissingConsumes", requireConsumes_);
95  for (auto& consumablesPerBranch : consumables_) {
96  cet::sort_all(consumablesPerBranch);
97  }
98 }
bool requireConsumes_
Definition: Consumer.h:137
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
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.

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

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

Referenced by art::RootOutputFile::writeOne().

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void ShowerQuality::SetMaxEnergyCut ( const double  energy)
inline

Set maximum energy for MCShowers to be considered.

Definition at line 66 of file ShowerQuality_module.cc.

References _mc_energy_max, and energy.

Referenced by ShowerQuality().

double energy
Definition: plottest35.C:25
double _mc_energy_max
Maximum MC shower energy cut.
void ShowerQuality::SetMCShowerProducer ( const std::string  name)
inline

Definition at line 60 of file ShowerQuality_module.cc.

References fMCShowerProducer.

Referenced by ShowerQuality().

61  { fMCShowerProducer = name; }
std::string fMCShowerProducer
MCShower Producer&#39;s Name.
void ShowerQuality::SetMinEnergyCut ( const double  energy)
inline

Set minimum energy for MCShowers to be considered.

Definition at line 69 of file ShowerQuality_module.cc.

References _mc_energy_min, and energy.

Referenced by ShowerQuality().

double energy
Definition: plottest35.C:25
double _mc_energy_min
Minimum MC shower energy cut.
void ShowerQuality::SetShowerProducer ( const std::string  name)
inline

Setter function for a shower producer name.

Definition at line 58 of file ShowerQuality_module.cc.

References fShowerProducer.

Referenced by ShowerQuality().

59  { fShowerProducer = name; }
std::string fShowerProducer
Shower Producer&#39;s Name.
void ShowerQuality::SetSimChannelProducer ( const std::string  name)
inline

Definition at line 62 of file ShowerQuality_module.cc.

References fSimChannelProducer.

Referenced by ShowerQuality().

63  { fSimChannelProducer = name; }
std::string fSimChannelProducer
SimChannel Producer&#39;s Name.
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Definition at line 125 of file Consumer.cc.

Referenced by art::EDProducer::doEndJob(), art::EDFilter::doEndJob(), art::EDAnalyzer::doEndJob(), and art::RootOutput::endJob().

126 {
127  if (!moduleContext_)
128  return;
129 
130  // If none of the branches have missing consumes statements, exit early.
131  if (std::all_of(cbegin(missingConsumes_),
132  cend(missingConsumes_),
133  [](auto const& perBranch) { return perBranch.empty(); }))
134  return;
135 
136  constexpr cet::HorizontalRule rule{60};
137  mf::LogPrint log{"MTdiagnostics"};
138  log << '\n'
139  << rule('=') << '\n'
140  << "The following consumes (or mayConsume) statements are missing from\n"
141  << module_context(moduleDescription_) << '\n'
142  << rule('-') << '\n';
143 
144  cet::for_all_with_index(
145  missingConsumes_, [&log](std::size_t const i, auto const& perBranch) {
146  for (auto const& pi : perBranch) {
147  log << " "
148  << assemble_consumes_statement(static_cast<BranchType>(i), pi)
149  << '\n';
150  }
151  });
152  log << rule('=');
153 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Definition at line 101 of file Consumer.cc.

References art::errors::ProductRegistrationFailure.

103 {
104  // Early exits if consumes tracking has been disabled or if the
105  // consumed product is an allowed consumable.
106  if (!moduleContext_)
107  return;
108 
109  if (cet::binary_search_all(consumables_[bt], pi))
110  return;
111 
112  if (requireConsumes_) {
114  "Consumer: an error occurred during validation of a "
115  "retrieved product\n\n")
116  << "The following consumes (or mayConsume) statement is missing from\n"
117  << module_context(moduleDescription_) << ":\n\n"
118  << " " << assemble_consumes_statement(bt, pi) << "\n\n";
119  }
120 
121  missingConsumes_[bt].insert(pi);
122 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
bool requireConsumes_
Definition: Consumer.h:137
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited
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

double ShowerQuality::_mc_energy_max
private

Maximum MC shower energy cut.

Definition at line 95 of file ShowerQuality_module.cc.

Referenced by analyze(), and SetMaxEnergyCut().

double ShowerQuality::_mc_energy_min
private

Minimum MC shower energy cut.

Definition at line 92 of file ShowerQuality_module.cc.

Referenced by analyze(), and SetMinEnergyCut().

::btutil::MCMatchAlg ShowerQuality::fBTAlg
private

Shower back tracking algorithm.

Definition at line 89 of file ShowerQuality_module.cc.

Referenced by analyze().

std::string ShowerQuality::fMCShowerProducer
private

MCShower Producer's Name.

Definition at line 101 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and SetMCShowerProducer().

std::string ShowerQuality::fShowerProducer
private

Shower Producer's Name.

Definition at line 98 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and SetShowerProducer().

std::string ShowerQuality::fSimChannelProducer
private

SimChannel Producer's Name.

Definition at line 104 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and SetSimChannelProducer().

TTree* ShowerQuality::fTree
private

Analysis TTree.

Definition at line 161 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), InitializeAnaTree(), and ShowerQuality().

struct ShowerQuality::TreeParams_t ShowerQuality::fTreeParams
private

Referenced by analyze(), and InitializeAnaTree().

TH1D* ShowerQuality::h3DAngleDiff
private

Opening angle between reco & MC 3D direction.

Definition at line 117 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and ShowerQuality().

TH1D* ShowerQuality::hBestPlane
private

Best plane id.

Definition at line 131 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and ShowerQuality().

TH1D* ShowerQuality::hDCosX
private

Direction unit vector X component difference.

Definition at line 114 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and ShowerQuality().

TH1D* ShowerQuality::hDCosY
private

Direction unit vector Y component difference.

Definition at line 115 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and ShowerQuality().

TH1D* ShowerQuality::hDCosZ
private

Direction unit vector Z component difference.

Definition at line 116 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and ShowerQuality().

TH1D* ShowerQuality::hEnergyAssym
private

Energy assym. parameter: (reco E - MC E) / (reco E + MC E) * 2.

Definition at line 121 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and ShowerQuality().

TH2D* ShowerQuality::hEnergyCorr
private

Energy correlation reco (x) vs. MC (y)

Definition at line 119 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and ShowerQuality().

TH1D* ShowerQuality::hEnergyDiff
private

Energy difference: reco E - MC E.

Definition at line 122 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and ShowerQuality().

TH1D* ShowerQuality::hMatchCorrectness
private

Matching correctness.

Definition at line 107 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and ShowerQuality().

TH1D* ShowerQuality::hMatchedClusterEff
private

Matched 3D shower's cluster efficiency (combined across planes)

Definition at line 124 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and ShowerQuality().

TH1D* ShowerQuality::hMatchedClusterPur
private

Matched 3D shower's cluster purity (combined across planes)

Definition at line 125 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and ShowerQuality().

TH1D* ShowerQuality::hVtxDR
private

3D vtx distance between reco to MC in cm

Definition at line 112 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and ShowerQuality().

TH1D* ShowerQuality::hVtxDX
private

X difference (reco-MC) in cm.

Definition at line 109 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and ShowerQuality().

TH1D* ShowerQuality::hVtxDY
private

Y difference (reco-MC) in cm.

Definition at line 110 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and ShowerQuality().

TH1D* ShowerQuality::hVtxDZ
private

Z difference (reco-MC) in cm.

Definition at line 111 of file ShowerQuality_module.cc.

Referenced by analyze(), beginJob(), and ShowerQuality().

std::map<int,TH1D*> ShowerQuality::mDEDX
private

dEdx per particle per PDG code

Definition at line 128 of file ShowerQuality_module.cc.

Referenced by analyze(), and ShowerQuality().


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