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

Public Types

using ModuleType = EDAnalyzer
 

Public Member Functions

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

Protected Member Functions

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

Private Member Functions

void analyze (art::Event const &e) override
 
void beginJob () override
 
void endJob () override
 
void beginRun (art::Run const &run) override
 
void doEfficiencies ()
 
bool insideFV (double vertex[4])
 
void reset ()
 

Private Attributes

std::string fMCTruthModuleLabel
 
std::string fHitModuleLabel
 
std::string fShowerModuleLabel
 
std::string fTruthMatchDataModuleLabel
 
int fNeutrinoPDGcode
 
int fLeptonPDGcode
 
bool fSaveMCTree
 
bool fHitShowerThroughPFParticle
 
double fMinPurity
 
double fMinCompleteness
 
float fFidVolCutX
 
float fFidVolCutY
 
float fFidVolCutZ
 
float fFidVolXmin
 
float fFidVolXmax
 
float fFidVolYmin
 
float fFidVolYmax
 
float fFidVolZmin
 
float fFidVolZmax
 
int Event
 
int Run
 
int SubRun
 
int MC_incoming_PDG
 
int MC_lepton_PDG
 
int MC_isCC
 
int MC_channel
 
int MC_target
 
double MC_Q2
 
double MC_W
 
double MC_vertex [4]
 
double MC_incoming_P [4]
 
double MC_lepton_startMomentum [4]
 
double MC_lepton_endMomentum [40]
 
double MC_lepton_startXYZT [4]
 
double MC_lepton_endXYZT [4]
 
double MC_lepton_theta
 
int MC_leptonID
 
int MC_LeptonTrack
 
double MC_incoming_E
 
double MC_lepton_startEnergy
 
int n_recoShowers
 
double sh_direction_X [MAX_SHOWERS]
 
double sh_direction_Y [MAX_SHOWERS]
 
double sh_direction_Z [MAX_SHOWERS]
 
double sh_start_X [MAX_SHOWERS]
 
double sh_start_Y [MAX_SHOWERS]
 
double sh_start_Z [MAX_SHOWERS]
 
double sh_length [MAX_SHOWERS]
 
double sh_ehit_Q [MAX_SHOWERS]
 
int sh_TrackId [MAX_SHOWERS]
 
int sh_hasPrimary_e [MAX_SHOWERS]
 
double sh_allhit_Q [MAX_SHOWERS]
 
double sh_purity [MAX_SHOWERS]
 
double sh_completeness [MAX_SHOWERS]
 
double esh_1_purity
 
double esh_1_completeness
 
double esh_each_purity [MAX_SHOWERS]
 
double esh_each_completeness [MAX_SHOWERS]
 
double esh_purity
 
double esh_completeness
 
int count_primary_e_in_Event
 
TTree * fEventTree
 
TH1D * h_Ev_den
 
TH1D * h_Ev_num
 
TH1D * h_Ee_den
 
TH1D * h_Ee_num
 
TEfficiency * h_Eff_Ev = 0
 
TEfficiency * h_Eff_Ee = 0
 

Detailed Description

Definition at line 48 of file NuShowerEff_module.cc.

Member Typedef Documentation

Definition at line 22 of file EDAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 163 of file NuShowerEff_module.cc.

164  : EDAnalyzer(p)
165  , fMCTruthModuleLabel(p.get<std::string>("MCTruthModuleLabel"))
166  , fHitModuleLabel(p.get<std::string>("HitModuleLabel"))
167  , fShowerModuleLabel(p.get<std::string>("ShowerModuleLabel"))
168  , fTruthMatchDataModuleLabel(p.get<std::string>("TruthMatchDataModuleLabel"))
169  , fNeutrinoPDGcode(p.get<int>("NeutrinoPDGcode"))
170  , fLeptonPDGcode(p.get<int>("LeptonPDGcode"))
171  , fSaveMCTree(p.get<bool>("SaveMCTree"))
172  , fHitShowerThroughPFParticle(p.get<bool>("HitShowerThroughPFParticle"))
173  , fMinPurity(p.get<double>("MinPurity"))
174  , fMinCompleteness(p.get<double>("MinCompleteness"))
175  , fFidVolCutX(p.get<float>("FidVolCutX"))
176  , fFidVolCutY(p.get<float>("FidVolCutY"))
177  , fFidVolCutZ(p.get<float>("FidVolCutZ"))
178 {}
std::string fMCTruthModuleLabel
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.cc:6
bool fHitShowerThroughPFParticle
std::string fShowerModuleLabel
std::string fHitModuleLabel
std::string fTruthMatchDataModuleLabel
NuShowerEff::NuShowerEff ( NuShowerEff const &  )
delete
NuShowerEff::NuShowerEff ( NuShowerEff &&  )
delete

Member Function Documentation

void NuShowerEff::analyze ( art::Event const &  e)
overrideprivatevirtual

Implements art::EDAnalyzer.

Definition at line 277 of file NuShowerEff_module.cc.

