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

Public Member Functions

 FilterOpFlash (fhicl::ParameterSet const &p)
 
 FilterOpFlash (FilterOpFlash const &)=delete
 
 FilterOpFlash (FilterOpFlash &&)=delete
 
FilterOpFlashoperator= (FilterOpFlash const &)=delete
 
FilterOpFlashoperator= (FilterOpFlash &&)=delete
 
bool filter (art::Event &e) override
 

Private Attributes

std::vector< std::string > _flash_producer_v
 
double _time_start
 
double _time_end
 
double _pe_threshold
 

Detailed Description

Definition at line 25 of file FilterOpFlash_module.cc.

Constructor & Destructor Documentation

FilterOpFlash::FilterOpFlash ( fhicl::ParameterSet const &  p)
explicit

Definition at line 43 of file FilterOpFlash_module.cc.

44  : EDFilter{p}
45 {
46  _flash_producer_v = p.get<std::vector<std::string> >("OpFlashProducerList");
47  _time_start = p.get<double>("WindowStartTime");
48  _time_end = p.get<double>("WindowEndTime");
49  _pe_threshold = p.get<double>("FlashPEThreshold",-1);
50  assert(_time_end>_time_start);
51 }
std::vector< std::string > _flash_producer_v
pdgs p
Definition: selectors.fcl:22
FilterOpFlash::FilterOpFlash ( FilterOpFlash const &  )
delete
FilterOpFlash::FilterOpFlash ( FilterOpFlash &&  )
delete

Member Function Documentation

bool FilterOpFlash::filter ( art::Event &  e)
override

Definition at line 53 of file FilterOpFlash_module.cc.

54 {
55 
56  bool pass = false;
57  for(auto const& producer : _flash_producer_v) {
58 
59  art::Handle<std::vector<recob::OpFlash> > flash_handle;
60  e.getByLabel(producer, flash_handle);
61  if(!flash_handle.isValid()) {
62  std::cerr << "Invalid producer for truth recob::OpFlash: " << producer<< std::endl;
63  throw std::exception();
64  }
65 
66  for(auto const& flash : *flash_handle) {
67  if(flash.TotalPE() < _pe_threshold) continue;
68  if(flash.Time() < _time_start || flash.Time() > _time_end) continue;
69  pass = true;
70  break;
71  }
72 
73  if(pass) break;
74  }
75  return pass;
76 }
std::vector< std::string > _flash_producer_v
BEGIN_PROLOG could also be cerr
do i e
FilterOpFlash& FilterOpFlash::operator= ( FilterOpFlash const &  )
delete
FilterOpFlash& FilterOpFlash::operator= ( FilterOpFlash &&  )
delete

Member Data Documentation

std::vector<std::string> FilterOpFlash::_flash_producer_v
private

Definition at line 36 of file FilterOpFlash_module.cc.

double FilterOpFlash::_pe_threshold
private

Definition at line 39 of file FilterOpFlash_module.cc.

double FilterOpFlash::_time_end
private

Definition at line 38 of file FilterOpFlash_module.cc.

double FilterOpFlash::_time_start
private

Definition at line 37 of file FilterOpFlash_module.cc.


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