CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HLTPrescaleExample Class Reference
Inheritance diagram for HLTPrescaleExample:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::Event const &iEvent, edm::EventSetup const &) override
 
void beginJob () override
 
void beginRun (edm::Run const &iEvent, edm::EventSetup const &) override
 
void endJob () override
 
void endRun (edm::Run const &iEvent, edm::EventSetup const &) override
 
 HLTPrescaleExample (edm::ParameterSet const &iPSet)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

std::string hltPath_
 
std::string hltProcess_
 
HLTPrescaleProvider hltPSProvider_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 9 of file HLTPrescaleExample.cc.

Constructor & Destructor Documentation

◆ HLTPrescaleExample()

HLTPrescaleExample::HLTPrescaleExample ( edm::ParameterSet const &  iPSet)

Definition at line 25 of file HLTPrescaleExample.cc.

26  : hltPSProvider_(iPSet.getParameter<edm::ParameterSet>("hltPSProvCfg"), consumesCollector(), *this),
27  hltProcess_(iPSet.getParameter<std::string>("hltProcess")),
28  hltPath_(iPSet.getParameter<std::string>("hltPath")) {}

Member Function Documentation

◆ analyze()

void HLTPrescaleExample::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 35 of file HLTPrescaleExample.cc.

35  {
36  auto hltPSDouble = hltPSProvider_.prescaleValue<double>(iEvent, iSetup, hltPath_);
37  auto hltPSInt = hltPSProvider_.prescaleValue<int>(iEvent, iSetup, hltPath_);
38  auto hltPSUInt = hltPSProvider_.prescaleValue<unsigned int>(iEvent, iSetup, hltPath_);
40 
41  auto l1HLTPSDouble = hltPSProvider_.prescaleValues<double>(iEvent, iSetup, hltPath_);
42  auto l1HLTPSInt = hltPSProvider_.prescaleValues<int>(iEvent, iSetup, hltPath_);
43  auto l1HLTPSFrac = hltPSProvider_.prescaleValues<FractionalPrescale>(iEvent, iSetup, hltPath_);
44  auto l1HLTPSDoubleFrac = hltPSProvider_.prescaleValues<double, FractionalPrescale>(iEvent, iSetup, hltPath_);
45 
46  auto l1HLTDetailPSDouble = hltPSProvider_.prescaleValuesInDetail<double>(iEvent, iSetup, hltPath_);
47  auto l1HLTDetailPSInt = hltPSProvider_.prescaleValuesInDetail<int>(iEvent, iSetup, hltPath_);
48  auto l1HLTDetailPSFrac = hltPSProvider_.prescaleValuesInDetail<FractionalPrescale>(iEvent, iSetup, hltPath_);
49 
50  std::cout << "---------Begin Event--------" << std::endl;
51  std::cout << "hltDouble " << hltPSDouble << " hltInt " << hltPSInt << " hltPSUInt " << hltPSUInt << " hltFrac "
52  << hltPSFrac << std::endl;
53 
54  std::cout << " l1HLTDouble " << l1HLTPSDouble.first << " " << l1HLTPSDouble.second << " l1HLTInt " << l1HLTPSInt.first
55  << " " << l1HLTPSInt.second << " l1HLTFrac " << l1HLTPSFrac.first << " " << l1HLTPSFrac.second
56  << " l1HLTDoubleFrac " << l1HLTPSDoubleFrac.first << " " << l1HLTPSDoubleFrac.second << std::endl;
57  auto printL1HLTDetail = [](const std::string& text, const auto& val, std::ostream& out) {
58  out << text;
59  for (const auto& entry : val.first) {
60  out << entry.first << ":" << entry.second << " ";
61  }
62  out << " HLT : " << val.second << std::endl;
63  };
64 
65  printL1HLTDetail("l1HLTDetailDouble ", l1HLTDetailPSDouble, std::cout);
66  printL1HLTDetail("l1HLTDetailInt ", l1HLTDetailPSInt, std::cout);
67  printL1HLTDetail("l1HLTDetailFrac ", l1HLTDetailPSFrac, std::cout);
68  std::cout << "---------End Event--------" << std::endl << std::endl;
69 }

References gather_cfg::cout, mps_splice::entry, hltPath_, hltPSProvider_, iEvent, MillePedeFileConverter_cfg::out, HLTPrescaleProvider::prescaleValue(), HLTPrescaleProvider::prescaleValues(), HLTPrescaleProvider::prescaleValuesInDetail(), AlCaHLTBitMon_QueryRunRegistry::string, runonSM::text, and heppy_batch::val.

◆ beginJob()

void HLTPrescaleExample::beginJob ( void  )
inlineoverridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 13 of file HLTPrescaleExample.cc.

13 {}

◆ beginRun()

void HLTPrescaleExample::beginRun ( edm::Run const &  iEvent,
edm::EventSetup const &  iSetup 
)
override

Definition at line 30 of file HLTPrescaleExample.cc.

30  {
31  bool changed = false;
32  hltPSProvider_.init(iRun, iSetup, hltProcess_, changed);
33 }

References hltProcess_, hltPSProvider_, and HLTPrescaleProvider::init().

◆ endJob()

void HLTPrescaleExample::endJob ( void  )
inlineoverridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 17 of file HLTPrescaleExample.cc.

17 {}

◆ endRun()

void HLTPrescaleExample::endRun ( edm::Run const &  iEvent,
edm::EventSetup const &   
)
inlineoverride

Definition at line 16 of file HLTPrescaleExample.cc.

16 {}

Member Data Documentation

◆ hltPath_

std::string HLTPrescaleExample::hltPath_
private

Definition at line 22 of file HLTPrescaleExample.cc.

Referenced by analyze().

◆ hltProcess_

std::string HLTPrescaleExample::hltProcess_
private

Definition at line 21 of file HLTPrescaleExample.cc.

Referenced by beginRun().

◆ hltPSProvider_

HLTPrescaleProvider HLTPrescaleExample::hltPSProvider_
private

Definition at line 20 of file HLTPrescaleExample.cc.

Referenced by analyze(), and beginRun().

HLTPrescaleExample::hltProcess_
std::string hltProcess_
Definition: HLTPrescaleExample.cc:21
mps_splice.entry
entry
Definition: mps_splice.py:68
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HLTPrescaleProvider::prescaleValues
std::pair< TL1, THLT > prescaleValues(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
Combined L1T (pair.first) and HLT (pair.second) prescales per HLT path.
Definition: HLTPrescaleProvider.h:72
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:47
HLTPrescaleExample::hltPSProvider_
HLTPrescaleProvider hltPSProvider_
Definition: HLTPrescaleExample.cc:20
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLTPrescaleProvider::prescaleValuesInDetail
std::pair< std::vector< std::pair< std::string, TL1 > >, THLT > prescaleValuesInDetail(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
Definition: HLTPrescaleProvider.h:82
HLTPrescaleExample::hltPath_
std::string hltPath_
Definition: HLTPrescaleExample.cc:22
edm::ParameterSet
Definition: ParameterSet.h:47
iEvent
int iEvent
Definition: GenABIO.cc:224
FractionalPrescale
boost::rational< int > FractionalPrescale
Definition: FractionalPrescale.h:5
HLTPrescaleProvider::init
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
Definition: HLTPrescaleProvider.cc:21
HLTPrescaleProvider::prescaleValue
T prescaleValue(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
combining the two methods above
Definition: HLTPrescaleProvider.h:63
heppy_batch.val
val
Definition: heppy_batch.py:351
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
runonSM.text
text
Definition: runonSM.py:43