test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GenericTriggerEventFlag.h
Go to the documentation of this file.
1 #ifndef GenericTriggerEventFlag_H
2 #define GenericTriggerEventFlag_H
3 
4 
5 // -*- C++ -*-
6 //
7 // Package: CommonTools/TriggerUtils
8 // Class: GenericTriggerEventFlag
9 //
10 // $Id: GenericTriggerEventFlag.h,v 1.5 2012/01/19 20:17:34 vadler Exp $
11 //
35 
36 #include <string>
37 
38 
40 
41  // Utility classes
46  // Configuration parameters
47  bool andOr_;
49  unsigned verbose_;
50  bool andOrDcs_;
53  std::vector< int > dcsPartitions_;
55  bool andOrGt_;
61  std::vector< std::string > gtLogicalExpressions_;
63  bool andOrL1_;
66  std::vector< std::string > l1LogicalExpressionsCache_;
67  std::vector< std::string > l1LogicalExpressions_;
69  bool andOrHlt_;
73  std::vector< std::string > hltLogicalExpressionsCache_;
74  std::vector< std::string > hltLogicalExpressions_;
76  // Switches
77  bool on_;
78  bool onDcs_;
79  bool onGt_;
80  bool onL1_;
81  bool onHlt_;
82  // Member constants
85 
86  public:
87 
88  // Constructors and destructor
89  GenericTriggerEventFlag( const edm::ParameterSet & config, edm::ConsumesCollector && iC ) : GenericTriggerEventFlag( config, iC ) {}; // To be called from the ED module's c'tor
90  GenericTriggerEventFlag( const edm::ParameterSet & config, edm::ConsumesCollector & iC ); // To be called from the ED module's c'tor
92 
93  // Public methods
94  bool on() { return on_ ; }
95  bool off() { return ( ! on_ ); }
96  void initRun( const edm::Run & run, const edm::EventSetup & setup ); // To be called from beginRun() methods
97  bool accept( const edm::Event & event, const edm::EventSetup & setup ); // To be called from analyze/filter() methods
98 
99  private:
100 
101  // Private methods
102 
103  // DCS
104  bool acceptDcs( const edm::Event & event );
105  bool acceptDcsPartition( const edm::Handle< DcsStatusCollection > & dcsStatus, int dcsPartition ) const;
106 
107  // GT status bits
108  bool acceptGt( const edm::Event & event );
109  bool acceptGtLogicalExpression( const edm::Event & event, std::string gtLogicalExpression );
110 
111  // L1
112  bool acceptL1( const edm::Event & event, const edm::EventSetup & setup );
113  bool acceptL1LogicalExpression( const edm::Event & event, std::string l1LogicalExpression );
114 
115  // HLT
116  bool acceptHlt( const edm::Event & event );
117  bool acceptHltLogicalExpression( const edm::Handle< edm::TriggerResults > & hltTriggerResults, std::string hltLogicalExpression ) const;
118 
119  // Algos
120  std::string expandLogicalExpression( const std::vector< std::string > & target, const std::string & expr, bool useAnd = false ) const;
121  bool negate( std::string & word ) const;
122 
123  public:
124 
125  // Methods for expert analysis
126 
127  std::string gtDBKey() { return gtDBKey_ ; } // can be empty
128  std::string l1DBKey() { return l1DBKey_ ; } // can be empty
129  std::string hltDBKey() { return hltDBKey_; } // can be empty
130 
131  std::vector< std::string > expressionsFromDB( const std::string & key, const edm::EventSetup & setup );
132 
133 };
134 
135 
136 #endif
bool negate(std::string &word) const
Checks for negated words.
std::vector< int > dcsPartitions_
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtInputToken_
std::vector< std::string > gtLogicalExpressions_
std::vector< std::string > hltLogicalExpressions_
edm::EDGetTokenT< edm::TriggerResults > hltInputToken_
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
std::vector< std::string > l1LogicalExpressionsCache_
bool acceptHlt(const edm::Event &event)
Was this event accepted by the configured HLT logical expression combination?
bool acceptDcsPartition(const edm::Handle< DcsStatusCollection > &dcsStatus, int dcsPartition) const
edm::EDGetTokenT< DcsStatusCollection > dcsInputToken_
std::vector< std::string > expressionsFromDB(const std::string &key, const edm::EventSetup &setup)
Reads and returns logical expressions from DB.
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
bool acceptGtLogicalExpression(const edm::Event &event, std::string gtLogicalExpression)
Does this event fulfill this particular GT status bits&#39; logical expression?
bool acceptL1LogicalExpression(const edm::Event &event, std::string l1LogicalExpression)
Was this event accepted by this particular L1 algorithms&#39; logical expression?
~GenericTriggerEventFlag()
To be called from d&#39;tors by &#39;delete&#39;.
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmInputToken_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchDB_
bool acceptDcs(const edm::Event &event)
std::vector< std::string > hltLogicalExpressionsCache_
std::vector< std::string > l1LogicalExpressions_
list key
Definition: combine.py:13
GenericTriggerEventFlag(const edm::ParameterSet &config, edm::ConsumesCollector &&iC)
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
std::string expandLogicalExpression(const std::vector< std::string > &target, const std::string &expr, bool useAnd=false) const
Expand wild-carded logical expressions, giving version postfixes priority.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
Definition: Run.h:41
bool acceptHltLogicalExpression(const edm::Handle< edm::TriggerResults > &hltTriggerResults, std::string hltLogicalExpression) const
Was this event accepted by this particular HLT paths&#39; logical expression?
bool acceptL1(const edm::Event &event, const edm::EventSetup &setup)
Was this event accepted by the configured L1 logical expression combination?
bool acceptGt(const edm::Event &event)
Does this event fulfill the configured GT status logical expression combination?