References util::abs(), sim::ParticleList::begin(), simb::MCNeutrino::CCNC(), count_primary_e_in_Event, art::FindManyP< ProdB, Data >::data(), recob::Shower::Direction(), sim::ParticleList::end(), simb::MCParticle::EndMomentum(), simb::MCParticle::EndPosition(), energy, esh_1_completeness, esh_1_purity, esh_completeness, esh_each_completeness, esh_each_purity, esh_purity, art::EventID::event(), Event, fEventTree, fHitModuleLabel, fHitShowerThroughPFParticle, art::fill_ptr_vector(), fLeptonPDGcode, fMCTruthModuleLabel, fMinCompleteness, fMinPurity, fNeutrinoPDGcode, fSaveMCTree, fShowerModuleLabel, fTruthMatchDataModuleLabel, art::ProductRetriever::getByLabel(), simb::MCTruth::GetNeutrino(), h_Ee_den, h_Ee_num, h_Ev_den, h_Ev_num, hits(), art::Event::id(), insideFV(), recob::Hit::Integral(), simb::MCNeutrino::InteractionType(), simb::kBeamNeutrino, art::Ptr< T >::key(), recob::Shower::Length(), simb::MCNeutrino::Lepton(), MC_channel, MC_incoming_E, MC_incoming_P, MC_incoming_PDG, MC_isCC, MC_lepton_endMomentum, MC_lepton_endXYZT, MC_lepton_PDG, MC_lepton_startEnergy, MC_lepton_startMomentum, MC_lepton_startXYZT, MC_leptonID, MC_Q2, MC_target, MC_vertex, MC_W, simb::MCParticle::Momentum(), simb::MCParticle::Mother(), n_recoShowers, simb::MCTruth::NeutrinoSet(), simb::MCNeutrino::Nu(), cheat::ParticleInventoryService::ParticleList(), cheat::ParticleInventoryService::ParticleToMCTruth_P(), simb::MCParticle::PdgCode(), simb::MCParticle::Position(), simb::MCNeutrino::QSqr(), reset(), art::Event::run(), Run, sh_allhit_Q, sh_completeness, sh_direction_X, sh_direction_Y, sh_direction_Z, sh_ehit_Q, sh_hasPrimary_e, sh_length, sh_purity, sh_start_X, sh_start_Y, sh_start_Z, sh_TrackId, recob::Shower::ShowerStart(), art::Event::subRun(), SubRun, simb::MCNeutrino::Target(), simb::MCParticle::TrackId(), cheat::ParticleInventoryService::TrackIdToMotherParticle_P(), cheat::ParticleInventoryService::TrackIdToParticle_P(), and simb::MCNeutrino::W().

