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>
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  //
47  explicit HLTPrescaler(edm::ParameterSet const& iConfig, const trigger::Efficiency* efficiency);
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
HLTPrescaler::gtDigi2Token_
edm::EDGetTokenT< GlobalAlgBlkBxCollection > gtDigi2Token_
Definition: HLTPrescaler.h:93
HLTPrescaler::newLumi_
bool newLumi_
check for (re)initialization of the prescale
Definition: HLTPrescaler.h:88
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:38
L1TObjectsTimingClient_cff.efficiency
efficiency
Definition: L1TObjectsTimingClient_cff.py:10
trigger::Efficiency::eventCount_
std::atomic< unsigned int > eventCount_
Definition: HLTPrescaler.h:37
PrescaleService.h
HLTPrescaler::prescaleSet_
unsigned int prescaleSet_
l1 prescale set index
Definition: HLTPrescaler.h:69
HLTPrescaler::acceptCount_
unsigned int acceptCount_
accept counter
Definition: HLTPrescaler.h:78
HLTPrescaler::offsetPhase_
unsigned int offsetPhase_
Definition: HLTPrescaler.h:82
HLTPrescaler::gtDigiTag_
edm::InputTag gtDigiTag_
GT payload, to extract the prescale column index.
Definition: HLTPrescaler.h:91
HLTPrescaler::globalEndJob
static void globalEndJob(const trigger::Efficiency *efficiency)
Definition: HLTPrescaler.cc:141
HLTPrescaler::prescaleService_
edm::service::PrescaleService * prescaleService_
prescale service
Definition: HLTPrescaler.h:85
HLTPrescaler::gtDigi1Token_
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtDigi1Token_
Definition: HLTPrescaler.h:92
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:35
Event.h
HLTPrescaler::prescaleSeed_
static const unsigned int prescaleSeed_
"seed" used to initialize the prescale counter
Definition: HLTPrescaler.h:96
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:58
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:50
Frameworkfwd.h
trigger::Efficiency::Efficiency
Efficiency()
Definition: HLTPrescaler.h:36
HLTPrescaler::filter
bool filter(edm::Event &iEvent, edm::EventSetup const &iSetup) override
Definition: HLTPrescaler.cc:68
HLTPrescaler
Definition: HLTPrescaler.h:42
trigger
Definition: HLTPrescaleTableCond.h:8
EDFilter.h
ParameterSet.h
HLTPrescaler::eventCount_
unsigned int eventCount_
event counter
Definition: HLTPrescaler.h:75
edm::stream::EDFilter
Definition: EDFilter.h:36
edm::Event
Definition: Event.h:73
HLTPrescaler::offsetCount_
unsigned int offsetCount_
initial offset
Definition: HLTPrescaler.h:81
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:72