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 =
"";
294 unsigned int iRun = iLumi.
run();
296 bool writeFiles=
true;
308 gethostname(hostname,32);
314 std::stringstream sOutDef;
315 sOutDef << monPath <<
"output_" << getpid() <<
".jsd";
321 l1JsnData[DataPoint::DEFINITION] = iSummary->
stL1Jsd;
334 std::stringstream ssL1JsnData;
335 ssL1JsnData <<
"run" << std::setfill(
'0') << std::setw(6) << iRun <<
"_ls" << std::setfill(
'0') << std::setw(4) << iLs;
336 ssL1JsnData <<
"_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsndata";
339 std::ofstream outL1JsnData( monPath +
"/" + ssL1JsnData.str() );
341 outL1JsnData.close();
346 IntJ l1JsnFilesize = 0;
347 unsigned int l1JsnFileAdler32 = 1;
349 l1JsnFilelist.
update(ssL1JsnData.str());
350 l1JsnFilesize = result.size();
351 l1JsnFileAdler32 =
cms::Adler32(result.c_str(),result.size());
354 l1JsnInputFiles.
update(
"");
360 IntJ daqJsnAccepted = daqJsnProcessed;
361 IntJ daqJsnErrorEvents = 0;
362 IntJ daqJsnRetCodeMask = 0;
363 IntJ daqJsnHLTErrorEvents = 0;
368 l1DaqJsn[DataPoint::DEFINITION] = sOutDef.str();
381 result = writer.
write(l1DaqJsn);
383 std::stringstream ssL1DaqJsn;
384 ssL1DaqJsn <<
"run" << std::setfill(
'0') << std::setw(6) << iRun <<
"_ls" << std::setfill(
'0') << std::setw(4) << iLs;
385 ssL1DaqJsn <<
"_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsn";
387 std::ofstream outL1DaqJsn( monPath + ssL1DaqJsn.str() );
419 outfile <<
"{" << std::endl;
420 outfile <<
" \"data\" : [" << std::endl;
422 outfile <<
" \"name\" : \"Processed\"," ;
423 outfile <<
" \"type\" : \"integer\"," ;
424 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
427 outfile <<
" \"name\" : \"L1-AlgoAccepted\"," ;
428 outfile <<
" \"type\" : \"integer\"," ;
429 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
432 outfile <<
" \"name\" : \"L1-AlgoAccepted-Physics\"," ;
433 outfile <<
" \"type\" : \"integer\"," ;
434 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
437 outfile <<
" \"name\" : \"L1-AlgoAccepted-Calibration\"," ;
438 outfile <<
" \"type\" : \"integer\"," ;
439 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
442 outfile <<
" \"name\" : \"L1-AlgoAccepted-Random\"," ;
443 outfile <<
" \"type\" : \"integer\"," ;
444 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
447 outfile <<
" \"name\" : \"L1-Global\"," ;
448 outfile <<
" \"type\" : \"integer\"," ;
449 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
452 outfile <<
" \"name\" : \"Prescale-Index\"," ;
453 outfile <<
" \"type\" : \"integer\"," ;
454 outfile <<
" \"operation\" : \"sample\"}" << std::endl;
456 outfile <<
" ]" << std::endl;
457 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::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)