CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
L1TriggerJSONMonitoring Class Reference
Inheritance diagram for L1TriggerJSONMonitoring:
edm::global::EDAnalyzer< edm::StreamCache< L1TriggerJSONMonitoringData::stream >, edm::RunCache< L1TriggerJSONMonitoringData::run >, edm::LuminosityBlockSummaryCache< L1TriggerJSONMonitoringData::lumisection > > edm::global::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::StreamID, edm::Event const &, edm::EventSetup const &) const override
 
std::unique_ptr< L1TriggerJSONMonitoringData::streambeginStream (edm::StreamID) const override
 
std::shared_ptr< L1TriggerJSONMonitoringData::lumisectionglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
std::shared_ptr< L1TriggerJSONMonitoringData::runglobalBeginRun (edm::Run const &, edm::EventSetup const &) const override
 
void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, L1TriggerJSONMonitoringData::lumisection *) const override
 
void globalEndRun (edm::Run const &, edm::EventSetup const &) const override
 
 L1TriggerJSONMonitoring (const edm::ParameterSet &)
 
void streamBeginLuminosityBlock (edm::StreamID, edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
void streamEndLuminosityBlockSummary (edm::StreamID, edm::LuminosityBlock const &, edm::EventSetup const &, L1TriggerJSONMonitoringData::lumisection *) const override
 
 ~L1TriggerJSONMonitoring () override=default
 
- Public Member Functions inherited from edm::global::EDAnalyzer< edm::StreamCache< L1TriggerJSONMonitoringData::stream >, edm::RunCache< L1TriggerJSONMonitoringData::run >, edm::LuminosityBlockSummaryCache< L1TriggerJSONMonitoringData::lumisection > >
 EDAnalyzer ()=default
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Static Private Member Functions

static void writeIniFile (L1TriggerJSONMonitoringData::run const &, unsigned int, std::vector< std::string > const &)
 
static void writeJsdFile (L1TriggerJSONMonitoringData::run const &)
 

Private Attributes

const edm::InputTag level1Results_
 
const edm::EDGetTokenT< GlobalAlgBlkBxCollectionlevel1ResultsToken_
 

Static Private Attributes

static constexpr const char * streamName_ = "streamL1Rates"
 
static constexpr const std::array< const char *, 16 > tcdsTriggerTypes_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: This class outputs JSON files with TCDS and L1T monitoring information.

Definition at line 71 of file L1TriggerJSONMonitoring.cc.

Constructor & Destructor Documentation

◆ L1TriggerJSONMonitoring()

L1TriggerJSONMonitoring::L1TriggerJSONMonitoring ( const edm::ParameterSet config)
explicit

Definition at line 161 of file L1TriggerJSONMonitoring.cc.

162  : level1Results_(config.getParameter<edm::InputTag>("L1Results")),
163  level1ResultsToken_(consumes<GlobalAlgBlkBxCollection>(level1Results_)) {}

◆ ~L1TriggerJSONMonitoring()

L1TriggerJSONMonitoring::~L1TriggerJSONMonitoring ( )
overridedefault

Member Function Documentation

◆ analyze()

void L1TriggerJSONMonitoring::analyze ( edm::StreamID  sid,
edm::Event const &  event,
edm::EventSetup const &   
) const
overridevirtual

Implements edm::global::EDAnalyzerBase.

Definition at line 221 of file L1TriggerJSONMonitoring.cc.

221  {
222  auto& stream = *streamCache(sid);
223 
224  ++stream.processed;
225  unsigned int eventType = event.experimentType();
226  if (eventType < tcdsTriggerTypes_.size())
227  ++stream.tcdsAccept[eventType];
228  else
229  edm::LogWarning("L1TriggerJSONMonitoring") << "Unexpected event type " << eventType;
230 
231  // get hold of TriggerResults
233  if (not event.getByToken(level1ResultsToken_, handle) or not handle.isValid() or handle->isEmpty(0)) {
234  edm::LogError("L1TriggerJSONMonitoring")
235  << "L1 trigger results with label [" + level1Results_.encode() + "] not present or invalid";
236  return;
237  }
238 
239  // The GlobalAlgBlkBxCollection is a vector of vectors, but the second layer can only ever
240  // have one entry since there can't be more than one collection per bunch crossing.
241  // The first "0" here means BX = 0, while the second "0" is used to access the first and only element.
242  auto const& results = handle->at(0, 0);
243  auto const& decision = results.getAlgoDecisionFinal();
244  assert(decision.size() == GlobalAlgBlk::maxPhysicsTriggers);
245 
246  // check the results for each HLT path
247  for (unsigned int i = 0; i < decision.size(); ++i) {
248  if (decision[i]) {
249  ++stream.l1tAccept[i];
250  switch (eventType) {
252  ++stream.l1tAcceptPhysics[i];
253  break;
255  ++stream.l1tAcceptCalibration[i];
256  break;
258  ++stream.l1tAcceptRandom[i];
259  break;
260  default:
261  break;
262  }
263  }
264  }
265 
266  // check for conflicting values in the prescale column index, and store it
267  int prescaleIndex = results.getPreScColumn();
269  stream.prescaleIndex = prescaleIndex;
270  } else if (stream.prescaleIndex == L1TriggerJSONMonitoringData::kPrescaleConflict) {
271  // do nothing
272  } else if (stream.prescaleIndex != prescaleIndex) {
273  edm::LogWarning("L1TriggerJSONMonitoring") << "Prescale index changed from " << stream.prescaleIndex << " to "
274  << prescaleIndex << " inside lumisection " << event.luminosityBlock();
276  }
277 }

