Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
beamlinereco::ToFFilter Class Reference
Inheritance diagram for beamlinereco::ToFFilter:
art::EDFilter art::detail::Filter art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Types

using ModuleType = EDFilter
 
using WorkerType = WorkerT< EDFilter >
 
template<typename UserConfig >
using Table = Modifier::Table< UserConfig >
 

Public Member Functions

 ToFFilter (fhicl::ParameterSet const &p)
 
bool filter (art::Event &e)
 
void reconfigure (const fhicl::ParameterSet &p)
 
std::string workerType () const
 
void doBeginJob ()
 
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)
 
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< TconsumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< TmayConsumeView (InputTag const &tag)
 

Static Public Attributes

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

Protected Member Functions

ConsumesCollector & consumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (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< TmayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Private Attributes

art::InputTag fToFDataLabel
 
art::InputTag fBeamlineToFDataLabel
 
bool fFilterOnBeamlineDigits
 
bool fFilterOnRecoToFs
 
unsigned int fMinToFHitsUS
 
unsigned int fMaxToFHitsUS
 
unsigned int fMinToFHitsDS
 
unsigned int fMaxToFHitsDS
 
unsigned int fMinToFCount
 
unsigned int fMaxToFCount
 
double fMinToF
 
double fMaxToF
 

Detailed Description

Definition at line 36 of file ToFFilter_module.cc.

Member Typedef Documentation

Definition at line 19 of file EDFilter.h.

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

Definition at line 29 of file Filter.h.

using art::EDFilter::WorkerType = WorkerT<EDFilter>
inherited

Definition at line 20 of file EDFilter.h.

Constructor & Destructor Documentation

beamlinereco::ToFFilter::ToFFilter ( fhicl::ParameterSet const &  p)
explicit

Definition at line 60 of file ToFFilter_module.cc.

References reconfigure().

61 : EDFilter(p)
62 {
63  this->reconfigure(p);
64 }
void reconfigure(const fhicl::ParameterSet &p)
const char * p
Definition: xmltok.h:285
EDFilter(fhicl::ParameterSet const &pset)
Definition: EDFilter.h:22

Member Function Documentation

template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 55 of file ModuleBase.h.

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

56  {
57  return collector_.consumes<T, BT>(tag);
58  }
ConsumesCollector collector_
Definition: ModuleBase.h:50
ProductToken< T > consumes(InputTag const &)
double T
Definition: Xdiff_gwt.C:5
ConsumesCollector& art::ModuleBase::consumesCollector ( )
protectedinherited
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protectedinherited

Definition at line 69 of file ModuleBase.h.

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

70  {
71  collector_.consumesMany<T, BT>();
72  }
ConsumesCollector collector_
Definition: ModuleBase.h:50
double T
Definition: Xdiff_gwt.C:5
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 62 of file ModuleBase.h.

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

63  {
64  return collector_.consumesView<T, BT>(tag);
65  }
ConsumesCollector collector_
Definition: ModuleBase.h:50
ViewToken< Element > consumesView(InputTag const &)
double T
Definition: Xdiff_gwt.C:5
void art::detail::Filter::doBeginJob ( )
inherited
bool art::detail::Filter::doBeginRun ( RunPrincipal rp,
ModuleContext const &   
)
inherited
bool art::detail::Filter::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited
void art::detail::Filter::doEndJob ( )
inherited
bool art::detail::Filter::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited
bool art::detail::Filter::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited
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 
)
inherited
void art::detail::Filter::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited
void art::detail::Filter::doRespondToCloseOutputFiles ( FileBlock const &  fb)
inherited
void art::detail::Filter::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited
void art::detail::Filter::doRespondToOpenOutputFiles ( FileBlock const &  fb)
inherited
bool beamlinereco::ToFFilter::filter ( art::Event e)
virtual

Implements art::EDFilter.

Definition at line 81 of file ToFFilter_module.cc.

