LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ShowerQuality Class Reference
Inheritance diagram for ShowerQuality:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Classes

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

Public Types

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 doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
std::unique_ptr< Worker > makeWorker (WorkerParams const &wp)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Protected Member Functions

std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResults > getTriggerResults (Event const &e) const
 
ConsumesCollector & consumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Private Member Functions

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...
 
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 34 of file ShowerQuality_module.cc.

Member Typedef Documentation

Definition at line 22 of file EDAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 146 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().

146  : EDAnalyzer(p) // ,
147 // More initializers here.
148 {
149 
150  //fShowerProducer = "";
151  //fMCShowerProducer = "";
152  //fSimChannelProducer = "";
153  SetShowerProducer(p.get<std::string>("ShowerProducer"));
154  SetMCShowerProducer(p.get<std::string>("MCShowerProducer"));
155  SetSimChannelProducer(p.get<std::string>("SimChannelProducer"));
156  SetMinEnergyCut(p.get<double>("MCShowerEnergyMin"));
157  SetMaxEnergyCut(p.get<double>("MCShowerEnergyMax"));
158 
159  hMatchCorrectness = nullptr;
160 
161  hVtxDX = nullptr;
162  hVtxDY = nullptr;
163  hVtxDZ = nullptr;
164  hVtxDR = nullptr;
165 
166  hDCosX = nullptr;
167  hDCosY = nullptr;
168  hDCosZ = nullptr;
169  h3DAngleDiff = nullptr;
170 
171  hEnergyCorr = nullptr;
172  hEnergyAssym = nullptr;
173  hEnergyDiff = nullptr;
174 
175  hMatchedClusterPur = nullptr;
176  hMatchedClusterEff = nullptr;
177 
178  mDEDX.clear();
179  hBestPlane = nullptr;
180 
181  fTree = nullptr;
182 }
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.
std::map< int, TH1D * > mDEDX
dEdx per particle per PDG code
TH1D * hVtxDZ
Z difference (reco-MC) in cm.
TH1D * hVtxDX
X difference (reco-MC) in cm.
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.cc:6
TH1D * hDCosX
Direction unit vector X component difference.
TH1D * hVtxDY
Y difference (reco-MC) in cm.
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.
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)
overrideprivatevirtual

Implements art::EDAnalyzer.

Definition at line 314 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(), energy, fBTAlg, fMCShowerProducer, fShowerProducer, fSimChannelProducer, fTree, fTreeParams, art::ProductRetriever::getValidHandle(), h3DAngleDiff, hBestPlane, hDCosX, hDCosY, hDCosZ, hEnergyAssym, hEnergyCorr, hEnergyDiff, hMatchCorrectness, hMatchedClusterEff, hMatchedClusterPur, hVtxDR, hVtxDX, hVtxDY, hVtxDZ, 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, btutil::MCMatchAlg::ShowerCorrectness(), and lar::dump::vector().