278 {
279  reset(); // for some variables
280 
281  Event = e.id().event();
282  Run = e.run();
283  SubRun = e.subRun();
284 
285  // -------- find Geant4 TrackId that corresponds to e+/e- from neutrino interaction ----------
286  // MCTruth: Generator
288  e.getByLabel(fMCTruthModuleLabel, MCtruthHandle);
289  std::vector<art::Ptr<simb::MCTruth>> MCtruthlist;
290  art::fill_ptr_vector(MCtruthlist, MCtruthHandle);
291  art::Ptr<simb::MCTruth> MCtruth;
292  // MC (neutrino) interaction
293  int MCinteractions = MCtruthlist.size();
294  for (int i = 0; i < MCinteractions; i++) {
295  MCtruth = MCtruthlist[i];
296  if (MCtruth->NeutrinoSet()) { // NeutrinoSet(): whether the neutrino information has been set
297  simb::MCNeutrino nu = MCtruth->GetNeutrino(); // GetNeutrino(): reference to neutrino info
298  if (nu.CCNC() == 0)
299  MC_isCC = 1;
300  else if (nu.CCNC() == 1)
301  MC_isCC = 0;
302  simb::MCParticle neutrino = nu.Nu(); // Nu(): the incoming neutrino
303  MC_target = nu.Target(); // Target(): nuclear target, as PDG code
304  MC_incoming_PDG = std::abs(nu.Nu().PdgCode()); // here not use std::abs()
305  MC_Q2 = nu.QSqr(); // QSqr(): momentum transfer Q^2, in GeV^2
306  MC_channel = nu.InteractionType(); // 1001: CCQE
307  MC_W = nu.W(); // W(): hadronic invariant mass
308  const TLorentzVector& nu_momentum = nu.Nu().Momentum(0);
309  nu_momentum.GetXYZT(MC_incoming_P);
310  const TLorentzVector& vertex = neutrino.Position(0);
311  vertex.GetXYZT(MC_vertex);
312  simb::MCParticle lepton = nu.Lepton(); // Lepton(): the outgoing lepton
313  MC_lepton_PDG = lepton.PdgCode();
314 
316  }
317  }
318 
319  // Geant4: MCParticle -> lepton (e)
320  // Note: generator level MCPartilceList is different from Geant4 level MCParticleList. MCParticleList(Geant4) contains all particles in MCParticleList(generator) but their the indexes (TrackIds) are different.
321  simb::MCParticle* MClepton = NULL; //Geant4 level
323  const sim::ParticleList& plist = pi_serv->ParticleList();
324  simb::MCParticle* particle = 0;
325 
326  for (sim::ParticleList::const_iterator ipar = plist.begin(); ipar != plist.end(); ++ipar) {
327  particle = ipar->second; // first is index(TrackId), second is value (point address)
328 
329  auto& truth = pi_serv->ParticleToMCTruth_P(particle); // beam neutrino only
330  if (truth->Origin() == simb::kBeamNeutrino && std::abs(particle->PdgCode()) == fLeptonPDGcode &&
331  particle->Mother() == 0) { // primary lepton; Mother() = 0 means e^{-} for v+n=e^{-}+p
332  const TLorentzVector& lepton_momentum = particle->Momentum(0);
333  const TLorentzVector& lepton_position = particle->Position(0);
334  const TLorentzVector& lepton_positionEnd = particle->EndPosition();
335  const TLorentzVector& lepton_momentumEnd = particle->EndMomentum();
336  lepton_momentum.GetXYZT(MC_lepton_startMomentum);
337  lepton_position.GetXYZT(MC_lepton_startXYZT);
338  lepton_positionEnd.GetXYZT(MC_lepton_endXYZT);
339  lepton_momentumEnd.GetXYZT(MC_lepton_endMomentum);
340  MC_leptonID = particle->TrackId();
341 
343  MClepton = particle;
344  }
345  }
346 
347  // check if the interaction is inside the Fiducial Volume
348  bool isFiducial = false;
349  isFiducial = insideFV(MC_vertex);
350  if (!isFiducial) { return; }
351 
353  if (MClepton) {
354  h_Ev_den->Fill(MC_incoming_P[3]);
356  }
357  }
358 
359  // recob::Hit
360  // ---- build a map for total hit charges corresponding to MC_leptonID (Geant4) ----
361 
363  std::vector<art::Ptr<recob::Hit>> all_hits;
364  if (e.getByLabel(fHitModuleLabel, hitHandle)) { art::fill_ptr_vector(all_hits, hitHandle); }
365 
366  double ehit_total = 0.0;
367 
369  hitHandle, e, fTruthMatchDataModuleLabel);
370 
371  std::map<int, double> all_hits_trk_Q; //Q for charge: Integral()
372  for (size_t i = 0; i < all_hits.size(); ++i) {
373  art::Ptr<recob::Hit> hit = all_hits[i];
374  auto particles =
375  fmhitmc.at(hit.key()); // particles here is a pointer. A hit may come from multiple particles.
376  auto hitmatch = fmhitmc.data(hit.key()); // metadata
377  double maxenergy = -1e9;
378  int hit_TrackId = 0;
379  for (size_t j = 0; j < particles.size(); ++j) {
380  if (!particles[j]) continue;
381  if (!pi_serv->TrackIdToMotherParticle_P(particles[j]->TrackId())) continue;
382  size_t trkid = (pi_serv->TrackIdToMotherParticle_P(particles[j]->TrackId()))->TrackId();
383 
384  if ((hitmatch[j]->energy) > maxenergy) {
385  maxenergy = hitmatch[j]->energy;
386  hit_TrackId = trkid;
387  }
388  }
389  if (hit_TrackId == MC_leptonID) ehit_total += hit->Integral();
390  all_hits_trk_Q[hit_TrackId] +=
391  hit
392  ->Integral(); // Integral(): the integral under the calibrated signal waveform of the hit, in tick x ADC units
393  }
394 
395  //--------- Loop over all showers: find the associated hits for each shower ------------
396  const simb::MCParticle* MClepton_reco = NULL;
397 
398  double temp_sh_ehit_Q = 0.0;
399  double temp_sh_allHit_Q = 0.0;
400  int temp_sh_TrackId = -999;
402 
404  std::vector<art::Ptr<recob::Shower>> showerlist;
405  if (e.getByLabel(fShowerModuleLabel, showerHandle)) {
406  art::fill_ptr_vector(showerlist, showerHandle);
407  }
408  n_recoShowers = showerlist.size();
409  art::FindManyP<recob::Hit> sh_hitsAll(showerHandle, e, fShowerModuleLabel);
410 
411  std::map<int, double> showers_trk_Q;
412  for (int i = 0; i < n_recoShowers; i++) { // loop over showers
413  sh_hasPrimary_e[i] = 0;
414 
415  std::map<int, double> sh_hits_trk_Q; //Q for charge: Integral()
416  sh_hits_trk_Q.clear();
417 
418  art::Ptr<recob::Shower> shower = showerlist[i];
419  sh_direction_X[i] =
420  shower->Direction().X(); // Direction(): direction cosines at start of the shower
421  sh_direction_Y[i] = shower->Direction().Y();
422  sh_direction_Z[i] = shower->Direction().Z();
423  sh_start_X[i] = shower->ShowerStart().X();
424  sh_start_Y[i] = shower->ShowerStart().Y();
425  sh_start_Z[i] = shower->ShowerStart().Z();
426  sh_length[i] = shower->Length(); // shower length in [cm]
427 
428  std::vector<art::Ptr<recob::Hit>> sh_hits; // associated hits for ith shower
429  //In mcc8, if we get hits associated with the shower through shower->hits association directly for pandora, the hit list is incomplete. The recommended way of getting hits is through association with pfparticle:
430  //shower->pfparticle->clusters->hits
431  //----------getting hits through PFParticle (an option here)-------------------
433 
434  // PFParticle
436  std::vector<art::Ptr<recob::PFParticle>> pfps;
437  if (e.getByLabel(fShowerModuleLabel, pfpHandle)) art::fill_ptr_vector(pfps, pfpHandle);
438  // Clusters
440  std::vector<art::Ptr<recob::Cluster>> clusters;
441  if (e.getByLabel(fShowerModuleLabel, clusterHandle))
442  art::fill_ptr_vector(clusters, clusterHandle);
444  showerHandle, e, fShowerModuleLabel); // PFParticle in Shower
446  pfpHandle, e, fShowerModuleLabel); // Cluster vs. PFParticle
447  art::FindManyP<recob::Hit> fmhc(clusterHandle, e, fShowerModuleLabel); // Hit in Shower
448  if (fmps.isValid()) {
449  std::vector<art::Ptr<recob::PFParticle>> pfs = fmps.at(i);
450  for (size_t ipf = 0; ipf < pfs.size(); ++ipf) {
451  if (fmcp.isValid()) {
452  std::vector<art::Ptr<recob::Cluster>> clus = fmcp.at(pfs[ipf].key());
453  for (size_t iclu = 0; iclu < clus.size(); ++iclu) {
454  if (fmhc.isValid()) {
455  std::vector<art::Ptr<recob::Hit>> hits = fmhc.at(clus[iclu].key());
456  for (size_t ihit = 0; ihit < hits.size(); ++ihit) {
457  sh_hits.push_back(hits[ihit]);
458  }
459  }
460  }
461  }
462  }
463  }
464  }
465  else {
466 
467  // ----- using shower->hit association for getting hits associated with shower-----
468  sh_hits =
469  sh_hitsAll.at(i); // associated hits for ith shower (using association of hits and shower)
470  } // we only choose one method for hits associated with shower here.
471 
472  for (size_t k = 0; k < sh_hits.size(); ++k) {
473  art::Ptr<recob::Hit> hit = sh_hits[k];
474  auto particles = fmhitmc.at(hit.key());
475  auto hitmatch = fmhitmc.data(hit.key());
476  double maxenergy = -1e9;
477  int hit_TrackId = 0;
478  for (size_t j = 0; j < particles.size(); ++j) {
479  if (!particles[j]) continue;
480  if (!pi_serv->TrackIdToMotherParticle_P(particles[j]->TrackId())) continue;
481  size_t trkid = (pi_serv->TrackIdToMotherParticle_P(particles[j]->TrackId()))->TrackId();
482 
483  if ((hitmatch[j]->energy) > maxenergy) {
484  maxenergy = hitmatch[j]->energy;
485  hit_TrackId = trkid;
486  }
487  }
488  if (hit_TrackId == MC_leptonID) { sh_ehit_Q[i] += hit->Integral(); }
489  sh_allhit_Q[i] += hit->Integral();
490  sh_hits_trk_Q[hit_TrackId] += hit->Integral(); // Q from the same hit_TrackId
491  }
492 
493  // get TrackId for a shower
494  double maxshowerQ = -1.0e9;
495  for (std::map<int, double>::iterator k = sh_hits_trk_Q.begin(); k != sh_hits_trk_Q.end(); k++) {
496  if (k->second > maxshowerQ) {
497  maxshowerQ = k->second;
498  sh_TrackId[i] =
499  k->first; //assign a sh_TrackId with TrackId from hit(particle) that contributing largest to the shower.
500  }
501  }
502 
503  //---------------------------------------------------------------------------------
504 
505  if (sh_TrackId[i] == MC_leptonID && sh_ehit_Q[i] > 0) {
506  temp_sh_TrackId = sh_TrackId[i];
507  sh_hasPrimary_e[i] = 1;
509  MClepton_reco = pi_serv->TrackIdToParticle_P(sh_TrackId[i]);
510 
511  if (sh_allhit_Q[i] > 0 && sh_ehit_Q[i] <= sh_allhit_Q[i]) {
512  sh_purity[i] = sh_ehit_Q[i] / sh_allhit_Q[i];
513  }
514  else {
515  sh_purity[i] = 0;
516  }
517  if (ehit_total > 0 && sh_ehit_Q[i] <= sh_allhit_Q[i]) {
518  sh_completeness[i] = sh_ehit_Q[i] / ehit_total;
519  }
520  else {
521  sh_completeness[i] = 0;
522  }
523  temp_sh_ehit_Q += sh_ehit_Q[i];
524  temp_sh_allHit_Q += sh_allhit_Q[i];
525  }
526 
527  showers_trk_Q[sh_TrackId[i]] += maxshowerQ;
528 
529  } // end: for loop over showers
530 
531  // ---------------------------------------------------------------
532  if (MClepton_reco && MClepton) {
533  if ((temp_sh_TrackId == MC_leptonID) && MC_isCC &&
535  if ((temp_sh_allHit_Q >= temp_sh_ehit_Q) && (temp_sh_ehit_Q > 0.0)) {
536  esh_purity = temp_sh_ehit_Q / temp_sh_allHit_Q;
537  esh_completeness = temp_sh_ehit_Q / ehit_total;
538 
540  h_Ev_num->Fill(MC_incoming_P[3]);
542  }
543  }
544  }
545  }
546  // --------------------------------------------------------------
547 
548  if ((MClepton_reco && MClepton) && MC_isCC && (fNeutrinoPDGcode == std::abs(MC_incoming_PDG))) {
549  for (int j = 0; j < count_primary_e_in_Event; j++) {
550  esh_each_purity[j] = 0.0;
551  }
552 
553  double temp_esh_1_allhit = -1.0e9;
554  int temp_shower_index = -999;
555  int temp_esh_index = 0;
556  for (int i = 0; i < n_recoShowers; i++) {
557  if (sh_TrackId[i] == MC_leptonID) {
558 
559  // for each electron shower
560  if (sh_ehit_Q[i] > 0) {
561  esh_each_purity[temp_esh_index] = sh_purity[i];
562  esh_each_completeness[temp_esh_index] = sh_completeness[i];
563  temp_esh_index += 1;
564  }
565 
566  // find largest shower
567  if ((sh_allhit_Q[i] > temp_esh_1_allhit) && (sh_ehit_Q[i] > 0.0)) {
568  temp_esh_1_allhit = sh_allhit_Q[i];
569  temp_shower_index = i;
570  }
571  }
572  }
573  // largest shower with electron contribution
574  esh_1_purity = sh_purity[temp_shower_index];
575  esh_1_completeness = sh_completeness[temp_shower_index];
576  }
577 
578  if (count_primary_e_in_Event > 0 && MC_isCC && fSaveMCTree) {
579  fEventTree->Fill();
580  } // so far, only save CC event
581 }
intermediate_table::iterator iterator
double esh_each_purity[MAX_SHOWERS]
double sh_direction_X[MAX_SHOWERS]
const TVector3 & ShowerStart() const
Definition: Shower.h:197
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:220
int PdgCode() const
Definition: MCParticle.h:213
int CCNC() const
Definition: MCNeutrino.h:148
double QSqr() const
Definition: MCNeutrino.h:157
const simb::MCNeutrino & GetNeutrino() const
Definition: MCTruth.h:77
double MC_lepton_startEnergy
const TLorentzVector & EndPosition() const
Definition: MCParticle.h:226
double Length() const
Definition: Shower.h:227
double sh_start_Y[MAX_SHOWERS]
const simb::MCParticle * TrackIdToParticle_P(int id) const
int Mother() const
Definition: MCParticle.h:214
const simb::MCParticle & Nu() const
Definition: MCNeutrino.h:146
list_type::const_iterator const_iterator
Definition: ParticleList.h:132
double sh_direction_Y[MAX_SHOWERS]
constexpr auto abs(T v)
Returns the absolute value of the argument.
std::string fMCTruthModuleLabel
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:244
double MC_lepton_startMomentum[4]
const art::Ptr< simb::MCTruth > & ParticleToMCTruth_P(const simb::MCParticle *p) const
int TrackId() const
Definition: MCParticle.h:211
bool fHitShowerThroughPFParticle
int sh_TrackId[MAX_SHOWERS]
std::string fShowerModuleLabel
int InteractionType() const
Definition: MCNeutrino.h:150
void hits()
Definition: readHits.C:15
const simb::MCParticle & Lepton() const
Definition: MCNeutrino.h:147
double W() const
Definition: MCNeutrino.h:154
std::string fHitModuleLabel
double esh_each_completeness[MAX_SHOWERS]
int sh_hasPrimary_e[MAX_SHOWERS]
key_type key() const noexcept
Definition: Ptr.h:166
bool insideFV(double vertex[4])
double energy
Definition: plottest35.C:25
iterator begin()
Definition: ParticleList.h:305
const TVector3 & Direction() const
Definition: Shower.h:188
double sh_start_Z[MAX_SHOWERS]
double sh_purity[MAX_SHOWERS]
Detector simulation of raw signals on wires.
const sim::ParticleList & ParticleList() const
double sh_ehit_Q[MAX_SHOWERS]
double MC_lepton_startXYZT[4]
double MC_lepton_endXYZT[4]
double sh_direction_Z[MAX_SHOWERS]
int Target() const
Definition: MCNeutrino.h:151
double sh_completeness[MAX_SHOWERS]
double MC_lepton_endMomentum[40]
double sh_allhit_Q[MAX_SHOWERS]
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:221
std::string fTruthMatchDataModuleLabel
bool NeutrinoSet() const
Definition: MCTruth.h:78
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:306
const simb::MCParticle * TrackIdToMotherParticle_P(int id) const
Float_t e
Definition: plot.C:35
Event generator information.
Definition: MCNeutrino.h:18
double sh_start_X[MAX_SHOWERS]
const TLorentzVector & EndMomentum() const
Definition: MCParticle.h:241
double MC_incoming_P[4]
double sh_length[MAX_SHOWERS]
Beam neutrinos.
Definition: MCTruth.h:23
vertex reconstruction
void NuShowerEff::beginJob ( )
overrideprivatevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 181 of file NuShowerEff_module.cc.