References cms::cuda::assert(), edm::EventAuxiliary::CalibrationTrigger, edm::InputTag::encode(), hcalcalib_dqm_sourceclient-live_cfg::eventType, patZpeak::handle, mps_fire::i, L1TriggerJSONMonitoringData::kPrescaleConflict, L1TriggerJSONMonitoringData::kPrescaleUndefined, level1Results_, level1ResultsToken_, GlobalAlgBlk::maxPhysicsTriggers, or, edm::EventAuxiliary::PhysicsTrigger, edm::EventAuxiliary::RandomTrigger, bookConverter::results, cms::cuda::stream, and tcdsTriggerTypes_.

◆ beginStream()

std::unique_ptr< L1TriggerJSONMonitoringData::stream > L1TriggerJSONMonitoring::beginStream ( edm::StreamID  ) const
override

Definition at line 173 of file L1TriggerJSONMonitoring.cc.

173  {
174  return std::make_unique<L1TriggerJSONMonitoringData::stream>();
175 }

◆ fillDescriptions()

void L1TriggerJSONMonitoring::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 166 of file L1TriggerJSONMonitoring.cc.

166  {
168  desc.add<edm::InputTag>("L1Results", edm::InputTag("hltGtStage2Digis"));
169  descriptions.add("L1TriggerJSONMonitoring", desc);
170 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_2018_cff::InputTag.

◆ globalBeginLuminosityBlockSummary()

std::shared_ptr< L1TriggerJSONMonitoringData::lumisection > L1TriggerJSONMonitoring::globalBeginLuminosityBlockSummary ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &   
) const
override

Definition at line 280 of file L1TriggerJSONMonitoring.cc.