References d, DEFINE_ART_MODULE(), beamlinegeo::DS, fBeamlineToFDataLabel, fFilterOnBeamlineDigits, fFilterOnRecoToFs, art::fill_ptr_vector(), fMaxToF, fMaxToFCount, fMaxToFHitsDS, fMaxToFHitsUS, fMinToF, fMinToFCount, fMinToFHitsDS, fMinToFHitsUS, fToFDataLabel, art::DataViewImpl::getByLabel(), and beamlinegeo::US.

82 {
83  // Get tof digits
85  std::vector<art::Ptr<brb::BeamlineDigit>> digits;
86  if (e.getByLabel(fBeamlineToFDataLabel, digitHandle)) art::fill_ptr_vector(digits, digitHandle);
87 
88  // Get ToF objects
90  std::vector<art::Ptr<brb::ToF>> tofs;
91  if (e.getByLabel(fToFDataLabel, tofHandle)) art::fill_ptr_vector(tofs, tofHandle);
92 
93  // tof digit filtering
95  // Separate by counter
96  std::vector<art::Ptr<brb::BeamlineDigit>> usDigits;
97  std::vector<art::Ptr<brb::BeamlineDigit>> dsDigits;
98  for (auto d : digits) {
99  if (d->ChannelID().Detector == beamlinegeo::ToFCounter::US) {
100  usDigits.push_back(d);
101  } else if (d->ChannelID().Detector == beamlinegeo::ToFCounter::DS) {
102  dsDigits.push_back(d);
103  }
104  }
105  if (usDigits.size() < fMinToFHitsUS) return false;
106  if (usDigits.size() > fMaxToFHitsUS) return false;
107  if (dsDigits.size() < fMinToFHitsDS) return false;
108  if (dsDigits.size() > fMaxToFHitsDS) return false;
109  }
110 
111  // tof filtering
112  if (fFilterOnRecoToFs) {
113  if(tofs.size() < fMinToFCount) return false;
114  if(tofs.size() > fMaxToFCount) return false;
115 
116  //std::cout << e.id() << ": \n";
117 
118  // Retrieve BeamlineDigits for tof reco
120 
121  //filter out events with bad behavior
122  for (auto tof : tofs) {
123  if (tof->Time() < fMinToF) return false;
124  if (tof->Time() > fMaxToF) return false;
125 
126  // Get associated reco digits
127  //const std::vector<art::Ptr<brb::BeamlineDigit>> tofDigits = fmbd.at(tof.key());
128  }
129  }
130 
131  return true;
132 }
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:446
Float_t d
Definition: plot.C:236
art::InputTag fBeamlineToFDataLabel
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:291
std::array<std::vector<ProductInfo>, NumBranchTypes> const& art::ModuleBase::getConsumables ( ) const
inherited
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protectedinherited

Definition at line 76 of file ModuleBase.h.

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

