43 descriptions.
add(
"triggerJSONMonitoring", desc);
60 LogDebug(
"TriggerJSONMonitoring") <<
"Not Physics, Calibration or Random. experimentType = " << ex << std::endl;
69 const std::vector<bool> & algoword = L1TResults.decisionWord();
71 for (
unsigned int i = 0;
i < algoword.size();
i++){
81 LogWarning(
"TriggerJSONMonitoring")<<
"L1 Algo Trigger Mask size does not match number of L1 Algo Triggers!";
84 const std::vector<bool> & techword = L1TResults.technicalTriggerWord();
86 for (
unsigned int i = 0;
i < techword.size();
i++){
96 LogWarning(
"TriggerJSONMonitoring")<<
"L1 Tech Trigger Mask size does not match number of L1 Tech Triggers!";
102 if (!HLTR.isValid()) {
109 for (
unsigned int i=0;
i<
n;
i++) {
115 const int index(static_cast<int>(HLTR->index(
i)));
116 if (HLTR->accept(
i)) {
126 std::vector<bool> acceptedByDS(
hltIndex_.size(),
false);
127 for (
unsigned int ds=0; ds <
hltIndex_.size(); ds++) {
129 if (acceptedByDS[ds]>0 || HLTR->accept(
hltIndex_[ds][
p]) ) {
130 acceptedByDS[ds] =
true;
164 int bitNumber = (itAlgo->second).algoBitNumber();
174 int bitNumber = (itAlgo->second).algoBitNumber();
218 for (
unsigned int ds = 0; ds <
d; ds++) {
221 for (
unsigned int p = 0;
p <
size;
p++) {
231 for (
unsigned int i = 0;
i <
n; ++
i) {
235 for (
unsigned int j = 0;
j < moduleLabels.size(); ++
j) {
237 if (label ==
"HLTLevel1GTSeed")
239 else if (label ==
"HLTPrescaler")
318 LogDebug(
"TriggerJSONMonitoring") <<
"HLTConfigProvider initialization failed!" << std::endl;
324 bool expected =
false;
325 if( runCache()->wroteFiles.compare_exchange_strong(expected,
true) ){
326 runCache()->wroteFiles =
true;
328 unsigned int nRun = iRun.
run();
331 std::stringstream ssHltJsd;
332 ssHltJsd <<
"run" << std::setfill(
'0') << std::setw(6) << nRun <<
"_ls0000";
333 ssHltJsd <<
"_streamHLTRates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsd";
339 std::stringstream ssL1Jsd;
340 ssL1Jsd <<
"run" << std::setfill(
'0') << std::setw(6) << nRun <<
"_ls0000";
341 ssL1Jsd <<
"_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsd";
361 hltIni[
"Path-Names"] = hltNamesVal;
362 hltIni[
"Dataset-Names"] = datasetNamesVal;
366 std::stringstream ssHltIni;
367 ssHltIni <<
"run" << std::setfill(
'0') << std::setw(6) << nRun <<
"_ls0000_streamHLTRates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".ini";
369 std::ofstream outHltIni( monPath + ssHltIni.str() );
391 l1Ini[
"L1-Algo-Names"] = l1AlgoNamesVal;
392 l1Ini[
"L1-Tech-Names"] = l1TechNamesVal;
393 l1Ini[
"Event-Type"] = eventTypeVal;
395 result = writer.
write(l1Ini);
397 std::stringstream ssL1Ini;
398 ssL1Ini <<
"run" << std::setfill(
'0') << std::setw(6) << nRun <<
"_ls0000_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".ini";
400 std::ofstream outL1Ini( monPath + ssL1Ini.str() );
413 std::shared_ptr<hltJson::lumiVars>
418 unsigned int MAXPATHS = 500;
431 iSummary->prescaleIndex = 100;
443 iSummary->baseRunDir =
"";
444 iSummary->stHltJsd =
"";
445 iSummary->stL1Jsd =
"";
446 iSummary->streamL1Destination =
"";
447 iSummary->streamHLTDestination =
"";
536 unsigned int iRun = iLumi.
run();
538 bool writeFiles=
true;
550 gethostname(hostname,32);
556 std::stringstream sOutDef;
557 sOutDef << monPath <<
"output_" << getpid() <<
".jsd";
563 hltJsnData[DataPoint::DEFINITION] = iSummary->
stHltJsd;
579 std::stringstream ssHltJsnData;
580 ssHltJsnData <<
"run" << std::setfill(
'0') << std::setw(6) << iRun <<
"_ls" << std::setfill(
'0') << std::setw(4) << iLs;
581 ssHltJsnData <<
"_streamHLTRates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsndata";
584 std::ofstream outHltJsnData( monPath + ssHltJsnData.str() );
586 outHltJsnData.close();
591 IntJ hltJsnFilesize = 0;
592 unsigned int hltJsnFileAdler32 = 1;
594 hltJsnFilelist.
update(ssHltJsnData.str());
595 hltJsnFilesize = result.size();
596 hltJsnFileAdler32 =
cms::Adler32(result.c_str(),result.size());
599 hltJsnInputFiles.
update(
"");
604 l1JsnData[DataPoint::DEFINITION] = iSummary->
stL1Jsd;
616 result = writer.
write(l1JsnData);
618 std::stringstream ssL1JsnData;
619 ssL1JsnData <<
"run" << std::setfill(
'0') << std::setw(6) << iRun <<
"_ls" << std::setfill(
'0') << std::setw(4) << iLs;
620 ssL1JsnData <<
"_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsndata";
623 std::ofstream outL1JsnData( monPath +
"/" + ssL1JsnData.str() );
625 outL1JsnData.close();
630 IntJ l1JsnFilesize = 0;
631 unsigned int l1JsnFileAdler32 = 1;
633 l1JsnFilelist.
update(ssL1JsnData.str());
634 l1JsnFilesize = result.size();
635 l1JsnFileAdler32 =
cms::Adler32(result.c_str(),result.size());
638 l1JsnInputFiles.
update(
"");
645 IntJ daqJsnAccepted = daqJsnProcessed;
646 IntJ daqJsnErrorEvents = 0;
647 IntJ daqJsnRetCodeMask = 0;
652 hltDaqJsn[DataPoint::DEFINITION] = sOutDef.str();
664 result = writer.
write(hltDaqJsn);
666 std::stringstream ssHltDaqJsn;
667 ssHltDaqJsn <<
"run" << std::setfill(
'0') << std::setw(6) << iRun <<
"_ls" << std::setfill(
'0') << std::setw(4) << iLs;
668 ssHltDaqJsn <<
"_streamHLTRates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsn";
670 std::ofstream outHltDaqJsn( monPath + ssHltDaqJsn.str() );
672 outHltDaqJsn.close();
677 l1DaqJsn[DataPoint::DEFINITION] = sOutDef.str();
689 result = writer.
write(l1DaqJsn);
691 std::stringstream ssL1DaqJsn;
692 ssL1DaqJsn <<
"run" << std::setfill(
'0') << std::setw(6) << iRun <<
"_ls" << std::setfill(
'0') << std::setw(4) << iLs;
693 ssL1DaqJsn <<
"_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsn";
695 std::ofstream outL1DaqJsn( monPath + ssL1DaqJsn.str() );
732 outfile <<
"{" << std::endl;
733 outfile <<
" \"data\" : [" << std::endl;
735 outfile <<
" \"name\" : \"Processed\"," ;
736 outfile <<
" \"type\" : \"integer\"," ;
737 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
740 outfile <<
" \"name\" : \"Path-WasRun\"," ;
741 outfile <<
" \"type\" : \"integer\"," ;
742 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
745 outfile <<
" \"name\" : \"Path-AfterL1Seed\"," ;
746 outfile <<
" \"type\" : \"integer\"," ;
747 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
750 outfile <<
" \"name\" : \"Path-AfterPrescale\"," ;
751 outfile <<
" \"type\" : \"integer\"," ;
752 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
755 outfile <<
" \"name\" : \"Path-Accepted\"," ;
756 outfile <<
" \"type\" : \"integer\"," ;
757 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
760 outfile <<
" \"name\" : \"Path-Rejected\"," ;
761 outfile <<
" \"type\" : \"integer\"," ;
762 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
765 outfile <<
" \"name\" : \"Path-Errors\"," ;
766 outfile <<
" \"type\" : \"integer\"," ;
767 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
770 outfile <<
" \"name\" : \"Dataset-Accepted\"," ;
771 outfile <<
" \"type\" : \"integer\"," ;
772 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
775 outfile <<
" \"name\" : \"Prescale-Index\"," ;
776 outfile <<
" \"type\" : \"integer\"," ;
777 outfile <<
" \"operation\" : \"sample\"}" << std::endl;
779 outfile <<
" ]" << std::endl;
780 outfile <<
"}" << std::endl;
790 outfile <<
"{" << std::endl;
791 outfile <<
" \"data\" : [" << std::endl;
793 outfile <<
" \"name\" : \"Processed\"," ;
794 outfile <<
" \"type\" : \"integer\"," ;
795 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
798 outfile <<
" \"name\" : \"L1-AlgoAccepted\"," ;
799 outfile <<
" \"type\" : \"integer\"," ;
800 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
803 outfile <<
" \"name\" : \"L1-TechAccepted\"," ;
804 outfile <<
" \"type\" : \"integer\"," ;
805 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
808 outfile <<
" \"name\" : \"L1-AlgoAccepted-Physics\"," ;
809 outfile <<
" \"type\" : \"integer\"," ;
810 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
813 outfile <<
" \"name\" : \"L1-TechAccepted-Physics\"," ;
814 outfile <<
" \"type\" : \"integer\"," ;
815 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
818 outfile <<
" \"name\" : \"L1-AlgoAccepted-Calibration\"," ;
819 outfile <<
" \"type\" : \"integer\"," ;
820 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
823 outfile <<
" \"name\" : \"L1-TechAccepted-Calibration\"," ;
824 outfile <<
" \"type\" : \"integer\"," ;
825 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
828 outfile <<
" \"name\" : \"L1-AlgoAccepted-Random\"," ;
829 outfile <<
" \"type\" : \"integer\"," ;
830 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
833 outfile <<
" \"name\" : \"L1-TechAccepted-Random\"," ;
834 outfile <<
" \"type\" : \"integer\"," ;
835 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
838 outfile <<
" \"name\" : \"L1-Global\"," ;
839 outfile <<
" \"type\" : \"integer\"," ;
840 outfile <<
" \"operation\" : \"histo\"}" << std::endl;
842 outfile <<
" ]" << std::endl;
843 outfile <<
"}" << std::endl;
TriggerJSONMonitoring(const edm::ParameterSet &)
void resetRun(bool changed)
T getParameter(std::string const &) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1t_results
HistoJ< unsigned int > * L1TechAccept
unsigned int prescaleIndex_
unsigned int prescaleIndex
const std::string moduleType(const std::string &module) const
C++ class name of module.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
HistoJ< unsigned int > * hltReject
std::vector< unsigned int > hltDatasets_
static std::shared_ptr< hltJson::lumiVars > globalBeginLuminosityBlockSummary(edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
std::vector< unsigned int > L1AlgoAccept_
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)
HistoJ< unsigned int > * hltErrors
Value & append(const Value &value)
Append value to array at the end.
void update(std::string const &newStr)
HistoJ< unsigned int > * L1AlgoAccept
std::vector< unsigned int > hltErrors_
static void globalEndLuminosityBlockSummary(edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, hltJson::lumiVars *)
std::vector< unsigned int > L1TechAcceptRandom_
void beginRun(edm::Run const &, edm::EventSetup const &)
HistoJ< unsigned int > * processed
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()
HistoJ< unsigned int > * hltAccept
HistoJ< unsigned int > * L1AlgoAcceptCalibration
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
std::string streamL1Destination
tuple path
else: Piece not in the list, fine.
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
edm::InputTag level1Results_
void endLuminosityBlockSummary(edm::LuminosityBlock const &, edm::EventSetup const &, hltJson::lumiVars *) const
std::vector< std::string > hltNames_
HLTConfigProvider hltConfig_
HistoJ< unsigned int > * L1TechAcceptCalibration
const L1GtTriggerMask * m_l1tTechMask
std::vector< std::string > datasetNames_
std::vector< std::string > L1GlobalType_
std::vector< unsigned int > hltReject_
HistoJ< unsigned int > * hltPre
HistoJ< unsigned int > * L1AlgoAcceptRandom
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::string streamHLTDestination
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
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)
EventAuxiliary const & eventAuxiliary() const
int prescaleSet(const edm::Event &iEvent, const edm::EventSetup &iSetup) const
HistoJ< unsigned int > * hltDatasets
HistoJ< unsigned int > * L1TechAcceptRandom
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_
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
HistoJ< unsigned int > * hltL1s
std::vector< unsigned int > L1TechAcceptPhysics_
edm::InputTag triggerResults_
std::vector< std::string > L1TechNames_
HistoJ< unsigned int > * L1TechAcceptPhysics
std::vector< unsigned int > L1AlgoAcceptCalibration_
void analyze(edm::Event const &, edm::EventSetup const &)
unsigned int oldPrescaleIndex
Writes a Value in JSON format in a human friendly way.
HistoJ< unsigned int > * L1Global
HistoJ< unsigned int > * hltWasRun
void writeL1DefJson(std::string path)
tuple size
Write out results.
AlgorithmMap technicalMap
HistoJ< unsigned int > * L1AlgoAcceptPhysics
const std::vector< std::string > & datasetNames() const
std::vector< unsigned int > hltPre_
array value (ordered list)