References count_primary_e_in_Event, esh_1_completeness, esh_1_purity, esh_completeness, esh_each_completeness, esh_each_purity, esh_purity, Event, fEventTree, fFidVolCutX, fFidVolCutY, fFidVolCutZ, fFidVolXmax, fFidVolXmin, fFidVolYmax, fFidVolYmin, fFidVolZmax, fFidVolZmin, fSaveMCTree, h_Ee_den, h_Ee_num, h_Ev_den, h_Ev_num, MC_incoming_E, MC_lepton_startEnergy, n_recoShowers, Run, sh_hasPrimary_e, and SubRun.

182 {
183  // Get geometry: Fiducial Volume
184  auto const* geo = lar::providerFrom<geo::Geometry>();
185  double minx = 1e9; // [cm]
186  double maxx = -1e9;
187  double miny = 1e9;
188  double maxy = -1e9;
189  double minz = 1e9;
190  double maxz = -1e9;
191  for (auto const& tpc : geo->Iterate<geo::TPCGeo>()) {
192  auto const world = tpc.GetCenter();
193 
194  if (minx > world.X() - tpc.HalfWidth()) minx = world.X() - tpc.HalfWidth();
195  if (maxx < world.X() + tpc.HalfWidth()) maxx = world.X() + tpc.HalfWidth();
196  if (miny > world.Y() - tpc.HalfHeight()) miny = world.Y() - tpc.HalfHeight();
197  if (maxy < world.Y() + tpc.HalfHeight()) maxy = world.Y() + tpc.HalfHeight();
198  if (minz > world.Z() - tpc.Length() / 2.) minz = world.Z() - tpc.Length() / 2.;
199  if (maxz < world.Z() + tpc.Length() / 2.) maxz = world.Z() + tpc.Length() / 2.;
200  }
201 
202  fFidVolXmin = minx + fFidVolCutX;
203  fFidVolXmax = maxx - fFidVolCutX;
204  fFidVolYmin = miny + fFidVolCutY;
205  fFidVolYmax = maxy - fFidVolCutY;
206  fFidVolZmin = minz + fFidVolCutZ;
207  fFidVolZmax = maxz - fFidVolCutZ;
208 
210 
211  double E_bins[21] = {0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4, 4.5, 5.0,
212  5.5, 6.0, 7.0, 8.0, 10.0, 12.0, 14.0, 17.0, 20.0, 25.0};
213 
214  h_Ev_den =
215  tfs->make<TH1D>("h_Ev_den",
216  "Neutrino Energy; Neutrino Energy (GeV); Shower Reconstruction Efficiency",
217  20,
218  E_bins);
219  h_Ev_den->Sumw2();
220  h_Ev_num =
221  tfs->make<TH1D>("h_Ev_num",
222  "Neutrino Energy; Neutrino Energy (GeV); Shower Reconstruction Efficiency",
223  20,
224  E_bins);
225  h_Ev_num->Sumw2();
226 
227  h_Ee_den =
228  tfs->make<TH1D>("h_Ee_den",
229  "Electron Energy; Electron Energy (GeV); Shower Reconstruction Efficiency",
230  20,
231  E_bins);
232  h_Ee_den->Sumw2();
233  h_Ee_num =
234  tfs->make<TH1D>("h_Ee_num",
235  "Electron Energy; Electron Energy (GeV); Shower Reconstruction Efficiency",
236  20,
237  E_bins);
238  h_Ee_num->Sumw2();
239 
240  if (fSaveMCTree) {
241  fEventTree = new TTree("Event", "Event Tree from Sim & Reco");
242  fEventTree->Branch("eventNo", &Event); // only select event in FV
243  fEventTree->Branch("runNo", &Run);
244  fEventTree->Branch("subRunNo", &SubRun);
245 
246  fEventTree->Branch("MC_incoming_E", &MC_incoming_E);
247  fEventTree->Branch("MC_lepton_startEnergy", &MC_lepton_startEnergy);
248 
249  fEventTree->Branch("n_showers", &n_recoShowers);
250  fEventTree->Branch("sh_hasPrimary_e", &sh_hasPrimary_e, "sh_hasPrimary_e[n_showers]/I");
251  fEventTree->Branch("count_primary_e_in_Event", &count_primary_e_in_Event);
252  fEventTree->Branch("esh_1_purity", &esh_1_purity);
253  fEventTree->Branch("esh_1_completeness", &esh_1_completeness);
254  fEventTree->Branch(
255  "esh_each_purity", &esh_each_purity, "esh_each_purity[count_primary_e_in_Event]/D");
256  fEventTree->Branch("esh_each_completeness",
258  "esh_each_completeness[count_primary_e_in_Event]/D");
259  fEventTree->Branch("esh_purity", &esh_purity);
260  fEventTree->Branch("esh_completeness", &esh_completeness);
261  }
262 }
double esh_each_purity[MAX_SHOWERS]
double MC_lepton_startEnergy
Geometry information for a single TPC.
Definition: TPCGeo.h:36
double esh_each_completeness[MAX_SHOWERS]
int sh_hasPrimary_e[MAX_SHOWERS]
Namespace collecting geometry-related classes utilities.
void NuShowerEff::beginRun ( art::Run const &  run)
overrideprivatevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 271 of file NuShowerEff_module.cc.

