36 src_(ps.getParameter<
int>(
"src")),
37 run_(ps.getParameter<
bool>(
"run")),
38 lumi_(ps.getParameter<
bool>(
"lumi")),
40 condDB_(ps.getParameter<
bool>(
"condDB")),
41 psetName_(ps.getParameter<
string>(
"psetName")),
42 hltInputTag_(ps.getParameter<
InputTag>(
"hltInputTag")),
44 hltDBTag_(ps.getParameter<
string>(
"hltDBTag")),
63 <<
"src:run-lumi-event-condDB+psetName+tags: " 71 LogError(
"HLTPrescaleRecorder")<<
"PrescaleService requested as source but unavailable!";
77 LogError(
"HLTPrescaleRecorder")<<
"PoolDBOutputService requested as destination but unavailable!";
80 if (
run_) produces<HLTPrescaleTable,edm::Transition::EndRun>(
"Run");
81 if (
lumi_) produces<HLTPrescaleTable,edm::Transition::EndLuminosityBlock>(
"Lumi");
82 if (
event_) produces<HLTPrescaleTable,edm::Transition::Event>(
"Event");
97 desc.
add<
int>(
"src",0);
99 desc.
add<
bool>(
"run",
true);
100 desc.
add<
bool>(
"lumi",
true);
101 desc.
add<
bool>(
"event",
true);
102 desc.
add<
bool>(
"condDB",
true);
110 descriptions.
add(
"hltPrescaleRecorder", desc);
124 vector<ParameterSet> vpTable(iPS.
getParameter<std::vector<ParameterSet> >(
"prescaleTable"));
127 const unsigned int n(labels.size());
128 for (
unsigned int i=0;
i!=
n; ++
i) {
129 if (labels[
i]==defaultLabel)
set=
i;
132 map<string,vector<unsigned int> > table;
133 const unsigned int m (vpTable.size());
134 for (
unsigned int i=0;
i!=
m; ++
i) {
135 table[vpTable[
i].getParameter<
std::string>(
"pathName")] =
136 vpTable[
i].getParameter<std::vector<unsigned int> >(
"prescales");
140 }
else if (
src_==0) {
147 LogError(
"HLTPrescaleRecorder")<<
"PrescaleService not found!";
149 }
else if (
src_==1) {
154 LogError(
"HLTPrescaleRecorder")<<
"HLTPrescaleTable not found in Run!";
156 }
else if (
src_==4) {
175 LogError(
"HLTPrescaleRecorder")<<
"PrescaleService not found!";
177 }
else if (
src_==2) {
183 LogError(
"HLTPrescaleRecorder")<<
"HLTPrescaleTable not found in LumiBlock!";
198 LogError(
"HLTPrescaleRecorder")<<
"HLTPrescaleTable not found in Event!";
228 oss <<
"PrescaleTable: # of labels = " <<
n << endl;
230 for (
unsigned int i=0;
i!=
n; ++
i) {
231 oss <<
" " <<
i <<
"/'" <<
labels.at(
i) <<
"'";
234 const map<string,vector<unsigned int> >& table(
hlt_.
table());
235 oss <<
"PrescaleTable: # of paths = " << table.size() << endl;
236 const map<string,vector<unsigned int> >::const_iterator tb(table.begin());
237 const map<string,vector<unsigned int> >::const_iterator te(table.end());
238 for (
map<
string,vector<unsigned int> >::const_iterator ti=tb; ti!=te; ++ti) {
239 for (
unsigned int i=0;
i!=
n; ++
i) {
240 oss <<
" " << ti->second.at(
i);
242 oss <<
" " << ti->first << endl;
250 const string rcdName(
"HLTPrescaleTableRcd");
256 gettimeofday(&tv,
nullptr);
264 LogError(
"HLTPrescaleRecorder") <<
"PoolDBOutputService not available!";
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void endRunProduce(edm::Run &iRun, const edm::EventSetup &iSetup) final
void endRun(edm::Run const &iRun, const edm::EventSetup &iSetup) final
edm::service::PrescaleService * ps_
Prescale service.
unsigned int getLvl1IndexDefault() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< trigger::HLTPrescaleTable > hltInputToken_
InputToken of HLTPrescaleTable product (src=1,2,3)
The single EDProduct containing the HLT Prescale Table.
std::string hltDBTag_
Tag of DB entry (HLT Key Name) (src=4)
const PrescaleTable_t & getPrescaleTable() const
ModuleDescription const & moduleDescription() const
const std::map< std::string, std::vector< unsigned int > > & table() const
edm::ESHandle< trigger::HLTPrescaleTableCond > hltESHandle_
void beginLuminosityBlock(edm::LuminosityBlock const &iLumi, const edm::EventSetup &iSetup) final
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
ParameterSet const & getProcessParameterSetContainingModule(ModuleDescription const &moduleDescription)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) final
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
bool isNewTagRequest(const std::string &recordName)
void endLuminosityBlockProduce(edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) final
const std::vector< std::string > & labels() const
~HLTPrescaleRecorder() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void beginRun(edm::Run const &iRun, const edm::EventSetup &iSetup) final
void put(std::unique_ptr< PROD > product)
Put a new product.
cond::Time_t beginOfTime() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
cond::service::PoolDBOutputService * db_
Pool DB service.
trigger::HLTPrescaleTable hlt_
payload HLT object
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
void endLuminosityBlock(edm::LuminosityBlock const &iLumi, const edm::EventSetup &iSetup) final
const VString_t & getLvl1Labels() const
void put(std::unique_ptr< PROD > product)
Put a new product.
void add(std::string const &label, ParameterSetDescription const &psetDescription)
cond::Time_t endOfTime() const
edm::Handle< trigger::HLTPrescaleTable > hltHandle_
Handle and ESHandle for existing HLT object.
bool run_
(Multiple) Destinations
HLTPrescaleRecorder(const edm::ParameterSet &)
const trigger::HLTPrescaleTable & hltPrescaleTable() const
trivial const accessor
unsigned int size() const
consistency condition: all vectors must have the same length
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
TimeValue_t value() const
edm::InputTag hltInputTag_
InputTag of HLTPrescaleTable product (src=1,2,3)