30 using namespace trigger;
36 src_(ps.getParameter<int>(
"src")),
37 run_(ps.getParameter<bool>(
"run")),
38 lumi_(ps.getParameter<bool>(
"lumi")),
39 event_(ps.getParameter<bool>(
"event")),
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::InRun>(
"Run");
81 if (
lumi_) produces<HLTPrescaleTable,edm::InLumi>(
"Lumi");
82 if (
event_) produces<HLTPrescaleTable,edm::InEvent>(
"Event");
99 desc.
add<
int>(
"src",0);
101 desc.
add<
bool>(
"run",
true);
102 desc.
add<
bool>(
"lumi",
true);
103 desc.
add<
bool>(
"event",
true);
104 desc.
add<
bool>(
"condDB",
true);
112 descriptions.
add(
"hltPrescaleRecorder", desc);
126 vector<ParameterSet> vpTable(iPS.
getParameter<std::vector<ParameterSet> >(
"prescaleTable"));
129 const unsigned int n(labels.size());
130 for (
unsigned int i=0;
i!=
n; ++
i) {
131 if (labels[
i]==defaultLabel) set=
i;
134 map<string,vector<unsigned int> >
table;
135 const unsigned int m (vpTable.size());
136 for (
unsigned int i=0;
i!=
m; ++
i) {
137 table[vpTable[
i].getParameter<
std::string>(
"pathName")] =
138 vpTable[
i].getParameter<std::vector<unsigned int> >(
"prescales");
142 }
else if (
src_==0) {
149 LogError(
"HLTPrescaleRecorder")<<
"PrescaleService not found!";
151 }
else if (
src_==1) {
156 LogError(
"HLTPrescaleRecorder")<<
"HLTPrescaleTable not found in Run!";
158 }
else if (
src_==4) {
177 LogError(
"HLTPrescaleRecorder")<<
"PrescaleService not found!";
179 }
else if (
src_==2) {
185 LogError(
"HLTPrescaleRecorder")<<
"HLTPrescaleTable not found in LumiBlock!";
200 LogError(
"HLTPrescaleRecorder")<<
"HLTPrescaleTable not found in Event!";
207 iEvent.
put(product,
"Event");
220 iLumi.
put(product,
"Lumi");
230 oss <<
"PrescaleTable: # of labels = " <<
n << endl;
232 for (
unsigned int i=0;
i!=
n; ++
i) {
233 oss <<
" " <<
i <<
"/'" <<
labels.at(
i) <<
"'";
237 oss <<
"PrescaleTable: # of paths = " <<
table.size() << endl;
238 const map<string,vector<unsigned int> >::const_iterator tb(
table.begin());
239 const map<string,vector<unsigned int> >::const_iterator te(
table.end());
240 for (
map<
string,vector<unsigned int> >::const_iterator ti=tb; ti!=te; ++ti) {
241 for (
unsigned int i=0;
i!=
n; ++
i) {
242 oss <<
" " << ti->second.at(
i);
244 oss <<
" " << ti->first << endl;
252 const string rcdName(
"HLTPrescaleTableRcd");
266 LogError(
"HLTPrescaleRecorder") <<
"PoolDBOutputService not available!";
277 iRun.
put(product,
"Run");
T getParameter(std::string const &) const
virtual void endRunProduce(edm::Run &iRun, const edm::EventSetup &iSetup) overridefinal
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
virtual void beginRun(edm::Run const &iRun, const edm::EventSetup &iSetup) overridefinal
ModuleDescription const & moduleDescription() const
const std::map< std::string, std::vector< unsigned int > > & table() const
edm::ESHandle< trigger::HLTPrescaleTableCond > hltESHandle_
virtual void beginLuminosityBlock(edm::LuminosityBlock const &iLumi, const edm::EventSetup &iSetup) overridefinal
ParameterSet const & getProcessParameterSetContainingModule(ModuleDescription const &moduleDescription)
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) overridefinal
virtual void endRun(edm::Run const &iRun, const edm::EventSetup &iSetup) overridefinal
bool isNewTagRequest(const std::string &recordName)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void endLuminosityBlockProduce(edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) overridefinal
const std::vector< std::string > & labels() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
cond::Time_t beginOfTime() const
void get(HolderT &iHolder) 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)
const VString_t & getLvl1Labels() const
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.
virtual ~HLTPrescaleRecorder()
bool run_
(Multiple) Destinations
HLTPrescaleRecorder(const edm::ParameterSet &)
void put(std::auto_ptr< PROD > product)
Put a new product.
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)
void put(std::auto_ptr< PROD > product)
Put a new product.
virtual void endLuminosityBlock(edm::LuminosityBlock const &iLumi, const edm::EventSetup &iSetup) overridefinal