CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HLTPrescaleRecorder Class Reference

#include <HLTPrescaleRecorder.h>

Inheritance diagram for HLTPrescaleRecorder:
edm::one::EDProducer< edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginLuminosityBlock (edm::LuminosityBlock const &iLumi, const edm::EventSetup &iSetup) final
 
void beginRun (edm::Run const &iRun, const edm::EventSetup &iSetup) final
 
void endLuminosityBlock (edm::LuminosityBlock const &iLumi, const edm::EventSetup &iSetup) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) final
 
void endRun (edm::Run const &iRun, const edm::EventSetup &iSetup) final
 
void endRunProduce (edm::Run &iRun, const edm::EventSetup &iSetup) final
 
 HLTPrescaleRecorder (const edm::ParameterSet &)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) final
 
 ~HLTPrescaleRecorder () override
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

bool condDB_
 
cond::service::PoolDBOutputServicedb_
 Pool DB service. More...
 
bool event_
 
trigger::HLTPrescaleTable hlt_
 payload HLT object More...
 
std::string hltDBTag_
 Tag of DB entry (HLT Key Name) (src=4) More...
 
edm::Handle< trigger::HLTPrescaleTablehltHandle_
 Handle and ESHandle for existing HLT object. More...
 
edm::InputTag hltInputTag_
 InputTag of HLTPrescaleTable product (src=1,2,3) More...
 
edm::EDGetTokenT< trigger::HLTPrescaleTablehltInputToken_
 InputToken of HLTPrescaleTable product (src=1,2,3) More...
 
edm::ESGetToken< trigger::HLTPrescaleTableCond, HLTPrescaleTableRcd > const hltPrescaleTableCondToken_
 
bool lumi_
 
edm::service::PrescaleServiceps_
 Prescale service. More...
 
std::string psetName_
 
bool run_
 (Multiple) Destinations More...
 
int src_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- 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 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<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

This class is an EDProducer making the HLTPrescaleTable object

Author
Martin Grunewald

See header file for documentation

Author
Martin Grunewald

Definition at line 44 of file HLTPrescaleRecorder.h.

Constructor & Destructor Documentation

◆ HLTPrescaleRecorder()

HLTPrescaleRecorder::HLTPrescaleRecorder ( const edm::ParameterSet ps)
explicit

Definition at line 27 of file HLTPrescaleRecorder.cc.

References edm::BeginRun, condDB_, db_, edm::InputTag::encode(), event_, hltDBTag_, hltInputTag_, hltInputToken_, lumi_, Utilities::operator, ps_, psetName_, run_, and src_.

