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

Public Member Functions

 EventSelect (fhicl::ParameterSet const &p)
 
 EventSelect (EventSelect const &)=delete
 
 EventSelect (EventSelect &&)=delete
 
EventSelectoperator= (EventSelect const &)=delete
 
EventSelectoperator= (EventSelect &&)=delete
 
bool filter (art::Event &e) override
 
void respondToOpenInputFile (const art::FileBlock &fb) override
 

Private Attributes

std::vector< std::string > fConfig
 
std::vector< int > fFileNoSelect
 
std::vector< int > fEvtSelect
 
int fFileNo
 
unsigned fNAccept
 

Detailed Description

Definition at line 29 of file EventSelect_module.cc.

Constructor & Destructor Documentation

sbn::util::EventSelect::EventSelect ( fhicl::ParameterSet const &  p)
explicit

Definition at line 57 of file EventSelect_module.cc.

58  : EDFilter{p},
59  fConfig(p.get<std::vector<std::string>>("Select"))
60 {
61  for (const std::string &s: fConfig) {
62  fFileNoSelect.push_back(-1);
63  fEvtSelect.push_back(-1);
64  sscanf(s.c_str(), "%d:%d", &fFileNoSelect.back(), &fEvtSelect.back());
65  }
66  fFileNo = -1;
67  fNAccept = 0;
68 }
pdgs p
Definition: selectors.fcl:22
std::vector< std::string > fConfig
std::vector< int > fEvtSelect
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
std::vector< int > fFileNoSelect
sbn::util::EventSelect::EventSelect ( EventSelect const &  )
delete
sbn::util::EventSelect::EventSelect ( EventSelect &&  )
delete

Member Function Documentation

bool sbn::util::EventSelect::filter ( art::Event &  e)
override

Definition at line 70 of file EventSelect_module.cc.

71 {
72  //if (fNAccept == fFileNoSelect.size()) {
73  // throw cet::exception("EventSelect Filter") << "Finished selecting events from list. ";
74  //}
75 
76  for (unsigned i = 0; i < fFileNoSelect.size(); i++) {
77  if (fFileNoSelect[i] == fFileNo && fEvtSelect[i] == (int)e.event()) {
78  fNAccept ++;
79  return true;
80  }
81  }
82  return false;
83 }
std::vector< int > fEvtSelect
do i e
std::vector< int > fFileNoSelect
EventSelect& sbn::util::EventSelect::operator= ( EventSelect const &  )
delete
EventSelect& sbn::util::EventSelect::operator= ( EventSelect &&  )
delete
void sbn::util::EventSelect::respondToOpenInputFile ( const art::FileBlock &  fb)
inlineoverride

Definition at line 44 of file EventSelect_module.cc.

Member Data Documentation

std::vector<std::string> sbn::util::EventSelect::fConfig
private

Definition at line 49 of file EventSelect_module.cc.

std::vector<int> sbn::util::EventSelect::fEvtSelect
private

Definition at line 51 of file EventSelect_module.cc.

int sbn::util::EventSelect::fFileNo
private

Definition at line 52 of file EventSelect_module.cc.

std::vector<int> sbn::util::EventSelect::fFileNoSelect
private

Definition at line 50 of file EventSelect_module.cc.

unsigned sbn::util::EventSelect::fNAccept
private

Definition at line 53 of file EventSelect_module.cc.


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