Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
mcchk::LeptonAna Class Reference

Module to check the daughter leptons coming from neutrino interactions. More...

Inheritance diagram for mcchk::LeptonAna:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 LeptonAna (fhicl::ParameterSet const &pset)
 
virtual ~LeptonAna ()
 
void analyze (art::Event const &evt)
 
void beginRun (art::Run const &run)
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

bool fDetOnly
 
std::string fMCTruthModuleLabel
 Label MC Truth information module. More...
 
std::map< int, std::stringfLeptons
 Map of outgoing lepton PDG and names. More...
 
std::map< int, TH1F * > fLeptonCosX
 Directional cosines between outgoing lepton and axes. More...
 
std::map< int, TH1F * > fLeptonCosY
 Cosine of angle between lepton momentum and y axis. More...
 
std::map< int, TH1F * > fLeptonCosZ
 Cosine of angle between lepton momentum and z axis. More...
 
std::map< int, TH1F * > fLeptonCosNu
 Cosine of angle between lepton momentum and nu momentum. More...
 
std::map< int, TH1F * > fLeptonE
 Energy spectrum of daughter leptons. More...
 
std::map< int, TH1F * > fLeptonP
 Momentum of daughter leptons. More...
 
std::map< int, TH1F * > fLeptonTrackL
 Track length of daughter leptons. More...
 
std::map< int, TH1F * > fLeptonEDiff
 Difference between lepton true and deposited energies. More...
 
std::map< int, TH1F * > fLeptondEdx
 Average dE/dx for lepton along its track/shower. More...
 
TH2F * fEDepXZ
 Energy deposition distribution of outgoing charged lepton hits. More...
 
TH2F * fEDepYZ
 Y vs Z view of energy deposited by charged lepton. More...
 
TH2F * fEndPointXZ
 End Point Information for Contained CC Leptons. More...
 
TH2F * fEndPointYZ
 Y vs Z view of contained charged lepton track end points. More...
 
TH2F * fEndPointXE
 True Energy vs X view of contained charged lepton track end points. More...
 
TH2F * fEndPointYE
 True Energy vs Y view of contained charged lepton track end points. More...
 
TH2F * fEndPointZE
 True Energy vs Z view of contained charged lepton track end points. More...
 
TH2F * fEscapeXZ
 Escape Point Information for Uncontained CC Leptons. More...
 
TH2F * fEscapeYZ
 Y vs Z view of uncontained charged lepton detector escape point. More...
 
TH2F * fEscapeXE
 True Energy vs X view of uncontained charged lepton detector escape point. More...
 
TH2F * fEscapeYE
 True Energy vs Y view of uncontained charged lepton detector escape point. More...
 
TH2F * fEscapeZE
 True Energy vs Z view of uncontained charged lepton detector escape point. More...
 

Detailed Description

Module to check the daughter leptons coming from neutrino interactions.

Definition at line 48 of file LeptonAna_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

mcchk::LeptonAna::LeptonAna ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 103 of file LeptonAna_module.cc.

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  }
std::string fMCTruthModuleLabel
Label MC Truth information module.
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
TH2F * fEDepXZ
Energy deposition distribution of outgoing charged lepton hits.
enum BeamMode string
mcchk::LeptonAna::~LeptonAna ( )
virtual

Definition at line 112 of file LeptonAna_module.cc.

113  {
114  }

Member Function Documentation

void mcchk::LeptonAna::analyze ( art::Event const &  evt)
virtual

Implements art::EDAnalyzer.

Definition at line 261 of file LeptonAna_module.cc.

