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 // $Id: TriggerHelper.h,v 1.8 2010/03/27 12:09:10 dutta Exp $
11 //
34 
36 
37  // Utility classes
42  // Configuration parameters
43  bool andOr_;
44  bool andOrDcs_;
46  std::vector< int > dcsPartitions_;
48  bool andOrGt_;
50  std::string gtDBKey_;
51  std::vector< std::string > gtLogicalExpressions_;
53  bool andOrL1_;
54  std::string l1DBKey_;
55  std::vector< std::string > l1LogicalExpressions_;
57  bool andOrHlt_;
59  std::string hltDBKey_;
60  std::vector< std::string > hltLogicalExpressions_;
62  // Switches
63  bool on_;
64  bool onDcs_;
65  bool onGt_;
66  bool onL1_;
67  bool onHlt_;
68  // Member constants
69  const std::string configError_;
70 
71  public:
72 
73  // Constructors and destructor
74  TriggerHelper( const edm::ParameterSet & config ); // To be called from the ED module's c'tor
76 
77  // Public methods
78  bool on() { return on_ ; }
79  bool off() { return ( ! on_ ); }
80  void initRun( const edm::Run & run, const edm::EventSetup & setup ); // To be called from beginRun() methods
81  bool accept( const edm::Event & event, const edm::EventSetup & setup ); // To be called from analyze/filter() methods
82 
83  private:
84 
85  // Private methods
86 
87  // DCS
88  bool acceptDcs( const edm::Event & event );
89  bool acceptDcsPartition( const edm::Handle< DcsStatusCollection > & dcsStatus, int dcsPartition ) const;
90 
91  // GT status bits
92  bool acceptGt( const edm::Event & event );
93  bool acceptGtLogicalExpression( const edm::Handle< L1GlobalTriggerReadoutRecord > & gtReadoutRecord, std::string gtLogicalExpression );
94 
95  // L1
96  bool acceptL1( const edm::Event & event, const edm::EventSetup & setup );
97  bool acceptL1LogicalExpression( const edm::Event & event, std::string l1LogicalExpression );
98 
99  // HLT
100  bool acceptHlt( const edm::Event & event );
101  bool acceptHltLogicalExpression( const edm::Handle< edm::TriggerResults > & hltTriggerResults, std::string hltLogicalExpression ) const;
102 
103  // Algos
104  std::vector< std::string > expressionsFromDB( const std::string & key, const edm::EventSetup & setup );
105  bool negate( std::string & word ) const;
106 
107 };
108 
109 
110 #endif
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
Definition: TriggerHelper.h:35
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:54
std::vector< int > dcsPartitions_
Definition: TriggerHelper.h:46
const std::string configError_
Definition: TriggerHelper.h:69
TriggerHelper(const edm::ParameterSet &config)
To be called from the ED module&#39;s c&#39;tor.
std::vector< std::string > gtLogicalExpressions_
Definition: TriggerHelper.h:51
~TriggerHelper()
To be called from d&#39;tors by &#39;delete&#39;.
std::string gtDBKey_
Definition: TriggerHelper.h:50
bool acceptHlt(const edm::Event &event)
Was this event accepted by the configured HLT logical expression combination?
edm::InputTag hltInputTag_
Definition: TriggerHelper.h:58
std::vector< std::string > l1LogicalExpressions_
Definition: TriggerHelper.h:55
L1GtUtils l1Gt_
Definition: TriggerHelper.h: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
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:40
edm::InputTag gtInputTag_
Definition: TriggerHelper.h:49
bool acceptDcsPartition(const edm::Handle< DcsStatusCollection > &dcsStatus, int dcsPartition) const
edm::InputTag dcsInputTag_
Definition: TriggerHelper.h:45
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.
list key
Definition: combine.py:13
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginedm::Run() methods.
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchDB_
Definition: TriggerHelper.h:38
std::vector< std::string > hltLogicalExpressions_
Definition: TriggerHelper.h:60
std::string hltDBKey_
Definition: TriggerHelper.h:59
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
Definition: Run.h:33
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.