CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
int prescaleWeight(const edm::Event &event, const edm::EventSetup &setup)
edm::Handle< L1GtTriggerMenuLite > triggerMenuLite_
std::vector< std::string > l1SeedPaths_
std::vector< std::string > hltPaths_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
std::unique_ptr< HLTPrescaleProvider > hltPrescaleProvider_
void initRun(const edm::Run &run, const edm::EventSetup &setup)
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
This class takes a vector of HLT paths and returns a weight based on their HLT and L1 prescales...
long double T
Definition: vlib.h:208
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void parseL1Seeds(const std::string &l1Seeds)
Definition: Run.h:41