CMS 3D CMS Logo

TriggerHelper.h
Go to the documentation of this file.
1 #ifndef TriggerHelper_H
2 #define TriggerHelper_H
3 
4 // -*- C++ -*-
5 //
6 // Package: DQM/TrackerCommon
7 // Class: TriggerHelper
8 //
9 //
31 
32 #include <memory>
33 
34 namespace edm {
35  class ConsumesCollector;
36  class ParameterSet;
37 } // namespace edm
38 
40  // Utility classes
42  std::unique_ptr<L1GtUtils> l1Gt_;
45  // Configuration parameters
46  bool andOr_;
47  bool andOrDcs_;
49  std::vector<int> dcsPartitions_;
51  bool andOrGt_;
54  std::vector<std::string> gtLogicalExpressions_;
56  bool andOrL1_;
58  std::vector<std::string> l1LogicalExpressions_;
60  bool andOrHlt_;
63  std::vector<std::string> hltLogicalExpressions_;
65  // Switches
66  bool on_;
67  bool onDcs_;
68  bool onGt_;
69  bool onL1_;
70  bool onHlt_;
71  // Member constants
73 
74 public:
75  // Constructors must be called from the ED module's c'tor
76  template <typename T>
78 
79  template <typename T>
81 
82  ~TriggerHelper();
83 
84  // Public methods
85  bool on() { return on_; }
86  bool off() { return (!on_); }
87  void initRun(const edm::Run &run,
88  const edm::EventSetup &setup); // To be called from beginRun() methods
89  bool accept(const edm::Event &event,
90  const edm::EventSetup &setup); // To be called from analyze/filter() methods
91 
92 private:
93  // Private methods
94 
96 
97  // DCS
98  bool acceptDcs(const edm::Event &event);
99  bool acceptDcsPartition(const edm::Handle<DcsStatusCollection> &dcsStatus, int dcsPartition) const;
100 
101  // GT status bits
102  bool acceptGt(const edm::Event &event);
103  bool acceptGtLogicalExpression(const edm::Handle<L1GlobalTriggerReadoutRecord> &gtReadoutRecord,
104  std::string gtLogicalExpression);
105 
106  // L1
107  bool acceptL1(const edm::Event &event, const edm::EventSetup &setup);
108  bool acceptL1LogicalExpression(const edm::Event &event, std::string l1LogicalExpression);
109 
110  // HLT
111  bool acceptHlt(const edm::Event &event);
112  bool acceptHltLogicalExpression(const edm::Handle<edm::TriggerResults> &hltTriggerResults,
113  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 template <typename T>
122  : TriggerHelper(config, iC, module) {}
123 
124 template <typename T>
126  : TriggerHelper(config) {
127  l1Gt_.reset(new L1GtUtils(config, iC, false, module));
128 }
129 
130 #endif
std::unique_ptr< L1GtUtils > l1Gt_
Definition: TriggerHelper.h:42
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
Definition: TriggerHelper.h:39
std::vector< std::string > l1LogicalExpressions_
Definition: TriggerHelper.h:58
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
std::string l1DBKey_
Definition: TriggerHelper.h:57
Definition: config.py:1
const std::string configError_
Definition: TriggerHelper.h:72
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchDB_
Definition: TriggerHelper.h:41
TriggerHelper(const edm::ParameterSet &config, edm::ConsumesCollector &&iC, T &module)
std::vector< std::string > hltLogicalExpressions_
Definition: TriggerHelper.h:63
std::string gtDBKey_
Definition: TriggerHelper.h:53
std::vector< std::string > gtLogicalExpressions_
Definition: TriggerHelper.h:54
edm::InputTag hltInputTag_
Definition: TriggerHelper.h:61
HLTConfigProvider hltConfig_
Definition: TriggerHelper.h:43
edm::InputTag gtInputTag_
Definition: TriggerHelper.h:52
std::vector< int > dcsPartitions_
Definition: TriggerHelper.h:49
edm::InputTag dcsInputTag_
Definition: TriggerHelper.h:48
HLT enums.
long double T
Definition: vlib.h:208
std::string hltDBKey_
Definition: TriggerHelper.h:62
Definition: event.py:1
Definition: Run.h:45