LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 
15 #include "art_root_io/TFileService.h"
17 #include "fhiclcpp/ParameterSet.h"
18 
19 #include "ShowerRecoException.h"
27 
28 #include "TH1D.h"
29 #include "TH2D.h"
30 #include "TTree.h"
31 
32 #include <map>
33 
35 public:
36  explicit ShowerQuality(fhicl::ParameterSet const& p);
37  // The destructor generated by the compiler is fine for classes
38  // without bare pointers or other resource use.
39 
40  // Plugins should not be copied or assigned.
41  ShowerQuality(ShowerQuality const&) = delete;
42  ShowerQuality(ShowerQuality&&) = delete;
43  ShowerQuality& operator=(ShowerQuality const&) = delete;
45 
46 private:
47  // Required functions.
48  void analyze(art::Event const& e) override;
49 
50  void beginJob() override;
51 
55  void SetShowerProducer(const std::string name) { fShowerProducer = name; }
56  void SetMCShowerProducer(const std::string name) { fMCShowerProducer = name; }
57  void SetSimChannelProducer(const std::string name) { fSimChannelProducer = name; }
58 
60  void SetMaxEnergyCut(const double energy) { _mc_energy_max = energy; }
61 
63  void SetMinEnergyCut(const double energy) { _mc_energy_min = energy; }
64 
67 
70 
73 
75  std::string fShowerProducer;
76 
78  std::string fMCShowerProducer;
79 
81  std::string fSimChannelProducer;
82 
85 
86  TH1D* hVtxDX;
87  TH1D* hVtxDY;
88  TH1D* hVtxDZ;
89  TH1D* hVtxDR;
90 
91  TH1D* hDCosX;
92  TH1D* hDCosY;
93  TH1D* hDCosZ;
94  TH1D* h3DAngleDiff;
95 
96  TH2D* hEnergyCorr;
97 
98  TH1D* hEnergyAssym;
99  TH1D* hEnergyDiff;
100 
103 
105  std::map<int, TH1D*> mDEDX;
106 
108  TH1D* hBestPlane;
109 
111  struct TreeParams_t {
112 
113  double reco_x, reco_y, reco_z;
115  double reco_energy;
116  double reco_dedx;
117  double reco_dedx_U;
118  double reco_dedx_V;
119  double reco_dedx_Y;
121 
122  double mc_x, mc_y, mc_z;
124  double mc_energy;
125  int mc_pdgid;
126 
128  double mc_reco_dist;
129 
132  double cluster_eff;
133  double cluster_pur;
134 
135  } fTreeParams;
136 
138  TTree* fTree;
139 
141  void InitializeAnaTree();
142 
143  // Declare member data here.
144 };
145 
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 }
183 
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 }
313 
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 }
563 
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 }
600 
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)
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
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.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
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:65
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
T get(std::string const &key) const
Definition: ParameterSet.h:314
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.
Declaration of cluster object.
TH2D * hEnergyCorr
Energy correlation reco (x) vs. MC (y)
ShowerQuality & operator=(ShowerQuality const &)=delete
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
struct ShowerQuality::TreeParams_t fTreeParams
void InitializeAnaTree()
Function to prepare TTree.
void SetMCShowerProducer(const std::string name)
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:148
TH1D * hDCosY
Direction unit vector Y component difference.
Float_t e
Definition: plot.C:35
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.