28  : src_(ps.getParameter<int>("src")),
29  run_(ps.getParameter<bool>("run")),
30  lumi_(ps.getParameter<bool>("lumi")),
31  event_(ps.getParameter<bool>("event")),
32  condDB_(ps.getParameter<bool>("condDB")),
33  psetName_(ps.getParameter<string>("psetName")),
34  hltInputTag_(ps.getParameter<InputTag>("hltInputTag")),
36  hltDBTag_(ps.getParameter<string>("hltDBTag")),
37  hltPrescaleTableCondToken_(esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", hltDBTag_))),
38  ps_(nullptr),
39  db_(nullptr),
40  hltHandle_(),
41  hlt_() {
42  if (src_ == 1) {
43  // Run
44  hltInputToken_ = consumes<trigger::HLTPrescaleTable, edm::InRun>(hltInputTag_);
45  } else if (src_ == 2) {
46  // Lumi
47  hltInputToken_ = consumes<trigger::HLTPrescaleTable, edm::InLumi>(hltInputTag_);
48  } else if (src_ == 3) {
49  // Event
50  hltInputToken_ = consumes<trigger::HLTPrescaleTable>(hltInputTag_);
51  }
52 
53  LogInfo("HLTPrescaleRecorder") << "src:run-lumi-event-condDB+psetName+tags: " << src_ << ":" << run_ << "-" << lumi_
54  << "-" << event_ << "-" << condDB_ << "+" << psetName_ << "+" << hltInputTag_.encode()
55  << "+" << hltDBTag_;
56 
57  if (edm::Service<edm::service::PrescaleService>().isAvailable()) {
59  } else if (src_ == 0) {
60  LogError("HLTPrescaleRecorder") << "PrescaleService requested as source but unavailable!";
61  }
62 
65  } else if (condDB_) {
66  LogError("HLTPrescaleRecorder") << "PoolDBOutputService requested as destination but unavailable!";
67  }
68 
69  if (run_)
70  produces<HLTPrescaleTable, edm::Transition::EndRun>("Run");
71  if (lumi_)
72  produces<HLTPrescaleTable, edm::Transition::EndLuminosityBlock>("Lumi");
73  if (event_)
74  produces<HLTPrescaleTable, edm::Transition::Event>("Event");
75 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::service::PrescaleService * ps_
Prescale service.
edm::ESGetToken< trigger::HLTPrescaleTableCond, HLTPrescaleTableRcd > const hltPrescaleTableCondToken_
std::string encode() const
Definition: InputTag.cc:159
edm::EDGetTokenT< trigger::HLTPrescaleTable > hltInputToken_
InputToken of HLTPrescaleTable product (src=1,2,3)
std::string hltDBTag_
Tag of DB entry (HLT Key Name) (src=4)
Log< level::Error, false > LogError
cond::service::PoolDBOutputService * db_
Pool DB service.
trigger::HLTPrescaleTable hlt_
payload HLT object
Log< level::Info, false > LogInfo
edm::Handle< trigger::HLTPrescaleTable > hltHandle_
Handle and ESHandle for existing HLT object.
bool run_
(Multiple) Destinations
edm::InputTag hltInputTag_
InputTag of HLTPrescaleTable product (src=1,2,3)

◆ ~HLTPrescaleRecorder()

HLTPrescaleRecorder::~HLTPrescaleRecorder ( )
overridedefault

Member Function Documentation

◆ beginLuminosityBlock()

void HLTPrescaleRecorder::beginLuminosityBlock ( edm::LuminosityBlock const &  iLumi,
const edm::EventSetup iSetup 
)
final

From PrescaleService default index updated at lumi block boundaries
From Lumi Block

Definition at line 156 of file HLTPrescaleRecorder.cc.

References edm::LuminosityBlock::getByToken(), edm::service::PrescaleService::getLvl1IndexDefault(), edm::service::PrescaleService::getLvl1Labels(), edm::service::PrescaleService::getPrescaleTable(), hlt_, hltHandle_, hltInputToken_, ps_, and src_.

156  {
157  if (src_ == 0) {
160  if (ps_ != nullptr) {
162  } else {
164  LogError("HLTPrescaleRecorder") << "PrescaleService not found!";
165  }
166  } else if (src_ == 2) {
168  if (iLumi.getByToken(hltInputToken_, hltHandle_)) {
169  hlt_ = *hltHandle_;
170  } else {
172  LogError("HLTPrescaleRecorder") << "HLTPrescaleTable not found in LumiBlock!";
173  }
174  }
175 
176  return;
177 }
edm::service::PrescaleService * ps_
Prescale service.
const PrescaleTable_t & getPrescaleTable() const
edm::EDGetTokenT< trigger::HLTPrescaleTable > hltInputToken_
InputToken of HLTPrescaleTable product (src=1,2,3)
The single EDProduct containing the HLT Prescale Table.
unsigned int getLvl1IndexDefault() const
Log< level::Error, false > LogError
trigger::HLTPrescaleTable hlt_
payload HLT object
edm::Handle< trigger::HLTPrescaleTable > hltHandle_
Handle and ESHandle for existing HLT object.
const VString_t & getLvl1Labels() const

◆ beginRun()

void HLTPrescaleRecorder::beginRun ( edm::Run const &  iRun,
const edm::EventSetup iSetup 
)
final

From PrescaleTable tracked PSet

From PrescaleService default index updated at lumi block boundaries

From Run Block

From CondDB (needs ESProducer module as well)

Definition at line 104 of file HLTPrescaleRecorder.cc.

References edm::Run::getByToken(), edm::EventSetup::getData(), edm::service::PrescaleService::getLvl1IndexDefault(), edm::service::PrescaleService::getLvl1Labels(), edm::ParameterSet::getParameter(), edm::service::PrescaleService::getPrescaleTable(), edm::getProcessParameterSetContainingModule(), hlt_, hltHandle_, hltInputToken_, hltPrescaleTableCondToken_, mps_fire::i, SummaryClient_cfi::labels, visualization-live-secondInstance_cfg::m, edm::one::EDProducerBase::moduleDescription(), dqmiodumpmetadata::n, ps_, psetName_, src_, AlCaHLTBitMon_QueryRunRegistry::string, and TableParser::table.

104  {
106 
107  if (src_ == -1) {
110  ParameterSet iPS(pPSet.getParameter<ParameterSet>(psetName_));
111 
112  string defaultLabel(iPS.getParameter<std::string>("lvl1DefaultLabel"));
113  vector<string> labels(iPS.getParameter<std::vector<std::string> >("lvl1Labels"));
114  vector<ParameterSet> vpTable(iPS.getParameter<std::vector<ParameterSet> >("prescaleTable"));
115 
116  unsigned int set(0);
117  const unsigned int n(labels.size());
118  for (unsigned int i = 0; i != n; ++i) {
119  if (labels[i] == defaultLabel)
120  set = i;
121  }
122 
123  map<string, vector<unsigned int> > table;
124  const unsigned int m(vpTable.size());
125  for (unsigned int i = 0; i != m; ++i) {
126  table[vpTable[i].getParameter<std::string>("pathName")] =
127  vpTable[i].getParameter<std::vector<unsigned int> >("prescales");
128  }
130 
131  } else if (src_ == 0) {
134  if (ps_ != nullptr) {
136  } else {
138  LogError("HLTPrescaleRecorder") << "PrescaleService not found!";
139  }
140  } else if (src_ == 1) {
142  if (iRun.getByToken(hltInputToken_, hltHandle_)) {
143  hlt_ = *hltHandle_;
144  } else {
145  LogError("HLTPrescaleRecorder") << "HLTPrescaleTable not found in Run!";
146  }
147  } else if (src_ == 4) {
149  auto const& hltPrescaleTableCond = iSetup.getData(hltPrescaleTableCondToken_);
150  hlt_ = hltPrescaleTableCond.hltPrescaleTable();
151  }
152 
153  return;
154 }
edm::service::PrescaleService * ps_
Prescale service.
edm::ESGetToken< trigger::HLTPrescaleTableCond, HLTPrescaleTableRcd > const hltPrescaleTableCondToken_
const PrescaleTable_t & getPrescaleTable() const
ModuleDescription const & moduleDescription() const
edm::EDGetTokenT< trigger::HLTPrescaleTable > hltInputToken_
InputToken of HLTPrescaleTable product (src=1,2,3)
The single EDProduct containing the HLT Prescale Table.
unsigned int getLvl1IndexDefault() const
Log< level::Error, false > LogError
bool getData(T &iHolder) const
Definition: EventSetup.h:122
trigger::HLTPrescaleTable hlt_
payload HLT object
ParameterSet const & getProcessParameterSetContainingModule(ModuleDescription const &moduleDescription)
edm::Handle< trigger::HLTPrescaleTable > hltHandle_
Handle and ESHandle for existing HLT object.
const VString_t & getLvl1Labels() const

◆ endLuminosityBlock()

void HLTPrescaleRecorder::endLuminosityBlock ( edm::LuminosityBlock const &  iLumi,
const edm::EventSetup iSetup 
)
final

Definition at line 198 of file HLTPrescaleRecorder.cc.

198 {}

◆ endLuminosityBlockProduce()

void HLTPrescaleRecorder::endLuminosityBlockProduce ( edm::LuminosityBlock iLumi,
const edm::EventSetup iSetup 
)
final

Writing to Lumi Block

Definition at line 200 of file HLTPrescaleRecorder.cc.

References hlt_, lumi_, eostools::move(), and edm::LuminosityBlock::put().

200  {
201  if (lumi_) {
203  unique_ptr<HLTPrescaleTable> product(new HLTPrescaleTable(hlt_));
204  iLumi.put(std::move(product), "Lumi");
205  }
206  return;
207 }
The single EDProduct containing the HLT Prescale Table.
void put(std::unique_ptr< PROD > product)
Put a new product.
trigger::HLTPrescaleTable hlt_
payload HLT object
def move(src, dest)
Definition: eostools.py:511

◆ endRun()

void HLTPrescaleRecorder::endRun ( edm::Run const &  iRun,
const edm::EventSetup iSetup 
)
final

Dump to logfile

Writing to CondDB (needs PoolDBOutputService)

Definition at line 209 of file HLTPrescaleRecorder.cc.

References condDB_, db_, hlt_, mps_fire::i, SummaryClient_cfi::labels, trigger::HLTPrescaleTable::labels(), genParticles_cff::map, dqmiodumpmetadata::n, trigger::HLTPrescaleTable::size(), trigger::HLTPrescaleTable::table(), TableParser::table, edm::Timestamp::value(), and cond::service::PoolDBOutputService::writeOneIOV().

209  {
211  ostringstream oss;
212  const unsigned int n(hlt_.size());
213  oss << "PrescaleTable: # of labels = " << n << endl;
214  const vector<string>& labels(hlt_.labels());
215  for (unsigned int i = 0; i != n; ++i) {
216  oss << " " << i << "/'" << labels.at(i) << "'";
217  }
218  oss << endl;
219  const map<string, vector<unsigned int> >& table(hlt_.table());
220  oss << "PrescaleTable: # of paths = " << table.size() << endl;
221  const map<string, vector<unsigned int> >::const_iterator tb(table.begin());
222  const map<string, vector<unsigned int> >::const_iterator te(table.end());
223  for (map<string, vector<unsigned int> >::const_iterator ti = tb; ti != te; ++ti) {
224  for (unsigned int i = 0; i != n; ++i) {
225  oss << " " << ti->second.at(i);
226  }
227  oss << " " << ti->first << endl;
228  }
229  LogVerbatim("HLTPrescaleRecorder") << oss.str();
230 
231  if (condDB_) {
233  if (db_ != nullptr) {
234  HLTPrescaleTableCond product(hlt_);
235  ::timeval tv;
236  gettimeofday(&tv, nullptr);
237  edm::Timestamp tstamp((unsigned long long)tv.tv_sec);
238  db_->writeOneIOV(product, tstamp.value(), "HLTPrescaleTableRcd");
239  } else {
240  LogError("HLTPrescaleRecorder") << "PoolDBOutputService not available!";
241  }
242  }
243 
244  return;
245 }
Log< level::Info, true > LogVerbatim
const std::vector< std::string > & labels() const
Log< level::Error, false > LogError
const std::map< std::string, std::vector< unsigned int > > & table() const
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
cond::service::PoolDBOutputService * db_
Pool DB service.
trigger::HLTPrescaleTable hlt_
payload HLT object
unsigned int size() const
consistency condition: all vectors must have the same length

◆ endRunProduce()

void HLTPrescaleRecorder::endRunProduce ( edm::Run iRun,
const edm::EventSetup iSetup 
)
final

Writing to Run Block

Definition at line 247 of file HLTPrescaleRecorder.cc.

References hlt_, eostools::move(), edm::Run::put(), and run_.

247  {
248  if (run_) {
250  unique_ptr<HLTPrescaleTable> product(new HLTPrescaleTable(hlt_));
251  iRun.put(std::move(product), "Run");
252  }
253 }
The single EDProduct containing the HLT Prescale Table.
trigger::HLTPrescaleTable hlt_
payload HLT object
void put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Run.h:109
bool run_
(Multiple) Destinations
def move(src, dest)
Definition: eostools.py:511

◆ fillDescriptions()

void HLTPrescaleRecorder::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 83 of file HLTPrescaleRecorder.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_2022v11_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

83  {
85  // # (single) source:
86  // # -1:PrescaleServicePSet, 0:PrescaleService,
87  // # 1:Run, 2:Lumi, 3:Event, 4:CondDB
88  desc.add<int>("src", 0);
89  // # (multiple) destinations
90  desc.add<bool>("run", true);
91  desc.add<bool>("lumi", true);
92  desc.add<bool>("event", true);
93  desc.add<bool>("condDB", true);
94  // # src=-1
95  desc.add<std::string>("psetName", "");
96  // # src= 1,2,3
97  desc.add<edm::InputTag>("hltInputTag", edm::InputTag("", "", ""));
98  // # src= 4
99  desc.add<std::string>("hltDBTag", "");
100  //
101  descriptions.add("hltPrescaleRecorder", desc);
102 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void HLTPrescaleRecorder::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
finalvirtual

From Event Block

Writing to Event

Implements edm::one::EDProducerBase.

Definition at line 179 of file HLTPrescaleRecorder.cc.

References event_, hlt_, hltHandle_, hltInputToken_, iEvent, eostools::move(), and src_.

179  {
180  if (src_ == 3) {
182  if (iEvent.getByToken(hltInputToken_, hltHandle_)) {
183  hlt_ = *hltHandle_;
184  } else {
186  LogError("HLTPrescaleRecorder") << "HLTPrescaleTable not found in Event!";
187  }
188  }
189 
190  if (event_) {
192  unique_ptr<HLTPrescaleTable> product(new HLTPrescaleTable(hlt_));
193  iEvent.put(std::move(product), "Event");
194  }
195 
196  return;
197 }
edm::EDGetTokenT< trigger::HLTPrescaleTable > hltInputToken_
InputToken of HLTPrescaleTable product (src=1,2,3)
The single EDProduct containing the HLT Prescale Table.
Log< level::Error, false > LogError
int iEvent
Definition: GenABIO.cc:224
trigger::HLTPrescaleTable hlt_
payload HLT object
edm::Handle< trigger::HLTPrescaleTable > hltHandle_
Handle and ESHandle for existing HLT object.
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ condDB_

bool HLTPrescaleRecorder::condDB_
private

Definition at line 69 of file HLTPrescaleRecorder.h.

Referenced by endRun(), and HLTPrescaleRecorder().

◆ db_

cond::service::PoolDBOutputService* HLTPrescaleRecorder::db_
private

Pool DB service.

Definition at line 85 of file HLTPrescaleRecorder.h.

Referenced by endRun(), and HLTPrescaleRecorder().

◆ event_

bool HLTPrescaleRecorder::event_
private

Definition at line 68 of file HLTPrescaleRecorder.h.

Referenced by HLTPrescaleRecorder(), and produce().

◆ hlt_

trigger::HLTPrescaleTable HLTPrescaleRecorder::hlt_
private

payload HLT object

Definition at line 91 of file HLTPrescaleRecorder.h.

Referenced by beginLuminosityBlock(), beginRun(), endLuminosityBlockProduce(), endRun(), endRunProduce(), and produce().

◆ hltDBTag_

std::string HLTPrescaleRecorder::hltDBTag_
private

Tag of DB entry (HLT Key Name) (src=4)

Definition at line 79 of file HLTPrescaleRecorder.h.

Referenced by HLTPrescaleRecorder().

◆ hltHandle_

edm::Handle<trigger::HLTPrescaleTable> HLTPrescaleRecorder::hltHandle_
private

Handle and ESHandle for existing HLT object.

Definition at line 88 of file HLTPrescaleRecorder.h.

Referenced by beginLuminosityBlock(), beginRun(), and produce().

◆ hltInputTag_

edm::InputTag HLTPrescaleRecorder::hltInputTag_
private

InputTag of HLTPrescaleTable product (src=1,2,3)

Definition at line 75 of file HLTPrescaleRecorder.h.

Referenced by HLTPrescaleRecorder().

◆ hltInputToken_

edm::EDGetTokenT<trigger::HLTPrescaleTable> HLTPrescaleRecorder::hltInputToken_
private

InputToken of HLTPrescaleTable product (src=1,2,3)

Definition at line 77 of file HLTPrescaleRecorder.h.

Referenced by beginLuminosityBlock(), beginRun(), HLTPrescaleRecorder(), and produce().

◆ hltPrescaleTableCondToken_

edm::ESGetToken<trigger::HLTPrescaleTableCond, HLTPrescaleTableRcd> const HLTPrescaleRecorder::hltPrescaleTableCondToken_
private

Definition at line 80 of file HLTPrescaleRecorder.h.

Referenced by beginRun().

◆ lumi_

bool HLTPrescaleRecorder::lumi_
private

Definition at line 67 of file HLTPrescaleRecorder.h.

Referenced by endLuminosityBlockProduce(), and HLTPrescaleRecorder().

◆ ps_

edm::service::PrescaleService* HLTPrescaleRecorder::ps_
private

Prescale service.

Definition at line 83 of file HLTPrescaleRecorder.h.

Referenced by beginLuminosityBlock(), beginRun(), and HLTPrescaleRecorder().

◆ psetName_

std::string HLTPrescaleRecorder::psetName_
private

Source configs name of PrescaleServicePSet (src=-1)

Definition at line 73 of file HLTPrescaleRecorder.h.

Referenced by beginRun(), and HLTPrescaleRecorder().

◆ run_

bool HLTPrescaleRecorder::run_
private

(Multiple) Destinations

Definition at line 66 of file HLTPrescaleRecorder.h.

Referenced by endRunProduce(), and HLTPrescaleRecorder().

◆ src_

int HLTPrescaleRecorder::src_
private

(Single) source: -1:PrescaleServicePSet 0:PrescaleService, 1:Run, 2:Lumi, 3:Event, 4:CondDB

Definition at line 63 of file HLTPrescaleRecorder.h.

Referenced by beginLuminosityBlock(), beginRun(), HLTPrescaleRecorder(), and produce().