CMS 3D CMS Logo

PrescaleWeightProvider.h
Go to the documentation of this file.
1 #ifndef CommonTools_TriggerUtils_PrescaleWeightProvider_h
2 #define CommonTools_TriggerUtils_PrescaleWeightProvider_h
3 
4 // -*- C++ -*-
5 //
6 // Package: CommonTools/TriggerUtils
7 // Class: PrescaleWeightProvider
8 //
21 #include <memory>
22 #include <string>
23 #include <vector>
24 
26 
33 
35 
37 
38 namespace edm {
39  class ConsumesCollector;
40  class Event;
41  class EventSetup;
42  class ParameterSet;
43  class Run;
44  class TriggerResults;
45 } // namespace edm
46 
49  bool init_;
50  std::unique_ptr<HLTPrescaleProvider> hltPrescaleProvider_;
52 
53  std::vector<std::string> l1SeedPaths_;
54 
55  // configuration parameters
56  unsigned verbosity_; // optional (default: 0)
57  edm::InputTag triggerResultsTag_; // optional (default: "TriggerResults::HLT")
59  edm::InputTag l1GtTriggerMenuLiteTag_; // optional (default: "l1GtTriggerMenuLite")
60  edm::EDGetTokenT<L1GtTriggerMenuLite> l1GtTriggerMenuLiteToken_; // optional (default: "l1GtTriggerMenuLite")
61  std::vector<std::string> hltPaths_;
62 
63 public:
64  // The constructor must be called from the ED module's c'tor
65  template <typename T>
67 
68  template <typename T>
70 
72 
73  // to be called from the ED module's beginRun() method
74  void initRun(const edm::Run& run, const edm::EventSetup& setup);
75  // to be called from the ED module's event loop method
77 
78 private:
80 
81  void parseL1Seeds(const std::string& l1Seeds);
82 };
83 
84 template <typename T>
87 
88 template <typename T>
91  hltPrescaleProvider_ = std::make_unique<HLTPrescaleProvider>(config, iC, module);
92 }
93 #endif
PrescaleWeightProvider(const edm::ParameterSet &config, edm::ConsumesCollector &&iC, T &module)
int prescaleWeight(const edm::Event &event, const edm::EventSetup &setup)
edm::Handle< L1GtTriggerMenuLite > triggerMenuLite_
Definition: config.py:1
std::vector< std::string > l1SeedPaths_
std::vector< std::string > hltPaths_
std::unique_ptr< HLTPrescaleProvider > hltPrescaleProvider_
void initRun(const edm::Run &run, const edm::EventSetup &setup)
edm::EDGetTokenT< L1GtTriggerMenuLite > l1GtTriggerMenuLiteToken_
This class takes a vector of HLT paths and returns a weight based on their HLT and L1 prescales...
config
parse the configuration file
HLT enums.
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
long double T
void parseL1Seeds(const std::string &l1Seeds)
Definition: event.py:1
Definition: Run.h:45