All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
simfilter::FilterCryostatNus Class Reference
Inheritance diagram for simfilter::FilterCryostatNus:

Public Member Functions

 FilterCryostatNus (fhicl::ParameterSet const &pset)
 

Private Member Functions

bool filter (art::Event &) override
 

Private Attributes

bool fKeepNusInCryostat
 

Detailed Description

Definition at line 30 of file FilterCryostatNus_module.cc.

Constructor & Destructor Documentation

simfilter::FilterCryostatNus::FilterCryostatNus ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 43 of file FilterCryostatNus_module.cc.

44  : EDFilter{pset}
45  , fKeepNusInCryostat{pset.get<bool>("KeepNusInCryostat", false)}
46  {}

Member Function Documentation

bool simfilter::FilterCryostatNus::filter ( art::Event &  evt)
overrideprivate

Definition at line 49 of file FilterCryostatNus_module.cc.

50  {
51  // get the list of particles from this event
52  auto const& geom = *(lar::providerFrom<geo::Geometry>());
53 
54  //std::vector<art::Handle<std::vector<simb::MCTruth>>> allmclists;
55  //evt.getManyByType(allmclists);
56  auto allmclists = evt.getMany<std::vector<simb::MCTruth>>();
57 
58  bool inCryostatNu = false;
59  for (auto const& mclistHandle : allmclists) {
60  for (simb::MCTruth const& mct : *mclistHandle) {
61 
62  // get nu, does it end in cyrostat?
63  for (int ipart = 0; ipart < mct.NParticles(); ipart++) {
64  auto const& part = mct.GetParticle(ipart);
65  auto const absPDGID = std::abs(part.PdgCode());
66  if (absPDGID == 12 || absPDGID == 14 || absPDGID == 16) {
67  const TLorentzVector& end4 = part.EndPosition();
68  if (geom.PositionToCryostatPtr({end4.X(), end4.Y(), end4.Z()}) !=
69  nullptr) {
70  inCryostatNu = true;
71  }
72  } // if neutrino
73  } // for particles
74 
75  } // end loop over mctruth col
76 
77  } // end loop over all mctruth lists
78 
79  return fKeepNusInCryostat ^ (!inCryostatNu);
80  }
T abs(T value)
TCEvent evt
Definition: DataStructs.cxx:8

Member Data Documentation

bool simfilter::FilterCryostatNus::fKeepNusInCryostat
private

Definition at line 36 of file FilterCryostatNus_module.cc.


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