272 {
273  mf::LogInfo("ShowerEff") << "==== begin run ... ====" << endl;
274 }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 61 of file ModuleBase.h.

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

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

Definition at line 57 of file ModuleBase.cc.

References art::ModuleBase::collector_.

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

Definition at line 75 of file ModuleBase.h.

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

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

Definition at line 68 of file ModuleBase.h.

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

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

Definition at line 25 of file Analyzer.cc.

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

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

Definition at line 68 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

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

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

Definition at line 84 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

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

85  {
86  ProcessingFrame const frame{mc.scheduleID()};
87  beginSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
88  return true;
89  }
virtual void beginSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
void NuShowerEff::doEfficiencies ( )
private

Definition at line 584 of file NuShowerEff_module.cc.

References h_Ee_den, h_Ee_num, h_Eff_Ee, h_Eff_Ev, h_Ev_den, and h_Ev_num.

Referenced by endJob().

585 {
587 
588  if (TEfficiency::CheckConsistency(*h_Ev_num, *h_Ev_den)) {
589  h_Eff_Ev = tfs->make<TEfficiency>(*h_Ev_num, *h_Ev_den);
590  TGraphAsymmErrors* grEff_Ev = h_Eff_Ev->CreateGraph();
591  grEff_Ev->Write("grEff_Ev");
592  h_Eff_Ev->Write("h_Eff_Ev");
593  }
594 
595  if (TEfficiency::CheckConsistency(*h_Ee_num, *h_Ee_den)) {
596  h_Eff_Ee = tfs->make<TEfficiency>(*h_Ee_num, *h_Ee_den);
597  TGraphAsymmErrors* grEff_Ee = h_Eff_Ee->CreateGraph();
598  grEff_Ee->Write("grEff_Ee");
599  h_Eff_Ee->Write("h_Eff_Ee");
600  }
601 }
TEfficiency * h_Eff_Ee
TEfficiency * h_Eff_Ev
void art::detail::Analyzer::doEndJob ( )
inherited

