Public Member Functions | Private Member Functions | Private Attributes | List of all members
simfilter::FilterCryostatNus Class Reference
Inheritance diagram for simfilter::FilterCryostatNus:
art::EDFilter art::detail::Filter art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Member Functions

 FilterCryostatNus (fhicl::ParameterSet const &pset)
 
- Public Member Functions inherited from art::EDFilter
 EDFilter (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDFilter (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Filter
virtual ~Filter () noexcept
 
 Filter (fhicl::ParameterSet const &)
 
 Filter (Filter const &)=delete
 
 Filter (Filter &&)=delete
 
Filteroperator= (Filter const &)=delete
 
Filteroperator= (Filter &&)=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 &)
 
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)
 
- Public Member Functions inherited from art::Modifier
 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
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)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Member Functions

bool filter (art::Event &) override
 

Private Attributes

bool fKeepNusInCryostat
 

Additional Inherited Members

- Public Types inherited from art::EDFilter
using ModuleType = EDFilter
 
using WorkerType = WorkerT< EDFilter >
 
- Public Types inherited from art::detail::Filter
template<typename UserConfig >
using Table = Modifier::Table< UserConfig >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 
- Static Public Attributes inherited from art::detail::Filter
static constexpr bool Pass {true}
 
static constexpr bool Fail {false}
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
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 ()
 

Detailed Description

Definition at line 29 of file FilterCryostatNus_module.cc.

Constructor & Destructor Documentation

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

Definition at line 42 of file FilterCryostatNus_module.cc.

43  : EDFilter{pset}
44  , fKeepNusInCryostat{pset.get<bool>("KeepNusInCryostat", false)}
45  {}
EDFilter(fhicl::ParameterSet const &pset)
Definition: EDFilter.h:21

Member Function Documentation

bool simfilter::FilterCryostatNus::filter ( art::Event evt)
overrideprivatevirtual

Implements art::EDFilter.

Definition at line 48 of file FilterCryostatNus_module.cc.

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

Member Data Documentation

bool simfilter::FilterCryostatNus::fKeepNusInCryostat
private

Definition at line 35 of file FilterCryostatNus_module.cc.


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