315 {
316  // Retrieve mcshower data product
317  auto mcsHandle = e.getValidHandle<std::vector<sim::MCShower>>(fMCShowerProducer);
318  auto resHandle = e.getValidHandle<std::vector<recob::Shower>>(fShowerProducer);
319  auto schHandle = e.getValidHandle<std::vector<sim::SimChannel>>(fSimChannelProducer);
320  const std::vector<sim::MCShower>& ev_mcs(*mcsHandle);
321  const std::vector<recob::Shower>& ev_shower(*resHandle);
322  const std::vector<sim::SimChannel>& ev_simch(*schHandle);
323 
324  if (ev_shower.empty()) return;
325 
326  // Get the whole clusters + associated clusters
328  art::FindManyP<recob::Cluster> cluster_m(resHandle, e, fShowerProducer);
329  const std::vector<recob::Cluster>& ev_cluster = cluster_m.at(0).front().parentAs<std::vector>();
330 
331  // Make clusters in terms of hit vector to feed into BT algorithm
332  art::FindManyP<recob::Hit> hit_m(clsHandle, e, clsHandle.provenance()->moduleLabel());
333  std::vector<std::vector<art::Ptr<recob::Hit>>> ev_cluster_hit;
334  ev_cluster_hit.reserve(clsHandle->size());
335  std::map<art::Ptr<recob::Cluster>, size_t> cluster_ptr_map;
336  for (size_t i = 0; i < ev_cluster.size(); ++i) {
337  const art::Ptr<recob::Cluster> cluster_ptr(clsHandle, i);
338  cluster_ptr_map[cluster_ptr] = ev_cluster_hit.size();
339  ev_cluster_hit.push_back(hit_m.at(i));
340  }
341 
342  // Create ass_cluster_v index vector
343  std::vector<std::vector<unsigned int>> ass_cluster_v;
344  ass_cluster_v.reserve(ev_shower.size());
345  for (size_t shower_index = 0; shower_index < ev_shower.size(); ++shower_index) {
346  ass_cluster_v.push_back(std::vector<unsigned int>());
347  for (auto const& p : cluster_m.at(shower_index))
348  ass_cluster_v.back().push_back(cluster_ptr_map[p]);
349  }
350 
351  // Create G4 track ID vector for which we are interested in
352  std::vector<std::vector<unsigned int>> g4_trackid_v;
353  std::vector<unsigned int> mc_index_v;
354  g4_trackid_v.reserve(ev_mcs.size());
355  for (size_t mc_index = 0; mc_index < ev_mcs.size(); ++mc_index) {
356  auto const& mcs = ev_mcs[mc_index];
357  double energy = mcs.DetProfile().E();
358  std::vector<unsigned int> id_v;
359  id_v.reserve(mcs.DaughterTrackID().size());
360  if (_mc_energy_min < energy && energy < _mc_energy_max) {
361  for (auto const& id : mcs.DaughterTrackID()) {
362  if (id == mcs.TrackID()) continue;
363  id_v.push_back(id);
364  }
365  id_v.push_back(mcs.TrackID());
366  g4_trackid_v.push_back(id_v);
367  mc_index_v.push_back(mc_index);
368  }
369  }
370 
371  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(e);
372  if (!fBTAlg.BuildMap(clockData, g4_trackid_v, ev_simch, ev_cluster_hit)) {
373  std::cerr << "\033[93m[ERROR]\033[00m <<ShowerQuality::analyze>> Failed to "
374  "build back-tracking map for MC..."
375  << std::endl;
376  return;
377  }
378 
379  // Find the best-representative reco-ed Shower given an MCShower
380  std::vector<std::vector<double>> shower_mcq_vv(ev_shower.size(),
381  std::vector<double>(mc_index_v.size(), 0));
382 
383  for (size_t shower_index = 0; shower_index < ass_cluster_v.size(); ++shower_index) {
384 
385  auto const& ass_cluster = ass_cluster_v[shower_index];
386 
387  std::vector<::btutil::WireRange_t> w_v;
388 
389  for (auto const& cluster_index : ass_cluster) {
390 
391  auto const& ass_hit = ev_cluster_hit[cluster_index];
392 
393  w_v.reserve(ass_hit.size() + w_v.size());
394 
395  for (auto const& hit_ptr : ass_hit) {
396  w_v.emplace_back(hit_ptr->Channel(), hit_ptr->StartTick(), hit_ptr->EndTick());
397  }
398  }
399 
400  auto mcq_v = fBTAlg.BTAlg().MCQ(clockData, w_v);
401 
402  auto& shower_mcq_v = shower_mcq_vv[shower_index];
403 
404  for (size_t mcs_index = 0; mcs_index < (mcq_v.size() - 1); ++mcs_index) {
405 
406  shower_mcq_v[mcs_index] = mcq_v[mcs_index];
407  }
408  }
409 
410  // Loop over MCShower and inspect corresponding shower quality
411  for (size_t mcs_index = 0; mcs_index < mc_index_v.size(); ++mcs_index) {
412 
413  auto const& mc_shower = ev_mcs[mc_index_v[mcs_index]];
414 
415  // Search for the best representative shower
416  size_t best_shower_index = shower_mcq_vv.size();
417  double max_mcq = 0;
418  for (size_t shower_index = 0; shower_index < shower_mcq_vv.size(); ++shower_index) {
419 
420  if (shower_mcq_vv[shower_index][mcs_index] > max_mcq) best_shower_index = shower_index;
421  }
422 
423  if (best_shower_index == shower_mcq_vv.size()) {
424  std::string msg;
425  std::cerr << "\033[93m[ERROR]\033[00m <<ShowerQuality::analyze>> "
426  << "Failed to find a corresponding shower for MCShower " << mc_index_v[mcs_index]
427  << std::endl;
428  continue;
429  }
430 
431  auto const& reco_shower = ev_shower[best_shower_index];
432 
433  auto res = fBTAlg.ShowerCorrectness(ass_cluster_v[best_shower_index]);
434 
435  fTreeParams.match_correctness = res.second;
436 
437  if (fTreeParams.match_correctness < 0) {
438  std::cerr << "\033[93m[ERROR]\033[00m <<ShowerQuality::analyze>> "
439  << "Failed to find a corresponding MCShower for shower " << best_shower_index
440  << std::endl;
441  continue;
442  }
443 
444  // MC Info
445  fTreeParams.mc_x = mc_shower.DetProfile().X();
446  fTreeParams.mc_y = mc_shower.DetProfile().Y();
447  fTreeParams.mc_z = mc_shower.DetProfile().Z();
448 
449  fTreeParams.mc_energy = mc_shower.DetProfile().E();
450  fTreeParams.mc_pdgid = mc_shower.PdgCode();
451  fTreeParams.mc_containment = mc_shower.DetProfile().E() / mc_shower.Start().E();
452 
453  //fTreeParams.mc_dcosx = mc_shower.DetProfile().Px() / fTreeParams.mc_energy;
454  //fTreeParams.mc_dcosy = mc_shower.DetProfile().Py() / fTreeParams.mc_energy;
455  //fTreeParams.mc_dcosz = mc_shower.DetProfile().Pz() / fTreeParams.mc_energy;
456  fTreeParams.mc_dcosx = mc_shower.Start().Px() / mc_shower.Start().E();
457  fTreeParams.mc_dcosy = mc_shower.Start().Py() / mc_shower.Start().E();
458  fTreeParams.mc_dcosz = mc_shower.Start().Pz() / mc_shower.Start().E();
459 
460  // Reco vtx
461  fTreeParams.reco_x = reco_shower.ShowerStart()[0];
462  fTreeParams.reco_y = reco_shower.ShowerStart()[1];
463  fTreeParams.reco_z = reco_shower.ShowerStart()[2];
464 
465  // Reco angle
466  fTreeParams.reco_dcosx = reco_shower.Direction()[0];
467  fTreeParams.reco_dcosy = reco_shower.Direction()[1];
468  fTreeParams.reco_dcosz = reco_shower.Direction()[2];
469 
470  // Reco - MC angle diff
474  3.14159265359 * 180.;
475  // Reco - MC vtx distance
477  pow(fTreeParams.reco_y - fTreeParams.mc_y, 2) +
478  pow(fTreeParams.reco_z - fTreeParams.mc_z, 2));
479 
480  // Reco cluster efficiency & purity
483  for (auto const& cluster_index : ass_cluster_v[best_shower_index]) {
484  auto ep = fBTAlg.ClusterEP(cluster_index, mcs_index);
485  if (ep.first == 0 && ep.second == 0) continue;
486  fTreeParams.cluster_eff *= ep.first;
487  fTreeParams.cluster_pur *= ep.second;
488  }
489 
490  // Reco energy & dedx info
491  fTreeParams.best_plane_id = reco_shower.best_plane();
492 
493  /*
494  int best_plane_index = -1;
495 
496  for(size_t i=0; i < ass_cluster_v[best_shower_index].size(); ++i) {
497 
498  size_t cluster_index = ass_cluster_v[best_shower_index][i];
499  //std::cout<<best_plane_index<<" : "<<ev_cluster->at(cluster_index).View()<<std::endl;
500  if( ev_cluster->at(cluster_index).View() == reco_shower.best_plane() ) {
501  best_plane_index = i;
502  break;
503  }
504  }
505 
506  if(best_plane_index < 0) {
507  throw ::showerreco::ShowerRecoException(Form("Failed to identify the best plane for shower %zu",
508  best_shower_index)
509  );
510  }
511  */
512 
513  fTreeParams.reco_energy = reco_shower.Energy().at(reco_shower.best_plane());
514  //fTreeParams.reco_dedx_U = reco_shower.dEdx().at(0);
515  //fTreeParams.reco_dedx_V = reco_shower.dEdx().at(1);
516  //fTreeParams.reco_dedx_Y = reco_shower.dEdx().at(2);
517  fTreeParams.reco_dedx = reco_shower.dEdx().at(reco_shower.best_plane());
518 
519  //
520  // Fill histograms
521  //
523 
528 
529  // Angular info
534 
536 
539 
541 
542  if (mDEDX.find(fTreeParams.mc_pdgid) == mDEDX.end())
543 
544  mDEDX.insert(std::make_pair(
546  new TH1D(Form("hdEdx_PDG_%d", fTreeParams.mc_pdgid),
547  Form("Reco dE/dx for PDG = %d; dE/dx [MeV/cm]; Showers", fTreeParams.mc_pdgid),
548  100,
549  0,
550  50)));
551 
554 
556 
558 
559  // Fill Tree
560  fTree->Fill();
561  }
562 }
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.
std::map< int, TH1D * > mDEDX
dEdx per particle per PDG code
const MCBTAlg & BTAlg() const
BTAlgo getter.
Definition: MCMatchAlg.h:92
TH1D * hVtxDZ
Z difference (reco-MC) in cm.
std::string fMCShowerProducer
MCShower Producer&#39;s Name.
TH1D * hVtxDX
X difference (reco-MC) in cm.
bool BuildMap(detinfo::DetectorClocksData const &clockData, 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:21
TH1D * hDCosX
Direction unit vector X component difference.
TH1D * hVtxDY
Y difference (reco-MC) in cm.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
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.
std::vector< double > MCQ(detinfo::DetectorClocksData const &clockData, const WireRange_t &hit) const
Definition: MCBTAlg.cxx:101
::btutil::MCMatchAlg fBTAlg
Shower back tracking algorithm.
Provenance const * provenance() const
Definition: Handle.h:217
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
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:148
TH1D * hDCosY
Direction unit vector Y component difference.
Float_t e
Definition: plot.C:35
std::string fSimChannelProducer
SimChannel Producer&#39;s Name.
TH1D * hBestPlane
Best plane id.
void ShowerQuality::beginJob ( )
overrideprivatevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 184 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, and InitializeAnaTree().

185 {
186 
187  if (fShowerProducer.empty() || fMCShowerProducer.empty() || fSimChannelProducer.empty()) {
188  std::string msg;
189  msg += "\033[93m[ERROR]\033[00m <<";
190  msg += __FUNCTION__;
191  msg += ">> Producer's name not set!";
192  std::cout << msg.c_str() << std::endl;
193  throw ::showerreco::ShowerRecoException(msg.c_str());
194  }
195 
198 
199  if (fTree) delete fTree;
200  fTree = tfs->make<TTree>("fShowerQualityTree", "");
201 
202  //
203  // Matching correctness histogram initialization
204  //
207  tfs->make<TH1D>("hMatchCorrectness",
208  "Shower 2D Cluster Matching Correctness; Correctness; Showers",
209  101,
210  -0.005,
211  1.005);
212 
213  //
214  // 3D Vtx (start point) MC/Reco comparison histogram initialization
215  //
216  if (hVtxDX) delete hVtxDX;
217  if (hVtxDY) delete hVtxDY;
218  if (hVtxDZ) delete hVtxDZ;
219  if (hVtxDR) delete hVtxDR;
220 
221  hVtxDX = tfs->make<TH1D>(
222  "hVtxDX", "Reco - MC Start X [cm] Displacement; #DeltaX [cm]; Showers", 200, -100, 100);
223 
224  hVtxDY = tfs->make<TH1D>(
225  "hVtxDY", "Reco - MC Start Y [cm] Displacement; #DeltaY [cm]; Showers", 200, -100, 100);
226 
227  hVtxDZ = tfs->make<TH1D>(
228  "hVtxDZ", "Reco - MC Start Z [cm] Displacement; #DeltaZ [cm]; Showers", 200, -100, 100);
229 
230  hVtxDR = tfs->make<TH1D>(
231  "hVtxDR", "Reco - MC Start 3D Vtx Displacement; #DeltaR [cm]; Showers", 200, -100, 100);
232 
233  //
234  // 3D Angular MC/Reco comparison histogram initialization
235  //
236  if (hDCosX) delete hDCosX;
237  if (hDCosY) delete hDCosY;
238  if (hDCosZ) delete hDCosZ;
239  if (h3DAngleDiff) delete h3DAngleDiff;
240 
241  hDCosX = tfs->make<TH1D>(
242  "hDCosX", "Direction Unit Vector Reco - MC #DeltaX; #DeltaCosX; Showers", 100, -2, 2);
243 
244  hDCosY = tfs->make<TH1D>(
245  "hDCosY", "Direction Unit Vector Reco - MC #DeltaY; #DeltaCosY; Showers", 100, -2, 2);
246 
247  hDCosZ = tfs->make<TH1D>(
248  "hDCosZ", "Direction Unit Vector Reco - MC #DeltaZ; #DeltaCosZ; Showers", 100, -2, 2);
249 
250  h3DAngleDiff =
251  tfs->make<TH1D>("h3DAngleDiff",
252  "3D Opening Angle Between Reco & MC; Opening Angle [degrees]; Showers",
253  181,
254  -0.5,
255  180.5);
256 
257  //
258  // Energy MC/Reco comparison histogram initialization
259  //
260  if (hEnergyCorr) delete hEnergyCorr;
261  if (hEnergyAssym) delete hEnergyAssym;
262  if (hEnergyDiff) delete hEnergyDiff;
263 
264  hEnergyCorr =
265  tfs->make<TH2D>("hEnergyCorr",
266  "Reco (x) vs. MC (y) Energy Comparison; Reco Energy [MeV]; MC Energy [MeV]",
267  200,
268  0,
269  1000,
270  200,
271  0,
272  1000);
273 
274  hEnergyAssym = tfs->make<TH1D>("hEnergyAssym",
275  "MC - Reco Energy Fractional Difference; Assymetry; Showers",
276  201,
277  -1.005,
278  1.005);
279 
280  hEnergyDiff = tfs->make<TH1D>(
281  "hEnergyDiff", "MC - Reco Energy Difference; Energy Difference [MeV]; Showers", 200, 0, 1000);
282 
283  //
284  // Shower cluster purity & efficiency histograms initialization
285  //
288 
290  tfs->make<TH1D>("hMatchedClusterEff_PlaneCombo",
291  "Matched Shower Cluster's Charge Efficiency; Efficiency; Clusters",
292  101,
293  -0.005,
294  1.005);
295 
296  hMatchedClusterPur = tfs->make<TH1D>("hMatchedClusterPur_PlaneCombo",
297  "Matched Shower Cluster's Charge Purity; Purity; Clusters",
298  101,
299  -0.005,
300  1.005);
301 
302  //
303  // Best plane ID histogram initialization
304  //
305  hBestPlane = tfs->make<TH1D>("hBestPlane",
306  "Best Plane (for energy & dE/dx estimate); Plane ID; Showers",
307  geo->Nplanes(),
308  -0.5,
309  geo->Nplanes() - 0.5);
310 
312 }
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)
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.
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 61 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumes().