Definition at line 33 of file Analyzer.cc.

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

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

Definition at line 76 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

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

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

Definition at line 92 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

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

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

Definition at line 100 of file Analyzer.cc.

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

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

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

Definition at line 47 of file Analyzer.cc.

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

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

Definition at line 61 of file Analyzer.cc.

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

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

Definition at line 40 of file Analyzer.cc.

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

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

Definition at line 54 of file Analyzer.cc.

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

55  {
56  ProcessingFrame const frame{ScheduleID{}};
58  }
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void NuShowerEff::endJob ( )
overrideprivatevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 265 of file NuShowerEff_module.cc.

References doEfficiencies().

266 {
267  doEfficiencies();
268 }
std::array< std::vector< ProductInfo >, NumBranchTypes > const & art::ModuleBase::getConsumables ( ) const
inherited

Definition at line 43 of file ModuleBase.cc.

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

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

Definition at line 75 of file Observer.cc.

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

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

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

Definition at line 604 of file NuShowerEff_module.cc.

References fFidVolXmin, fFidVolYmin, fFidVolZmax, fFidVolZmin, x, y, and z.

Referenced by analyze().

605 {
606  double x = vertex[0];
607  double y = vertex[1];
608  double z = vertex[2];
609 
610  if (x > fFidVolXmin && x < fFidVolXmax && y > fFidVolYmin && y < fFidVolYmax && z > fFidVolZmin &&
611  z < fFidVolZmax) {
612  return true;
613  }
614  else {
615  return false;
616  }
617 }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
vertex reconstruction
std::unique_ptr< Worker > art::ModuleBase::makeWorker ( WorkerParams const &  wp)
inherited

Definition at line 37 of file ModuleBase.cc.

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

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

Definition at line 82 of file ModuleBase.h.

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

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

Definition at line 96 of file ModuleBase.h.

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

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

Definition at line 89 of file ModuleBase.h.

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

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

Definition at line 13 of file ModuleBase.cc.

References art::errors::LogicError.

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

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

Definition at line 57 of file Observer.cc.

References art::Observer::process_name_.

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

58  {
59  return process_name_;
60  }
std::string process_name_
Definition: Observer.h:76
void NuShowerEff::reset ( )
private