References std::abs(), std::cos(), DEFINE_ART_MODULE(), geo::GeometryBase::DetHalfHeight(), geo::GeometryBase::DetHalfWidth(), geo::GeometryBase::DetLength(), simb::MCParticle::E(), allTimeWatchdog::endl, simb::MCParticle::EndX(), simb::MCParticle::EndY(), simb::MCParticle::EndZ(), fDetOnly, fEDepXZ, fEDepYZ, fEndPointXE, fEndPointXZ, fEndPointYE, fEndPointYZ, fEndPointZE, fEscapeXE, fEscapeXZ, fEscapeYE, fEscapeYZ, fEscapeZE, art::fill_ptr_vector(), fLeptonCosNu, fLeptonCosX, fLeptonCosY, fLeptonCosZ, fLeptondEdx, fLeptonE, fLeptonEDiff, fLeptonP, fLeptons, fLeptonTrackL, fMCTruthModuleLabel, art::DataViewImpl::getByLabel(), hits(), sim::ParticleNavigator::IsPrimary(), simb::MCNeutrino::Lepton(), mc, cheat::BackTracker::MCTruthToParticles(), mcchk::msg1cnt, simb::MCNeutrino::Nu(), sim::ParticleNavigator::NumberOfPrimaries(), simb::MCParticle::NumberTrajectoryPoints(), simb::MCParticle::P(), cheat::BackTracker::ParticleNavigator(), cheat::BackTracker::ParticleToFLSHit(), simb::MCParticle::PdgCode(), geo::GeometryBase::Plane(), sim::ParticleNavigator::Primary(), simb::MCParticle::Px(), simb::MCParticle::Py(), util::pythag(), simb::MCParticle::Pz(), simb::MCNeutrino::Theta(), simb::MCParticle::TrackId(), simb::MCParticle::Vx(), simb::MCParticle::Vy(), and simb::MCParticle::Vz().

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
double E(const int i=0) const
Definition: MCParticle.h:232
unsigned int NumberTrajectoryPoints() const
Definition: MCParticle.h:217
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
double EndZ() const
Definition: MCParticle.h:227
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.
const PlaneGeo * Plane(unsigned int i) const
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
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.
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
int evt
double DetHalfHeight() const
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.
std::map< int, TH1F * > fLeptonTrackL
Track length of daughter leptons.
bool IsPrimary(int trackID) const
double Vx(const int i=0) const
Definition: MCParticle.h:220
double DetHalfWidth() const
std::map< int, TH1F * > fLeptonEDiff
Difference between lepton true and deposited energies.
double pythag(double x, double y)
2D Euclidean distance
Definition: MathUtil.h:29
Definition: structs.h:12
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
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
void mcchk::LeptonAna::beginRun ( art::Run const &  run)
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 117 of file LeptonAna_module.cc.

References geo::GeometryBase::DetHalfHeight(), geo::GeometryBase::DetHalfWidth(), geo::GeometryBase::DetLength(), fEDepXZ, fEDepYZ, fEndPointXE, fEndPointXZ, fEndPointYE, fEndPointYZ, fEndPointZE, fEscapeXE, fEscapeXZ, fEscapeYE, fEscapeYZ, fEscapeZE, fLeptonCosNu, fLeptonCosX, fLeptonCosY, fLeptonCosZ, fLeptondEdx, fLeptonE, fLeptonEDiff, fLeptonP, fLeptons, fLeptonTrackL, it, art::TFileDirectory::make(), make_root_from_grid_output::pdg, submit_syst::x, submit_syst::y, and test::z.

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  }
const XML_Char * name
Definition: expat.h:151
std::map< int, TH1F * > fLeptonCosZ
Cosine of angle between lepton momentum and z axis.
set< int >::iterator it
TH2F * fEndPointXZ
End Point Information for Contained CC Leptons.
TH2F * fEscapeXE
True Energy vs X view of uncontained charged lepton detector escape point.
TH2F * fEDepYZ
Y vs Z view of energy deposited by charged lepton.
double DetLength() const
std::map< int, TH1F * > fLeptonP
Momentum of daughter leptons.
TH2F * fEscapeYE
True Energy vs Y view of uncontained charged lepton detector escape point.
std::map< int, std::string > fLeptons
Map of outgoing lepton PDG and names.
std::map< int, TH1F * > fLeptonCosNu
Cosine of angle between lepton momentum and nu momentum.
TH2F * fEscapeXZ
Escape Point Information for Uncontained CC Leptons.
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.
TH2F * fEscapeZE
True Energy vs Z view of uncontained charged lepton detector escape point.
double DetHalfHeight() const
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
std::map< int, TH1F * > fLeptonTrackL
Track length of daughter leptons.
T * make(ARGS...args) const
double DetHalfWidth() const
std::map< int, TH1F * > fLeptonEDiff
Difference between lepton true and deposited energies.
TH2F * fEDepXZ
Energy deposition distribution of outgoing charged lepton hits.
TH2F * fEndPointYE
True Energy vs Y view of contained charged lepton track end points.
std::map< int, TH1F * > fLeptonE
Energy spectrum of daughter leptons.
TH2F * fEscapeYZ
Y vs Z view of uncontained charged lepton detector escape point.
Helper for AttenCurve.
Definition: Path.h:10
std::map< int, TH1F * > fLeptondEdx
Average dE/dx for lepton along its track/shower.
TH2F * fEndPointXE
True Energy vs X view of contained charged lepton track end points.
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

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

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDAnalyzer::currentContext ( ) const
protectedinherited
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

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

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

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

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

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

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

