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 <memory>
37 #include <string>
38 
39 
41 
42  // Utility classes
44  std::unique_ptr<L1GtUtils> l1Gt_;
47  // Configuration parameters
48  bool andOr_;
50  unsigned verbose_;
51  bool andOrDcs_;
54  std::vector< int > dcsPartitions_;
56  bool andOrGt_;
62  std::vector< std::string > gtLogicalExpressions_;
64  bool andOrL1_;
67  std::vector< std::string > l1LogicalExpressionsCache_;
68  std::vector< std::string > l1LogicalExpressions_;
70  bool andOrHlt_;
74  std::vector< std::string > hltLogicalExpressionsCache_;
75  std::vector< std::string > hltLogicalExpressions_;
77  // Switches
78  bool on_;
79  bool onDcs_;
80  bool onGt_;
81  bool onL1_;
82  bool onHlt_;
83  // Member constants
86 
87  public:
88 
89  // Constructors must be called from the ED module's c'tor
90  template <typename T>
92 
93  template <typename T>
95 
97 
98  // Public methods
99  bool on() { return on_ ; }
100  bool off() { return ( ! on_ ); }
101  void initRun( const edm::Run & run, const edm::EventSetup & setup ); // To be called from beginRun() methods
102  bool accept( const edm::Event & event, const edm::EventSetup & setup ); // To be called from analyze/filter() methods
103 
104  private:
105 
106  // Private methods
107 
109 
110  // DCS
111  bool acceptDcs( const edm::Event & event );
112  bool acceptDcsPartition( const edm::Handle< DcsStatusCollection > & dcsStatus, int dcsPartition ) const;
113 
114  // GT status bits
115  bool acceptGt( const edm::Event & event );
116  bool acceptGtLogicalExpression( const edm::Event & event, std::string gtLogicalExpression );
117 
118  // L1
119  bool acceptL1( const edm::Event & event, const edm::EventSetup & setup );
120  bool acceptL1LogicalExpression( const edm::Event & event, std::string l1LogicalExpression );
121 
122  // HLT
123  bool acceptHlt( const edm::Event & event );
124  bool acceptHltLogicalExpression( const edm::Handle< edm::TriggerResults > & hltTriggerResults, std::string hltLogicalExpression ) const;
125 
126  // Algos
127  std::string expandLogicalExpression( const std::vector< std::string > & target, const std::string & expr, bool useAnd = false ) const;
128  bool negate( std::string & word ) const;
129 
130  public:
131 
132  // Methods for expert analysis
133 
134  std::string gtDBKey() { return gtDBKey_ ; } // can be empty
135  std::string l1DBKey() { return l1DBKey_ ; } // can be empty
136  std::string hltDBKey() { return hltDBKey_; } // can be empty
137 
138  std::vector< std::string > expressionsFromDB( const std::string & key, const edm::EventSetup & setup );
139 
140 };
141 
142 template <typename T>
144  GenericTriggerEventFlag(config, iC, module) {
145 }
146 
147 template <typename T>
149  GenericTriggerEventFlag(config, iC) {
150  l1Gt_.reset(new L1GtUtils(config, iC, false, module));
151 }
152 
153 #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_
GenericTriggerEventFlag(const edm::ParameterSet &config, edm::ConsumesCollector &&iC, T &module)
edm::EDGetTokenT< edm::TriggerResults > hltInputToken_
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
std::unique_ptr< L1GtUtils > l1Gt_
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
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchDB_
bool acceptDcs(const edm::Event &event)
std::vector< std::string > hltLogicalExpressionsCache_
std::vector< std::string > l1LogicalExpressions_
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.
long double T
Definition: vlib.h:208
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?