21 using namespace jsoncollector;
24 level1Results_(ps.getParameter<edm::
InputTag>(
"L1Results")),
39 descriptions.
add(
"L1TMonitoring", desc);
56 LogDebug(
"L1TriggerJSONMonitoring") <<
"Not Physics, Calibration or Random. experimentType = " << ex << std::endl;
62 LogDebug(
"L1TriggerJSONMonitoring") <<
"Could not get L1 trigger results" << std::endl;
69 std::vector<GlobalAlgBlk>::const_iterator algBlk =
l1tResults->begin(0);
71 for (
unsigned int i = 0;
i < algBlk->maxPhysicsTriggers;
i++){
72 if (algBlk->getAlgoDecisionFinal(
i)){
81 prescaleIndex_ =
static_cast<unsigned int>(algBlk->getPreScColumn());
139 const std::map<std::string, L1TUtmAlgorithm>* m_algorithmMap;
141 m_l1GtMenu = l1GtMenu.
product();
144 for (std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo = m_algorithmMap->begin(); itAlgo != m_algorithmMap->end(); itAlgo++) {
145 int bitNumber = (itAlgo->second).getIndex();
172 bool expected =
false;
173 if( runCache()->wroteFiles.compare_exchange_strong(expected,
true) ){
174 runCache()->wroteFiles =
true;
176 unsigned int nRun = iRun.
run();
179 std::stringstream ssL1Jsd;
180 ssL1Jsd <<
"run" << std::setfill(
'0') << std::setw(6) << nRun <<
"_ls0000";
181 ssL1Jsd <<
"_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsd";
201 l1Ini[
"L1-Algo-Names"] = l1AlgoNamesVal;
202 l1Ini[
"Event-Type"] = eventTypeVal;
206 std::stringstream ssL1Ini;
207 ssL1Ini <<
"run" << std::setfill(
'0') << std::setw(6) << nRun <<
"_ls0000_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".ini";
209 std::ofstream outL1Ini( monPath + ssL1Ini.str() );
222 std::shared_ptr<l1Json::lumiVars>
227 unsigned int MAXPATHS = 512;
231 iSummary->prescaleIndex = 100;
239 iSummary->baseRunDir =
"";
240 iSummary->stL1Jsd =
"";
241 iSummary->streamL1Destination =
"";
242 iSummary->streamL1MergeType =
"";
296 unsigned int iRun = iLumi.
run();
298 bool writeFiles=
true;
310 gethostname(hostname,32);
316 std::stringstream sOutDef;
317 sOutDef << monPath <<
"output_" << getpid() <<
".jsd";
323 l1JsnData[DataPoint::DEFINITION] = iSummary->
stL1Jsd;
336 std::stringstream ssL1JsnData;
337 ssL1JsnData <<
"run" << std::setfill(
'0') << std::setw(6) << iRun <<
"_ls" << std::setfill(
'0') << std::setw(4) << iLs;
338 ssL1JsnData <<
"_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsndata";
341 std::ofstream outL1JsnData( monPath +
"/" + ssL1JsnData.str() );
343 outL1JsnData.close();
348 IntJ l1JsnFilesize = 0;
349 unsigned int l1JsnFileAdler32 = 1;
351 l1JsnFilelist.
update(ssL1JsnData.str());
352 l1JsnFilesize = result.size();
353 l1JsnFileAdler32 =
cms::Adler32(result.c_str(),result.size());
356 l1JsnInputFiles.
update(
"");
362 IntJ daqJsnAccepted = daqJsnProcessed;
363 IntJ daqJsnErrorEvents = 0;
364 IntJ daqJsnRetCodeMask = 0;
365 IntJ daqJsnHLTErrorEvents = 0;
370 l1DaqJsn[DataPoint::DEFINITION] = sOutDef.str();
384 result = writer.
write(l1DaqJsn);
386 std::stringstream ssL1DaqJsn;
387 ssL1DaqJsn <<
"run" << std::setfill(
'0') << std::setw(6) << iRun <<
"_ls" << std::setfill(
'0') << std::setw(4) << iLs;
388 ssL1DaqJsn <<
"_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsn";
390 std::ofstream outL1DaqJsn( monPath + ssL1DaqJsn.str() );
422 outfile <<
"{" << std::endl;
423 outfile <<
" \"data\" : [" << std::endl;
425 outfile <<
" \"name\" : \"Processed\"," ;
426 outfile <<
" \"type\" : \"integer\"," ;
427 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
430 outfile <<
" \"name\" : \"L1-AlgoAccepted\"," ;
431 outfile <<
" \"type\" : \"integer\"," ;
432 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
435 outfile <<
" \"name\" : \"L1-AlgoAccepted-Physics\"," ;
436 outfile <<
" \"type\" : \"integer\"," ;
437 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
440 outfile <<
" \"name\" : \"L1-AlgoAccepted-Calibration\"," ;
441 outfile <<
" \"type\" : \"integer\"," ;
442 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
445 outfile <<
" \"name\" : \"L1-AlgoAccepted-Random\"," ;
446 outfile <<
" \"type\" : \"integer\"," ;
447 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
450 outfile <<
" \"name\" : \"L1-Global\"," ;
451 outfile <<
" \"type\" : \"integer\"," ;
452 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
455 outfile <<
" \"name\" : \"Prescale-Index\"," ;
456 outfile <<
" \"type\" : \"integer\"," ;
457 outfile <<
" \"operation\" : \"sample\"}" << std::endl;
459 outfile <<
" ]" << std::endl;
460 outfile <<
"}" << std::endl;
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
bool getByToken(EDGetToken token, Handle< PROD > &result) const
unsigned int prescaleIndex
void endLuminosityBlockSummary(edm::LuminosityBlock const &, edm::EventSetup const &, l1Json::lumiVars *) const
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 > L1AlgoAcceptRandom_
std::vector< unsigned int > L1AlgoAccept_
void writeL1DefJson(std::string path)
jsoncollector::HistoJ< unsigned int > * L1AlgoAcceptCalibration
virtual Json::Value toJsonValue() const
static const unsigned int maxPhysicsTriggers
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
LuminosityBlockNumber_t luminosityBlock() const
std::string streamL1MergeType
std::vector< T > & value()
std::string streamL1Destination
std::vector< std::string > L1AlgoNames_
LuminosityBlockNumber_t luminosityBlock() const
unsigned int oldPrescaleIndex
std::vector< unsigned int > L1Global_
void analyze(edm::Event const &, edm::EventSetup const &)
edm::EDGetTokenT< GlobalAlgBlkBxCollection > level1ResultsToken_
std::vector< std::string > L1GlobalType_
std::vector< unsigned int > L1AlgoAcceptPhysics_
std::vector< unsigned int > L1AlgoAcceptCalibration_
void beginRun(edm::Run const &, edm::EventSetup const &)
jsoncollector::HistoJ< unsigned int > * L1Global
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
virtual std::string write(const Value &root)
Serialize a Value in JSON format.
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)
EventAuxiliary const & eventAuxiliary() const
jsoncollector::HistoJ< unsigned int > * L1AlgoAccept
jsoncollector::HistoJ< unsigned int > * processed
~L1TriggerJSONMonitoring()
T const * product() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
jsoncollector::HistoJ< unsigned int > * L1AlgoAcceptRandom
L1TriggerJSONMonitoring(const edm::ParameterSet &)
edm::EventAuxiliary::ExperimentType experimentType() const
static void globalEndLuminosityBlockSummary(edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, l1Json::lumiVars *)
jsoncollector::HistoJ< unsigned int > * L1AlgoAcceptPhysics
static std::shared_ptr< l1Json::lumiVars > globalBeginLuminosityBlockSummary(edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
Writes a Value in JSON format in a human friendly way.
unsigned int prescaleIndex_
array value (ordered list)