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
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept 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 noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

std::string const hltPath_
 
std::string const 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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 10 of file HLTPrescaleExample.cc.

Constructor & Destructor Documentation

◆ HLTPrescaleExample()

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

Definition at line 26 of file HLTPrescaleExample.cc.

27  : hltPSProvider_(iPSet.getParameter<edm::ParameterSet>("hltPSProvCfg"), consumesCollector(), *this),
28  hltProcess_(iPSet.getParameter<std::string>("hltProcess")),
29  hltPath_(iPSet.getParameter<std::string>("hltPath")) {}
std::string const hltProcess_
HLTPrescaleProvider hltPSProvider_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::string const hltPath_

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 36 of file HLTPrescaleExample.cc.

References mps_splice::entry, hltPath_, hltPSProvider_, iEvent, CrabHelper::log, HLTPrescaleProvider::prescaleValue(), HLTPrescaleProvider::prescaleValues(), HLTPrescaleProvider::prescaleValuesInDetail(), AlCaHLTBitMon_QueryRunRegistry::string, submitPVValidationJobs::text, and heppy_batch::val.

36  {
37  auto const hltPSDouble = hltPSProvider_.prescaleValue<double>(iEvent, iSetup, hltPath_);
38  auto const hltPSFrac = hltPSProvider_.prescaleValue<FractionalPrescale>(iEvent, iSetup, hltPath_);
39 
40  auto const l1HLTPSDouble = hltPSProvider_.prescaleValues<double>(iEvent, iSetup, hltPath_);
41  auto const l1HLTPSFrac = hltPSProvider_.prescaleValues<FractionalPrescale>(iEvent, iSetup, hltPath_);
42  auto const l1HLTPSDoubleFrac = hltPSProvider_.prescaleValues<double, FractionalPrescale>(iEvent, iSetup, hltPath_);
43 
44  auto const l1HLTDetailPSDouble = hltPSProvider_.prescaleValuesInDetail<double>(iEvent, iSetup, hltPath_);
45  auto const l1HLTDetailPSFrac = hltPSProvider_.prescaleValuesInDetail<FractionalPrescale>(iEvent, iSetup, hltPath_);
46 
47  edm::LogPrint log("");
48 
49  log << "---------Begin Event--------\n";
50  log << "hltDouble " << hltPSDouble << " hltFrac " << hltPSFrac << "\n";
51  log << " l1HLTDouble " << l1HLTPSDouble.first << " " << l1HLTPSDouble.second << " l1HLTFrac " << l1HLTPSFrac.first
52  << " " << l1HLTPSFrac.second << " l1HLTDoubleFrac " << l1HLTPSDoubleFrac.first << " " << l1HLTPSDoubleFrac.second
53  << "\n";
54  auto printL1HLTDetail = [&log](const std::string& text, const auto& val) {
55  log << text;
56  for (const auto& entry : val.first) {
57  log << entry.first << ":" << entry.second << " ";
58  }
59  log << " HLT : " << val.second << "\n";
60  };
61 
62  printL1HLTDetail("l1HLTDetailDouble ", l1HLTDetailPSDouble);
63  printL1HLTDetail("l1HLTDetailFrac ", l1HLTDetailPSFrac);
64  log << "---------End Event--------\n\n";
65 }
T prescaleValue(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
combining the two methods above
std::pair< std::vector< std::pair< std::string, TL1 > >, THLT > prescaleValuesInDetail(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
boost::rational< int > FractionalPrescale
HLTPrescaleProvider hltPSProvider_
int iEvent
Definition: GenABIO.cc:224
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.
std::string const hltPath_

◆ beginJob()

void HLTPrescaleExample::beginJob ( void  )
inlineoverridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 14 of file HLTPrescaleExample.cc.

14 {}

◆ beginRun()

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

Definition at line 31 of file HLTPrescaleExample.cc.

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

31  {
32  bool changed = false;
33  hltPSProvider_.init(iRun, iSetup, hltProcess_, changed);
34 }
std::string const hltProcess_
HLTPrescaleProvider hltPSProvider_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)

◆ endJob()

void HLTPrescaleExample::endJob ( void  )
inlineoverridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 18 of file HLTPrescaleExample.cc.

18 {}

◆ endRun()

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

Definition at line 17 of file HLTPrescaleExample.cc.

17 {}

Member Data Documentation

◆ hltPath_

std::string const HLTPrescaleExample::hltPath_
private

Definition at line 23 of file HLTPrescaleExample.cc.

Referenced by analyze().

◆ hltProcess_

std::string const HLTPrescaleExample::hltProcess_
private

Definition at line 22 of file HLTPrescaleExample.cc.

Referenced by beginRun().

◆ hltPSProvider_

HLTPrescaleProvider HLTPrescaleExample::hltPSProvider_
private

Definition at line 21 of file HLTPrescaleExample.cc.

Referenced by analyze(), and beginRun().