LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ShowerQuality_module.cc
Go to the documentation of this file.
1 // Class: ShowerQuality
3 // Module Type: analyzer
4 // File: ShowerQuality_module.cc
5 //
6 // Generated at Tue Mar 31 07:22:17 2015 by Kazuhiro Terao using artmod
7 // from cetpkgsupport v1_08_05.
9 
20 #include "fhiclcpp/ParameterSet.h"
22 
29 #include "ShowerRecoException.h"
30 
31 #include <TH1D.h>
32 #include <TH2D.h>
33 #include <TTree.h>
34 #include <map>
35 
36 class ShowerQuality;
37 
39 public:
40  explicit ShowerQuality(fhicl::ParameterSet const & p);
41  // The destructor generated by the compiler is fine for classes
42  // without bare pointers or other resource use.
43 
44  // Plugins should not be copied or assigned.
45  ShowerQuality(ShowerQuality const &) = delete;
46  ShowerQuality(ShowerQuality &&) = delete;
47  ShowerQuality & operator = (ShowerQuality const &) = delete;
49 
50  // Required functions.
51  void analyze(art::Event const & e) override;
52 
53  void beginJob() override;
54 
58  void SetShowerProducer(const std::string name)
59  { fShowerProducer = name; }
60  void SetMCShowerProducer(const std::string name)
61  { fMCShowerProducer = name; }
62  void SetSimChannelProducer(const std::string name)
63  { fSimChannelProducer = name; }
64 
66  void SetMaxEnergyCut(const double energy) { _mc_energy_max = energy; }
67 
69  void SetMinEnergyCut(const double energy) { _mc_energy_min = energy; }
70 
71  template <class T>
73  std::string producer)
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  }
85 
86 private:
87 
90 
93 
96 
98  std::string fShowerProducer;
99 
101  std::string fMCShowerProducer;
102 
104  std::string fSimChannelProducer;
105 
108 
109  TH1D *hVtxDX;
110  TH1D *hVtxDY;
111  TH1D *hVtxDZ;
112  TH1D *hVtxDR;
113 
114  TH1D *hDCosX;
115  TH1D *hDCosY;
116  TH1D *hDCosZ;
117  TH1D *h3DAngleDiff;
118 
119  TH2D *hEnergyCorr;
120 
121  TH1D *hEnergyAssym;
122  TH1D *hEnergyDiff;
123 
126 
128  std::map<int,TH1D*> mDEDX;
129 
131  TH1D *hBestPlane;
132 
134  struct TreeParams_t {
135 
136  double reco_x, reco_y, reco_z;
138  double reco_energy;
139  double reco_dedx;
140  double reco_dedx_U;
141  double reco_dedx_V;
142  double reco_dedx_Y;
144 
145  double mc_x, mc_y, mc_z;
147  double mc_energy;
148  int mc_pdgid;
149 
151  double mc_reco_dist;
152 
155  double cluster_eff;
156  double cluster_pur;
157 
158  } fTreeParams;
159 
161  TTree *fTree;
162 
164  void InitializeAnaTree();
165 
166  // Declare member data here.
167 
168 };
169 
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 }
209 
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 }
329 
330 
331 
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 }
591 
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 }
629 
TH1D * hMatchedClusterPur
Matched 3D shower&#39;s cluster purity (combined across planes)
void beginJob() override
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.
Class def header for a class MCMatchAlg.
Declaration of signal hit object.
ShowerQuality(fhicl::ParameterSet const &p)
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
void SetShowerProducer(const std::string name)
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.
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:42
::btutil::MCMatchAlg fBTAlg
Shower back tracking algorithm.
Provenance const * provenance() const
Definition: Handle.h:204
art::Handle< T > GetDataOrDie(art::Event const &e, std::string producer)
T get(std::string const &key) const
Definition: ParameterSet.h:231
double energy
Definition: plottest35.C:25
double _mc_energy_min
Minimum MC shower energy cut.
For convenience: struct to define a set of parameters per shower to be stored in TTree.
void SetMaxEnergyCut(const double energy)
Set maximum energy for MCShowers to be considered.
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
Declaration of cluster object.
TH2D * hEnergyCorr
Energy correlation reco (x) vs. MC (y)
ShowerQuality & operator=(ShowerQuality const &)=delete
T * make(ARGS...args) const
struct ShowerQuality::TreeParams_t fTreeParams
void InitializeAnaTree()
Function to prepare TTree.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
void SetMCShowerProducer(const std::string name)
std::vector< double > MCQ(const WireRange_t &hit) const
Definition: MCBTAlg.cxx:95
Class def header for MCShower data container.
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.
Namespace collecting geometry-related classes utilities.
void analyze(art::Event const &e) override
TH1D * hBestPlane
Best plane id.
art framework interface to geometry description
Class def header for exception classes in ShowerReco3D package.