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.6 2012/01/20 18:18:11 vadler Exp $
11 //
32 
33 #include <string>
34 
35 
37 
38  // Utility classes
43  // Configuration parameters
44  bool andOr_;
46  unsigned verbose_;
47  bool andOrDcs_;
49  std::vector< int > dcsPartitions_;
51  bool andOrGt_;
55  std::vector< std::string > gtLogicalExpressions_;
57  bool andOrL1_;
60  std::vector< std::string > l1LogicalExpressionsCache_;
61  std::vector< std::string > l1LogicalExpressions_;
63  bool andOrHlt_;
66  std::vector< std::string > hltLogicalExpressionsCache_;
67  std::vector< std::string > hltLogicalExpressions_;
69  // Switches
70  bool on_;
71  bool onDcs_;
72  bool onGt_;
73  bool onL1_;
74  bool onHlt_;
75  // Member constants
78 
79  public:
80 
81  // Constructors and destructor
82  GenericTriggerEventFlag( const edm::ParameterSet & config ); // To be called from the ED module's c'tor
84 
85  // Public methods
86  bool on() { return on_ ; }
87  bool off() { return ( ! on_ ); }
88  void initRun( const edm::Run & run, const edm::EventSetup & setup ); // To be called from beginRun() methods
89  bool accept( const edm::Event & event, const edm::EventSetup & setup ); // To be called from analyze/filter() methods
90 
91  private:
92 
93  // Private methods
94 
95  // DCS
96  bool acceptDcs( const edm::Event & event );
97  bool acceptDcsPartition( const edm::Handle< DcsStatusCollection > & dcsStatus, int dcsPartition ) const;
98 
99  // GT status bits
100  bool acceptGt( const edm::Event & event );
101  bool acceptGtLogicalExpression( const edm::Event & event, std::string gtLogicalExpression );
102 
103  // L1
104  bool acceptL1( const edm::Event & event, const edm::EventSetup & setup );
105  bool acceptL1LogicalExpression( const edm::Event & event, std::string l1LogicalExpression );
106 
107  // HLT
108  bool acceptHlt( const edm::Event & event );
109  bool acceptHltLogicalExpression( const edm::Handle< edm::TriggerResults > & hltTriggerResults, std::string hltLogicalExpression ) const;
110 
111  // Algos
112  std::string expandLogicalExpression( const std::vector< std::string > & target, const std::string & expr, bool useAnd = false ) const;
113  bool negate( std::string & word ) const;
114 
115  public:
116 
117  // Methods for expert analysis
118 
119  std::string gtDBKey() { return gtDBKey_ ; } // can be empty
120  std::string l1DBKey() { return l1DBKey_ ; } // can be empty
121  std::string hltDBKey() { return hltDBKey_; } // can be empty
122 
123  std::vector< std::string > expressionsFromDB( const std::string & key, const edm::EventSetup & setup );
124 
125 };
126 
127 
128 #endif
bool negate(std::string &word) const
Checks for negated words.
std::vector< int > dcsPartitions_
std::vector< std::string > gtLogicalExpressions_
std::vector< std::string > hltLogicalExpressions_
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
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(const edm::ParameterSet &config)
To be called from the ED module&#39;s c&#39;tor.
~GenericTriggerEventFlag()
To be called from d&#39;tors by &#39;delete&#39;.
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
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:36
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?