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 
5 // -*- C++ -*-
6 //
7 // Package: CommonTools/TriggerUtils
8 // Class: PrescaleWeightProvider
9 //
23 #include <memory>
24 #include <string>
25 #include <vector>
26 
28 
35 
37 
38 
40 
41 namespace edm {
42  class ConsumesCollector;
43  class Event;
44  class EventSetup;
45  class ParameterSet;
46  class Run;
47  class TriggerResults;
48 }
49 
51 
53  bool init_;
54  std::unique_ptr<HLTPrescaleProvider> hltPrescaleProvider_;
56 
57  std::vector< std::string > l1SeedPaths_;
58 
59  // configuration parameters
60  unsigned verbosity_; // optional (default: 0)
61  edm::InputTag triggerResultsTag_; // optional (default: "TriggerResults::HLT")
63  edm::InputTag l1GtTriggerMenuLiteTag_; // optional (default: "l1GtTriggerMenuLite")
64  edm::EDGetTokenT< L1GtTriggerMenuLite > l1GtTriggerMenuLiteToken_; // optional (default: "l1GtTriggerMenuLite")
65  std::vector< std::string > hltPaths_;
66 
67  public:
68 
69  // The constructor must be called from the ED module's c'tor
70  template <typename T>
72 
73  template <typename T>
75 
77 
78  void initRun( const edm::Run & run, const edm::EventSetup & setup ); // to be called from the ED module's beginRun() method
79  int prescaleWeight ( const edm::Event & event, const edm::EventSetup & setup ); // to be called from the ED module's event loop method
80 
81  private:
82 
84 
85  void parseL1Seeds( const std::string & l1Seeds );
86 
87 };
88 
89 template <typename T>
91  PrescaleWeightProvider( config, iC, module ) {
92 }
93 
94 template <typename T>
96  PrescaleWeightProvider( config, iC ) {
97  hltPrescaleProvider_.reset(new HLTPrescaleProvider(config, iC, module));
98 }
99 #endif
edm::EDGetTokenT< L1GtTriggerMenuLite > l1GtTriggerMenuLiteToken_
PrescaleWeightProvider(const edm::ParameterSet &config, edm::ConsumesCollector &&iC, T &module)
edm::Handle< L1GtTriggerMenuLite > triggerMenuLite_
std::vector< std::string > l1SeedPaths_
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
Definition: config.py:1
std::vector< std::string > hltPaths_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
std::unique_ptr< HLTPrescaleProvider > hltPrescaleProvider_
This class takes a vector of HLT paths and returns a weight based on their HLT and L1 prescales...
HLT enums.
long double T
Definition: vlib.h:208
Definition: event.py:1
Definition: Run.h:42