Public Member Functions | Private Attributes | List of all members
filt::ProtoDUNETriggerFilter Class Reference
Inheritance diagram for filt::ProtoDUNETriggerFilter:
art::EDFilter art::detail::Filter art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Member Functions

 ProtoDUNETriggerFilter (fhicl::ParameterSet const &pset)
 
virtual ~ProtoDUNETriggerFilter ()
 
virtual bool filter (art::Event &e)
 
- Public Member Functions inherited from art::EDFilter
 EDFilter (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDFilter (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Filter
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)
 

Private Attributes

unsigned int fLogLevel
 
std::vector< unsigned int > fTimingFlagSelectList
 
std::vector< unsigned int > fTimingFlagDeselectList
 
std::string fTimingLabel
 
std::string fTimingInstance
 
std::string fTriggerLabel
 
std::string fTriggerInstance
 

Additional Inherited Members

- Public Types inherited from art::EDFilter
using ModuleType = EDFilter
 
using WorkerType = WorkerT< EDFilter >
 
- Public Types inherited from art::detail::Filter
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 >
 
- Static Public Attributes inherited from art::detail::Filter
static constexpr bool Pass {true}
 
static constexpr bool Fail {false}
 
- 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 17 of file ProtoDUNETriggerFilter_module.cc.

Constructor & Destructor Documentation

filt::ProtoDUNETriggerFilter::ProtoDUNETriggerFilter ( fhicl::ParameterSet const &  pset)
explicit
virtual filt::ProtoDUNETriggerFilter::~ProtoDUNETriggerFilter ( )
inlinevirtual

Definition at line 20 of file ProtoDUNETriggerFilter_module.cc.

20 {};

Member Function Documentation

bool filt::ProtoDUNETriggerFilter::filter ( art::Event e)
virtual

Implements art::EDFilter.

Definition at line 76 of file ProtoDUNETriggerFilter_module.cc.

76  {
77  using std::cout;
78  using std::endl;
79  const std::string myname = "ProtoDUNETriggerFilter::filter: ";
80 
81  bool keep = true;
82 
83  bool checkTriggerFlag = fTimingFlagSelectList.size() || fTimingFlagDeselectList.size();
84 
85  std::string stinfo = "Trigger check disabled.";
86  if ( keep && checkTriggerFlag ) {
87  // Fetch the trigger and timing clock.
89  auto htims = evt.getHandle<std::vector<raw::RDTimeStamp>>(itag1);
90  //art::InputTag itag2(fTriggerLabel, fTriggerInstance);
91  //auto hctb = evt.getHandle<std::vector<raw::ctb::pdspctb> >(itag2);
92 
93  if ( ! htims.isValid() ) {
94  std::cout << myname << "WARNING: Timing clocks product not found." << std::endl;
95  if ( fLogLevel >=2 ) stinfo = "Timing clocks product not found.";
96  } else if ( htims->size() != 1 ) {
97  std::cout << myname << "WARNING: Unexpected timing clocks size: " << htims->size() << std::endl;
98  if ( fLogLevel >=2 ) stinfo = "Unexpected timing clocks size.";
99  for ( unsigned int itim=0; itim<htims->size() && itim<50; ++itim ) {
100  std::cout << myname << " " << htims->at(itim).GetTimeStamp() << std::endl;
101  }
102  } else {
103  const raw::RDTimeStamp& tim = htims->at(0);
104 
105  // See https://twiki.cern.ch/twiki/bin/view/CENF/TimingSystemAdvancedOp#Reference_info
106  unsigned int trigFlag = tim.GetFlags();
107  if ( fLogLevel >=2 ) stinfo = "Trigger flag: " + std::to_string(trigFlag);
108 
109  // If TimingFlagSelectList has entries, the trigger flag must be there.
110  if ( fTimingFlagSelectList.size() ) {
111  keep = false;
112  for ( unsigned int flg : fTimingFlagSelectList ) {
113  if ( keep ) break;
114  if ( flg == trigFlag) keep = true;
115  }
116  }
117 
118  // The trigger flag must not be in TimingFlagDeselectList.
119  for ( unsigned int flg : fTimingFlagDeselectList ) {
120  if ( ! keep ) break;
121  if ( flg == trigFlag ) keep = false;
122  }
123 
124  }
125  }
126 
127  if ( fLogLevel >=2 ) std::cout << myname << (keep ? "Keep" : "Reject") << "ing event " << evt.event()
128  << ". " << stinfo << endl;
129  return keep;
130 
131  }
unsigned int event
Definition: DataStructs.h:636
uint16_t GetFlags() const
Definition: RDTimeStamp.h:46
std::string string
Definition: nybbler.cc:12
std::vector< unsigned int > fTimingFlagSelectList
std::vector< unsigned int > fTimingFlagDeselectList
TCEvent evt
Definition: DataStructs.cxx:7
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
QTextStream & endl(QTextStream &s)

Member Data Documentation

unsigned int filt::ProtoDUNETriggerFilter::fLogLevel
private

Definition at line 25 of file ProtoDUNETriggerFilter_module.cc.

std::vector<unsigned int> filt::ProtoDUNETriggerFilter::fTimingFlagDeselectList
private

Definition at line 27 of file ProtoDUNETriggerFilter_module.cc.

std::vector<unsigned int> filt::ProtoDUNETriggerFilter::fTimingFlagSelectList
private

Definition at line 26 of file ProtoDUNETriggerFilter_module.cc.

std::string filt::ProtoDUNETriggerFilter::fTimingInstance
private

Definition at line 29 of file ProtoDUNETriggerFilter_module.cc.

std::string filt::ProtoDUNETriggerFilter::fTimingLabel
private

Definition at line 28 of file ProtoDUNETriggerFilter_module.cc.

std::string filt::ProtoDUNETriggerFilter::fTriggerInstance
private

Definition at line 31 of file ProtoDUNETriggerFilter_module.cc.

std::string filt::ProtoDUNETriggerFilter::fTriggerLabel
private

Definition at line 30 of file ProtoDUNETriggerFilter_module.cc.


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