77  {
78  return collector_.mayConsume<T, BT>(tag);
79  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:50
double T
Definition: Xdiff_gwt.C:5
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protectedinherited

Definition at line 90 of file ModuleBase.h.

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

91  {
93  }
ConsumesCollector collector_
Definition: ModuleBase.h:50
double T
Definition: Xdiff_gwt.C:5
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 83 of file ModuleBase.h.

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

84  {
85  return collector_.mayConsumeView<T, BT>(tag);
86  }
ConsumesCollector collector_
Definition: ModuleBase.h:50
ViewToken< Element > mayConsumeView(InputTag const &)
double T
Definition: Xdiff_gwt.C:5
ModuleDescription const& art::ModuleBase::moduleDescription ( ) const
inherited
void beamlinereco::ToFFilter::reconfigure ( const fhicl::ParameterSet p)

Definition at line 66 of file ToFFilter_module.cc.

References fBeamlineToFDataLabel, fFilterOnBeamlineDigits, fFilterOnRecoToFs, fMaxToF, fMaxToFCount, fMaxToFHitsDS, fMaxToFHitsUS, fMinToF, fMinToFCount, fMinToFHitsDS, fMinToFHitsUS, fToFDataLabel, and fhicl::ParameterSet::get().

Referenced by ToFFilter().

66  {
67  fToFDataLabel = pset.get<art::InputTag>("ToFDataLabel");
68  fBeamlineToFDataLabel = pset.get<art::InputTag>("BeamlineToFDataLabel");
69  fFilterOnBeamlineDigits = pset.get<bool>("FilterOnBeamlineDigits");
70  fFilterOnRecoToFs = pset.get<bool>("FilterOnRecoToFs");
71  fMinToFHitsUS = pset.get<unsigned int>("MinToFHitsUS");
72  fMaxToFHitsUS = pset.get<unsigned int>("MaxToFHitsUS");
73  fMinToFHitsDS = pset.get<unsigned int>("MinToFHitsDS");
74  fMaxToFHitsDS = pset.get<unsigned int>("MaxToFHitsDS");
75  fMinToFCount = pset.get<unsigned int>("MinToFCount");
76  fMaxToFCount = pset.get<unsigned int>("MaxToFCount");
77  fMinToF = pset.get<double>("MinToF");
78  fMaxToF = pset.get<double>("MaxToF");
79 }
art::InputTag fBeamlineToFDataLabel
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  )
inherited
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited
std::string art::EDFilter::workerType ( ) const
inherited

Referenced by art::EDFilter::EDFilter().

Member Data Documentation

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

Definition at line 26 of file Filter.h.

Referenced by evgen::GENIEFilter::filter().

art::InputTag beamlinereco::ToFFilter::fBeamlineToFDataLabel
private

Definition at line 45 of file ToFFilter_module.cc.

Referenced by filter(), and reconfigure().

bool beamlinereco::ToFFilter::fFilterOnBeamlineDigits
private

Definition at line 46 of file ToFFilter_module.cc.

Referenced by filter(), and reconfigure().

bool beamlinereco::ToFFilter::fFilterOnRecoToFs
private

Definition at line 47 of file ToFFilter_module.cc.

Referenced by filter(), and reconfigure().

double beamlinereco::ToFFilter::fMaxToF
private

Definition at line 55 of file ToFFilter_module.cc.

Referenced by filter(), and reconfigure().

unsigned int beamlinereco::ToFFilter::fMaxToFCount
private

Definition at line 53 of file ToFFilter_module.cc.

Referenced by filter(), and reconfigure().

unsigned int beamlinereco::ToFFilter::fMaxToFHitsDS
private

Definition at line 51 of file ToFFilter_module.cc.

Referenced by filter(), and reconfigure().

unsigned int beamlinereco::ToFFilter::fMaxToFHitsUS
private

Definition at line 49 of file ToFFilter_module.cc.

Referenced by filter(), and reconfigure().

double beamlinereco::ToFFilter::fMinToF
private

Definition at line 54 of file ToFFilter_module.cc.

Referenced by filter(), and reconfigure().

unsigned int beamlinereco::ToFFilter::fMinToFCount
private

Definition at line 52 of file ToFFilter_module.cc.

Referenced by filter(), and reconfigure().

unsigned int beamlinereco::ToFFilter::fMinToFHitsDS
private

Definition at line 50 of file ToFFilter_module.cc.

Referenced by filter(), and reconfigure().

unsigned int beamlinereco::ToFFilter::fMinToFHitsUS
private

Definition at line 48 of file ToFFilter_module.cc.

Referenced by filter(), and reconfigure().

art::InputTag beamlinereco::ToFFilter::fToFDataLabel
private

Definition at line 44 of file ToFFilter_module.cc.

Referenced by filter(), and reconfigure().

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

Definition at line 25 of file Filter.h.

Referenced by evgen::GENIEFilter::filter().


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