Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
art::detail::Filter Class Referenceabstract

#include <Filter.h>

Inheritance diagram for art::detail::Filter:
art::Modifier art::ModuleBase art::ProductRegistryHelper art::EDFilter art::ReplicatedFilter art::SharedFilter art::MixFilter< T, IOPolicy > art::test::DummyFilter arttest::PMTestFilter cluster::SmallClusterFilter CosmicFilter dune::CounterFilter DuneEventFilter filt::FinalStateParticleFilter filt::GenFilter filt::LArG4ExtCounterFilter filt::LArG4ParticleFilter filt::NucleonDecayFilter filt::ProtoDUNEFembFilter filt::ProtoDUNETriggerFilter filter::ADCFilter filter::EventFilter filter::EventTimeFilter filter::MuonFilter filter::ProtoDUNEUnstableHVFilter gar::filt::FSPEventFilter hit::NumberOfHitsFilter mpf::MissingProductFilter PionAbsCexSelection PrimaryPionSelection protoana::ProtoDUNEBeamlineFilter protoana::ProtoDUNETruthBeamFilter simfilter::FilterCryostatNus simfilter::FilterGenInTime simfilter::FilterNoDirtNeutrinos simfilter::FilterPrimaryPDG art::BlockingPrescaler art::EventIDFilter art::Prescaler simfilter::FilterNoMCParticles simfilter::FilterSimPhotonLiteTime simfilter::FilterSimPhotonTime

Public Types

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 >
 

Public Member Functions

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)
 

Static Public Attributes

static constexpr bool Pass {true}
 
static constexpr bool Fail {false}
 

Private Member Functions

virtual void setupQueues (SharedResources const &)=0
 
virtual void beginJobWithFrame (ProcessingFrame const &)=0
 
virtual void endJobWithFrame (ProcessingFrame const &)=0
 
virtual void respondToOpenInputFileWithFrame (FileBlock const &, ProcessingFrame const &)=0
 
virtual void respondToCloseInputFileWithFrame (FileBlock const &, ProcessingFrame const &)=0
 
virtual void respondToOpenOutputFilesWithFrame (FileBlock const &, ProcessingFrame const &)=0
 
virtual void respondToCloseOutputFilesWithFrame (FileBlock const &, ProcessingFrame const &)=0
 
virtual bool beginRunWithFrame (Run &, ProcessingFrame const &)=0
 
virtual bool endRunWithFrame (Run &, ProcessingFrame const &)=0
 
virtual bool beginSubRunWithFrame (SubRun &, ProcessingFrame const &)=0
 
virtual bool endSubRunWithFrame (SubRun &, ProcessingFrame const &)=0
 
virtual bool filterWithFrame (Event &, ProcessingFrame const &)=0
 

Private Attributes

bool const checkPutProducts_
 

Additional Inherited Members

- 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 25 of file Filter.h.

Member Typedef Documentation

template<typename UserConfig >
using art::detail::Filter::Table = Modifier::Table<UserConfig>

Definition at line 31 of file Filter.h.

Constructor & Destructor Documentation

art::detail::Filter::~Filter ( )
virtualdefaultnoexcept
art::detail::Filter::Filter ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 24 of file Filter.cc.

25  : checkPutProducts_{pset.get<bool>("errorOnFailureToPut", true)}
26  {}
bool const checkPutProducts_
Definition: Filter.h:74
art::detail::Filter::Filter ( Filter const &  )
delete
art::detail::Filter::Filter ( Filter &&  )
delete

Member Function Documentation

virtual void art::detail::Filter::beginJobWithFrame ( ProcessingFrame const &  )
privatepure virtual
virtual bool art::detail::Filter::beginRunWithFrame ( Run ,
ProcessingFrame const &   
)
privatepure virtual
virtual bool art::detail::Filter::beginSubRunWithFrame ( SubRun ,
ProcessingFrame const &   
)
privatepure virtual
void art::detail::Filter::doBeginJob ( SharedResources const &  resources)

Definition at line 29 of file Filter.cc.

30  {
31  setupQueues(resources);
32  ProcessingFrame const frame{ScheduleID{}};
33  beginJobWithFrame(frame);
34  }
virtual void setupQueues(SharedResources const &)=0
virtual void beginJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Filter::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)

Definition at line 72 of file Filter.cc.

73  {
74  Run r{rp, mc, RangeSet::forRun(rp.runID())};
75  ProcessingFrame const frame{mc.scheduleID()};
76  bool const rc = beginRunWithFrame(r, frame);
77  r.movePutProductsToPrincipal(rp);
78  return rc;
79  }
virtual bool beginRunWithFrame(Run &, ProcessingFrame const &)=0
static RangeSet forRun(RunID)
Definition: RangeSet.cc:51
bool art::detail::Filter::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)

Definition at line 92 of file Filter.cc.

