23 using namespace jsoncollector;
26 triggerResults_(ps.getParameter<edm::
InputTag>(
"triggerResults")),
28 level1Results_(ps.getParameter<edm::
InputTag>(
"L1Results")),
44 descriptions.
add(
"triggerJSONMonitoring", desc);
61 LogDebug(
"TriggerJSONMonitoring") <<
"Not Physics, Calibration or Random. experimentType = " << ex << std::endl;
104 if (!HLTR.isValid()) {
111 for (
unsigned int i=0;
i<
n;
i++) {
117 const int index(static_cast<int>(HLTR->index(
i)));
118 if (HLTR->accept(
i)) {
128 std::vector<bool> acceptedByDS(
hltIndex_.size(),
false);
129 for (
unsigned int ds=0; ds <
hltIndex_.size(); ds++) {
131 if (acceptedByDS[ds]>0 || HLTR->accept(
hltIndex_[ds][
p]) ) {
132 acceptedByDS[ds] =
true;
168 int bitNumber = (itAlgo->second).algoBitNumber();
178 int bitNumber = (itAlgo->second).algoBitNumber();
222 for (
unsigned int ds = 0; ds <
d; ds++) {
225 for (
unsigned int p = 0;
p <
size;
p++) {
235 for (
unsigned int i = 0;
i <
n; ++
i) {
239 for (
unsigned int j = 0;
j < moduleLabels.size(); ++
j) {
241 if (label ==
"HLTLevel1GTSeed")
243 else if (label ==
"HLTPrescaler")
322 LogDebug(
"TriggerJSONMonitoring") <<
"HLTConfigProvider initialization failed!" << std::endl;
328 bool expected =
false;
329 if( runCache()->wroteFiles.compare_exchange_strong(expected,
true) ){
330 runCache()->wroteFiles =
true;
332 unsigned int nRun = iRun.
run();
335 std::stringstream ssHltJsd;
336 ssHltJsd <<
"run" << std::setfill(
'0') << std::setw(6) << nRun <<
"_ls0000";
337 ssHltJsd <<
"_streamHLTRates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsd";
343 std::stringstream ssL1Jsd;
344 ssL1Jsd <<
"run" << std::setfill(
'0') << std::setw(6) << nRun <<
"_ls0000";
345 ssL1Jsd <<
"_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsd";
365 hltIni[
"Path-Names"] = hltNamesVal;
366 hltIni[
"Dataset-Names"] = datasetNamesVal;
370 std::stringstream ssHltIni;
371 ssHltIni <<
"run" << std::setfill(
'0') << std::setw(6) << nRun <<
"_ls0000_streamHLTRates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".ini";
373 std::ofstream outHltIni( monPath + ssHltIni.str() );
395 l1Ini[
"L1-Algo-Names"] = l1AlgoNamesVal;
396 l1Ini[
"L1-Tech-Names"] = l1TechNamesVal;
397 l1Ini[
"Event-Type"] = eventTypeVal;
399 result = writer.
write(l1Ini);
401 std::stringstream ssL1Ini;
402 ssL1Ini <<
"run" << std::setfill(
'0') << std::setw(6) << nRun <<
"_ls0000_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".ini";
404 std::ofstream outL1Ini( monPath + ssL1Ini.str() );
417 std::shared_ptr<trigJson::lumiVars>
422 unsigned int MAXPATHS = 1000;
435 iSummary->prescaleIndex = 100;
447 iSummary->baseRunDir =
"";
448 iSummary->stHltJsd =
"";
449 iSummary->stL1Jsd =
"";
450 iSummary->streamL1Destination =
"";
451 iSummary->streamHLTDestination =
"";
452 iSummary->streamL1MergeType =
"";
453 iSummary->streamHLTMergeType =
"";
544 unsigned int iRun = iLumi.
run();
546 bool writeFiles=
true;
558 gethostname(hostname,32);
564 std::stringstream sOutDef;
565 sOutDef << monPath <<
"output_" << getpid() <<
".jsd";
571 hltJsnData[DataPoint::DEFINITION] = iSummary->
stHltJsd;
587 std::stringstream ssHltJsnData;
588 ssHltJsnData <<
"run" << std::setfill(
'0') << std::setw(6) << iRun <<
"_ls" << std::setfill(
'0') << std::setw(4) << iLs;
589 ssHltJsnData <<
"_streamHLTRates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsndata";
592 std::ofstream outHltJsnData( monPath + ssHltJsnData.str() );
594 outHltJsnData.close();
599 IntJ hltJsnFilesize = 0;
600 unsigned int hltJsnFileAdler32 = 1;
602 hltJsnFilelist.
update(ssHltJsnData.str());
603 hltJsnFilesize = result.size();
604 hltJsnFileAdler32 =
cms::Adler32(result.c_str(),result.size());
607 hltJsnInputFiles.
update(
"");
612 l1JsnData[DataPoint::DEFINITION] = iSummary->
stL1Jsd;
624 result = writer.
write(l1JsnData);
626 std::stringstream ssL1JsnData;
627 ssL1JsnData <<
"run" << std::setfill(
'0') << std::setw(6) << iRun <<
"_ls" << std::setfill(
'0') << std::setw(4) << iLs;
628 ssL1JsnData <<
"_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsndata";
631 std::ofstream outL1JsnData( monPath +
"/" + ssL1JsnData.str() );
633 outL1JsnData.close();
638 IntJ l1JsnFilesize = 0;
639 unsigned int l1JsnFileAdler32 = 1;
641 l1JsnFilelist.
update(ssL1JsnData.str());
642 l1JsnFilesize = result.size();
643 l1JsnFileAdler32 =
cms::Adler32(result.c_str(),result.size());
646 l1JsnInputFiles.
update(
"");
653 IntJ daqJsnAccepted = daqJsnProcessed;
654 IntJ daqJsnErrorEvents = 0;
655 IntJ daqJsnRetCodeMask = 0;
656 IntJ daqJsnHLTErrorEvents = 0;
661 hltDaqJsn[DataPoint::DEFINITION] = sOutDef.str();
675 result = writer.
write(hltDaqJsn);
677 std::stringstream ssHltDaqJsn;
678 ssHltDaqJsn <<
"run" << std::setfill(
'0') << std::setw(6) << iRun <<
"_ls" << std::setfill(
'0') << std::setw(4) << iLs;
679 ssHltDaqJsn <<
"_streamHLTRates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsn";
681 std::ofstream outHltDaqJsn( monPath + ssHltDaqJsn.str() );
683 outHltDaqJsn.close();
688 l1DaqJsn[DataPoint::DEFINITION] = sOutDef.str();
702 result = writer.
write(l1DaqJsn);
704 std::stringstream ssL1DaqJsn;
705 ssL1DaqJsn <<
"run" << std::setfill(
'0') << std::setw(6) << iRun <<
"_ls" << std::setfill(
'0') << std::setw(4) << iLs;
706 ssL1DaqJsn <<
"_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsn";
708 std::ofstream outL1DaqJsn( monPath + ssL1DaqJsn.str() );
745 outfile <<
"{" << std::endl;
746 outfile <<
" \"data\" : [" << std::endl;
748 outfile <<
" \"name\" : \"Processed\"," ;
749 outfile <<
" \"type\" : \"integer\"," ;
750 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
753 outfile <<
" \"name\" : \"Path-WasRun\"," ;
754 outfile <<
" \"type\" : \"integer\"," ;
755 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
758 outfile <<
" \"name\" : \"Path-AfterL1Seed\"," ;
759 outfile <<
" \"type\" : \"integer\"," ;
760 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
763 outfile <<
" \"name\" : \"Path-AfterPrescale\"," ;
764 outfile <<
" \"type\" : \"integer\"," ;
765 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
768 outfile <<
" \"name\" : \"Path-Accepted\"," ;
769 outfile <<
" \"type\" : \"integer\"," ;
770 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
773 outfile <<
" \"name\" : \"Path-Rejected\"," ;
774 outfile <<
" \"type\" : \"integer\"," ;
775 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
778 outfile <<
" \"name\" : \"Path-Errors\"," ;
779 outfile <<
" \"type\" : \"integer\"," ;
780 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
783 outfile <<
" \"name\" : \"Dataset-Accepted\"," ;
784 outfile <<
" \"type\" : \"integer\"," ;
785 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
788 outfile <<
" \"name\" : \"Prescale-Index\"," ;
789 outfile <<
" \"type\" : \"integer\"," ;
790 outfile <<
" \"operation\" : \"sample\"}" << std::endl;
792 outfile <<
" ]" << std::endl;
793 outfile <<
"}" << std::endl;
803 outfile <<
"{" << std::endl;
804 outfile <<
" \"data\" : [" << std::endl;
806 outfile <<
" \"name\" : \"Processed\"," ;
807 outfile <<
" \"type\" : \"integer\"," ;
808 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
811 outfile <<
" \"name\" : \"L1-AlgoAccepted\"," ;
812 outfile <<
" \"type\" : \"integer\"," ;
813 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
816 outfile <<
" \"name\" : \"L1-TechAccepted\"," ;
817 outfile <<
" \"type\" : \"integer\"," ;
818 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
821 outfile <<
" \"name\" : \"L1-AlgoAccepted-Physics\"," ;
822 outfile <<
" \"type\" : \"integer\"," ;
823 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
826 outfile <<
" \"name\" : \"L1-TechAccepted-Physics\"," ;
827 outfile <<
" \"type\" : \"integer\"," ;
828 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
831 outfile <<
" \"name\" : \"L1-AlgoAccepted-Calibration\"," ;
832 outfile <<
" \"type\" : \"integer\"," ;
833 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
836 outfile <<
" \"name\" : \"L1-TechAccepted-Calibration\"," ;
837 outfile <<
" \"type\" : \"integer\"," ;
838 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
841 outfile <<
" \"name\" : \"L1-AlgoAccepted-Random\"," ;
842 outfile <<
" \"type\" : \"integer\"," ;
843 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
846 outfile <<
" \"name\" : \"L1-TechAccepted-Random\"," ;
847 outfile <<
" \"type\" : \"integer\"," ;
848 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
851 outfile <<
" \"name\" : \"L1-Global\"," ;
852 outfile <<
" \"type\" : \"integer\"," ;
853 outfile <<
" \"operation\" : \"histo\"}" << std::endl;
855 outfile <<
" ]" << std::endl;
856 outfile <<
"}" << std::endl;
TriggerJSONMonitoring(const edm::ParameterSet &)
void resetRun(bool changed)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
jsoncollector::HistoJ< unsigned int > * hltPre
unsigned int prescaleIndex_
const std::string moduleType(const std::string &module) const
C++ class name of module.
static std::shared_ptr< trigJson::lumiVars > globalBeginLuminosityBlockSummary(edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
jsoncollector::HistoJ< unsigned int > * processed
jsoncollector::HistoJ< unsigned int > * hltDatasets
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< unsigned int > hltDatasets_
jsoncollector::HistoJ< unsigned int > * L1TechAccept
std::string streamHLTMergeType
unsigned int prescaleIndex
std::vector< unsigned int > L1AlgoAccept_
static void globalEndLuminosityBlockSummary(edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, trigJson::lumiVars *)
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::vector< unsigned int > L1AlgoAcceptPhysics_
bool shouldWriteFiles(unsigned int lumi, unsigned int *proc=0)
jsoncollector::HistoJ< unsigned int > * L1Global
Value & append(const Value &value)
Append value to array at the end.
void update(std::string const &newStr)
std::vector< unsigned int > hltErrors_
std::vector< unsigned int > L1TechAcceptRandom_
void beginRun(edm::Run const &, edm::EventSetup const &)
jsoncollector::HistoJ< unsigned int > * L1TechAcceptCalibration
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1t_results
std::vector< unsigned int > hltL1s_
std::vector< unsigned int > L1TechAcceptCalibration_
const L1GtTriggerMenu * m_l1GtMenu
std::vector< unsigned int > L1AlgoAcceptRandom_
virtual Json::Value toJsonValue() const
std::vector< std::vector< unsigned int > > hltIndex_
LuminosityBlockNumber_t luminosityBlock() const
std::vector< T > & value()
jsoncollector::HistoJ< unsigned int > * L1AlgoAccept
triggerResultsToken_(consumes< edm::TriggerResults >(edm::InputTag("TriggerResults")))
std::vector< unsigned int > hltAccept_
LuminosityBlockNumber_t luminosityBlock() const
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
AlgorithmMap algorithmMap
jsoncollector::HistoJ< unsigned int > * L1AlgoAcceptRandom
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
std::vector< std::string > hltNames_
HLTConfigProvider hltConfig_
jsoncollector::HistoJ< unsigned int > * L1AlgoAcceptPhysics
std::string streamHLTDestination
const L1GtTriggerMask * m_l1tTechMask
std::vector< std::string > datasetNames_
std::string streamL1MergeType
std::vector< std::string > L1GlobalType_
std::vector< unsigned int > hltReject_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
jsoncollector::HistoJ< unsigned int > * L1TechAcceptRandom
virtual std::string write(const Value &root)
Serialize a Value in JSON format.
std::vector< int > posL1s_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
std::vector< std::string > L1AlgoNames_
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
jsoncollector::HistoJ< unsigned int > * hltWasRun
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)
EventAuxiliary const & eventAuxiliary() const
jsoncollector::HistoJ< unsigned int > * hltErrors
std::vector< unsigned int > L1TechAccept_
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
T const * product() const
const L1GtTriggerMask * m_l1tAlgoMask
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void writeDefJson(std::string path)
std::vector< unsigned int > L1Global_
const std::vector< std::vector< std::string > > & datasetContents() const
names of trigger paths for all datasets
std::vector< unsigned int > hltWasRun_
jsoncollector::HistoJ< unsigned int > * hltL1s
jsoncollector::HistoJ< unsigned int > * hltReject
std::vector< std::vector< std::string > > datasetContents_
< trclass="colgroup">< tdclass="colgroup"colspan=5 > DT local reconstruction</td ></tr >< tr >< td >< ahref="classDTRecHit1DPair.html"> DTRecHit1DPair</a ></td >< td >< ahref="DataFormats_DTRecHit.html"> edm::RangeMap & lt
std::vector< int > posPre_
edm::EventAuxiliary::ExperimentType experimentType() const
std::string streamL1Destination
std::vector< unsigned int > L1TechAcceptPhysics_
jsoncollector::HistoJ< unsigned int > * hltAccept
edm::InputTag triggerResults_
std::vector< std::string > L1TechNames_
std::vector< unsigned int > L1AlgoAcceptCalibration_
void analyze(edm::Event const &, edm::EventSetup const &)
jsoncollector::HistoJ< unsigned int > * L1TechAcceptPhysics
unsigned int oldPrescaleIndex
Writes a Value in JSON format in a human friendly way.
void writeL1DefJson(std::string path)
tuple size
Write out results.
AlgorithmMap technicalMap
const std::vector< std::string > & datasetNames() const
std::vector< unsigned int > hltPre_
jsoncollector::HistoJ< unsigned int > * L1AlgoAcceptCalibration
array value (ordered list)
void endLuminosityBlockSummary(edm::LuminosityBlock const &, edm::EventSetup const &, trigJson::lumiVars *) const