62  {
63  return collector_.consumes<T, BT>(tag);
64  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ProductToken< T > consumes(InputTag const &)
ConsumesCollector & art::ModuleBase::consumesCollector ( )
protectedinherited

Definition at line 57 of file ModuleBase.cc.

References art::ModuleBase::collector_.

58  {
59  return collector_;
60  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protectedinherited

Definition at line 75 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesMany().

76  {
77  collector_.consumesMany<T, BT>();
78  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::consumesView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::consumesView ( InputTag const &  tag)
inherited

Definition at line 68 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesView().

69  {
70  return collector_.consumesView<T, BT>(tag);
71  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > consumesView(InputTag const &)
void art::detail::Analyzer::doBeginJob ( SharedResources const &  resources)
inherited

Definition at line 25 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

26  {
27  setupQueues(resources);
28  ProcessingFrame const frame{ScheduleID{}};
29  beginJobWithFrame(frame);
30  }
virtual void beginJobWithFrame(ProcessingFrame const &)=0
virtual void setupQueues(SharedResources const &)=0
bool art::detail::Analyzer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 68 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

69  {
70  ProcessingFrame const frame{mc.scheduleID()};
71  beginRunWithFrame(std::as_const(rp).makeRun(mc), frame);
72  return true;
73  }
virtual void beginRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 84 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

85  {
86  ProcessingFrame const frame{mc.scheduleID()};
87  beginSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
88  return true;
89  }
virtual void beginSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doEndJob ( )
inherited

Definition at line 33 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

34  {
35  ProcessingFrame const frame{ScheduleID{}};
36  endJobWithFrame(frame);
37  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 76 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

77  {
78  ProcessingFrame const frame{mc.scheduleID()};
79  endRunWithFrame(std::as_const(rp).makeRun(mc), frame);
80  return true;
81  }
virtual void endRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 92 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

93  {
94  ProcessingFrame const frame{mc.scheduleID()};
95  endSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
96  return true;
97  }
virtual void endSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doEvent ( EventPrincipal ep,
ModuleContext const &  mc,
std::atomic< std::size_t > &  counts_run,
std::atomic< std::size_t > &  counts_passed,
std::atomic< std::size_t > &  counts_failed 
)
inherited

Definition at line 100 of file Analyzer.cc.

References e, and art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

105  {
106  auto const e = std::as_const(ep).makeEvent(mc);
107  if (wantEvent(mc.scheduleID(), e)) {
108  ++counts_run;
109  ProcessingFrame const frame{mc.scheduleID()};
110  analyzeWithFrame(e, frame);
111  ++counts_passed;
112  }
113  return true;
114  }
bool wantEvent(ScheduleID id, Event const &e) const
Definition: Observer.cc:63
Float_t e
Definition: plot.C:35
virtual void analyzeWithFrame(Event const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited

Definition at line 47 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

48  {
49  ProcessingFrame const frame{ScheduleID{}};
51  }
TFile fb("Li6.root")
virtual void respondToCloseInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToCloseOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 61 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

62  {
63  ProcessingFrame const frame{ScheduleID{}};
65  }
virtual void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Analyzer::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited

Definition at line 40 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

41  {
42  ProcessingFrame const frame{ScheduleID{}};
44  }
TFile fb("Li6.root")
virtual void respondToOpenInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToOpenOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 54 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

55  {
56  ProcessingFrame const frame{ScheduleID{}};
58  }
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
std::array< std::vector< ProductInfo >, NumBranchTypes > const & art::ModuleBase::getConsumables ( ) const
inherited

Definition at line 43 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::getConsumables().

44  {
45  return collector_.getConsumables();
46  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables() const
Handle< TriggerResults > art::Observer::getTriggerResults ( Event const &  e) const
protectedinherited

Definition at line 75 of file Observer.cc.

References art::ProductRetriever::get(), and art::Observer::selectors_.

Referenced by art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().

76  {
77  if (selectors_) {
78  return selectors_->getOneTriggerResults(e);
79  }
80 
81  // The following applies for cases where no SelectEvents entries
82  // exist.
83  Handle<TriggerResults> h;
84  if (e.get(empty_process_name, h)) {
85  return h;
86  }
87  return Handle<TriggerResults>{};
88  }
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79
void ShowerQuality::InitializeAnaTree ( )
private

Function to prepare TTree.

Definition at line 564 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().

565 {
566 
567  fTree->Branch("reco_x", &fTreeParams.reco_x, "reco_x/D");
568  fTree->Branch("reco_y", &fTreeParams.reco_y, "reco_y/D");
569  fTree->Branch("reco_z", &fTreeParams.reco_z, "reco_z/D");
570  fTree->Branch("reco_dcosx", &fTreeParams.reco_dcosx, "reco_dcosx/D");
571  fTree->Branch("reco_dcosy", &fTreeParams.reco_dcosy, "reco_dcosy/D");
572  fTree->Branch("reco_dcosz", &fTreeParams.reco_dcosz, "reco_dcosz/D");
573  fTree->Branch("reco_energy", &fTreeParams.reco_energy, "reco_energy/D");
574 
575  fTree->Branch("best_plane_id", &fTreeParams.best_plane_id, "best_plane_id/i");
576 
577  fTree->Branch("mc_x", &fTreeParams.mc_x, "mc_x/D");
578  fTree->Branch("mc_y", &fTreeParams.mc_y, "mc_y/D");
579  fTree->Branch("mc_z", &fTreeParams.mc_z, "mc_z/D");
580  fTree->Branch("mc_dcosx", &fTreeParams.mc_dcosx, "mc_dcosx/D");
581  fTree->Branch("mc_dcosy", &fTreeParams.mc_dcosy, "mc_dcosy/D");
582  fTree->Branch("mc_dcosz", &fTreeParams.mc_dcosz, "mc_dcosz/D");
583  fTree->Branch("mc_energy", &fTreeParams.mc_energy, "mc_energy/D");
584 
585  fTree->Branch("reco_dedx", &fTreeParams.reco_dedx, "reco_dedx_/D");
586  fTree->Branch("reco_dedx_U", &fTreeParams.reco_dedx_U, "reco_dedx_U/D");
587  fTree->Branch("reco_dedx_V", &fTreeParams.reco_dedx_V, "reco_dedx_V/D");
588  fTree->Branch("reco_dedx_Y", &fTreeParams.reco_dedx_Y, "reco_dedx_Y/D");
589  fTree->Branch("mc_pdgid", &fTreeParams.mc_pdgid, "mc_pdgid/i");
590 
591  fTree->Branch("mc_reco_anglediff", &fTreeParams.mc_reco_anglediff, "mc_reco_anglediff/D");
592  fTree->Branch("mc_reco_dist", &fTreeParams.mc_reco_dist, "mc_reco_dist/D");
593 
594  fTree->Branch("mc_containment", &fTreeParams.mc_containment, "mc_containment/D");
595 
596  fTree->Branch("match_correctness", &fTreeParams.match_correctness, "match_correctness/D");
597  fTree->Branch("cluster_eff", &fTreeParams.cluster_eff, "cluster_eff/D");
598  fTree->Branch("cluster_pur", &fTreeParams.cluster_pur, "cluster_pur/D");
599 }
struct ShowerQuality::TreeParams_t fTreeParams
TTree * fTree
Analysis TTree.
std::unique_ptr< Worker > art::ModuleBase::makeWorker ( WorkerParams const &  wp)
inherited

Definition at line 37 of file ModuleBase.cc.

References art::ModuleBase::doMakeWorker(), and art::NumBranchTypes.

38  {
39  return doMakeWorker(wp);
40  }
virtual std::unique_ptr< Worker > doMakeWorker(WorkerParams const &wp)=0
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protectedinherited

Definition at line 82 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsume().

83  {
84  return collector_.mayConsume<T, BT>(tag);
85  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protectedinherited

Definition at line 96 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeMany().

97  {
98  collector_.mayConsumeMany<T, BT>();
99  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::mayConsumeView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::mayConsumeView ( InputTag const &  tag)
inherited

Definition at line 89 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeView().

90  {
91  return collector_.mayConsumeView<T, BT>(tag);
92  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > mayConsumeView(InputTag const &)
ModuleDescription const & art::ModuleBase::moduleDescription ( ) const
inherited

Definition at line 13 of file ModuleBase.cc.

References art::errors::LogicError.

Referenced by art::OutputModule::doRespondToOpenInputFile(), art::OutputModule::doWriteEvent(), art::Modifier::fillProductDescriptions(), art::OutputModule::makePlugins_(), art::OutputWorker::OutputWorker(), reco::shower::LArPandoraModularShowerCreation::produce(), art::Modifier::registerProducts(), and art::OutputModule::registerProducts().

14  {
15  if (md_.has_value()) {
16  return *md_;
17  }
18 
20  "There was an error while calling moduleDescription().\n"}
21  << "The moduleDescription() base-class member function cannot be called\n"
22  "during module construction. To determine which module is "
23  "responsible\n"
24  "for calling it, find the '<module type>:<module "
25  "label>@Construction'\n"
26  "tag in the message prefix above. Please contact artists@fnal.gov\n"
27  "for guidance.\n";
28  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
ShowerQuality& ShowerQuality::operator= ( ShowerQuality const &  )
delete
ShowerQuality& ShowerQuality::operator= ( ShowerQuality &&  )
delete
string const & art::Observer::processName ( ) const
protectedinherited

Definition at line 57 of file Observer.cc.

References art::Observer::process_name_.

Referenced by art::FileDumperOutput::printPrincipal().

58  {
59  return process_name_;
60  }
std::string process_name_
Definition: Observer.h:76
void ShowerQuality::SetMaxEnergyCut ( const double  energy)
inlineprivate

Set maximum energy for MCShowers to be considered.

Definition at line 60 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)
inlineprivate

Definition at line 56 of file ShowerQuality_module.cc.

References fMCShowerProducer.

Referenced by ShowerQuality().

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

Set minimum energy for MCShowers to be considered.

Definition at line 63 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 art::ModuleBase::setModuleDescription ( ModuleDescription const &  md)
inherited

Definition at line 31 of file ModuleBase.cc.

References art::ModuleBase::md_.

32  {
33  md_ = md;
34  }
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void ShowerQuality::SetShowerProducer ( const std::string  name)
inlineprivate

Setter function for a shower producer name.

Definition at line 55 of file ShowerQuality_module.cc.

References fShowerProducer.

Referenced by ShowerQuality().

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

Definition at line 57 of file ShowerQuality_module.cc.

References fSimChannelProducer.

Referenced by ShowerQuality().

57 { fSimChannelProducer = name; }
std::string fSimChannelProducer
SimChannel Producer&#39;s Name.
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited

Definition at line 49 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().

50  {
51  // Now that we know we have seen all the consumes declarations,
52  // sort the results for fast lookup later.
53  collector_.sortConsumables(current_process_name);
54  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
void sortConsumables(std::string const &current_process_name)
bool art::Observer::wantAllEvents ( ) const
inlineprotectednoexceptinherited

Definition at line 31 of file Observer.h.

References e, art::Observer::getTriggerResults(), art::Observer::wantAllEvents_, and art::Observer::wantEvent().

32  {
33  return wantAllEvents_;
34  }
bool wantAllEvents_
Definition: Observer.h:75
bool art::Observer::wantEvent ( ScheduleID  id,
Event const &  e 
) const
protectedinherited

Definition at line 63 of file Observer.cc.

References art::Observer::rejectors_, art::Observer::selectors_, and art::Observer::wantAllEvents_.

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

64  {
65  if (wantAllEvents_) {
66  return true;
67  }
68  bool const select_event = selectors_ ? selectors_->matchEvent(id, e) : true;
69  bool const reject_event =
70  rejectors_ ? rejectors_->matchEvent(id, e) : false;
71  return select_event and not reject_event;
72  }
bool wantAllEvents_
Definition: Observer.h:75
std::optional< detail::ProcessAndEventSelectors > rejectors_
Definition: Observer.h:80
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79

Member Data Documentation

double ShowerQuality::_mc_energy_max
private

Maximum MC shower energy cut.

Definition at line 72 of file ShowerQuality_module.cc.

Referenced by analyze(), and SetMaxEnergyCut().

double ShowerQuality::_mc_energy_min
private

Minimum MC shower energy cut.

Definition at line 69 of file ShowerQuality_module.cc.

Referenced by analyze(), and SetMinEnergyCut().

::btutil::MCMatchAlg ShowerQuality::fBTAlg
private

Shower back tracking algorithm.

Definition at line 66 of file ShowerQuality_module.cc.

Referenced by analyze().

std::string ShowerQuality::fMCShowerProducer
private

MCShower Producer's Name.

Definition at line 78 of file ShowerQuality_module.cc.

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

std::string ShowerQuality::fShowerProducer
private

Shower Producer's Name.

Definition at line 75 of file ShowerQuality_module.cc.

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

std::string ShowerQuality::fSimChannelProducer
private

SimChannel Producer's Name.

Definition at line 81 of file ShowerQuality_module.cc.

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

TTree* ShowerQuality::fTree
private

Analysis TTree.

Definition at line 138 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 94 of file ShowerQuality_module.cc.

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

TH1D* ShowerQuality::hBestPlane
private

Best plane id.

Definition at line 108 of file ShowerQuality_module.cc.

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

TH1D* ShowerQuality::hDCosX
private

Direction unit vector X component difference.

Definition at line 91 of file ShowerQuality_module.cc.

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

TH1D* ShowerQuality::hDCosY
private

Direction unit vector Y component difference.

Definition at line 92 of file ShowerQuality_module.cc.

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

TH1D* ShowerQuality::hDCosZ
private

Direction unit vector Z component difference.

Definition at line 93 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 98 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 96 of file ShowerQuality_module.cc.

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

TH1D* ShowerQuality::hEnergyDiff
private

Energy difference: reco E - MC E.

Definition at line 99 of file ShowerQuality_module.cc.

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

TH1D* ShowerQuality::hMatchCorrectness
private

Matching correctness.

Definition at line 84 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 101 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 102 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 89 of file ShowerQuality_module.cc.

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

TH1D* ShowerQuality::hVtxDX
private

X difference (reco-MC) in cm.

Definition at line 86 of file ShowerQuality_module.cc.

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

TH1D* ShowerQuality::hVtxDY
private

Y difference (reco-MC) in cm.

Definition at line 87 of file ShowerQuality_module.cc.

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

TH1D* ShowerQuality::hVtxDZ
private

Z difference (reco-MC) in cm.

Definition at line 88 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 105 of file ShowerQuality_module.cc.

Referenced by analyze(), and ShowerQuality().


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