281  {
282  // the API of jsoncollector::HistoJ does not really match our use case,
283  // but it is the only vector-like object available in JsonMonitorable.h
284  auto lumidata = std::make_shared<L1TriggerJSONMonitoringData::lumisection>(L1TriggerJSONMonitoringData::lumisection{
285  jsoncollector::HistoJ<unsigned int>(1), // processed
291  });
292  // repeated calls to `update` necessary to set the internal element counter
293  lumidata->processed.update(0);
294  for (unsigned int i = 0; i < GlobalAlgBlk::maxPhysicsTriggers; ++i)
295  lumidata->l1tAccept.update(0);
296  for (unsigned int i = 0; i < GlobalAlgBlk::maxPhysicsTriggers; ++i)
297  lumidata->l1tAcceptPhysics.update(0);
298  for (unsigned int i = 0; i < GlobalAlgBlk::maxPhysicsTriggers; ++i)
299  lumidata->l1tAcceptCalibration.update(0);
300  for (unsigned int i = 0; i < GlobalAlgBlk::maxPhysicsTriggers; ++i)
301  lumidata->l1tAcceptRandom.update(0);
302  for (unsigned int i = 0; i < tcdsTriggerTypes_.size(); ++i)
303  lumidata->tcdsAccept.update(0);
304  lumidata->prescaleIndex = L1TriggerJSONMonitoringData::kPrescaleUndefined;
305 
306  return lumidata;
307 }

References mps_fire::i, L1TriggerJSONMonitoringData::kPrescaleUndefined, GlobalAlgBlk::maxPhysicsTriggers, and tcdsTriggerTypes_.

◆ globalBeginRun()

std::shared_ptr< L1TriggerJSONMonitoringData::run > L1TriggerJSONMonitoring::globalBeginRun ( edm::Run const &  run,
edm::EventSetup const &  setup 
) const
override

Definition at line 178 of file L1TriggerJSONMonitoring.cc.

179  {
180  auto rundata = std::make_shared<L1TriggerJSONMonitoringData::run>();
181 
182  // set the DAQ parameters
183  if (edm::Service<evf::EvFDaqDirector>().isAvailable()) {
184  rundata->streamDestination = edm::Service<evf::EvFDaqDirector>()->getStreamDestinations(streamName_);
185  rundata->streamMergeType =
187  rundata->baseRunDir = edm::Service<evf::EvFDaqDirector>()->baseRunDir();
188  } else {
189  rundata->streamDestination = "";
190  rundata->streamMergeType = "";
191  rundata->baseRunDir = ".";
192  }
193 
194  // read the L1 trigger names from the EventSetup
195  std::vector<std::string> triggerNames(GlobalAlgBlk::maxPhysicsTriggers, ""s);
197  setup.get<L1TUtmTriggerMenuRcd>().get(menuHandle);
198  if (menuHandle.isValid()) {
199  for (auto const& algo : menuHandle->getAlgorithmMap())
200  triggerNames[algo.second.getIndex()] = algo.first;
201  } else {
202  edm::LogWarning("L1TriggerJSONMonitoring") << "L1TUtmTriggerMenu not found in the EventSetup.\nThe Level 1 Trigger "
203  "rate monitoring will not include the trigger names.";
204  }
205 
206  // write the per-run .jsd file
207  rundata->jsdFileName = (boost::format("run%06d_ls0000_streamL1Rates_pid%05d.jsd") % run.run() % getpid()).str();
208  writeJsdFile(*rundata);
209 
210  // write the per-run .ini file
211  // iniFileName = (boost::format("run%06d_ls0000_streamL1Rates_pid%05d.ini") % run.run() % getpid()).str();
212  writeIniFile(*rundata, run.run(), triggerNames);
213 
214  return rundata;
215 }

References dqm-mbProfile::format, get, L1TUtmTriggerMenu::getAlgorithmMap(), edm::ESHandleBase::isValid(), GlobalAlgBlk::maxPhysicsTriggers, evf::MergeTypeJSNDATA, writedatasetfile::run, alignCSCRings::s, singleTopDQM_cfi::setup, str, streamName_, L1TEGammaOffline_cfi::triggerNames, writeIniFile(), and writeJsdFile().

◆ globalEndLuminosityBlockSummary()

void L1TriggerJSONMonitoring::globalEndLuminosityBlockSummary ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  ,
L1TriggerJSONMonitoringData::lumisection lumidata 
) const
override

Definition at line 350 of file L1TriggerJSONMonitoring.cc.

