25 triggerResults_(ps.getParameter<
edm::InputTag>(
"triggerResults")),
26 triggerResultsToken_(consumes<
edm::TriggerResults>(triggerResults_))
38 descriptions.
add(
"HLTriggerJSONMonitoring", desc);
59 for (
unsigned int i=0;
i<
n;
i++) {
76 std::vector<bool> acceptedByDS(
hltIndex_.size(),
false);
77 for (
unsigned int ds=0; ds <
hltIndex_.size(); ds++) {
80 acceptedByDS[ds] =
true;
115 for (
unsigned int ds = 0; ds <
d; ds++) {
118 for (
unsigned int p = 0;
p <
size;
p++) {
128 for (
unsigned int i = 0;
i <
n; ++
i) {
132 for (
unsigned int j = 0; j < moduleLabels.size(); ++j) {
134 if (label ==
"HLTL1TSeed")
136 else if (label ==
"HLTPrescaler")
178 LogDebug(
"HLTriggerJSONMonitoring") <<
"HLTConfigProvider initialization failed!" << std::endl;
184 bool expected =
false;
185 if( runCache()->wroteFiles.compare_exchange_strong(expected,
true) ){
186 runCache()->wroteFiles =
true;
188 unsigned int nRun = iRun.
run();
191 std::stringstream ssHltJsd;
192 ssHltJsd <<
"run" << std::setfill(
'0') << std::setw(6) << nRun <<
"_ls0000";
193 ssHltJsd <<
"_streamHLTRates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsd";
205 hltNamesVal.
append(hltName);
213 hltIni[
"Path-Names"] = hltNamesVal;
214 hltIni[
"Dataset-Names"] = datasetNamesVal;
218 std::stringstream ssHltIni;
219 ssHltIni <<
"run" << std::setfill(
'0') << std::setw(6) << nRun <<
"_ls0000_streamHLTRates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".ini";
221 std::ofstream outHltIni( monPath + ssHltIni.str() );
230 std::shared_ptr<hltJson::lumiVars>
235 unsigned int MAXPATHS = 1000;
248 iSummary->baseRunDir =
"";
249 iSummary->stHltJsd =
"";
250 iSummary->streamHLTDestination =
"";
251 iSummary->streamHLTMergeType =
"";
306 unsigned int iRun = iLumi.
run();
308 bool writeFiles=
true;
320 gethostname(hostname,32);
326 std::stringstream sOutDef;
327 sOutDef << monPath <<
"output_" << getpid() <<
".jsd";
332 hltJsnData[DataPoint::SOURCE] = sourceHost;
333 hltJsnData[DataPoint::DEFINITION] = iSummary->
stHltJsd;
347 std::stringstream ssHltJsnData;
348 ssHltJsnData <<
"run" << std::setfill(
'0') << std::setw(6) << iRun <<
"_ls" << std::setfill(
'0') << std::setw(4) << iLs;
349 ssHltJsnData <<
"_streamHLTRates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsndata";
352 std::ofstream outHltJsnData( monPath + ssHltJsnData.str() );
354 outHltJsnData.close();
359 IntJ hltJsnFilesize = 0;
360 unsigned int hltJsnFileAdler32 = 1;
362 hltJsnFilelist.
update(ssHltJsnData.str());
363 hltJsnFilesize = result.size();
364 hltJsnFileAdler32 =
cms::Adler32(result.c_str(),result.size());
367 hltJsnInputFiles.
update(
"");
373 IntJ daqJsnAccepted = daqJsnProcessed;
374 IntJ daqJsnErrorEvents = 0;
375 IntJ daqJsnRetCodeMask = 0;
376 IntJ daqJsnHLTErrorEvents = 0;
380 hltDaqJsn[DataPoint::SOURCE] = sourceHost;
381 hltDaqJsn[DataPoint::DEFINITION] = sOutDef.str();
395 result = writer.
write(hltDaqJsn);
397 std::stringstream ssHltDaqJsn;
398 ssHltDaqJsn <<
"run" << std::setfill(
'0') << std::setw(6) << iRun <<
"_ls" << std::setfill(
'0') << std::setw(4) << iLs;
399 ssHltDaqJsn <<
"_streamHLTRates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsn";
401 std::ofstream outHltDaqJsn( monPath + ssHltDaqJsn.str() );
403 outHltDaqJsn.close();
425 iSummary->
hltL1s =
nullptr;
426 iSummary->
hltPre =
nullptr;
440 outfile <<
"{" << std::endl;
441 outfile <<
" \"data\" : [" << std::endl;
443 outfile <<
" \"name\" : \"Processed\"," ;
444 outfile <<
" \"type\" : \"integer\"," ;
445 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
448 outfile <<
" \"name\" : \"Path-WasRun\"," ;
449 outfile <<
" \"type\" : \"integer\"," ;
450 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
453 outfile <<
" \"name\" : \"Path-AfterL1Seed\"," ;
454 outfile <<
" \"type\" : \"integer\"," ;
455 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
458 outfile <<
" \"name\" : \"Path-AfterPrescale\"," ;
459 outfile <<
" \"type\" : \"integer\"," ;
460 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
463 outfile <<
" \"name\" : \"Path-Accepted\"," ;
464 outfile <<
" \"type\" : \"integer\"," ;
465 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
468 outfile <<
" \"name\" : \"Path-Rejected\"," ;
469 outfile <<
" \"type\" : \"integer\"," ;
470 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
473 outfile <<
" \"name\" : \"Path-Errors\"," ;
474 outfile <<
" \"type\" : \"integer\"," ;
475 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
478 outfile <<
" \"name\" : \"Dataset-Accepted\"," ;
479 outfile <<
" \"type\" : \"integer\"," ;
480 outfile <<
" \"operation\" : \"histo\"}" << std::endl;
482 outfile <<
" ]" << std::endl;
483 outfile <<
"}" << std::endl;
std::vector< std::string > hltNames_
HLTConfigProvider hltConfig_
bool wasrun() const
Was at least one path run?
std::string streamHLTMergeType
jsoncollector::HistoJ< unsigned int > * hltAccept
const std::string moduleType(const std::string &module) const
C++ class name of module.
void endLuminosityBlockSummary(edm::LuminosityBlock const &, edm::EventSetup const &, hltJson::lumiVars *) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< int > posL1s_
std::vector< unsigned int > hltDatasets_
static void globalEndLuminosityBlockSummary(edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, hltJson::lumiVars *)
HLTriggerJSONMonitoring(const edm::ParameterSet &)
bool accept() const
Has at least one path accepted the event?
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::vector< unsigned int > hltPre_
bool shouldWriteFiles(unsigned int lumi, unsigned int *proc=0)
Value & append(const Value &value)
Append value to array at the end.
void update(std::string const &newStr)
std::vector< unsigned int > hltAccept_
std::vector< unsigned int > hltReject_
std::vector< int > posPre_
jsoncollector::HistoJ< unsigned int > * hltWasRun
virtual Json::Value toJsonValue() const
static std::shared_ptr< hltJson::lumiVars > globalBeginLuminosityBlockSummary(edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
std::vector< T > & value()
LuminosityBlockNumber_t luminosityBlock() const
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
std::vector< std::vector< unsigned int > > hltIndex_
void beginRun(edm::Run const &, edm::EventSetup const &)
jsoncollector::HistoJ< unsigned int > * hltDatasets
edm::InputTag triggerResults_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
unsigned int index(const unsigned int i) const
Get index (slot position) of module giving the decision of the ith path.
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
~HLTriggerJSONMonitoring()
bool error() const
Has any path encountered an error (exception)
std::vector< unsigned int > hltL1s_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::string streamHLTDestination
virtual std::string write(const Value &root)
Serialize a Value in JSON format.
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)
void resetRun(bool changed)
jsoncollector::HistoJ< unsigned int > * hltPre
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
std::vector< std::string > datasetNames_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< unsigned int > hltWasRun_
const std::vector< std::vector< std::string > > & datasetContents() const
names of trigger paths for all datasets
jsoncollector::HistoJ< unsigned int > * hltErrors
jsoncollector::HistoJ< unsigned int > * processed
void writeHLTDefJson(std::string path)
std::vector< unsigned int > hltErrors_
void analyze(edm::Event const &, edm::EventSetup const &)
Writes a Value in JSON format in a human friendly way.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
jsoncollector::HistoJ< unsigned int > * hltL1s
jsoncollector::HistoJ< unsigned int > * hltReject
const std::vector< std::string > & datasetNames() const
array value (ordered list)
std::vector< std::vector< std::string > > datasetContents_