Public Types | Public Member Functions | Static 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::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

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

Public Member Functions

 ToFFilter (fhicl::ParameterSet const &p)
 
bool filter (art::Event &e)
 
void reconfigure (const fhicl::ParameterSet &p)
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Static Public Attributes

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

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

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

using art::EDFilter::ModuleType = EDFilter
inherited

Definition at line 37 of file EDFilter.h.

template<typename UserConfig >
using art::EDFilter::Table = ProducerBase::Table<UserConfig>
inherited

Definition at line 46 of file EDFilter.h.

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

Definition at line 38 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 {
62  this->reconfigure(p);
63 }
void reconfigure(const fhicl::ParameterSet &p)
const char * p
Definition: xmltok.h:285

Member Function Documentation

template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDFilter::currentContext ( ) const
protectedinherited
bool beamlinereco::ToFFilter::filter ( art::Event e)
virtual

Implements art::EDFilter.

Definition at line 80 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.

81 {
82  // Get tof digits
84  std::vector<art::Ptr<brb::BeamlineDigit>> digits;
85  if (e.getByLabel(fBeamlineToFDataLabel, digitHandle)) art::fill_ptr_vector(digits, digitHandle);
86 
87  // Get ToF objects
89  std::vector<art::Ptr<brb::ToF>> tofs;
90  if (e.getByLabel(fToFDataLabel, tofHandle)) art::fill_ptr_vector(tofs, tofHandle);
91 
92  // tof digit filtering
94  // Separate by counter
95  std::vector<art::Ptr<brb::BeamlineDigit>> usDigits;
96  std::vector<art::Ptr<brb::BeamlineDigit>> dsDigits;
97  for (auto d : digits) {
98  if (d->ChannelID().Detector == beamlinegeo::ToFCounter::US) {
99  usDigits.push_back(d);
100  } else if (d->ChannelID().Detector == beamlinegeo::ToFCounter::DS) {
101  dsDigits.push_back(d);
102  }
103  }
104  if (usDigits.size() < fMinToFHitsUS) return false;
105  if (usDigits.size() > fMaxToFHitsUS) return false;
106  if (dsDigits.size() < fMinToFHitsDS) return false;
107  if (dsDigits.size() > fMaxToFHitsDS) return false;
108  }
109 
110  // tof filtering
111  if (fFilterOnRecoToFs) {
112  if(tofs.size() < fMinToFCount) return false;
113  if(tofs.size() > fMaxToFCount) return false;
114 
115  //std::cout << e.id() << ": \n";
116 
117  // Retrieve BeamlineDigits for tof reco
119 
120  //filter out events with bad behavior
121  for (auto tof : tofs) {
122  if (tof->Time() < fMinToF) return false;
123  if (tof->Time() > fMaxToF) return false;
124 
125  // Get associated reco digits
126  //const std::vector<art::Ptr<brb::BeamlineDigit>> tofDigits = fmbd.at(tof.key());
127  }
128  }
129 
130  return true;
131 }
Float_t d
Definition: plot.C:236
art::InputTag fBeamlineToFDataLabel
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
template<typename PROD , BranchType B>
ProductID art::EDFilter::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 131 of file EDFilter.h.

References art::EDFilter::moduleDescription_.

Referenced by novaddt::HoughTrackMaker::create_associations().

132  {
133  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
134  instanceName);
135  }
ModuleDescription moduleDescription_
Definition: EDFilter.h:124
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID(), and string.

41  {
42  return true;
43  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void beamlinereco::ToFFilter::reconfigure ( const fhicl::ParameterSet p)

Definition at line 65 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().

65  {
66  fToFDataLabel = pset.get<art::InputTag>("ToFDataLabel");
67  fBeamlineToFDataLabel = pset.get<art::InputTag>("BeamlineToFDataLabel");
68  fFilterOnBeamlineDigits = pset.get<bool>("FilterOnBeamlineDigits");
69  fFilterOnRecoToFs = pset.get<bool>("FilterOnRecoToFs");
70  fMinToFHitsUS = pset.get<unsigned int>("MinToFHitsUS");
71  fMaxToFHitsUS = pset.get<unsigned int>("MaxToFHitsUS");
72  fMinToFHitsDS = pset.get<unsigned int>("MinToFHitsDS");
73  fMaxToFHitsDS = pset.get<unsigned int>("MaxToFHitsDS");
74  fMinToFCount = pset.get<unsigned int>("MinToFCount");
75  fMaxToFCount = pset.get<unsigned int>("MaxToFCount");
76  fMinToF = pset.get<double>("MinToF");
77  fMaxToF = pset.get<double>("MaxToF");
78 }
art::InputTag fBeamlineToFDataLabel
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Member Data Documentation

constexpr bool art::EDFilter::Fail {false}
staticinherited

Definition at line 33 of file EDFilter.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::EDFilter::Pass {true}
staticinherited

Definition at line 32 of file EDFilter.h.

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


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