CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HLTPrescaler.h
Go to the documentation of this file.
1 #ifndef HLTPrescaler_H
2 #define HLTPrescaler_H
3 
15 #include <atomic>
16 #include <memory>
17 
23 
24 // legacy/stage-1 L1T:
26 
27 // stage-2 L1T:
29 
30 namespace edm {
32 }
33 
34 namespace trigger {
35  struct Efficiency {
37  mutable std::atomic<unsigned int> eventCount_;
38  mutable std::atomic<unsigned int> acceptCount_;
39  };
40 } // namespace trigger
41 
42 class HLTPrescaler : public edm::stream::EDFilter<edm::GlobalCache<trigger::Efficiency> > {
43 public:
44  //
45  // construction/destruction
46  //
48  ~HLTPrescaler() override;
49 
50  static std::unique_ptr<trigger::Efficiency> initializeGlobalCache(edm::ParameterSet const&) {
51  return std::make_unique<trigger::Efficiency>();
52  }
53 
54  //
55  // member functions
56  //
57  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
58  void beginLuminosityBlock(edm::LuminosityBlock const& lb, edm::EventSetup const& iSetup) override;
59  bool filter(edm::Event& iEvent, edm::EventSetup const& iSetup) override;
60  void endStream() override;
61  static void globalEndJob(const trigger::Efficiency* efficiency);
62 
63 private:
64  //
65  //member data
66  //
67 
69  unsigned int prescaleSet_;
70 
72  unsigned int prescaleFactor_;
73 
75  unsigned int eventCount_;
76 
78  unsigned int acceptCount_;
79 
81  unsigned int offsetCount_;
82  unsigned int offsetPhase_;
83 
86 
88  bool newLumi_;
89 
94 
96  static const unsigned int prescaleSeed_;
97 };
98 
99 #endif
std::atomic< unsigned int > acceptCount_
Definition: HLTPrescaler.h:38
static std::unique_ptr< trigger::Efficiency > initializeGlobalCache(edm::ParameterSet const &)
Definition: HLTPrescaler.h:50
edm::service::PrescaleService * prescaleService_
prescale service
Definition: HLTPrescaler.h:85
bool filter(edm::Event &iEvent, edm::EventSetup const &iSetup) override
Definition: HLTPrescaler.cc:68
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: HLTPrescaler.cc:55
void beginLuminosityBlock(edm::LuminosityBlock const &lb, edm::EventSetup const &iSetup) override
Definition: HLTPrescaler.cc:63
static const unsigned int prescaleSeed_
&quot;seed&quot; used to initialize the prescale counter
Definition: HLTPrescaler.h:96
HLTPrescaler(edm::ParameterSet const &iConfig, const trigger::Efficiency *efficiency)
Definition: HLTPrescaler.cc:30
unsigned int acceptCount_
accept counter
Definition: HLTPrescaler.h:78
int iEvent
Definition: GenABIO.cc:224
unsigned int eventCount_
event counter
Definition: HLTPrescaler.h:75
bool newLumi_
check for (re)initialization of the prescale
Definition: HLTPrescaler.h:88
unsigned int prescaleSet_
l1 prescale set index
Definition: HLTPrescaler.h:69
edm::InputTag gtDigiTag_
GT payload, to extract the prescale column index.
Definition: HLTPrescaler.h:91
~HLTPrescaler() override
edm::EDGetTokenT< GlobalAlgBlkBxCollection > gtDigi2Token_
Definition: HLTPrescaler.h:93
unsigned int offsetPhase_
Definition: HLTPrescaler.h:82
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtDigi1Token_
Definition: HLTPrescaler.h:92
static void globalEndJob(const trigger::Efficiency *efficiency)
unsigned int offsetCount_
initial offset
Definition: HLTPrescaler.h:81
unsigned int prescaleFactor_
accept one in prescaleFactor_; 0 means never to accept an event
Definition: HLTPrescaler.h:72
void endStream() override
std::atomic< unsigned int > eventCount_
Definition: HLTPrescaler.h:37