Definition at line 620 of file NuShowerEff_module.cc.

References DEFINE_ART_MODULE, MAX_SHOWERS, MC_channel, MC_incoming_PDG, MC_isCC, MC_lepton_PDG, MC_lepton_theta, MC_leptonID, MC_LeptonTrack, MC_Q2, MC_target, MC_W, sh_allhit_Q, sh_completeness, sh_direction_X, sh_direction_Y, sh_direction_Z, sh_ehit_Q, sh_hasPrimary_e, sh_length, sh_purity, sh_start_X, sh_start_Y, and sh_start_Z.

Referenced by analyze().

621 {
622  MC_incoming_PDG = -999;
623  MC_lepton_PDG = -999;
624  MC_isCC = -999;
625  MC_channel = -999;
626  MC_target = -999;
627  MC_Q2 = -999.0;
628  MC_W = -999.0;
629  MC_lepton_theta = -999.0;
630  MC_leptonID = -999;
631  MC_LeptonTrack = -999;
632 
633  for (int i = 0; i < MAX_SHOWERS; i++) {
634  sh_direction_X[i] = -999.0;
635  sh_direction_Y[i] = -999.0;
636  sh_direction_Z[i] = -999.0;
637  sh_start_X[i] = -999.0;
638  sh_start_Y[i] = -999.0;
639  sh_start_Z[i] = -999.0;
640  sh_length[i] = -999.0;
641  sh_hasPrimary_e[i] = -999;
642  sh_ehit_Q[i] = 0.0;
643  sh_allhit_Q[i] = 0.0;
644  sh_purity[i] = 0.0;
645  sh_completeness[i] = 0.0;
646  }
647 }
double sh_direction_X[MAX_SHOWERS]
double sh_start_Y[MAX_SHOWERS]
double sh_direction_Y[MAX_SHOWERS]
#define MAX_SHOWERS
int sh_hasPrimary_e[MAX_SHOWERS]
double sh_start_Z[MAX_SHOWERS]
double sh_purity[MAX_SHOWERS]
double sh_ehit_Q[MAX_SHOWERS]
double sh_direction_Z[MAX_SHOWERS]
double sh_completeness[MAX_SHOWERS]
double sh_allhit_Q[MAX_SHOWERS]
double sh_start_X[MAX_SHOWERS]
double sh_length[MAX_SHOWERS]
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  md)
inherited

Definition at line 31 of file ModuleBase.cc.

References art::ModuleBase::md_.

32  {
33  md_ = md;
34  }
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited

Definition at line 49 of file ModuleBase.cc.

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

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

Definition at line 31 of file Observer.h.

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

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

Definition at line 63 of file Observer.cc.

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

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

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

Member Data Documentation

int NuShowerEff::count_primary_e_in_Event
private

Definition at line 147 of file NuShowerEff_module.cc.

Referenced by analyze(), and beginJob().

double NuShowerEff::esh_1_completeness
private

Definition at line 141 of file NuShowerEff_module.cc.

Referenced by analyze(), and beginJob().

double NuShowerEff::esh_1_purity
private

Definition at line 140 of file NuShowerEff_module.cc.

Referenced by analyze(), and beginJob().

double NuShowerEff::esh_completeness
private

Definition at line 146 of file NuShowerEff_module.cc.

Referenced by analyze(), and beginJob().

double NuShowerEff::esh_each_completeness[MAX_SHOWERS]
private

Definition at line 144 of file NuShowerEff_module.cc.

Referenced by analyze(), and beginJob().

double NuShowerEff::esh_each_purity[MAX_SHOWERS]
private

Definition at line 143 of file NuShowerEff_module.cc.

Referenced by analyze(), and beginJob().

double NuShowerEff::esh_purity
private

Definition at line 145 of file NuShowerEff_module.cc.

Referenced by analyze(), and beginJob().

int NuShowerEff::Event
private

Definition at line 100 of file NuShowerEff_module.cc.

Referenced by analyze(), and beginJob().

TTree* NuShowerEff::fEventTree
private

Definition at line 150 of file NuShowerEff_module.cc.

Referenced by analyze(), and beginJob().

float NuShowerEff::fFidVolCutX
private

Definition at line 87 of file NuShowerEff_module.cc.

Referenced by beginJob().

float NuShowerEff::fFidVolCutY
private

Definition at line 88 of file NuShowerEff_module.cc.

Referenced by beginJob().

float NuShowerEff::fFidVolCutZ
private

Definition at line 89 of file NuShowerEff_module.cc.

Referenced by beginJob().

float NuShowerEff::fFidVolXmax
private

Definition at line 93 of file NuShowerEff_module.cc.

Referenced by beginJob().

float NuShowerEff::fFidVolXmin
private

Definition at line 92 of file NuShowerEff_module.cc.

Referenced by beginJob(), and insideFV().

float NuShowerEff::fFidVolYmax
private

Definition at line 95 of file NuShowerEff_module.cc.

Referenced by beginJob().

float NuShowerEff::fFidVolYmin
private

Definition at line 94 of file NuShowerEff_module.cc.

Referenced by beginJob(), and insideFV().

float NuShowerEff::fFidVolZmax
private

Definition at line 97 of file NuShowerEff_module.cc.

Referenced by beginJob(), and insideFV().

float NuShowerEff::fFidVolZmin
private

Definition at line 96 of file NuShowerEff_module.cc.

Referenced by beginJob(), and insideFV().

std::string NuShowerEff::fHitModuleLabel
private

Definition at line 76 of file NuShowerEff_module.cc.

Referenced by analyze().

bool NuShowerEff::fHitShowerThroughPFParticle
private

Definition at line 84 of file NuShowerEff_module.cc.

Referenced by analyze().

int NuShowerEff::fLeptonPDGcode
private

Definition at line 82 of file NuShowerEff_module.cc.

Referenced by analyze().

