CMS 3D CMS Logo

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