CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TriggerHelper.h
Go to the documentation of this file.
1 #ifndef TriggerHelper_H
2 #define TriggerHelper_H
3 
4 
5 // -*- C++ -*-
6 //
7 // Package: DQM/TrackerCommon
8 // Class: TriggerHelper
9 //
10 //
32 
33 #include <memory>
34 
35 namespace edm {
36  class ConsumesCollector;
37  class ParameterSet;
38 }
39 
41 
42  // Utility classes
44  std::unique_ptr<L1GtUtils> l1Gt_;
47  // Configuration parameters
48  bool andOr_;
49  bool andOrDcs_;
51  std::vector< int > dcsPartitions_;
53  bool andOrGt_;
56  std::vector< std::string > gtLogicalExpressions_;
58  bool andOrL1_;
60  std::vector< std::string > l1LogicalExpressions_;
62  bool andOrHlt_;
65  std::vector< std::string > hltLogicalExpressions_;
67  // Switches
68  bool on_;
69  bool onDcs_;
70  bool onGt_;
71  bool onL1_;
72  bool onHlt_;
73  // Member constants
75 
76  public:
77 
78  // Constructors must be called from the ED module's c'tor
79  template <typename T>
81 
82  template <typename T>
84 
86 
87  // Public methods
88  bool on() { return on_ ; }
89  bool off() { return ( ! on_ ); }
90  void initRun( const edm::Run & run, const edm::EventSetup & setup ); // To be called from beginRun() methods
91  bool accept( const edm::Event & event, const edm::EventSetup & setup ); // To be called from analyze/filter() methods
92 
93  private:
94 
95  // Private methods
96 
98 
99  // DCS
100  bool acceptDcs( const edm::Event & event );
101  bool acceptDcsPartition( const edm::Handle< DcsStatusCollection > & dcsStatus, int dcsPartition ) const;
102 
103  // GT status bits
104  bool acceptGt( const edm::Event & event );
105  bool acceptGtLogicalExpression( const edm::Handle< L1GlobalTriggerReadoutRecord > & gtReadoutRecord, std::string gtLogicalExpression );
106 
107  // L1
108  bool acceptL1( const edm::Event & event, const edm::EventSetup & setup );
109  bool acceptL1LogicalExpression( const edm::Event & event, std::string l1LogicalExpression );
110 
111  // HLT
112  bool acceptHlt( const edm::Event & event );
113  bool acceptHltLogicalExpression( const edm::Handle< edm::TriggerResults > & hltTriggerResults, std::string hltLogicalExpression ) const;
114 
115  // Algos
116  std::vector< std::string > expressionsFromDB( const std::string & key, const edm::EventSetup & setup );
117  bool negate( std::string & word ) const;
118 
119 };
120 
121 template <typename T>
123  TriggerHelper(config, iC, module) {
124 }
125 
126 template <typename T>
128  TriggerHelper(config) {
129  l1Gt_.reset(new L1GtUtils(config, iC, false, module));
130 }
131 
132 #endif
std::unique_ptr< L1GtUtils > l1Gt_
Definition: TriggerHelper.h:44
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
Definition: TriggerHelper.h:40
bool acceptGtLogicalExpression(const edm::Handle< L1GlobalTriggerReadoutRecord > &gtReadoutRecord, std::string gtLogicalExpression)
Does this event fulfill this particular GT status bits&#39; logical expression?
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 negate(std::string &word) const
Checks for negated words.
std::string l1DBKey_
Definition: TriggerHelper.h:59
std::vector< int > dcsPartitions_
Definition: TriggerHelper.h:51
const std::string configError_
Definition: TriggerHelper.h:74
std::vector< std::string > gtLogicalExpressions_
Definition: TriggerHelper.h:56
TriggerHelper(const edm::ParameterSet &config, edm::ConsumesCollector &&iC, T &module)
~TriggerHelper()
To be called from d&#39;tors by &#39;delete&#39;.
std::string gtDBKey_
Definition: TriggerHelper.h:55
bool acceptHlt(const edm::Event &event)
Was this event accepted by the configured HLT logical expression combination?
edm::InputTag hltInputTag_
Definition: TriggerHelper.h:63
std::vector< std::string > l1LogicalExpressions_
Definition: TriggerHelper.h:60
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.
bool acceptL1(const edm::Event &event, const edm::EventSetup &setup)
Was this event accepted by the configured L1 logical expression combination?
bool acceptL1LogicalExpression(const edm::Event &event, std::string l1LogicalExpression)
Was this event accepted by this particular L1 algorithms&#39; logical expression?
HLTConfigProvider hltConfig_
Definition: TriggerHelper.h:45
edm::InputTag gtInputTag_
Definition: TriggerHelper.h:54
bool acceptDcsPartition(const edm::Handle< DcsStatusCollection > &dcsStatus, int dcsPartition) const
edm::InputTag dcsInputTag_
Definition: TriggerHelper.h:50
bool acceptDcs(const edm::Event &event)
bool acceptGt(const edm::Event &event)
Does this event fulfill the configured GT status logical expression combination?
std::vector< std::string > expressionsFromDB(const std::string &key, const edm::EventSetup &setup)
Reads and returns logical expressions from DB.
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginedm::Run() methods.
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchDB_
Definition: TriggerHelper.h:43
std::vector< std::string > hltLogicalExpressions_
Definition: TriggerHelper.h:65
long double T
Definition: vlib.h:208
std::string hltDBKey_
Definition: TriggerHelper.h:64
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
Definition: Run.h:43
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.