93  {
94  SubRun sr{srp, mc, RangeSet::forSubRun(srp.subRunID())};
95  ProcessingFrame const frame{mc.scheduleID()};
96  bool const rc = beginSubRunWithFrame(sr, frame);
97  sr.movePutProductsToPrincipal(srp);
98  return rc;
99  }
static RangeSet forSubRun(SubRunID)
Definition: RangeSet.cc:57
virtual bool beginSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
static constexpr double sr
Definition: Units.h:166
void art::detail::Filter::doEndJob ( )

Definition at line 37 of file Filter.cc.

38  {
39  ProcessingFrame const frame{ScheduleID{}};
40  endJobWithFrame(frame);
41  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Filter::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)

Definition at line 82 of file Filter.cc.

83  {
84  Run r{rp, mc, rp.seenRanges()};
85  ProcessingFrame const frame{mc.scheduleID()};
86  bool const rc = endRunWithFrame(r, frame);
87  r.movePutProductsToPrincipal(rp);
88  return rc;
89  }
virtual bool endRunWithFrame(Run &, ProcessingFrame const &)=0
bool art::detail::Filter::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)

Definition at line 102 of file Filter.cc.

103  {
104  SubRun sr{srp, mc, srp.seenRanges()};
105  ProcessingFrame const frame{mc.scheduleID()};
106  bool const rc = endSubRunWithFrame(sr, frame);
107  sr.movePutProductsToPrincipal(srp);
108  return rc;
109  }
virtual bool endSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
static constexpr double sr
Definition: Units.h:166
bool art::detail::Filter::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 
)

Definition at line 112 of file Filter.cc.

117  {
118  Event e{ep, mc};
119  ++counts_run;
120  ProcessingFrame const frame{mc.scheduleID()};
121  bool const rc = filterWithFrame(e, frame);
122  e.movePutProductsToPrincipal(
123  ep, checkPutProducts_, &expectedProducts<InEvent>());
124  if (rc) {
125  ++counts_passed;
126  } else {
127  ++counts_failed;
128  }
129  return rc;
130  }
const double e
virtual bool filterWithFrame(Event &, ProcessingFrame const &)=0
bool const checkPutProducts_
Definition: Filter.h:74
Definition: types.h:32
void art::detail::Filter::doRespondToCloseInputFile ( FileBlock const &  fb)

Definition at line 51 of file Filter.cc.

52  {
53  ProcessingFrame const frame{ScheduleID{}};
55  }
virtual void respondToCloseInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Filter::doRespondToCloseOutputFiles ( FileBlock const &  fb)

Definition at line 65 of file Filter.cc.

66  {
67  ProcessingFrame const frame{ScheduleID{}};
69  }
virtual void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Filter::doRespondToOpenInputFile ( FileBlock const &  fb)

Definition at line 44 of file Filter.cc.

45  {
46  ProcessingFrame const frame{ScheduleID{}};
48  }
virtual void respondToOpenInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Filter::doRespondToOpenOutputFiles ( FileBlock const &  fb)

Definition at line 58 of file Filter.cc.

59  {
60  ProcessingFrame const frame{ScheduleID{}};
62  }
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
virtual void art::detail::Filter::endJobWithFrame ( ProcessingFrame const &  )
privatepure virtual
virtual bool art::detail::Filter::endRunWithFrame ( Run ,
ProcessingFrame const &   
)
privatepure virtual
virtual bool art::detail::Filter::endSubRunWithFrame ( SubRun ,
ProcessingFrame const &   
)
privatepure virtual
virtual bool art::detail::Filter::filterWithFrame ( Event ,
ProcessingFrame const &   
)
privatepure virtual
Filter& art::detail::Filter::operator= ( Filter const &  )
delete
Filter& art::detail::Filter::operator= ( Filter &&  )
delete
virtual void art::detail::Filter::respondToCloseInputFileWithFrame ( FileBlock const &  ,
ProcessingFrame const &   
)
privatepure virtual
virtual void art::detail::Filter::respondToCloseOutputFilesWithFrame ( FileBlock const &  ,
ProcessingFrame const &   
)
privatepure virtual
virtual void art::detail::Filter::respondToOpenInputFileWithFrame ( FileBlock const &  ,
ProcessingFrame const &   
)
privatepure virtual
virtual void art::detail::Filter::respondToOpenOutputFilesWithFrame ( FileBlock const &  ,
ProcessingFrame const &   
)
privatepure virtual
virtual void art::detail::Filter::setupQueues ( SharedResources const &  )
privatepure virtual

Member Data Documentation

bool const art::detail::Filter::checkPutProducts_
private

Definition at line 74 of file Filter.h.

constexpr bool art::detail::Filter::Fail {false}
static

Definition at line 28 of file Filter.h.

constexpr bool art::detail::Filter::Pass {true}
static

Definition at line 27 of file Filter.h.


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