352  {
353  unsigned int ls = lumi.luminosityBlock();
354  unsigned int run = lumi.run();
355 
356  bool writeFiles = true;
357  if (edm::Service<evf::MicroStateService>().isAvailable()) {
360  if (fms)
361  writeFiles = fms->shouldWriteFiles(ls);
362  }
363  if (not writeFiles)
364  return;
365 
366  unsigned int processed = lumidata->processed.value().at(0);
367  auto const& rundata = *runCache(lumi.getRun().index());
369 
370  // [SIC]
371  char hostname[33];
372  gethostname(hostname, 32);
373  std::string sourceHost(hostname);
374 
375  // [SIC]
376  std::stringstream sOutDef;
377  sOutDef << rundata.baseRunDir << "/"
378  << "output_" << getpid() << ".jsd";
379 
380  std::string jsndataFileList = "";
381  unsigned int jsndataSize = 0;
382  unsigned int jsndataAdler32 = 1; // adler32 checksum for an empty file
383 
384  if (processed) {
385  // write the .jsndata files which contain the actual rates
386  Json::Value jsndata;
387  jsndata[jsoncollector::DataPoint::SOURCE] = sourceHost;
388  jsndata[jsoncollector::DataPoint::DEFINITION] = rundata.jsdFileName;
394 
395  // write only the number of "physics", "calibration" and "random" events
400  jsndata[jsoncollector::DataPoint::DATA].append(tcdsAccept.toJsonValue());
401  /* FIXME send information for all event types instead of only these three
402  jsndata[jsoncollector::DataPoint::DATA].append(lumidata->tcdsAccept.toJsonValue());
403  */
405 
406  auto jsndataFileName = boost::format("run%06d_ls%04d_streamL1Rates_pid%05d.jsndata") % run % ls % getpid();
407 
408  std::string result = writer.write(jsndata);
409  std::ofstream jsndataFile(rundata.baseRunDir + "/" + jsndataFileName.str());
410  jsndataFile << result;
411  jsndataFile.close();
412 
413  jsndataFileList = jsndataFileName.str();
414  jsndataSize = result.size();
415  jsndataAdler32 = cms::Adler32(result.c_str(), result.size());
416  }
417 
418  // create a metadata json file for the "HLT rates" pseudo-stream
419  unsigned int jsnProcessed = processed;
420  unsigned int jsnAccepted = processed;
421  unsigned int jsnErrorEvents = 0;
422  unsigned int jsnRetCodeMask = 0;
423  std::string jsnInputFiles = "";
424  unsigned int jsnHLTErrorEvents = 0;
425 
426  Json::Value jsn;
427  jsn[jsoncollector::DataPoint::SOURCE] = sourceHost;
428  jsn[jsoncollector::DataPoint::DEFINITION] = sOutDef.str();
429  jsn[jsoncollector::DataPoint::DATA].append(jsnProcessed);
430  jsn[jsoncollector::DataPoint::DATA].append(jsnAccepted);
431  jsn[jsoncollector::DataPoint::DATA].append(jsnErrorEvents);
432  jsn[jsoncollector::DataPoint::DATA].append(jsnRetCodeMask);
433  jsn[jsoncollector::DataPoint::DATA].append(jsndataFileList);
434  jsn[jsoncollector::DataPoint::DATA].append(jsndataSize);
435  jsn[jsoncollector::DataPoint::DATA].append(jsnInputFiles);
436  jsn[jsoncollector::DataPoint::DATA].append(jsndataAdler32);
437  jsn[jsoncollector::DataPoint::DATA].append(rundata.streamDestination);
438  jsn[jsoncollector::DataPoint::DATA].append(rundata.streamMergeType);
439  jsn[jsoncollector::DataPoint::DATA].append(jsnHLTErrorEvents);
440 
441  auto jsnFileName = boost::format("run%06d_ls%04d_streamL1Rates_pid%05d.jsn") % run % ls % getpid();
442  std::ofstream jsnFile(rundata.baseRunDir + "/" + jsnFileName.str());
443  jsnFile << writer.write(jsn);
444  jsnFile.close();
445 }

