LeptonAna_module.cc
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 /// \brief version 1
3 ///
4 /// \authors Dan Pershey - Raphael Schroeter
5 // rschroet@physics.harvard.edu
6 /// \date 12/01/25
7 ///////////////////////////////////////////////////////////////////////////////
8 
9 // C/C++ Includes
10 #include <cmath>
11 #include <map>
12 #include <vector>
13 
14 // ART includes
25 #include "fhiclcpp/ParameterSet.h"
27 
28 // NOvA includes
29 #include "Geometry/Geometry.h"
31 #include "MCCheater/BackTracker.h"
32 #include "Simulation/Particle.h"
35 #include "Simulation/FLSHitList.h"
37 #include "Utilities/func/MathUtil.h"
38 
39 // ROOT Includes
40 #include "TH1.h"
41 #include "TH2.h"
42 #include "TH3.h"
43 #include "TParticle.h"
44 #include "TSystem.h"
45 
46 namespace mcchk {
47  /// Module to check the daughter leptons coming from neutrino interactions
48  class LeptonAna : public art::EDAnalyzer {
49 
50  public:
51  explicit LeptonAna(fhicl::ParameterSet const& pset);
52  virtual ~LeptonAna();
53 
54  void analyze(art::Event const& evt);
55  void beginRun(art::Run const& run);
56 
57  private:
58  bool fDetOnly;
59 
60  // Truth information
61  std::string fMCTruthModuleLabel; ///< Label MC Truth information module
62 
63  std::map<int, std::string> fLeptons; ///< Map of outgoing lepton PDG and names
64 
65  /// Directional cosines between outgoing lepton and axes
66  std::map<int, TH1F*> fLeptonCosX; ///< Cosine of angle between lepton momentum and x axis
67  std::map<int, TH1F*> fLeptonCosY; ///< Cosine of angle between lepton momentum and y axis
68  std::map<int, TH1F*> fLeptonCosZ; ///< Cosine of angle between lepton momentum and z axis
69  std::map<int, TH1F*> fLeptonCosNu; ///< Cosine of angle between lepton momentum and nu momentum
70 
71  std::map<int, TH1F*> fLeptonE; ///< Energy spectrum of daughter leptons
72  std::map<int, TH1F*> fLeptonP; ///< Momentum of daughter leptons
73  std::map<int, TH1F*> fLeptonTrackL; ///< Track length of daughter leptons
74 
75  std::map<int, TH1F*> fLeptonEDiff; ///< Difference between lepton true and deposited energies
76  std::map<int, TH1F*> fLeptondEdx; ///< Average dE/dx for lepton along its track/shower
77 
78  /// Energy deposition distribution of outgoing charged lepton hits
79  TH2F* fEDepXZ; ///< X vs Z view of energy deposited by charged lepton
80  TH2F* fEDepYZ; ///< Y vs Z view of energy deposited by charged lepton
81 
82  /// End Point Information for Contained CC Leptons
83  TH2F* fEndPointXZ; ///< X vs Z view of contained charged lepton track end points
84  TH2F* fEndPointYZ; ///< Y vs Z view of contained charged lepton track end points
85  TH2F* fEndPointXE; ///< True Energy vs X view of contained charged lepton track end points
86  TH2F* fEndPointYE; ///< True Energy vs Y view of contained charged lepton track end points
87  TH2F* fEndPointZE; ///< True Energy vs Z view of contained charged lepton track end points
88 
89  /// Escape Point Information for Uncontained CC Leptons
90  TH2F* fEscapeXZ; ///< X vs Z view of uncontained charged lepton detector escape point
91  TH2F* fEscapeYZ; ///< Y vs Z view of uncontained charged lepton detector escape point
92  TH2F* fEscapeXE; ///< True Energy vs X view of uncontained charged lepton detector escape point
93  TH2F* fEscapeYE; ///< True Energy vs Y view of uncontained charged lepton detector escape point
94  TH2F* fEscapeZE; ///< True Energy vs Z view of uncontained charged lepton detector escape point
95  };
96 }
97 
98 ///////////////////////////////////////////////////////////////////////////////
99 namespace mcchk {
100  static int msg1cnt = 0;
101 
102  //......................................................................
104  : EDAnalyzer(pset),
105  fDetOnly(pset.get<bool>("DetOnly")),
106  fMCTruthModuleLabel(pset.get<std::string>("MCTruthModuleLabel")),
107  fEDepXZ(0) // Flag to beginRun that histograms are uninitialized
108  {
109  }
110 
111  //......................................................................
113  {
114  }
115 
116  //......................................................................
118  {
119  if(fEDepXZ) { return; }
120 
123 
124  double x = 2.1*geo->DetHalfWidth();
125  double y = 2.1*geo->DetHalfHeight();
126  double z = 1.1*geo->DetLength();
127  int xdiv = TMath::Nint(2*x/5.);
128  int ydiv = TMath::Nint(2*y/5.);
129  int zdiv = TMath::Nint(2*z/5.);
130 
131  fLeptons[11] = "Electron";
132  fLeptons[13] = "Muon";
133 
134  char histoName[200];
135  char histoTitle[200];
136  char titleHelper[200];
137 
138  for(std::map<int, std::string>::iterator it = fLeptons.begin(); it != fLeptons.end(); ++it) {
139  int pdg = it->first;
140  char name[it->second.length()];
141  sprintf(name, "%s", it->second.c_str());
142 
143  // Make directional cosine histograms
144  sprintf(titleHelper, "Cosine of Angle Between Outgoing");
145 
146  sprintf(histoName, "fCosX{group=Flavor,cat=%s (CC)}", name);
147  sprintf(histoTitle, "%s lepton momentum and X Axis;cos#theta_{x};Events", titleHelper);
148  fLeptonCosX[pdg] = tfs->make<TH1F>(histoName, histoTitle, 200, -1., 1.);
149 
150  sprintf(histoName, "fCosY{group=Flavor,cat=%s (CC)}", name);
151  sprintf(histoTitle, "%s lepton momentum and Y Axis;cos#theta_{y};Events", titleHelper);
152  fLeptonCosY[pdg] = tfs->make<TH1F>(histoName, histoTitle, 200, -1., 1.);
153 
154  sprintf(histoName, "fCosZ{group=Flavor,cat=%s (CC)}", name);
155  sprintf(histoTitle, "%s lepton momentum and Z Axis;cos#theta_{z};Events", titleHelper);
156  fLeptonCosZ[pdg] = tfs->make<TH1F>(histoName, histoTitle, 200, -1., 1.);
157 
158  sprintf(histoName, "fCosNu{group=Flavor,cat=%s (CC)}", name);
159  sprintf(histoTitle, "%s Lepton and Incoming Neutrino Momenta;cos#theta;Events", titleHelper);
160  fLeptonCosNu[pdg] = tfs->make<TH1F>(histoName, histoTitle, 200, -1., 1.);
161 
162  // Make energy, momentum, track length histograms
163  sprintf(histoName, "fE{group=Flavor,cat=%s (CC)}", name);
164  sprintf(histoTitle, "True Energy of Outgoing Lepton;E_{l} (GeV);Events");
165  fLeptonE[pdg] = tfs->make<TH1F>(histoName, histoTitle, 200, 0., 10.);
166 
167  sprintf(histoName, "fMomentum{group=Flavor,cat=%s (CC)}", name);
168  sprintf(histoTitle, "Momentum of Outgoing Lepton;p (GeV);Events");
169  fLeptonP[pdg] = tfs->make<TH1F>(histoName, histoTitle, 500, 0., 50.);
170 
171  sprintf(histoName, "fTrackLength{group=Flavor,cat=%s (CC)}", name);
172  sprintf(histoTitle, "Track Length of Outgoing Lepton;L (cm);Events");
173  fLeptonTrackL[pdg] = tfs->make<TH1F>(histoName, histoTitle, 1000, 0., 2000.);
174 
175  // Make histogram of difference between true and depostied energies
176  sprintf(histoName, "fEDiff{group=Flavor,cat=%s (CC)}", name);
177  sprintf(histoTitle, "True - Deposited Energy of Outgoing Lepton;#Delta E (GeV);Events");
178  fLeptonEDiff[pdg] = tfs->make<TH1F>(histoName, histoTitle, 200, 0., 1.);
179 
180  // Make histogram for average energy loss of outgoing lepton
181  sprintf(histoName, "fdEdx{group=Flavor,cat=%s (CC)}", name);
182  sprintf(histoTitle, "Average Energy Loss of Outgoing Lepton;dE/dx (MeV/cm);Events");
183  fLeptondEdx[pdg] = tfs->make<TH1F>(histoName, histoTitle, 400, 0., 10.);
184  }
185 
186  // Energy spectrum for NC events
187  sprintf(titleHelper, "True Energy of Outgoing Lepton");
188 
189  sprintf(histoName, "fE{group=Flavor,cat=%s}", "nu_e (NC)");
190  sprintf(histoTitle, "%s;E (GeV);Events", titleHelper);
191  fLeptonE[12] = tfs->make<TH1F>(histoName, histoTitle, 200, 0., 10.);
192 
193  sprintf(histoName, "fE{group=Flavor,cat=%s}", "nu_mu (NC)");
194  sprintf(histoTitle, "%s;E (GeV);Events", titleHelper);
195  fLeptonE[14] = tfs->make<TH1F>(histoName, histoTitle, 200, 0., 10.);
196 
197  // Histogram of difference between true and deposited energies of all (outgoing) particles
198  sprintf(histoName, "fTotalEDiff");
199  sprintf(histoTitle, "True - Deposited Energy of All Outgoing Particles;#Delta E (GeV);Events");
200  fLeptonEDiff[0] = tfs->make<TH1F>(histoName, histoTitle, 200, 0., 1.);
201 
202  // Make histograms of outgoing lepton deposited energy distributions
203  sprintf(titleHelper, "Energy Deposited by Outgoing Lepton");
204 
205  sprintf(histoName, "fEDepXZ");
206  sprintf(histoTitle, "%s;z (cm);x (cm)", titleHelper);
207  fEDepXZ = tfs->make<TH2F>(histoName, histoTitle, zdiv, -0.02*z, z, xdiv, -x, x);
208 
209  sprintf(histoName, "fEDepYZ");
210  sprintf(histoTitle, "%s;z (cm);y (cm)", titleHelper);
211  fEDepYZ = tfs->make<TH2F>(histoName, histoTitle, zdiv, -0.02*z, z, ydiv, -y, y);
212 
213  // Make histograms of endpoint of contained outgoing charged leptons
214  sprintf(titleHelper, "View of Contained Charged Lepton Track End Points");
215 
216  sprintf(histoName, "fEndPointXZ");
217  sprintf(histoTitle, "X vs Z %s;z (cm);x (cm)", titleHelper);
218  fEndPointXZ = tfs->make<TH2F>(histoName, histoTitle, zdiv, -0.02*z, z, xdiv, -x, x);
219 
220  sprintf(histoName, "fEndPointYZ");
221  sprintf(histoTitle, "Y vs Z %s;z (cm);y (cm)", titleHelper);
222  fEndPointYZ = tfs->make<TH2F>(histoName, histoTitle, zdiv, -0.02*z, z, ydiv, -y, y);
223 
224  sprintf(histoName, "fEndPointXE");
225  sprintf(histoTitle, "True Lepton Energy vs X %s;x (cm);E (GeV)", titleHelper);
226  fEndPointXE = tfs->make<TH2F>(histoName, histoTitle, xdiv, -x, x,200,0,10);
227 
228  sprintf(histoName, "fEndPointYE");
229  sprintf(histoTitle, "True Lepton Energy vs Y %s;x (cm);E (GeV)", titleHelper);
230  fEndPointYE = tfs->make<TH2F>(histoName, histoTitle, ydiv, -y, y,200,0,10);
231 
232  sprintf(histoName, "fEndPointZE");
233  sprintf(histoTitle, "True Lepton Energy vs Z %s;x (cm);E (GeV)", titleHelper);
234  fEndPointZE = tfs->make<TH2F>(histoName, histoTitle, zdiv, -0.02*z, z,200,0,10);
235 
236  // Make histograms of escape point of uncontained outgoing charged leptons
237  sprintf(titleHelper, "View of Uncontained Charged Lepton Track Escape Points");
238 
239  sprintf(histoName, "fEscapeXZ");
240  sprintf(histoTitle, "X vs Z %s;z (cm);x (cm)", titleHelper);
241  fEscapeXZ = tfs->make<TH2F>(histoName, histoTitle, zdiv, -0.02*z, z, xdiv, -x, x);
242 
243  sprintf(histoName, "fEscapeYZ");
244  sprintf(histoTitle, "Y vs Z %s;z (cm);y (cm)", titleHelper);
245  fEscapeYZ = tfs->make<TH2F>(histoName, histoTitle, zdiv, -0.02*z, z, ydiv, -y, y);
246 
247  sprintf(histoName, "fEscapeXE");
248  sprintf(histoTitle, "True Lepton Energy vs X %s;x (cm);E (GeV)", titleHelper);
249  fEscapeXE = tfs->make<TH2F>(histoName, histoTitle, xdiv, -x, x, 200, 0., 10.);
250 
251  sprintf(histoName, "fEscapeYE");
252  sprintf(histoTitle, "True Lepton Energy vs Y %s;x (cm);E (GeV)", titleHelper);
253  fEscapeYE = tfs->make<TH2F>(histoName, histoTitle, ydiv, -y, y, 200, 0., 10.);
254 
255  sprintf(histoName, "fEscapeZE");
256  sprintf(histoTitle, "True Lepton Energy vs Z %s;x (cm);E (GeV)", titleHelper);
257  fEscapeZE = tfs->make<TH2F>(histoName, histoTitle, zdiv, -0.02*z, z, 200, 0., 10.);
258  }
259 
260  //......................................................................
262  {
264 
265  double detHalfWidth = geo->DetHalfWidth();
266  double detHalfHeight = geo->DetHalfHeight();
267  double detLength = geo->DetLength();
268 
269  // Pull the MC generator information out of the event
270  bool isMCTruthListEmpty = false;
272  try {
273  evt.getByLabel(fMCTruthModuleLabel, mclist);
274  if(mclist->empty()) { isMCTruthListEmpty = true; }
275  }
276  catch(...) { isMCTruthListEmpty = true; }
277  if(isMCTruthListEmpty) {
278  mf::LogError("LeptonAna MCTruth Error") << "Error retrieving MCTruth list." << std::endl;
279  return;
280  }
281 
282  std::vector<art::Ptr<simb::MCTruth> > mcptrs;
283  art::fill_ptr_vector(mcptrs, mclist);
284 
285  // Loop over each MCTruth object
286  // mc should be an art::ptr<simb::MCTruth>
287  for(const auto &mc : mcptrs) {
288  // If there is no MCNeutrino, skip the event
289  if(!mc->NeutrinoSet()) {
290  if(msg1cnt < 5) {
291  mf::LogError("LeptonAna MCNeutrino") << "There is no MCNeutrino in this event." << std::endl;
292  ++msg1cnt;
293  }
294 
295  return;
296  }
297 
298  // Get the MCNeutrino object, incoming neutrino, and outgoing lepton
299  const simb::MCNeutrino& mc_neutrino = mc->GetNeutrino();
300  //const simb::MCParticle& nu = mc_neutrino.Nu();
301  const simb::MCParticle& lep = mc_neutrino.Lepton();
302 
303  // Skip non detector event if FCL says to skip them
304  if(fDetOnly) {
305  const simb::MCParticle& nu = mc_neutrino.Nu();
306  if(std::abs(nu.Vx()) > detHalfWidth ||
307  std::abs(nu.Vy()) > detHalfHeight ||
308  nu.Vz() < 0. || nu.Vz() > detLength) {
309  continue;
310  }
311  }
312 
313  // This will serve as the map key for many histograms
314  int lepPDG = std::abs(lep.PdgCode());
315 
316  // Fill directional cosine histograms for:
317  // Specific leptons, i.e., e+/-, mu+/-, (anti-)numu, (anti-)nue
318  if(fLeptonCosX.find(lepPDG) != fLeptonCosX.end()) {
319  fLeptonCosX[lepPDG] ->Fill(lep.Px()/lep.P());
320  fLeptonCosY[lepPDG] ->Fill(lep.Py()/lep.P());
321  fLeptonCosZ[lepPDG] ->Fill(lep.Pz()/lep.P());
322  fLeptonCosNu[lepPDG]->Fill(std::cos(mc_neutrino.Theta()));
323  }
324 
325  // Fill energy histogram
326  if(fLeptonE.find(lepPDG) != fLeptonE.end()) {
327  fLeptonE[lepPDG]->Fill(lep.E());
328  }
329 
330  // Fill momentum histogram
331  if(fLeptonP.find(lepPDG) != fLeptonP.end()) {
332  fLeptonP[lepPDG]->Fill(lep.P());
333  }
334 
335  // BackTracker will match the list of particles to the MCTruth
336  // Later, it will match FLSHits to the particles
338 
339  // Create a ParticleNavigator for specialized looping
340  const sim::ParticleNavigator& pnav = bt->ParticleNavigator();
341 
342  // Create and initialize a Particle pointer that will contain the outgoing lepton
343  // This is similar to the MCParticle lep, but from a different point in the simulation
344  const sim::Particle* primaryLep = pnav.Primary(0);
345  int leptonTrackID = -1; // Track ID of the primary outgoing lepton
346 
347  // Loop over event primary particles
348  for(int i_primary = 0, n_primary = pnav.NumberOfPrimaries(); i_primary < n_primary; ++i_primary) {
349  // Save the primary matching the outgoing lepton from MCTruth
350 
351  if(std::abs(pnav.Primary(i_primary)->PdgCode()) == lepPDG) {
352  primaryLep = pnav.Primary(i_primary);
353  leptonTrackID = primaryLep->TrackId(); // Also save the track ID
354  break;
355  }
356  }
357 
358  // If there are no particles/primaries according to ParticleNavigator, quit now
359  if(leptonTrackID == -1) {
360  if(msg1cnt < 5) {
361  mf::LogWarning("LeptonAna ParticleNavigator")
362  << "ParticleNavigator did not match MCTruth outgoing lepton." << std::endl
363  << "Number of primaries: " << pnav.NumberOfPrimaries() << std::endl;
364  ++msg1cnt;
365  }
366 
367  return;
368  }
369 
370  // Get the list of particles associated with the MCTruth object
371  std::vector<const sim::Particle*> particles = bt->MCTruthToParticles(mc);
372 
373  float trueETotal = 0.;
374  float depositedE = 0.;
375  float depositedETotal = 0.;
376 
377  // Loop over all particles in the event
378  for(const auto& particle : particles) {
379  if(particle->Mother() >= 0) { // Only these particles are initialized
380  // Sum the energies of all primaries
381  if(pnav.IsPrimary(particle->TrackId())) {
382  trueETotal += particle->E();
383  }
384 
385  double xyz[3];
386  double xyzworld[3];
387 
388  // Get the list of FLSHits associated with the current Particle
389  const std::vector<sim::FLSHit>& hits = bt->ParticleToFLSHit(particle->TrackId());
390 
391  // Loop over all FLSHits
392  for(const auto& hit : hits) {
393  depositedETotal += hit.GetEdep(); // Sum the total energy deposited
394 
395  // Daughter particles may have a Geant4 Track ID equal to -leptonTrackID
396  if(std::abs(hit.GetTrackID()) == leptonTrackID) {
397  depositedE += hit.GetEdep(); // Sum the energy deposited by the lepton
398 
399  // Get the location of the FLSHit
400  xyz[0] = 0.5*(hit.GetEntryX() + hit.GetExitX());
401  xyz[1] = 0.5*(hit.GetEntryY() + hit.GetExitY());
402  xyz[2] = 0.5*(hit.GetEntryZ() + hit.GetExitZ());
403  geo->Plane(hit.GetPlaneID())->Cell(hit.GetCellID())->LocalToWorld(xyz,xyzworld);
404 
405  // Fill the FLSHit distribution histograms
406  fEDepXZ->Fill(xyzworld[2], xyzworld[0], hit.GetEdep());
407  fEDepYZ->Fill(xyzworld[2], xyzworld[1], hit.GetEdep());
408  } // end of condition if current FLSHit track ID is the same as the primary lepton
409  } // end of loop over FLSHits
410  } // end of condition if current particle mother has a track ID greater than or equal to 0
411  } // end of loop over particles
412 
413  // Find the last point in the track of the charged outgoing lepton in the detector
414  float finalTrackPointX = 0.;
415  float finalTrackPointY = 0.;
416  float finalTrackPointZ = 0.;
417  float trackLength = 0.;
418 
419  // If lepton end point is inside detector, store the end point for later and fill relevant histograms
420  if(std::abs(primaryLep->EndX()) < detHalfWidth &&
421  std::abs(primaryLep->EndY()) < detHalfHeight &&
422  primaryLep->EndZ() < detLength && primaryLep->EndZ() > 0) {
423  // Store the end of the lepton track
424  finalTrackPointX = primaryLep->EndX();
425  finalTrackPointY = primaryLep->EndY();
426  finalTrackPointZ = primaryLep->EndZ();
427 
428  // Fill end point histograms
429  fEndPointXZ->Fill(finalTrackPointZ, finalTrackPointX);
430  fEndPointYZ->Fill(finalTrackPointZ, finalTrackPointY);
431  // Fill end point vs lepton energy histograms
432  fEndPointXE->Fill(finalTrackPointX, primaryLep->E());
433  fEndPointYE->Fill(finalTrackPointY, primaryLep->E());
434  fEndPointZE->Fill(finalTrackPointZ, primaryLep->E());
435  }
436  else {
437  // Otherwise, find the last trajectory point inside the detector and fill escape point histograms
438  for(unsigned int i_trajpt = 0, n_trajpt = primaryLep->NumberTrajectoryPoints();
439  i_trajpt < n_trajpt; ++i_trajpt) {
440  if(std::abs(primaryLep->Vx(i_trajpt)) < detHalfWidth &&
441  std::abs(primaryLep->Vy(i_trajpt)) < detHalfHeight &&
442  primaryLep->Vz(i_trajpt) < detLength &&
443  primaryLep->Vz(i_trajpt) > 0.) {
444  // Store the last trajectory point inside the detector
445  finalTrackPointX = primaryLep->Vx(i_trajpt);
446  finalTrackPointY = primaryLep->Vy(i_trajpt);
447  finalTrackPointZ = primaryLep->Vz(i_trajpt);
448  }
449  else {
450  break;
451  }
452  }
453 
454  fEscapeXZ->Fill(finalTrackPointZ, finalTrackPointX);
455  fEscapeYZ->Fill(finalTrackPointZ, finalTrackPointY);
456  fEscapeXE->Fill(finalTrackPointX, primaryLep->E());
457  fEscapeYE->Fill(finalTrackPointY, primaryLep->E());
458  fEscapeZE->Fill(finalTrackPointZ, primaryLep->E());
459  }
460 
461  // Calculate the track length of the outgoing lepton
462  trackLength = util::pythag(primaryLep->Vx()-finalTrackPointX,
463  primaryLep->Vy()-finalTrackPointY,
464  primaryLep->Vz()-finalTrackPointZ);
465 
466  if(fLeptons.find(lepPDG) != fLeptons.end()) {
467  // Fill difference between true and deposited lepton energies
468  fLeptonEDiff[lepPDG]->Fill(primaryLep->E() - depositedE);
469 
470  if(trackLength > 0.) {
471  fLeptonTrackL[lepPDG]->Fill(trackLength); // Fill track length
472 
473  // Calculate and fill average dE/dx
474  fLeptondEdx[lepPDG]->Fill(depositedE/trackLength);
475  } // end of condition if track length is greater than 0
476  } // end of condition that outgoing lepton is part of lepton map
477  } // end of loop over MCTruth objects
478  } // end of LeptonAna::analyze
479 } // end of namespace mcchk
480 
481 ///////////////////////////////////////////////////////////////////////////////
482 namespace mcchk {
484 }
double E(const int i=0) const
Definition: MCParticle.h:232
const XML_Char * name
Definition: expat.h:151
unsigned int NumberTrajectoryPoints() const
Definition: MCParticle.h:217
back track the reconstruction to the simulation
int PdgCode() const
Definition: MCParticle.h:211
std::map< int, TH1F * > fLeptonCosZ
Cosine of angle between lepton momentum and z axis.
double Theta() const
angle between incoming and outgoing leptons, in radians
Definition: MCNeutrino.cxx:63
double Py(const int i=0) const
Definition: MCParticle.h:230
set< int >::iterator it
double EndZ() const
Definition: MCParticle.h:227
Simple module to analyze MC cosmics distributions.
void analyze(art::Event const &evt)
TH2F * fEndPointXZ
End Point Information for Contained CC Leptons.
const sim::ParticleNavigator & ParticleNavigator() const
Get a reference to the ParticleNavigator.
Definition: BackTracker.h:744
const simb::MCParticle & Nu() const
Definition: MCNeutrino.h:146
std::vector< sim::FLSHit > ParticleToFLSHit(const int &trackID) const
All the FLSHits that were created by the track id trackID, sorted from most to least light...
TH2F * fEscapeXE
True Energy vs X view of uncontained charged lepton detector escape point.
double Px(const int i=0) const
Definition: MCParticle.h:229
TH2F * fEDepYZ
Y vs Z view of energy deposited by charged lepton.
double DetLength() const
std::map< int, TH1F * > fLeptonP
Momentum of daughter leptons.
std::string fMCTruthModuleLabel
Label MC Truth information module.
TH2F * fEscapeYE
True Energy vs Y view of uncontained charged lepton detector escape point.
Module to check the daughter leptons coming from neutrino interactions.
const PlaneGeo * Plane(unsigned int i) const
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
DEFINE_ART_MODULE(TestTMapFile)
std::map< int, std::string > fLeptons
Map of outgoing lepton PDG and names.
double EndY() const
Definition: MCParticle.h:226
std::map< int, TH1F * > fLeptonCosNu
Cosine of angle between lepton momentum and nu momentum.
float abs(float number)
Definition: d0nt_math.hpp:39
TH2F * fEscapeXZ
Escape Point Information for Uncontained CC Leptons.
Definition: Run.h:31
int TrackId() const
Definition: MCParticle.h:209
TH2F * fEndPointZE
True Energy vs Z view of contained charged lepton track end points.
std::map< int, TH1F * > fLeptonCosX
Directional cosines between outgoing lepton and axes.
void hits()
Definition: readHits.C:15
const simb::MCParticle & Lepton() const
Definition: MCNeutrino.h:147
const sim::Particle * Primary(const int) const
TH2F * fEscapeZE
True Energy vs Z view of uncontained charged lepton detector escape point.
double P(const int i=0) const
Definition: MCParticle.h:233
double DetHalfHeight() const
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
std::map< int, TH1F * > fLeptonCosY
Cosine of angle between lepton momentum and y axis.
TH2F * fEndPointYZ
Y vs Z view of contained charged lepton track end points.
z
Definition: test.py:28
Definition: run.py:1
std::map< int, TH1F * > fLeptonTrackL
Track length of daughter leptons.
LeptonAna(fhicl::ParameterSet const &pset)
bool IsPrimary(int trackID) const
double Vx(const int i=0) const
Definition: MCParticle.h:220
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
T * make(ARGS...args) const
double DetHalfWidth() const
std::map< int, TH1F * > fLeptonEDiff
Difference between lepton true and deposited energies.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
double pythag(double x, double y)
2D Euclidean distance
Definition: MathUtil.h:29
Definition: event.h:1
TH2F * fEDepXZ
Energy deposition distribution of outgoing charged lepton hits.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
double Pz(const int i=0) const
Definition: MCParticle.h:231
TH2F * fEndPointYE
True Energy vs Y view of contained charged lepton track end points.
double Vz(const int i=0) const
Definition: MCParticle.h:222
T cos(T number)
Definition: d0nt_math.hpp:78
std::map< int, TH1F * > fLeptonE
Energy spectrum of daughter leptons.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
double EndX() const
Definition: MCParticle.h:225
static int msg1cnt
TH2F * fEscapeYZ
Y vs Z view of uncontained charged lepton detector escape point.
Event generator information.
Definition: MCNeutrino.h:18
Helper for AttenCurve.
Definition: Path.h:10
std::map< int, TH1F * > fLeptondEdx
Average dE/dx for lepton along its track/shower.
double Vy(const int i=0) const
Definition: MCParticle.h:221
Encapsulate the geometry of one entire detector (near, far, ndos)
void beginRun(art::Run const &run)
TH2F * fEndPointXE
True Energy vs X view of contained charged lepton track end points.
std::vector< const sim::Particle * > MCTruthToParticles(art::Ptr< simb::MCTruth > const &mct) const