24 level1Results_(ps.getParameter<
edm::InputTag>(
"L1Results")),
37 descriptions.
add(
"L1TMonitoring", desc);
54 LogDebug(
"L1TriggerJSONMonitoring") <<
"Not Physics, Calibration or Random. experimentType = " << ex << std::endl;
60 LogDebug(
"L1TriggerJSONMonitoring") <<
"Could not get L1 trigger results" << std::endl;
67 auto algBlk = l1tResults->
begin(0);
69 for (
unsigned int i = 0;
i < algBlk->maxPhysicsTriggers;
i++){
70 if (algBlk->getAlgoDecisionFinal(
i)){
79 prescaleIndex_ =
static_cast<unsigned int>(algBlk->getPreScColumn());
137 const std::map<std::string, L1TUtmAlgorithm>* m_algorithmMap;
139 m_l1GtMenu = l1GtMenu.
product();
142 for (
auto const & itAlgo : *m_algorithmMap) {
143 int bitNumber = (itAlgo.second).getIndex();
144 L1AlgoNames_.at(bitNumber) = itAlgo.first;
155 const unsigned int la = L1AlgoNames_.size();
170 bool expected =
false;
171 if( runCache()->wroteFiles.compare_exchange_strong(expected,
true) ){
172 runCache()->wroteFiles =
true;
174 unsigned int nRun = iRun.
run();
177 std::stringstream ssL1Jsd;
178 ssL1Jsd <<
"run" << std::setfill(
'0') << std::setw(6) << nRun <<
"_ls0000";
179 ssL1Jsd <<
"_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsd";
190 for (
auto & L1AlgoName : L1AlgoNames_){
191 l1AlgoNamesVal.
append(L1AlgoName);
199 l1Ini[
"L1-Algo-Names"] = l1AlgoNamesVal;
200 l1Ini[
"Event-Type"] = eventTypeVal;
204 std::stringstream ssL1Ini;
205 ssL1Ini <<
"run" << std::setfill(
'0') << std::setw(6) << nRun <<
"_ls0000_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".ini";
207 std::ofstream outL1Ini( monPath + ssL1Ini.str() );
220 std::shared_ptr<l1Json::lumiVars>
225 unsigned int MAXPATHS = 512;
229 iSummary->prescaleIndex = 100;
237 iSummary->baseRunDir =
"";
238 iSummary->stL1Jsd =
"";
239 iSummary->streamL1Destination =
"";
240 iSummary->streamL1MergeType =
"";
294 unsigned int iRun = iLumi.
run();
296 bool writeFiles=
true;
308 gethostname(hostname,32);
314 std::stringstream sOutDef;
315 sOutDef << monPath <<
"output_" << getpid() <<
".jsd";
320 l1JsnData[DataPoint::SOURCE] = sourceHost;
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;
367 l1DaqJsn[DataPoint::SOURCE] = sourceHost;
368 l1DaqJsn[DataPoint::DEFINITION] = sOutDef.str();
382 result = writer.
write(l1DaqJsn);
384 std::stringstream ssL1DaqJsn;
385 ssL1DaqJsn <<
"run" << std::setfill(
'0') << std::setw(6) << iRun <<
"_ls" << std::setfill(
'0') << std::setw(4) << iLs;
386 ssL1DaqJsn <<
"_streamL1Rates_pid" << std::setfill(
'0') << std::setw(5) << getpid() <<
".jsn";
388 std::ofstream outL1DaqJsn( monPath + ssL1DaqJsn.str() );
420 outfile <<
"{" << std::endl;
421 outfile <<
" \"data\" : [" << std::endl;
423 outfile <<
" \"name\" : \"Processed\"," ;
424 outfile <<
" \"type\" : \"integer\"," ;
425 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
428 outfile <<
" \"name\" : \"L1-AlgoAccepted\"," ;
429 outfile <<
" \"type\" : \"integer\"," ;
430 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
433 outfile <<
" \"name\" : \"L1-AlgoAccepted-Physics\"," ;
434 outfile <<
" \"type\" : \"integer\"," ;
435 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
438 outfile <<
" \"name\" : \"L1-AlgoAccepted-Calibration\"," ;
439 outfile <<
" \"type\" : \"integer\"," ;
440 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
443 outfile <<
" \"name\" : \"L1-AlgoAccepted-Random\"," ;
444 outfile <<
" \"type\" : \"integer\"," ;
445 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
448 outfile <<
" \"name\" : \"L1-Global\"," ;
449 outfile <<
" \"type\" : \"integer\"," ;
450 outfile <<
" \"operation\" : \"histo\"}," << std::endl;
453 outfile <<
" \"name\" : \"Prescale-Index\"," ;
454 outfile <<
" \"type\" : \"integer\"," ;
455 outfile <<
" \"operation\" : \"sample\"}" << std::endl;
457 outfile <<
" ]" << std::endl;
458 outfile <<
"}" << std::endl;
const_iterator end(int bx) const
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_
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
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()
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.
const_iterator begin(int bx) const
T const * product() const
unsigned int prescaleIndex_
array value (ordered list)