References cms::Adler32(), Json::Value::append(), edm::EventAuxiliary::CalibrationTrigger, jsoncollector::DataPoint::DATA, jsoncollector::DataPoint::DEFINITION, dqm-mbProfile::format, L1TriggerJSONMonitoringData::lumisection::l1tAccept, L1TriggerJSONMonitoringData::lumisection::l1tAcceptCalibration, L1TriggerJSONMonitoringData::lumisection::l1tAcceptPhysics, L1TriggerJSONMonitoringData::lumisection::l1tAcceptRandom, eostools::ls(), edm::EventAuxiliary::PhysicsTrigger, L1TriggerJSONMonitoringData::lumisection::prescaleIndex, L1TriggerJSONMonitoringData::lumisection::processed, edm::EventAuxiliary::RandomTrigger, mps_fire::result, writedatasetfile::run, evf::FastMonitoringService::shouldWriteFiles(), jsoncollector::DataPoint::SOURCE, AlCaHLTBitMon_QueryRunRegistry::string, L1TriggerJSONMonitoringData::lumisection::tcdsAccept, jsoncollector::HistoJ< T >::toJsonValue(), jsoncollector::HistoJ< T >::update(), jsoncollector::HistoJ< T >::value(), and cscNeutronWriter_cfi::writer.

◆ globalEndRun()

void L1TriggerJSONMonitoring::globalEndRun ( edm::Run const &  ,
edm::EventSetup const &   
) const
override

Definition at line 218 of file L1TriggerJSONMonitoring.cc.

218 {}

◆ streamBeginLuminosityBlock()

void L1TriggerJSONMonitoring::streamBeginLuminosityBlock ( edm::StreamID  sid,
edm::LuminosityBlock const &  lumi,
edm::EventSetup const &   
) const
override

Definition at line 310 of file L1TriggerJSONMonitoring.cc.

312  {
313  auto& stream = *streamCache(sid);
314 
315  // reset the stream counters
316  stream.processed = 0;
317  stream.l1tAccept.assign(GlobalAlgBlk::maxPhysicsTriggers, 0);
318  stream.l1tAcceptPhysics.assign(GlobalAlgBlk::maxPhysicsTriggers, 0);
319  stream.l1tAcceptCalibration.assign(GlobalAlgBlk::maxPhysicsTriggers, 0);
320  stream.l1tAcceptRandom.assign(GlobalAlgBlk::maxPhysicsTriggers, 0);
321  stream.tcdsAccept.assign(tcdsTriggerTypes_.size(), 0);
323 }

References L1TriggerJSONMonitoringData::kPrescaleUndefined, GlobalAlgBlk::maxPhysicsTriggers, cms::cuda::stream, and tcdsTriggerTypes_.

◆ streamEndLuminosityBlockSummary()

void L1TriggerJSONMonitoring::streamEndLuminosityBlockSummary ( edm::StreamID  sid,
edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  ,
L1TriggerJSONMonitoringData::lumisection lumidata 
) const
override

Definition at line 326 of file L1TriggerJSONMonitoring.cc.

329  {
330  auto const& stream = *streamCache(sid);
331  lumidata->processed.value()[0] += stream.processed;
332 
333  for (unsigned int i = 0; i < GlobalAlgBlk::maxPhysicsTriggers; ++i) {
334  lumidata->l1tAccept.value()[i] += stream.l1tAccept[i];
335  lumidata->l1tAcceptPhysics.value()[i] += stream.l1tAcceptPhysics[i];
336  lumidata->l1tAcceptCalibration.value()[i] += stream.l1tAcceptCalibration[i];
337  lumidata->l1tAcceptRandom.value()[i] += stream.l1tAcceptRandom[i];
338  }
339  for (unsigned int i = 0; i < tcdsTriggerTypes_.size(); ++i)
340  lumidata->tcdsAccept.value()[i] += stream.tcdsAccept[i];
341 
342  // check for conflicting values in the prescale column index
344  lumidata->prescaleIndex = stream.prescaleIndex;
345  else if (lumidata->prescaleIndex != stream.prescaleIndex)
347 }