Referenced by art::RootOutput::RootOutput().

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

bool mcchk::LeptonAna::fDetOnly
private

Definition at line 58 of file LeptonAna_module.cc.

Referenced by analyze().

TH2F* mcchk::LeptonAna::fEDepXZ
private

Energy deposition distribution of outgoing charged lepton hits.

X vs Z view of energy deposited by charged lepton

Definition at line 79 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

TH2F* mcchk::LeptonAna::fEDepYZ
private

Y vs Z view of energy deposited by charged lepton.

Definition at line 80 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

TH2F* mcchk::LeptonAna::fEndPointXE
private

True Energy vs X view of contained charged lepton track end points.

Definition at line 85 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

TH2F* mcchk::LeptonAna::fEndPointXZ
private

End Point Information for Contained CC Leptons.

X vs Z view of contained charged lepton track end points

Definition at line 83 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

TH2F* mcchk::LeptonAna::fEndPointYE
private

True Energy vs Y view of contained charged lepton track end points.

Definition at line 86 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

TH2F* mcchk::LeptonAna::fEndPointYZ
private

Y vs Z view of contained charged lepton track end points.

Definition at line 84 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

TH2F* mcchk::LeptonAna::fEndPointZE
private

True Energy vs Z view of contained charged lepton track end points.

Definition at line 87 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

TH2F* mcchk::LeptonAna::fEscapeXE
private

True Energy vs X view of uncontained charged lepton detector escape point.

Definition at line 92 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

TH2F* mcchk::LeptonAna::fEscapeXZ
private

Escape Point Information for Uncontained CC Leptons.

X vs Z view of uncontained charged lepton detector escape point

Definition at line 90 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

TH2F* mcchk::LeptonAna::fEscapeYE
private

True Energy vs Y view of uncontained charged lepton detector escape point.

Definition at line 93 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

TH2F* mcchk::LeptonAna::fEscapeYZ
private

Y vs Z view of uncontained charged lepton detector escape point.

Definition at line 91 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

TH2F* mcchk::LeptonAna::fEscapeZE
private

True Energy vs Z view of uncontained charged lepton detector escape point.

Definition at line 94 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

std::map<int, TH1F*> mcchk::LeptonAna::fLeptonCosNu
private

Cosine of angle between lepton momentum and nu momentum.

Definition at line 69 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

std::map<int, TH1F*> mcchk::LeptonAna::fLeptonCosX
private

Directional cosines between outgoing lepton and axes.

Cosine of angle between lepton momentum and x axis

Definition at line 66 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

std::map<int, TH1F*> mcchk::LeptonAna::fLeptonCosY
private

Cosine of angle between lepton momentum and y axis.

Definition at line 67 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

std::map<int, TH1F*> mcchk::LeptonAna::fLeptonCosZ
private

Cosine of angle between lepton momentum and z axis.

Definition at line 68 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

std::map<int, TH1F*> mcchk::LeptonAna::fLeptondEdx
private

Average dE/dx for lepton along its track/shower.

Definition at line 76 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

std::map<int, TH1F*> mcchk::LeptonAna::fLeptonE
private

Energy spectrum of daughter leptons.

Definition at line 71 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

std::map<int, TH1F*> mcchk::LeptonAna::fLeptonEDiff
private

Difference between lepton true and deposited energies.

Definition at line 75 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

std::map<int, TH1F*> mcchk::LeptonAna::fLeptonP
private

Momentum of daughter leptons.

Definition at line 72 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

std::map<int, std::string> mcchk::LeptonAna::fLeptons
private

Map of outgoing lepton PDG and names.

Definition at line 63 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

std::map<int, TH1F*> mcchk::LeptonAna::fLeptonTrackL
private

Track length of daughter leptons.

Definition at line 73 of file LeptonAna_module.cc.

Referenced by analyze(), and beginRun().

std::string mcchk::LeptonAna::fMCTruthModuleLabel
private

Label MC Truth information module.

Definition at line 61 of file LeptonAna_module.cc.

Referenced by analyze().


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