std::string NuShowerEff::fMCTruthModuleLabel
private

Definition at line 75 of file NuShowerEff_module.cc.

Referenced by analyze().

double NuShowerEff::fMinCompleteness
private

Definition at line 86 of file NuShowerEff_module.cc.

Referenced by analyze().

double NuShowerEff::fMinPurity
private

Definition at line 85 of file NuShowerEff_module.cc.

Referenced by analyze().

int NuShowerEff::fNeutrinoPDGcode
private

Definition at line 81 of file NuShowerEff_module.cc.

Referenced by analyze().

bool NuShowerEff::fSaveMCTree
private

Definition at line 83 of file NuShowerEff_module.cc.

Referenced by analyze(), and beginJob().

std::string NuShowerEff::fShowerModuleLabel
private

Definition at line 77 of file NuShowerEff_module.cc.

Referenced by analyze().

std::string NuShowerEff::fTruthMatchDataModuleLabel
private

Definition at line 78 of file NuShowerEff_module.cc.

Referenced by analyze().

TH1D* NuShowerEff::h_Ee_den
private

Definition at line 155 of file NuShowerEff_module.cc.

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

TH1D* NuShowerEff::h_Ee_num
private

Definition at line 156 of file NuShowerEff_module.cc.

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

TEfficiency* NuShowerEff::h_Eff_Ee = 0
private

Definition at line 159 of file NuShowerEff_module.cc.

Referenced by doEfficiencies().

TEfficiency* NuShowerEff::h_Eff_Ev = 0
private

Definition at line 158 of file NuShowerEff_module.cc.

Referenced by doEfficiencies().

TH1D* NuShowerEff::h_Ev_den
private

Definition at line 152 of file NuShowerEff_module.cc.

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

TH1D* NuShowerEff::h_Ev_num
private

Definition at line 153 of file NuShowerEff_module.cc.

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

int NuShowerEff::MC_channel
private

Definition at line 108 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

double NuShowerEff::MC_incoming_E
private

Definition at line 122 of file NuShowerEff_module.cc.

Referenced by analyze(), and beginJob().

double NuShowerEff::MC_incoming_P[4]
private

Definition at line 113 of file NuShowerEff_module.cc.

Referenced by analyze().

int NuShowerEff::MC_incoming_PDG
private

Definition at line 105 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

int NuShowerEff::MC_isCC
private

Definition at line 107 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

double NuShowerEff::MC_lepton_endMomentum[40]
private

Definition at line 115 of file NuShowerEff_module.cc.

Referenced by analyze().

double NuShowerEff::MC_lepton_endXYZT[4]
private

Definition at line 117 of file NuShowerEff_module.cc.

Referenced by analyze().

int NuShowerEff::MC_lepton_PDG
private

Definition at line 106 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

double NuShowerEff::MC_lepton_startEnergy
private

Definition at line 123 of file NuShowerEff_module.cc.

Referenced by analyze(), and beginJob().

double NuShowerEff::MC_lepton_startMomentum[4]
private

Definition at line 114 of file NuShowerEff_module.cc.

Referenced by analyze().

double NuShowerEff::MC_lepton_startXYZT[4]
private

Definition at line 116 of file NuShowerEff_module.cc.

Referenced by analyze().

double NuShowerEff::MC_lepton_theta
private

Definition at line 118 of file NuShowerEff_module.cc.

Referenced by reset().

int NuShowerEff::MC_leptonID
private

Definition at line 119 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

int NuShowerEff::MC_LeptonTrack
private

Definition at line 120 of file NuShowerEff_module.cc.

Referenced by reset().

double NuShowerEff::MC_Q2
private

Definition at line 110 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

int NuShowerEff::MC_target
private

Definition at line 109 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

double NuShowerEff::MC_vertex[4]
private

Definition at line 112 of file NuShowerEff_module.cc.

Referenced by analyze().

double NuShowerEff::MC_W
private

Definition at line 111 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

int NuShowerEff::n_recoShowers
private

Definition at line 126 of file NuShowerEff_module.cc.

Referenced by analyze(), and beginJob().

int NuShowerEff::Run
private

Definition at line 101 of file NuShowerEff_module.cc.

Referenced by analyze(), and beginJob().

double NuShowerEff::sh_allhit_Q[MAX_SHOWERS]
private

Definition at line 137 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

double NuShowerEff::sh_completeness[MAX_SHOWERS]
private

Definition at line 139 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

double NuShowerEff::sh_direction_X[MAX_SHOWERS]
private

Definition at line 127 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

double NuShowerEff::sh_direction_Y[MAX_SHOWERS]
private

Definition at line 128 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

double NuShowerEff::sh_direction_Z[MAX_SHOWERS]
private

Definition at line 129 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

double NuShowerEff::sh_ehit_Q[MAX_SHOWERS]
private

Definition at line 134 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

int NuShowerEff::sh_hasPrimary_e[MAX_SHOWERS]
private

Definition at line 136 of file NuShowerEff_module.cc.

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

double NuShowerEff::sh_length[MAX_SHOWERS]
private

Definition at line 133 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

double NuShowerEff::sh_purity[MAX_SHOWERS]
private

Definition at line 138 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

double NuShowerEff::sh_start_X[MAX_SHOWERS]
private

Definition at line 130 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

double NuShowerEff::sh_start_Y[MAX_SHOWERS]
private

Definition at line 131 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

double NuShowerEff::sh_start_Z[MAX_SHOWERS]
private

Definition at line 132 of file NuShowerEff_module.cc.

Referenced by analyze(), and reset().

int NuShowerEff::sh_TrackId[MAX_SHOWERS]
private

Definition at line 135 of file NuShowerEff_module.cc.

Referenced by analyze().

int NuShowerEff::SubRun
private

Definition at line 102 of file NuShowerEff_module.cc.

Referenced by analyze(), and beginJob().


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