References mps_fire::i, L1TriggerJSONMonitoringData::kPrescaleConflict, L1TriggerJSONMonitoringData::kPrescaleUndefined, L1TriggerJSONMonitoringData::lumisection::l1tAccept, L1TriggerJSONMonitoringData::lumisection::l1tAcceptCalibration, L1TriggerJSONMonitoringData::lumisection::l1tAcceptPhysics, L1TriggerJSONMonitoringData::lumisection::l1tAcceptRandom, GlobalAlgBlk::maxPhysicsTriggers, L1TriggerJSONMonitoringData::lumisection::prescaleIndex, L1TriggerJSONMonitoringData::lumisection::processed, cms::cuda::stream, L1TriggerJSONMonitoringData::lumisection::tcdsAccept, tcdsTriggerTypes_, and jsoncollector::HistoJ< T >::value().

◆ writeIniFile()

void L1TriggerJSONMonitoring::writeIniFile ( L1TriggerJSONMonitoringData::run const &  rundata,
unsigned int  run,
std::vector< std::string > const &  l1TriggerNames 
)
staticprivate

Definition at line 463 of file L1TriggerJSONMonitoring.cc.

465  {
467 
469  for (auto const& name : l1TriggerNames)
470  triggerNames.append(name);
471  content["L1-Algo-Names"] = triggerNames;
472 
477  /* FIXME send information for all event types instead of only these three
478  for (auto const& name : tcdsTriggerTypes_)
479  eventTypes.append(name);
480  */
481  content["Event-Type"] = eventTypes;
482 
483  std::string iniFileName = (boost::format("run%06d_ls0000_streamL1Rates_pid%05d.ini") % run % getpid()).str();
484  std::ofstream file(rundata.baseRunDir + "/" + iniFileName);
486  file << writer.write(content);
487  file.close();
488 }

References Json::arrayValue, L1TriggerJSONMonitoringData::run::baseRunDir, edm::EventAuxiliary::CalibrationTrigger, Skims_PA_cff::content, RawDataTask_cfi::eventTypes, FrontierConditions_GlobalTag_cff::file, dqm-mbProfile::format, Skims_PA_cff::name, edm::EventAuxiliary::PhysicsTrigger, edm::EventAuxiliary::RandomTrigger, writedatasetfile::run, str, AlCaHLTBitMon_QueryRunRegistry::string, tcdsTriggerTypes_, L1TEGammaOffline_cfi::triggerNames, and cscNeutronWriter_cfi::writer.

Referenced by globalBeginRun().

◆ writeJsdFile()

void L1TriggerJSONMonitoring::writeJsdFile ( L1TriggerJSONMonitoringData::run const &  rundata)
staticprivate

Definition at line 447 of file L1TriggerJSONMonitoring.cc.

447  {
448  std::ofstream file(rundata.baseRunDir + "/" + rundata.jsdFileName);
449  file << R"""({
450  "data" : [
451  { "name" : "Processed", "type" : "integer", "operation" : "histo"},
452  { "name" : "L1-AlgoAccepted", "type" : "integer", "operation" : "histo"},
453  { "name" : "L1-AlgoAccepted-Physics", "type" : "integer", "operation" : "histo"},
454  { "name" : "L1-AlgoAccepted-Calibration", "type" : "integer", "operation" : "histo"},
455  { "name" : "L1-AlgoAccepted-Random", "type" : "integer", "operation" : "histo"},
456  { "name" : "L1-Global", "type" : "integer", "operation" : "histo"},
457  { "name" : "Prescale-Index", "type" : "integer", "operation" : "sample"}
458  ]
459 })""";
460  file.close();
461 }

References L1TriggerJSONMonitoringData::run::baseRunDir, FrontierConditions_GlobalTag_cff::file, and L1TriggerJSONMonitoringData::run::jsdFileName.

Referenced by globalBeginRun().

Member Data Documentation

◆ level1Results_

const edm::InputTag L1TriggerJSONMonitoring::level1Results_
private

Definition at line 153 of file L1TriggerJSONMonitoring.cc.

