CMS 3D CMS Logo

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 } // namespace trigger
39 
40 class HLTPrescaler : public edm::stream::EDFilter<edm::GlobalCache<trigger::Efficiency> > {
41 public:
42  //
43  // construction/destruction
44  //
45  explicit HLTPrescaler(edm::ParameterSet const& iConfig, const trigger::Efficiency* efficiency);
46  ~HLTPrescaler() override;
47 
48  static std::unique_ptr<trigger::Efficiency> initializeGlobalCache(edm::ParameterSet const&) {
49  return std::unique_ptr<trigger::Efficiency>(new trigger::Efficiency());
50  }
51 
52  //
53  // member functions
54  //
55  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
56  void beginLuminosityBlock(edm::LuminosityBlock const& lb, edm::EventSetup const& iSetup) override;
57  bool filter(edm::Event& iEvent, edm::EventSetup const& iSetup) override;
58  void endStream() override;
59  static void globalEndJob(const trigger::Efficiency* efficiency);
60 
61 private:
62  //
63  //member data
64  //
65 
67  unsigned int prescaleSet_;
68 
70  unsigned int prescaleFactor_;
71 
73  unsigned int eventCount_;
74 
76  unsigned int acceptCount_;
77 
79  unsigned int offsetCount_;
80  unsigned int offsetPhase_;
81 
84 
86  bool newLumi_;
87 
92 
94  static const unsigned int prescaleSeed_;
95 };
96 
97 #endif
HLTPrescaler::gtDigi2Token_
edm::EDGetTokenT< GlobalAlgBlkBxCollection > gtDigi2Token_
Definition: HLTPrescaler.h:91
HLTPrescaler::newLumi_
bool newLumi_
check for (re)initialization of the prescale
Definition: HLTPrescaler.h:86
HLTPrescaler::endStream
void endStream() override
Definition: HLTPrescaler.cc:132
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord >
edm
HLT enums.
Definition: AlignableModifier.h:19
trigger::Efficiency::acceptCount_
std::atomic< unsigned int > acceptCount_
Definition: HLTPrescaler.h:36
L1TObjectsTimingClient_cff.efficiency
efficiency
Definition: L1TObjectsTimingClient_cff.py:10
trigger::Efficiency::eventCount_
std::atomic< unsigned int > eventCount_
Definition: HLTPrescaler.h:35
PrescaleService.h
HLTPrescaler::prescaleSet_
unsigned int prescaleSet_
l1 prescale set index
Definition: HLTPrescaler.h:67
HLTPrescaler::acceptCount_
unsigned int acceptCount_
accept counter
Definition: HLTPrescaler.h:76
HLTPrescaler::offsetPhase_
unsigned int offsetPhase_
Definition: HLTPrescaler.h:80
HLTPrescaler::gtDigiTag_
edm::InputTag gtDigiTag_
GT payload, to extract the prescale column index.
Definition: HLTPrescaler.h:89
HLTPrescaler::globalEndJob
static void globalEndJob(const trigger::Efficiency *efficiency)
Definition: HLTPrescaler.cc:141
HLTPrescaler::prescaleService_
edm::service::PrescaleService * prescaleService_
prescale service
Definition: HLTPrescaler.h:83
HLTPrescaler::gtDigi1Token_
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtDigi1Token_
Definition: HLTPrescaler.h:90
edm::service::PrescaleService
Definition: PrescaleService.h:20
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
HLTPrescaler::HLTPrescaler
HLTPrescaler(edm::ParameterSet const &iConfig, const trigger::Efficiency *efficiency)
Definition: HLTPrescaler.cc:30
edm::ParameterSet
Definition: ParameterSet.h:47
trigger::Efficiency
Definition: HLTPrescaler.h:33
Event.h
HLTPrescaler::prescaleSeed_
static const unsigned int prescaleSeed_
"seed" used to initialize the prescale counter
Definition: HLTPrescaler.h:94
HLTPrescaler::~HLTPrescaler
~HLTPrescaler() override
iEvent
int iEvent
Definition: GenABIO.cc:224
GlobalAlgBlk.h
HLTPrescaler::beginLuminosityBlock
void beginLuminosityBlock(edm::LuminosityBlock const &lb, edm::EventSetup const &iSetup) override
Definition: HLTPrescaler.cc:63
edm::EventSetup
Definition: EventSetup.h:57
HLTPrescaler::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: HLTPrescaler.cc:55
ConfigurationDescriptions
HLTPrescaler::initializeGlobalCache
static std::unique_ptr< trigger::Efficiency > initializeGlobalCache(edm::ParameterSet const &)
Definition: HLTPrescaler.h:48
Frameworkfwd.h
trigger::Efficiency::Efficiency
Efficiency()
Definition: HLTPrescaler.h:34
HLTPrescaler::filter
bool filter(edm::Event &iEvent, edm::EventSetup const &iSetup) override
Definition: HLTPrescaler.cc:68
HLTPrescaler
Definition: HLTPrescaler.h:40
trigger
Definition: HLTPrescaleTableCond.h:8
EDFilter.h
ParameterSet.h
HLTPrescaler::eventCount_
unsigned int eventCount_
event counter
Definition: HLTPrescaler.h:73
edm::stream::EDFilter
Definition: EDFilter.h:38
edm::Event
Definition: Event.h:73
HLTPrescaler::offsetCount_
unsigned int offsetCount_
initial offset
Definition: HLTPrescaler.h:79
edm::InputTag
Definition: InputTag.h:15
L1GlobalTriggerReadoutRecord.h
HLTPrescaler::prescaleFactor_
unsigned int prescaleFactor_
accept one in prescaleFactor_; 0 means never to accept an event
Definition: HLTPrescaler.h:70