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>
22 namespace edm {
24 }
25 
26 namespace trigger {
27  struct Efficiency {
29  mutable std::atomic<unsigned int> eventCount_;
30  mutable std::atomic<unsigned int> acceptCount_;
31  };
32 }
33 
34 class HLTPrescaler : public edm::stream::EDFilter<edm::GlobalCache<trigger::Efficiency> >
35 {
36 public:
37  //
38  // construction/destruction
39  //
40  explicit HLTPrescaler(edm::ParameterSet const& iConfig, const trigger::Efficiency* efficiency);
41  virtual ~HLTPrescaler();
42 
43  static std::unique_ptr<trigger::Efficiency> initializeGlobalCache(edm::ParameterSet const&) {
44  return std::unique_ptr<trigger::Efficiency>(new trigger::Efficiency());
45  }
46 
47 
48 
49  //
50  // member functions
51  //
52  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
53  virtual void beginLuminosityBlock(edm::LuminosityBlock const&lb,
54  edm::EventSetup const& iSetup) override;
55  virtual bool filter(edm::Event& iEvent,edm::EventSetup const& iSetup) override;
56  virtual void endStream() override;
57  static void globalEndJob(const trigger::Efficiency* efficiency);
58 
59 
60 private:
61  //
62  //member data
63  //
64 
66  unsigned int prescaleSet_;
67 
69  unsigned int prescaleFactor_;
70 
72  unsigned int eventCount_;
73 
75  unsigned int acceptCount_;
76 
78  unsigned int offsetCount_;
79  unsigned int offsetPhase_;
80 
83 
85  bool newLumi_;
86 
90 
92  static const
93  unsigned int prescaleSeed_;
94 
95 };
96 
97 #endif
virtual ~HLTPrescaler()
Definition: HLTPrescaler.cc:51
std::atomic< unsigned int > acceptCount_
Definition: HLTPrescaler.h:30
static std::unique_ptr< trigger::Efficiency > initializeGlobalCache(edm::ParameterSet const &)
Definition: HLTPrescaler.h:43
edm::service::PrescaleService * prescaleService_
prescale service
Definition: HLTPrescaler.h:82
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:93
HLTPrescaler(edm::ParameterSet const &iConfig, const trigger::Efficiency *efficiency)
Definition: HLTPrescaler.cc:32
unsigned int acceptCount_
accept counter
Definition: HLTPrescaler.h:75
int iEvent
Definition: GenABIO.cc:243
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtDigiToken_
Definition: HLTPrescaler.h:89
unsigned int eventCount_
event counter
Definition: HLTPrescaler.h:72
bool newLumi_
check for (re)initialization of the prescale
Definition: HLTPrescaler.h:85
unsigned int prescaleSet_
l1 prescale set index
Definition: HLTPrescaler.h:66
edm::InputTag gtDigiTag_
GT payload, to extract the prescale column index.
Definition: HLTPrescaler.h:88
unsigned int offsetPhase_
Definition: HLTPrescaler.h:79
static void globalEndJob(const trigger::Efficiency *efficiency)
unsigned int offsetCount_
initial offset
Definition: HLTPrescaler.h:78
unsigned int prescaleFactor_
accept one in prescaleFactor_; 0 means never to accept an event
Definition: HLTPrescaler.h:69
virtual void endStream() override
std::atomic< unsigned int > eventCount_
Definition: HLTPrescaler.h:29