Referenced by analyze().

◆ level1ResultsToken_

const edm::EDGetTokenT<GlobalAlgBlkBxCollection> L1TriggerJSONMonitoring::level1ResultsToken_
private

Definition at line 154 of file L1TriggerJSONMonitoring.cc.

Referenced by analyze().

◆ streamName_

constexpr const char* L1TriggerJSONMonitoring::streamName_ = "streamL1Rates"
staticconstexprprivate

Definition at line 147 of file L1TriggerJSONMonitoring.cc.

Referenced by globalBeginRun().

◆ tcdsTriggerTypes_

constexpr const std::array< const char *, 16 > L1TriggerJSONMonitoring::tcdsTriggerTypes_
staticconstexprprivate
Initial value:
= {{
"Error",
"Physics",
"Calibration",
"Random",
"Auxiliary",
"",
"",
"",
"Cyclic",
"Bunch-pattern",
"Software",
"TTS",
"",
"",
"",
""
}}

Definition at line 128 of file L1TriggerJSONMonitoring.cc.

Referenced by analyze(), globalBeginLuminosityBlockSummary(), streamBeginLuminosityBlock(), streamEndLuminosityBlockSummary(), and writeIniFile().

eostools.ls
def ls(path, rec=False)
Definition: eostools.py:349
L1TriggerJSONMonitoringData::lumisection::processed
jsoncollector::HistoJ< unsigned int > processed
Definition: L1TriggerJSONMonitoring.cc:60
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
L1TriggerJSONMonitoringData::kPrescaleConflict
static constexpr const int kPrescaleConflict
Definition: L1TriggerJSONMonitoring.cc:38
evf::FastMonitoringService::shouldWriteFiles
bool shouldWriteFiles(unsigned int lumi, unsigned int *proc=nullptr)
Definition: FastMonitoringService.h:171
jsoncollector::HistoJ::value
std::vector< T > & value()
Definition: JsonMonitorable.h:224
L1TUtmTriggerMenuRcd
Definition: L1TUtmTriggerMenuRcd.h:11
patZpeak.handle
handle
Definition: patZpeak.py:23
Json::arrayValue
array value (ordered list)
Definition: value.h:30
L1TriggerJSONMonitoringData::kPrescaleUndefined
static constexpr const int kPrescaleUndefined
Definition: L1TriggerJSONMonitoring.cc:37
L1TriggerJSONMonitoringData::lumisection
Definition: L1TriggerJSONMonitoring.cc:59
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
edm::EventAuxiliary::CalibrationTrigger
Definition: EventAuxiliary.h:21
jsoncollector::HistoJ< unsigned int >
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
L1TriggerJSONMonitoring::writeIniFile
static void writeIniFile(L1TriggerJSONMonitoringData::run const &, unsigned int, std::vector< std::string > const &)
Definition: L1TriggerJSONMonitoring.cc:463
cms::cuda::assert
assert(be >=bs)
bookConverter.results
results
Definition: bookConverter.py:144
cscNeutronWriter_cfi.writer
writer
Definition: cscNeutronWriter_cfi.py:6
L1TriggerJSONMonitoringData::lumisection::l1tAcceptRandom
jsoncollector::HistoJ< unsigned int > l1tAcceptRandom
Definition: L1TriggerJSONMonitoring.cc:65
edm::Handle
Definition: AssociativeIterator.h:50
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
config
Definition: config.py:1
evf::FastMonitoringService
Definition: FastMonitoringService.h:69
cmsdt::algo
algo
Definition: constants.h:164
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1TriggerJSONMonitoring::level1Results_
const edm::InputTag level1Results_
Definition: L1TriggerJSONMonitoring.cc:153
jsoncollector::HistoJ::toJsonValue
virtual Json::Value toJsonValue() const
Definition: JsonMonitorable.h:210
evf::MergeTypeJSNDATA
Definition: EvFDaqDirector.h:58
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
jsoncollector::DataPoint::DATA
static const std::string DATA
Definition: DataPoint.h:116
cms::Adler32
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)
Definition: Adler32Calculator.cc:10
L1TEGammaOffline_cfi.triggerNames
triggerNames
Definition: L1TEGammaOffline_cfi.py:40
dqm-mbProfile.format
format
Definition: dqm-mbProfile.py:16
L1TriggerJSONMonitoring::writeJsdFile
static void writeJsdFile(L1TriggerJSONMonitoringData::run const &)
Definition: L1TriggerJSONMonitoring.cc:447
str
#define str(s)
Definition: TestProcessor.cc:48
edm::ESHandle
Definition: DTSurvey.h:22
Json::StyledWriter
Writes a Value in JSON format in a human friendly way.
Definition: writer.h:63
jsoncollector::DataPoint::DEFINITION
static const std::string DEFINITION
Definition: DataPoint.h:115
L1TriggerJSONMonitoringData::lumisection::l1tAccept
jsoncollector::HistoJ< unsigned int > l1tAccept
Definition: L1TriggerJSONMonitoring.cc:61
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
jsoncollector::HistoJ::update
void update(T val)
Definition: JsonMonitorable.h:245
L1TriggerJSONMonitoring::streamName_
static constexpr const char * streamName_
Definition: L1TriggerJSONMonitoring.cc:147
Skims_PA_cff.content
content
Definition: Skims_PA_cff.py:19
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
Json::Value::append
Value & append(const Value &value)
Append value to array at the end.
edm::LogError
Definition: MessageLogger.h:183
edm::Service
Definition: Service.h:30
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
L1TriggerJSONMonitoringData::lumisection::l1tAcceptCalibration
jsoncollector::HistoJ< unsigned int > l1tAcceptCalibration
Definition: L1TriggerJSONMonitoring.cc:64
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
get
#define get
L1TriggerJSONMonitoring::level1ResultsToken_
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > level1ResultsToken_
Definition: L1TriggerJSONMonitoring.cc:154
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
hcalcalib_dqm_sourceclient-live_cfg.eventType
eventType
Definition: hcalcalib_dqm_sourceclient-live_cfg.py:200
jsoncollector::DataPoint::SOURCE
static const std::string SOURCE
Definition: DataPoint.h:114
edm::EventAuxiliary::PhysicsTrigger
Definition: EventAuxiliary.h:20
writedatasetfile.run
run
Definition: writedatasetfile.py:27
L1TriggerJSONMonitoringData::lumisection::prescaleIndex
int prescaleIndex
Definition: L1TriggerJSONMonitoring.cc:67
L1TriggerJSONMonitoringData::lumisection::l1tAcceptPhysics
jsoncollector::HistoJ< unsigned int > l1tAcceptPhysics
Definition: L1TriggerJSONMonitoring.cc:62
L1TriggerJSONMonitoringData::lumisection::tcdsAccept
jsoncollector::HistoJ< unsigned int > tcdsAccept
Definition: L1TriggerJSONMonitoring.cc:66
L1TriggerJSONMonitoring::tcdsTriggerTypes_
static constexpr const std::array< const char *, 16 > tcdsTriggerTypes_
Definition: L1TriggerJSONMonitoring.cc:128
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
or
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
Definition: Activities.doc:12
RawDataTask_cfi.eventTypes
eventTypes
Definition: RawDataTask_cfi.py:3
mps_fire.result
result
Definition: mps_fire.py:303
GlobalAlgBlk::maxPhysicsTriggers
static constexpr unsigned int maxPhysicsTriggers
Definition: GlobalAlgBlk.h:52
event
Definition: event.py:1
lumi
Definition: LumiSectionData.h:20
L1TUtmTriggerMenu::getAlgorithmMap
const std::map< std::string, L1TUtmAlgorithm > & getAlgorithmMap() const
Definition: L1TUtmTriggerMenu.h:61
edm::EventAuxiliary::RandomTrigger
Definition: EventAuxiliary.h:22
edm::InputTag
Definition: InputTag.h:15
Json::Value
Represents a JSON value.
Definition: value.h:99