CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Public Attributes
TriggerJSONMonitoring Class Reference

#include <TriggerJSONMonitoring.h>

Inheritance diagram for TriggerJSONMonitoring:
edm::stream::EDAnalyzer< edm::RunCache< trigJson::runVars >, edm::LuminosityBlockSummaryCache< trigJson::lumiVars > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
void beginRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, trigJson::lumiVars *) const
 
void resetLumi ()
 
void resetRun (bool changed)
 
 TriggerJSONMonitoring (const edm::ParameterSet &)
 
void writeDefJson (std::string path)
 
void writeL1DefJson (std::string path)
 
 ~TriggerJSONMonitoring ()
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunCache< trigJson::runVars >, edm::LuminosityBlockSummaryCache< trigJson::lumiVars > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static std::shared_ptr< trigJson::lumiVarsglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< trigJson::runVarsglobalBeginRun (edm::Run const &, edm::EventSetup const &, void const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, trigJson::lumiVars *)
 
static void globalEndRun (edm::Run const &iRun, edm::EventSetup const &, RunContext const *iContext)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Public Attributes

AlgorithmMap algorithmMap
 
std::string baseRunDir_
 
std::vector< std::vector< std::string > > datasetContents_
 
std::vector< std::string > datasetNames_
 
std::vector< unsigned int > hltAccept_
 
HLTConfigProvider hltConfig_
 
std::vector< unsigned int > hltDatasets_
 
std::vector< unsigned int > hltErrors_
 
std::vector< std::vector< unsigned int > > hltIndex_
 
std::vector< unsigned int > hltL1s_
 
std::vector< std::string > hltNames_
 
std::vector< unsigned int > hltPre_
 
std::vector< unsigned int > hltReject_
 
std::vector< unsigned int > hltWasRun_
 
std::vector< unsigned int > L1AlgoAccept_
 
std::vector< unsigned int > L1AlgoAcceptCalibration_
 
std::vector< unsigned int > L1AlgoAcceptPhysics_
 
std::vector< unsigned int > L1AlgoAcceptRandom_
 
std::vector< int > L1AlgoBitNumber_
 
std::vector< std::string > L1AlgoNames_
 
std::vector< unsigned int > L1Global_
 
std::vector< std::string > L1GlobalType_
 
std::vector< unsigned int > L1TechAccept_
 
std::vector< unsigned int > L1TechAcceptCalibration_
 
std::vector< unsigned int > L1TechAcceptPhysics_
 
std::vector< unsigned int > L1TechAcceptRandom_
 
std::vector< int > L1TechBitNumber_
 
std::vector< std::string > L1TechNames_
 
edm::InputTag level1Results_
 
const L1GtTriggerMenum_l1GtMenu
 
edm::EDGetTokenT< GlobalAlgBlkBxCollectionm_l1t_results
 
const L1GtTriggerMaskm_l1tAlgoMask
 
const L1GtTriggerMaskm_l1tTechMask
 
unsigned int oldLumi
 
unsigned int oldPrescaleIndex
 
std::vector< int > posL1s_
 
std::vector< int > posPre_
 
unsigned int prescaleIndex_
 
unsigned int processed_
 
std::string stHltJsd_
 
std::string stL1Jsd_
 
AlgorithmMap technicalMap
 
edm::InputTag triggerResults_
 
edm::EDGetTokenT< edm::TriggerResultstriggerResultsToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunCache< trigJson::runVars >, edm::LuminosityBlockSummaryCache< trigJson::lumiVars > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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 ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: This class prints JSON files with trigger info.

Created: Wed, 09 Jul 2014

Author
Aram Avetisyan
Daniel Salerno

See header file for documentation

Author
Aram Avetisyan
Daniel Salerno

Definition at line 92 of file TriggerJSONMonitoring.h.

Constructor & Destructor Documentation

TriggerJSONMonitoring::TriggerJSONMonitoring ( const edm::ParameterSet ps)
explicit

Definition at line 25 of file TriggerJSONMonitoring.cc.

References ~TriggerJSONMonitoring().

25  :
26  triggerResults_(ps.getParameter<edm::InputTag>("triggerResults")),
27  triggerResultsToken_(consumes<edm::TriggerResults>(triggerResults_)),
28  level1Results_(ps.getParameter<edm::InputTag>("L1Results")),
29  m_l1t_results(consumes<GlobalAlgBlkBxCollection>(level1Results_))
30 {
31 
32 
33 }
T getParameter(std::string const &) const
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1t_results
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
TriggerJSONMonitoring::~TriggerJSONMonitoring ( )
default

Referenced by TriggerJSONMonitoring().

Member Function Documentation

void TriggerJSONMonitoring::analyze ( edm::Event const &  ,
edm::EventSetup const &   
)
virtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 46 of file TriggerJSONMonitoring.cc.

References edm::HLTGlobalStatus::accept(), BXVector< T >::begin(), edm::InputTag::encode(), BXVector< T >::end(), edm::HLTGlobalStatus::error(), edm::Event::eventAuxiliary(), edm::EventBase::experimentType(), edm::Event::getByToken(), hltAccept_, hltDatasets_, hltErrors_, hltIndex_, hltL1s_, hltNames_, hltPre_, hltReject_, hltWasRun_, mps_fire::i, edm::HLTGlobalStatus::index(), diffTreeTool::index, createfilelist::int, edm::HandleBase::isValid(), L1Global_, SelectingProcedure_cff::l1tResults, LogDebug, edm::EventAuxiliary::luminosityBlock(), m_l1t_results, gen::n, oldLumi, oldPrescaleIndex, AlCaHLTBitMon_ParallelJobs::p, posL1s_, posPre_, prescaleIndex_, processed_, triggerResults_, triggerResultsToken_, and edm::HLTGlobalStatus::wasrun().

47 {
48 
49  using namespace std;
50  using namespace edm;
51 
52  processed_++;
53 
54  int ex = iEvent.experimentType();
55  if (ex == 1) L1Global_[0]++;
56  else if (ex == 2) L1Global_[1]++;
57  else if (ex == 3) L1Global_[2]++;
58  else{
59  LogDebug("TriggerJSONMonitoring") << "Not Physics, Calibration or Random. experimentType = " << ex << std::endl;
60  }
61 
62  //Temporarily removing L1 monitoring while we adapt for Stage 2
63  //Get hold of L1TResults
64  // edm::Handle<L1GlobalTriggerReadoutRecord> l1tResults;
65  // iEvent.getByToken(m_l1t_results, l1tResults);
66 
67  // L1GlobalTriggerReadoutRecord L1TResults = * l1tResults.product();
68 
69  // const std::vector<bool> & algoword = L1TResults.decisionWord();
70  // if (algoword.size() == L1AlgoAccept_.size()){
71  // for (unsigned int i = 0; i < algoword.size(); i++){
72  // if (algoword[i]){
73  // L1AlgoAccept_[i]++;
74  // if (ex == 1) L1AlgoAcceptPhysics_[i]++;
75  // if (ex == 2) L1AlgoAcceptCalibration_[i]++;
76  // if (ex == 3) L1AlgoAcceptRandom_[i]++;
77  // }
78  // }
79  // }
80  // else {
81  // LogWarning("TriggerJSONMonitoring")<<"L1 Algo Trigger Mask size does not match number of L1 Algo Triggers!";
82  // }
83 
84  // const std::vector<bool> & techword = L1TResults.technicalTriggerWord();
85  // if (techword.size() == L1TechAccept_.size()){
86  // for (unsigned int i = 0; i < techword.size(); i++){
87  // if (techword[i]){
88  // L1TechAccept_[i]++;
89  // if (ex == 1) L1TechAcceptPhysics_[i]++;
90  // if (ex == 2) L1TechAcceptCalibration_[i]++;
91  // if (ex == 3) L1TechAcceptRandom_[i]++;
92  // }
93  // }
94  // }
95  // else{
96  // LogWarning("TriggerJSONMonitoring")<<"L1 Tech Trigger Mask size does not match number of L1 Tech Triggers!";
97  // }
98 
99  //Get hold of TriggerResults
101  iEvent.getByToken(triggerResultsToken_, HLTR);
102  if (!HLTR.isValid()) {
103  LogDebug("TriggerJSONMonitoring") << "HLT TriggerResults with label ["+triggerResults_.encode()+"] not found!" << std::endl;
104  return;
105  }
106 
107  //Decision for each HLT path
108  const unsigned int n(hltNames_.size());
109  for (unsigned int i=0; i<n; i++) {
110  if (HLTR->wasrun(i)) hltWasRun_[i]++;
111  if (HLTR->accept(i)) hltAccept_[i]++;
112  if (HLTR->wasrun(i) && !HLTR->accept(i)) hltReject_[i]++;
113  if (HLTR->error(i)) hltErrors_[i]++;
114  //Count L1 seeds and Prescales
115  const int index(static_cast<int>(HLTR->index(i)));
116  if (HLTR->accept(i)) {
117  if (index >= posL1s_[i]) hltL1s_[i]++;
118  if (index >= posPre_[i]) hltPre_[i]++;
119  } else {
120  if (index > posL1s_[i]) hltL1s_[i]++;
121  if (index > posPre_[i]) hltPre_[i]++;
122  }
123  }
124 
125  //Decision for each HLT dataset
126  std::vector<bool> acceptedByDS(hltIndex_.size(), false);
127  for (unsigned int ds=0; ds < hltIndex_.size(); ds++) { // ds = index of dataset
128  for (unsigned int p=0; p<hltIndex_[ds].size(); p++) { // p = index of path with dataset ds
129  if (acceptedByDS[ds]>0 || HLTR->accept(hltIndex_[ds][p]) ) {
130  acceptedByDS[ds] = true;
131  }
132  }
133  if (acceptedByDS[ds]) hltDatasets_[ds]++;
134  }
135 
136  //Prescale index
138  if (iEvent.getByToken(m_l1t_results, l1tResults) and not (l1tResults->begin(0) == l1tResults->end(0)))
139  prescaleIndex_ = static_cast<unsigned int>(l1tResults->begin(0)->getPreScColumn());
140 
141  //Check that the prescale index hasn't changed inside a lumi section
142  unsigned int newLumi = (unsigned int) iEvent.eventAuxiliary().luminosityBlock();
143  if (oldLumi == newLumi and prescaleIndex_ != oldPrescaleIndex){
144  LogWarning("TriggerJSONMonitoring")<<"Prescale index has changed from "<<oldPrescaleIndex<<" to "<<prescaleIndex_<<" inside lumi section "<<newLumi;
145  }
146  oldLumi = newLumi;
148 
149 }//End analyze function
#define LogDebug(id)
const_iterator end(int bx) const
bool wasrun() const
Was at least one path run?
std::vector< unsigned int > hltDatasets_
bool accept() const
Has at least one path accepted the event?
std::vector< unsigned int > hltErrors_
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1t_results
std::vector< unsigned int > hltL1s_
std::string encode() const
Definition: InputTag.cc:165
std::vector< std::vector< unsigned int > > hltIndex_
std::vector< unsigned int > hltAccept_
int iEvent
Definition: GenABIO.cc:230
std::vector< std::string > hltNames_
unsigned int index(const unsigned int i) const
Get index (slot position) of module giving the decision of the ith path.
bool error() const
Has any path encountered an error (exception)
std::vector< unsigned int > hltReject_
bool isValid() const
Definition: HandleBase.h:74
std::vector< int > posL1s_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
std::vector< unsigned int > L1Global_
std::vector< unsigned int > hltWasRun_
HLT enums.
std::vector< int > posPre_
const_iterator begin(int bx) const
std::vector< unsigned int > hltPre_
void TriggerJSONMonitoring::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
virtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 413 of file TriggerJSONMonitoring.cc.

References resetLumi().

void TriggerJSONMonitoring::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
virtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 292 of file TriggerJSONMonitoring.cc.

References algorithmMap, Json::Value::append(), Json::arrayValue, baseRunDir_, dataset::datasetName, datasetNames_, edm::EventSetup::get(), L1GtTriggerMenu::gtAlgorithmMap(), L1GtTriggerMenu::gtTechnicalTriggerMap(), hltConfig_, hltNames_, HLTConfigProvider::init(), L1AlgoNames_, L1GlobalType_, L1TechNames_, LogDebug, m_l1GtMenu, m_l1tAlgoMask, m_l1tTechMask, oldLumi, oldPrescaleIndex, edm::InputTag::process(), edm::ESHandle< T >::product(), resetRun(), mps_fire::result, edm::RunBase::run(), stHltJsd_, stL1Jsd_, AlCaHLTBitMon_QueryRunRegistry::string, technicalMap, triggerResults_, interactiveExample::ui, Json::StyledWriter::write(), writeDefJson(), writeL1DefJson(), and cscNeutronWriter_cfi::writer.

293 {
294  //Get the run directory from the EvFDaqDirector
296  else baseRunDir_ = ".";
297 
298  std::string monPath = baseRunDir_ + "/";
299 
300  //Get/update the L1 trigger menu from the EventSetup
302  iSetup.get<L1GtTriggerMenuRcd>().get(l1GtMenu);
303  m_l1GtMenu = l1GtMenu.product();
306 
307  //Get masks (for now, only use them to find the number of triggers)
308  edm::ESHandle<L1GtTriggerMask> l1GtAlgoMask;
309  iSetup.get<L1GtTriggerMaskAlgoTrigRcd>().get(l1GtAlgoMask);
310  m_l1tAlgoMask = l1GtAlgoMask.product();
311 
312  edm::ESHandle<L1GtTriggerMask> l1GtTechMask;
313  iSetup.get<L1GtTriggerMaskTechTrigRcd>().get(l1GtTechMask);
314  m_l1tTechMask = l1GtTechMask.product();
315 
316  //Initialize hltConfig_
317  bool changed = true;
318  if (hltConfig_.init(iRun, iSetup, triggerResults_.process(), changed)) resetRun(changed);
319  else{
320  LogDebug("TriggerJSONMonitoring") << "HLTConfigProvider initialization failed!" << std::endl;
321  return;
322  }
323 
324  //Write the once-per-run files if not already written
325  //Eventually must rewrite this with proper multithreading (i.e. globalBeginRun)
326  bool expected = false;
327  if( runCache()->wroteFiles.compare_exchange_strong(expected, true) ){
328  runCache()->wroteFiles = true;
329 
330  unsigned int nRun = iRun.run();
331 
332  //Create definition file for HLT Rates
333  std::stringstream ssHltJsd;
334  ssHltJsd << "run" << std::setfill('0') << std::setw(6) << nRun << "_ls0000";
335  ssHltJsd << "_streamHLTRates_pid" << std::setfill('0') << std::setw(5) << getpid() << ".jsd";
336  stHltJsd_ = ssHltJsd.str();
337 
339 
340  //Create definition file for L1 Rates -
341  std::stringstream ssL1Jsd;
342  ssL1Jsd << "run" << std::setfill('0') << std::setw(6) << nRun << "_ls0000";
343  ssL1Jsd << "_streamL1Rates_pid" << std::setfill('0') << std::setw(5) << getpid() << ".jsd";
344  stL1Jsd_ = ssL1Jsd.str();
345 
347 
348  //Write ini files
349  //HLT
350  Json::Value hltIni;
352 
353  Json::Value hltNamesVal(Json::arrayValue);
354  for (auto & hltName : hltNames_){
355  hltNamesVal.append(hltName);
356  }
357 
358  Json::Value datasetNamesVal(Json::arrayValue);
359  for (auto & datasetName : datasetNames_){
360  datasetNamesVal.append(datasetName);
361  }
362 
363  hltIni["Path-Names"] = hltNamesVal;
364  hltIni["Dataset-Names"] = datasetNamesVal;
365 
366  std::string && result = writer.write(hltIni);
367 
368  std::stringstream ssHltIni;
369  ssHltIni << "run" << std::setfill('0') << std::setw(6) << nRun << "_ls0000_streamHLTRates_pid" << std::setfill('0') << std::setw(5) << getpid() << ".ini";
370 
371  std::ofstream outHltIni( monPath + ssHltIni.str() );
372  outHltIni<<result;
373  outHltIni.close();
374 
375  //L1
376  Json::Value l1Ini;
377 
378  Json::Value l1AlgoNamesVal(Json::arrayValue);
379  for (auto & L1AlgoName : L1AlgoNames_){
380  l1AlgoNamesVal.append(L1AlgoName);
381  }
382 
383  Json::Value l1TechNamesVal(Json::arrayValue);
384  for (auto & L1TechName : L1TechNames_){
385  l1TechNamesVal.append(L1TechName);
386  }
387 
388  Json::Value eventTypeVal(Json::arrayValue);
389  for (auto & ui : L1GlobalType_){
390  eventTypeVal.append(ui);
391  }
392 
393  l1Ini["L1-Algo-Names"] = l1AlgoNamesVal;
394  l1Ini["L1-Tech-Names"] = l1TechNamesVal;
395  l1Ini["Event-Type"] = eventTypeVal;
396 
397  result = writer.write(l1Ini);
398 
399  std::stringstream ssL1Ini;
400  ssL1Ini << "run" << std::setfill('0') << std::setw(6) << nRun << "_ls0000_streamL1Rates_pid" << std::setfill('0') << std::setw(5) << getpid() << ".ini";
401 
402  std::ofstream outL1Ini( monPath + ssL1Ini.str() );
403  outL1Ini<<result;
404  outL1Ini.close();
405  }
406 
407  //Initialize variables for verification of prescaleIndex
408  oldLumi = 0;
409  oldPrescaleIndex = 0;
410 
411 }//End beginRun function
#define LogDebug(id)
Represents a JSON value.
Definition: value.h:111
const L1GtTriggerMenu * m_l1GtMenu
std::vector< std::string > hltNames_
HLTConfigProvider hltConfig_
const L1GtTriggerMask * m_l1tTechMask
std::vector< std::string > datasetNames_
std::vector< std::string > L1GlobalType_
virtual std::string write(const Value &root)
Serialize a Value in JSON format.
std::vector< std::string > L1AlgoNames_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
const L1GtTriggerMask * m_l1tAlgoMask
void writeDefJson(std::string path)
std::string const & process() const
Definition: InputTag.h:40
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
std::vector< std::string > L1TechNames_
const AlgorithmMap & gtTechnicalTriggerMap() const
get / set the technical trigger map
Writes a Value in JSON format in a human friendly way.
Definition: writer.h:65
void writeL1DefJson(std::string path)
T const * product() const
Definition: ESHandle.h:86
string datasetName
Definition: dataset.py:928
array value (ordered list)
Definition: value.h:31
void TriggerJSONMonitoring::endLuminosityBlockSummary ( edm::LuminosityBlock const &  ,
edm::EventSetup const &  ,
trigJson::lumiVars  
) const

Definition at line 457 of file TriggerJSONMonitoring.cc.

References trigJson::lumiVars::baseRunDir, baseRunDir_, trigJson::lumiVars::hltAccept, hltAccept_, trigJson::lumiVars::hltDatasets, hltDatasets_, trigJson::lumiVars::hltErrors, hltErrors_, trigJson::lumiVars::hltL1s, hltL1s_, trigJson::lumiVars::hltPre, hltPre_, trigJson::lumiVars::hltReject, hltReject_, trigJson::lumiVars::hltWasRun, hltWasRun_, trigJson::lumiVars::L1AlgoAccept, L1AlgoAccept_, trigJson::lumiVars::L1AlgoAcceptCalibration, L1AlgoAcceptCalibration_, trigJson::lumiVars::L1AlgoAcceptPhysics, L1AlgoAcceptPhysics_, trigJson::lumiVars::L1AlgoAcceptRandom, L1AlgoAcceptRandom_, trigJson::lumiVars::L1Global, L1Global_, L1GlobalType_, trigJson::lumiVars::L1TechAccept, L1TechAccept_, trigJson::lumiVars::L1TechAcceptCalibration, L1TechAcceptCalibration_, trigJson::lumiVars::L1TechAcceptPhysics, L1TechAcceptPhysics_, trigJson::lumiVars::L1TechAcceptRandom, L1TechAcceptRandom_, trigJson::lumiVars::prescaleIndex, prescaleIndex_, trigJson::lumiVars::processed, processed_, trigJson::lumiVars::stHltJsd, stHltJsd_, trigJson::lumiVars::stL1Jsd, stL1Jsd_, trigJson::lumiVars::streamHLTDestination, trigJson::lumiVars::streamHLTMergeType, trigJson::lumiVars::streamL1Destination, trigJson::lumiVars::streamL1MergeType, interactiveExample::ui, jsoncollector::HistoJ< T >::update(), and jsoncollector::HistoJ< T >::value().

457  {
458 
459  //Whichever stream gets there first does the initialiazation
460  if (iSummary->hltWasRun->value().size() == 0){
461  iSummary->processed->update(processed_);
462 
463  for (unsigned int ui = 0; ui < hltWasRun_.size(); ui++){
464  iSummary->hltWasRun->update(hltWasRun_.at(ui));
465  iSummary->hltL1s ->update(hltL1s_ .at(ui));
466  iSummary->hltPre ->update(hltPre_ .at(ui));
467  iSummary->hltAccept->update(hltAccept_.at(ui));
468  iSummary->hltReject->update(hltReject_.at(ui));
469  iSummary->hltErrors->update(hltErrors_.at(ui));
470  }
471  for (unsigned int hltDataset : hltDatasets_){
472  iSummary->hltDatasets->update(hltDataset);
473  }
474  iSummary->prescaleIndex = prescaleIndex_;
475 
476  iSummary->stHltJsd = stHltJsd_;
477  iSummary->baseRunDir = baseRunDir_;
478 
479  for (unsigned int ui = 0; ui < L1AlgoAccept_.size(); ui++){
480  iSummary->L1AlgoAccept ->update(L1AlgoAccept_.at(ui));
481  iSummary->L1AlgoAcceptPhysics ->update(L1AlgoAcceptPhysics_.at(ui));
482  iSummary->L1AlgoAcceptCalibration->update(L1AlgoAcceptCalibration_.at(ui));
483  iSummary->L1AlgoAcceptRandom ->update(L1AlgoAcceptRandom_.at(ui));
484  }
485  for (unsigned int ui = 0; ui < L1TechAccept_.size(); ui++){
486  iSummary->L1TechAccept ->update(L1TechAccept_.at(ui));
487  iSummary->L1TechAcceptPhysics ->update(L1TechAcceptPhysics_.at(ui));
488  iSummary->L1TechAcceptCalibration->update(L1TechAcceptCalibration_.at(ui));
489  iSummary->L1TechAcceptRandom ->update(L1TechAcceptRandom_.at(ui));
490  }
491  for (unsigned int ui = 0; ui < L1GlobalType_.size(); ui++){
492  iSummary->L1Global ->update(L1Global_.at(ui));
493  }
494  iSummary->stL1Jsd = stL1Jsd_;
495 
496  iSummary->streamHLTDestination = runCache()->streamHLTDestination;
497  iSummary->streamL1Destination = runCache()->streamL1Destination;
498  iSummary->streamHLTMergeType = runCache()->streamHLTMergeType;
499  iSummary->streamL1MergeType = runCache()->streamL1MergeType;
500  }
501 
502  else{
503  iSummary->processed->value().at(0) += processed_;
504 
505  for (unsigned int ui = 0; ui < hltWasRun_.size(); ui++){
506  iSummary->hltWasRun->value().at(ui) += hltWasRun_.at(ui);
507  iSummary->hltL1s ->value().at(ui) += hltL1s_ .at(ui);
508  iSummary->hltPre ->value().at(ui) += hltPre_ .at(ui);
509  iSummary->hltAccept->value().at(ui) += hltAccept_.at(ui);
510  iSummary->hltReject->value().at(ui) += hltReject_.at(ui);
511  iSummary->hltErrors->value().at(ui) += hltErrors_.at(ui);
512  }
513  for (unsigned int ui = 0; ui < hltDatasets_.size(); ui++){
514  iSummary->hltDatasets->value().at(ui) += hltDatasets_.at(ui);
515  }
516  for (unsigned int ui = 0; ui < L1AlgoAccept_.size(); ui++){
517  iSummary->L1AlgoAccept->value().at(ui) += L1AlgoAccept_.at(ui);
518  iSummary->L1AlgoAcceptPhysics->value().at(ui) += L1AlgoAcceptPhysics_.at(ui);
519  iSummary->L1AlgoAcceptCalibration->value().at(ui) += L1AlgoAcceptCalibration_.at(ui);
520  iSummary->L1AlgoAcceptRandom->value().at(ui) += L1AlgoAcceptRandom_.at(ui);
521  }
522  for (unsigned int ui = 0; ui < L1TechAccept_.size(); ui++){
523  iSummary->L1TechAccept->value().at(ui) += L1TechAccept_.at(ui);
524  iSummary->L1TechAcceptPhysics->value().at(ui) += L1TechAcceptPhysics_.at(ui);
525  iSummary->L1TechAcceptCalibration->value().at(ui) += L1TechAcceptCalibration_.at(ui);
526  iSummary->L1TechAcceptRandom->value().at(ui) += L1TechAcceptRandom_.at(ui);
527  }
528  for (unsigned int ui = 0; ui < L1Global_.size(); ui++){
529  iSummary->L1Global->value().at(ui) += L1Global_.at(ui);
530  }
531 
532  }
533 
534 }//End endLuminosityBlockSummary function
std::vector< unsigned int > hltDatasets_
std::vector< unsigned int > L1AlgoAccept_
std::vector< unsigned int > L1AlgoAcceptPhysics_
std::vector< unsigned int > hltErrors_
std::vector< unsigned int > L1TechAcceptRandom_
std::vector< unsigned int > hltL1s_
std::vector< unsigned int > L1TechAcceptCalibration_
std::vector< unsigned int > L1AlgoAcceptRandom_
std::vector< unsigned int > hltAccept_
std::vector< std::string > L1GlobalType_
std::vector< unsigned int > hltReject_
std::vector< unsigned int > L1TechAccept_
std::vector< unsigned int > L1Global_
std::vector< unsigned int > hltWasRun_
std::vector< unsigned int > L1TechAcceptPhysics_
std::vector< unsigned int > L1AlgoAcceptCalibration_
std::vector< unsigned int > hltPre_
void TriggerJSONMonitoring::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 38 of file TriggerJSONMonitoring.cc.

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

38  {
40  desc.add<edm::InputTag>("triggerResults",edm::InputTag("TriggerResults","","HLT"));
41  desc.add<edm::InputTag>("L1Results",edm::InputTag("hltGtStage2Digis"));
42  descriptions.add("triggerJSONMonitoring", desc);
43 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::shared_ptr< trigJson::lumiVars > TriggerJSONMonitoring::globalBeginLuminosityBlockSummary ( edm::LuminosityBlock const &  ,
edm::EventSetup const &  ,
LuminosityBlockContext const *   
)
static

Definition at line 416 of file TriggerJSONMonitoring.cc.

417 {
418  std::shared_ptr<trigJson::lumiVars> iSummary(new trigJson::lumiVars);
419 
420  unsigned int MAXPATHS = 1000;
421 
422  iSummary->processed = new HistoJ<unsigned int>(1, 1);
423 
424  iSummary->hltWasRun = new HistoJ<unsigned int>(1, MAXPATHS);
425  iSummary->hltL1s = new HistoJ<unsigned int>(1, MAXPATHS);
426  iSummary->hltPre = new HistoJ<unsigned int>(1, MAXPATHS);
427  iSummary->hltAccept = new HistoJ<unsigned int>(1, MAXPATHS);
428  iSummary->hltReject = new HistoJ<unsigned int>(1, MAXPATHS);
429  iSummary->hltErrors = new HistoJ<unsigned int>(1, MAXPATHS);
430 
431  iSummary->hltDatasets = new HistoJ<unsigned int>(1, MAXPATHS);
432 
433  iSummary->prescaleIndex = 100;
434 
435  iSummary->L1AlgoAccept = new HistoJ<unsigned int>(1, MAXPATHS);
436  iSummary->L1TechAccept = new HistoJ<unsigned int>(1, MAXPATHS);
437  iSummary->L1AlgoAcceptPhysics = new HistoJ<unsigned int>(1, MAXPATHS);
438  iSummary->L1TechAcceptPhysics = new HistoJ<unsigned int>(1, MAXPATHS);
439  iSummary->L1AlgoAcceptCalibration = new HistoJ<unsigned int>(1, MAXPATHS);
440  iSummary->L1TechAcceptCalibration = new HistoJ<unsigned int>(1, MAXPATHS);
441  iSummary->L1AlgoAcceptRandom = new HistoJ<unsigned int>(1, MAXPATHS);
442  iSummary->L1TechAcceptRandom = new HistoJ<unsigned int>(1, MAXPATHS);
443  iSummary->L1Global = new HistoJ<unsigned int>(1, MAXPATHS);
444 
445  iSummary->baseRunDir = "";
446  iSummary->stHltJsd = "";
447  iSummary->stL1Jsd = "";
448  iSummary->streamL1Destination = "";
449  iSummary->streamHLTDestination = "";
450  iSummary->streamL1MergeType = "";
451  iSummary->streamHLTMergeType = "";
452 
453  return iSummary;
454 }//End globalBeginLuminosityBlockSummary function
static std::shared_ptr<trigJson::runVars> TriggerJSONMonitoring::globalBeginRun ( edm::Run const &  ,
edm::EventSetup const &  ,
void const *   
)
inlinestatic

Definition at line 105 of file TriggerJSONMonitoring.h.

References evf::MergeTypeJSNDATA, and AlCaHLTBitMon_QueryRunRegistry::string.

105  {
106  std::shared_ptr<trigJson::runVars> rv(new trigJson::runVars);
107  if (edm::Service<evf::EvFDaqDirector>().isAvailable()) {
108  rv->streamHLTDestination = edm::Service<evf::EvFDaqDirector>()->getStreamDestinations("streamHLTRates");
109  rv->streamL1Destination = edm::Service<evf::EvFDaqDirector>()->getStreamDestinations("streamL1Rates");
110  std::string mergeType;
111  rv->streamHLTMergeType = edm::Service<evf::EvFDaqDirector>()->getStreamMergeType("streamHLTRates",evf::MergeTypeJSNDATA);
112  rv->streamL1MergeType = edm::Service<evf::EvFDaqDirector>()->getStreamMergeType("streamL1Rates",evf::MergeTypeJSNDATA);
113 
114  }
115  rv->wroteFiles = false;
116  return rv;
117  }
void TriggerJSONMonitoring::globalEndLuminosityBlockSummary ( edm::LuminosityBlock const &  ,
edm::EventSetup const &  ,
LuminosityBlockContext const *  ,
trigJson::lumiVars  
)
static

Definition at line 538 of file TriggerJSONMonitoring.cc.

References cms::Adler32(), Json::Value::append(), trigJson::lumiVars::baseRunDir, cscdqm::DATA, trigJson::lumiVars::hltAccept, trigJson::lumiVars::hltDatasets, trigJson::lumiVars::hltErrors, trigJson::lumiVars::hltL1s, trigJson::lumiVars::hltPre, trigJson::lumiVars::hltReject, trigJson::lumiVars::hltWasRun, trigJson::lumiVars::L1AlgoAccept, trigJson::lumiVars::L1AlgoAcceptCalibration, trigJson::lumiVars::L1AlgoAcceptPhysics, trigJson::lumiVars::L1AlgoAcceptRandom, trigJson::lumiVars::L1Global, trigJson::lumiVars::L1TechAccept, trigJson::lumiVars::L1TechAcceptCalibration, trigJson::lumiVars::L1TechAcceptPhysics, trigJson::lumiVars::L1TechAcceptRandom, edm::LuminosityBlockBase::luminosityBlock(), trigJson::lumiVars::prescaleIndex, trigJson::lumiVars::processed, mps_fire::result, edm::LuminosityBlockBase::run(), evf::FastMonitoringService::shouldWriteFiles(), trigJson::lumiVars::stHltJsd, trigJson::lumiVars::stL1Jsd, trigJson::lumiVars::streamHLTDestination, trigJson::lumiVars::streamHLTMergeType, trigJson::lumiVars::streamL1Destination, trigJson::lumiVars::streamL1MergeType, AlCaHLTBitMon_QueryRunRegistry::string, jsoncollector::HistoJ< T >::toJsonValue(), jsoncollector::StringJ::update(), jsoncollector::IntJ::value(), jsoncollector::StringJ::value(), jsoncollector::HistoJ< T >::value(), Json::StyledWriter::write(), and cscNeutronWriter_cfi::writer.

539 {
540 
541  unsigned int iLs = iLumi.luminosityBlock();
542  unsigned int iRun = iLumi.run();
543 
544  bool writeFiles=true;
545  if (edm::Service<evf::MicroStateService>().isAvailable()) {
547  if (fms) {
548  writeFiles = fms->shouldWriteFiles(iLumi.luminosityBlock());
549  }
550  }
551 
552  if (writeFiles) {
554 
555  char hostname[33];
556  gethostname(hostname,32);
557  std::string sourceHost(hostname);
558 
559  //Get the output directory
560  std::string monPath = iSummary->baseRunDir + "/";
561 
562  std::stringstream sOutDef;
563  sOutDef << monPath << "output_" << getpid() << ".jsd";
564 
565  //Write the .jsndata files which contain the actual rates
566  //HLT .jsndata file
567  Json::Value hltJsnData;
568  hltJsnData[DataPoint::SOURCE] = sourceHost;
569  hltJsnData[DataPoint::DEFINITION] = iSummary->stHltJsd;
570 
571  hltJsnData[DataPoint::DATA].append(iSummary->processed->toJsonValue());
572  hltJsnData[DataPoint::DATA].append(iSummary->hltWasRun->toJsonValue());
573  hltJsnData[DataPoint::DATA].append(iSummary->hltL1s ->toJsonValue());
574  hltJsnData[DataPoint::DATA].append(iSummary->hltPre ->toJsonValue());
575  hltJsnData[DataPoint::DATA].append(iSummary->hltAccept->toJsonValue());
576  hltJsnData[DataPoint::DATA].append(iSummary->hltReject->toJsonValue());
577  hltJsnData[DataPoint::DATA].append(iSummary->hltErrors->toJsonValue());
578 
579  hltJsnData[DataPoint::DATA].append(iSummary->hltDatasets->toJsonValue());
580 
581  hltJsnData[DataPoint::DATA].append(iSummary->prescaleIndex);
582 
583  std::string && result = writer.write(hltJsnData);
584 
585  std::stringstream ssHltJsnData;
586  ssHltJsnData << "run" << std::setfill('0') << std::setw(6) << iRun << "_ls" << std::setfill('0') << std::setw(4) << iLs;
587  ssHltJsnData << "_streamHLTRates_pid" << std::setfill('0') << std::setw(5) << getpid() << ".jsndata";
588 
589  if (iSummary->processed->value().at(0)!=0) {
590  std::ofstream outHltJsnData( monPath + ssHltJsnData.str() );
591  outHltJsnData<<result;
592  outHltJsnData.close();
593  }
594 
595  //HLT jsn entries
596  StringJ hltJsnFilelist;
597  IntJ hltJsnFilesize = 0;
598  unsigned int hltJsnFileAdler32 = 1;
599  if (iSummary->processed->value().at(0)!=0) {
600  hltJsnFilelist.update(ssHltJsnData.str());
601  hltJsnFilesize = result.size();
602  hltJsnFileAdler32 = cms::Adler32(result.c_str(),result.size());
603  }
604  StringJ hltJsnInputFiles;
605  hltJsnInputFiles.update("");
606 
607  //L1 .jsndata file
608  Json::Value l1JsnData;
609  l1JsnData[DataPoint::SOURCE] = sourceHost;
610  l1JsnData[DataPoint::DEFINITION] = iSummary->stL1Jsd;
611 
612  l1JsnData[DataPoint::DATA].append(iSummary->processed->toJsonValue());
613  l1JsnData[DataPoint::DATA].append(iSummary->L1AlgoAccept ->toJsonValue());
614  l1JsnData[DataPoint::DATA].append(iSummary->L1TechAccept ->toJsonValue());
615  l1JsnData[DataPoint::DATA].append(iSummary->L1AlgoAcceptPhysics ->toJsonValue());
616  l1JsnData[DataPoint::DATA].append(iSummary->L1TechAcceptPhysics ->toJsonValue());
617  l1JsnData[DataPoint::DATA].append(iSummary->L1AlgoAcceptCalibration->toJsonValue());
618  l1JsnData[DataPoint::DATA].append(iSummary->L1TechAcceptCalibration->toJsonValue());
619  l1JsnData[DataPoint::DATA].append(iSummary->L1AlgoAcceptRandom ->toJsonValue());
620  l1JsnData[DataPoint::DATA].append(iSummary->L1TechAcceptRandom ->toJsonValue());
621  l1JsnData[DataPoint::DATA].append(iSummary->L1Global ->toJsonValue());
622  result = writer.write(l1JsnData);
623 
624  std::stringstream ssL1JsnData;
625  ssL1JsnData << "run" << std::setfill('0') << std::setw(6) << iRun << "_ls" << std::setfill('0') << std::setw(4) << iLs;
626  ssL1JsnData << "_streamL1Rates_pid" << std::setfill('0') << std::setw(5) << getpid() << ".jsndata";
627 
628  if (iSummary->processed->value().at(0)!=0) {
629  std::ofstream outL1JsnData( monPath + "/" + ssL1JsnData.str() );
630  outL1JsnData<<result;
631  outL1JsnData.close();
632  }
633 
634  //L1 jsn entries
635  StringJ l1JsnFilelist;
636  IntJ l1JsnFilesize = 0;
637  unsigned int l1JsnFileAdler32 = 1;
638  if (iSummary->processed->value().at(0)!=0) {
639  l1JsnFilelist.update(ssL1JsnData.str());
640  l1JsnFilesize = result.size();
641  l1JsnFileAdler32 = cms::Adler32(result.c_str(),result.size());
642  }
643  StringJ l1JsnInputFiles;
644  l1JsnInputFiles.update("");
645 
646 
647  //Create special DAQ JSON file for L1 and HLT rates pseudo-streams
648  //Only three variables are different between the files:
649  //the file list, the file size and the Adler32 value
650  IntJ daqJsnProcessed = iSummary->processed->value().at(0);
651  IntJ daqJsnAccepted = daqJsnProcessed;
652  IntJ daqJsnErrorEvents = 0;
653  IntJ daqJsnRetCodeMask = 0;
654  IntJ daqJsnHLTErrorEvents = 0;
655 
656  //write out HLT metadata jsn
657  Json::Value hltDaqJsn;
658  hltDaqJsn[DataPoint::SOURCE] = sourceHost;
659  hltDaqJsn[DataPoint::DEFINITION] = sOutDef.str();
660 
661  hltDaqJsn[DataPoint::DATA].append((unsigned int)daqJsnProcessed.value());
662  hltDaqJsn[DataPoint::DATA].append((unsigned int)daqJsnAccepted.value());
663  hltDaqJsn[DataPoint::DATA].append((unsigned int)daqJsnErrorEvents.value());
664  hltDaqJsn[DataPoint::DATA].append((unsigned int)daqJsnRetCodeMask.value());
665  hltDaqJsn[DataPoint::DATA].append(hltJsnFilelist.value());
666  hltDaqJsn[DataPoint::DATA].append((unsigned int)hltJsnFilesize.value());
667  hltDaqJsn[DataPoint::DATA].append(hltJsnInputFiles.value());
668  hltDaqJsn[DataPoint::DATA].append(hltJsnFileAdler32);
669  hltDaqJsn[DataPoint::DATA].append(iSummary->streamHLTDestination);
670  hltDaqJsn[DataPoint::DATA].append(iSummary->streamHLTMergeType);
671  hltDaqJsn[DataPoint::DATA].append((unsigned int)daqJsnHLTErrorEvents.value());
672 
673  result = writer.write(hltDaqJsn);
674 
675  std::stringstream ssHltDaqJsn;
676  ssHltDaqJsn << "run" << std::setfill('0') << std::setw(6) << iRun << "_ls" << std::setfill('0') << std::setw(4) << iLs;
677  ssHltDaqJsn << "_streamHLTRates_pid" << std::setfill('0') << std::setw(5) << getpid() << ".jsn";
678 
679  std::ofstream outHltDaqJsn( monPath + ssHltDaqJsn.str() );
680  outHltDaqJsn<<result;
681  outHltDaqJsn.close();
682 
683  //write out L1 metadata jsn
684  Json::Value l1DaqJsn;
685  l1DaqJsn[DataPoint::SOURCE] = sourceHost;
686  l1DaqJsn[DataPoint::DEFINITION] = sOutDef.str();
687 
688  l1DaqJsn[DataPoint::DATA].append((unsigned int)daqJsnProcessed.value());
689  l1DaqJsn[DataPoint::DATA].append((unsigned int)daqJsnAccepted.value());
690  l1DaqJsn[DataPoint::DATA].append((unsigned int)daqJsnErrorEvents.value());
691  l1DaqJsn[DataPoint::DATA].append((unsigned int)daqJsnRetCodeMask.value());
692  l1DaqJsn[DataPoint::DATA].append(l1JsnFilelist.value());
693  l1DaqJsn[DataPoint::DATA].append((unsigned int)l1JsnFilesize.value());
694  l1DaqJsn[DataPoint::DATA].append(l1JsnInputFiles.value());
695  l1DaqJsn[DataPoint::DATA].append(l1JsnFileAdler32);
696  l1DaqJsn[DataPoint::DATA].append(iSummary->streamL1Destination);
697  l1DaqJsn[DataPoint::DATA].append(iSummary->streamL1MergeType);
698  l1DaqJsn[DataPoint::DATA].append((unsigned int)daqJsnHLTErrorEvents.value());
699 
700  result = writer.write(l1DaqJsn);
701 
702  std::stringstream ssL1DaqJsn;
703  ssL1DaqJsn << "run" << std::setfill('0') << std::setw(6) << iRun << "_ls" << std::setfill('0') << std::setw(4) << iLs;
704  ssL1DaqJsn << "_streamL1Rates_pid" << std::setfill('0') << std::setw(5) << getpid() << ".jsn";
705 
706  std::ofstream outL1DaqJsn( monPath + ssL1DaqJsn.str() );
707  outL1DaqJsn<<result;
708  outL1DaqJsn.close();
709  }
710 
711  //Delete the individual HistoJ pointers
712  delete iSummary->processed;
713 
714  delete iSummary->hltWasRun;
715  delete iSummary->hltL1s ;
716  delete iSummary->hltPre ;
717  delete iSummary->hltAccept;
718  delete iSummary->hltReject;
719  delete iSummary->hltErrors;
720 
721  delete iSummary->hltDatasets;
722 
723  delete iSummary->L1AlgoAccept;
724  delete iSummary->L1TechAccept;
725  delete iSummary->L1AlgoAcceptPhysics;
726  delete iSummary->L1TechAcceptPhysics;
727  delete iSummary->L1AlgoAcceptCalibration;
728  delete iSummary->L1TechAcceptCalibration;
729  delete iSummary->L1AlgoAcceptRandom;
730  delete iSummary->L1TechAcceptRandom;
731  delete iSummary->L1Global;
732 
733  //Note: Do not delete the iSummary pointer. The framework does something with it later on
734  // and deleting it results in a segmentation fault.
735 
736 }//End globalEndLuminosityBlockSummary function
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)
Represents a JSON value.
Definition: value.h:111
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)
Writes a Value in JSON format in a human friendly way.
Definition: writer.h:65
static void TriggerJSONMonitoring::globalEndRun ( edm::Run const &  iRun,
edm::EventSetup const &  ,
RunContext const *  iContext 
)
inlinestatic

Definition at line 119 of file TriggerJSONMonitoring.h.

References callgraph::path, and AlCaHLTBitMon_QueryRunRegistry::string.

119 { }
void TriggerJSONMonitoring::resetLumi ( )

Definition at line 250 of file TriggerJSONMonitoring.cc.

References hltAccept_, hltDatasets_, hltErrors_, hltL1s_, hltPre_, hltReject_, hltWasRun_, mps_fire::i, L1AlgoAccept_, L1AlgoAcceptCalibration_, L1AlgoAcceptPhysics_, L1AlgoAcceptRandom_, L1Global_, L1GlobalType_, L1TechAccept_, L1TechAcceptCalibration_, L1TechAcceptPhysics_, L1TechAcceptRandom_, prescaleIndex_, and processed_.

Referenced by beginLuminosityBlock(), and resetRun().

250  {
251  //Reset total number of events
252  processed_ = 0;
253 
254  //Reset per-path counters
255  for (unsigned int i = 0; i < hltWasRun_.size(); i++) {
256  hltWasRun_[i] = 0;
257  hltL1s_[i] = 0;
258  hltPre_[i] = 0;
259  hltAccept_[i] = 0;
260  hltReject_[i] = 0;
261  hltErrors_[i] = 0;
262  }
263  //Reset per-dataset counter
264  for (unsigned int & hltDataset : hltDatasets_) {
265  hltDataset = 0;
266  }
267  //Reset L1 per-algo counters -
268  for (unsigned int i = 0; i < L1AlgoAccept_.size(); i++) {
269  L1AlgoAccept_[i] = 0;
270  L1AlgoAcceptPhysics_[i] = 0;
272  L1AlgoAcceptRandom_[i] = 0;
273  }
274  //Reset L1 per-tech counters -
275  for (unsigned int i = 0; i < L1TechAccept_.size(); i++) {
276  L1TechAccept_[i] = 0;
277  L1TechAcceptPhysics_[i] = 0;
279  L1TechAcceptRandom_[i] = 0;
280  }
281  //Reset L1 global counters -
282  for (unsigned int i = 0; i < L1GlobalType_.size(); i++) {
283  L1Global_[i] = 0;
284  }
285 
286  //Luminosity and prescale index
287  prescaleIndex_ = 0;
288 
289 }//End resetLumi function
std::vector< unsigned int > hltDatasets_
std::vector< unsigned int > L1AlgoAccept_
std::vector< unsigned int > L1AlgoAcceptPhysics_
std::vector< unsigned int > hltErrors_
std::vector< unsigned int > L1TechAcceptRandom_
std::vector< unsigned int > hltL1s_
std::vector< unsigned int > L1TechAcceptCalibration_
std::vector< unsigned int > L1AlgoAcceptRandom_
std::vector< unsigned int > hltAccept_
std::vector< std::string > L1GlobalType_
std::vector< unsigned int > hltReject_
std::vector< unsigned int > L1TechAccept_
std::vector< unsigned int > L1Global_
std::vector< unsigned int > hltWasRun_
std::vector< unsigned int > L1TechAcceptPhysics_
std::vector< unsigned int > L1AlgoAcceptCalibration_
std::vector< unsigned int > hltPre_
void TriggerJSONMonitoring::resetRun ( bool  changed)

Definition at line 152 of file TriggerJSONMonitoring.cc.

References algorithmMap, edmIntegrityCheck::d, HLTConfigProvider::datasetContents(), datasetContents_, HLTConfigProvider::datasetNames(), datasetNames_, L1GtTriggerMask::gtTriggerMask(), hltAccept_, hltConfig_, hltDatasets_, hltErrors_, hltIndex_, hltL1s_, hltNames_, hltPre_, hltReject_, hltWasRun_, mps_fire::i, L1AlgoAccept_, L1AlgoAcceptCalibration_, L1AlgoAcceptPhysics_, L1AlgoAcceptRandom_, L1AlgoNames_, L1Global_, L1GlobalType_, L1TechAccept_, L1TechAcceptCalibration_, L1TechAcceptPhysics_, L1TechAcceptRandom_, L1TechNames_, diffTwoXMLs::label, m_l1tAlgoMask, m_l1tTechMask, HLTConfigProvider::moduleLabels(), HLTConfigProvider::moduleType(), gen::n, AlCaHLTBitMon_ParallelJobs::p, posL1s_, posPre_, resetLumi(), findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, technicalMap, HLTConfigProvider::triggerIndex(), and HLTConfigProvider::triggerNames().

Referenced by beginRun().

152  {
153 
154  //Update trigger and dataset names, clear L1 names and counters
155  if (changed){
159 
160  L1AlgoNames_.resize(m_l1tAlgoMask->gtTriggerMask().size());
161  for (auto & L1AlgoName : L1AlgoNames_) {
162  L1AlgoName = "";
163  }
164  //Get L1 algorithm trigger names -
165  for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
166  int bitNumber = (itAlgo->second).algoBitNumber();
167  L1AlgoNames_.at(bitNumber) = itAlgo->first;
168  }
169 
170  L1TechNames_.resize(m_l1tTechMask->gtTriggerMask().size());
171  for (auto & L1TechName : L1TechNames_) {
172  L1TechName = "";
173  }
174  //Get L1 technical trigger names -
175  for (CItAlgo itAlgo = technicalMap.begin(); itAlgo != technicalMap.end(); itAlgo++) {
176  int bitNumber = (itAlgo->second).algoBitNumber();
177  L1TechNames_.at(bitNumber) = itAlgo->first;
178  }
179 
180  L1GlobalType_.clear();
181  L1Global_.clear();
182 
183  //Set the experimentType -
184  L1GlobalType_.push_back( "Physics" );
185  L1GlobalType_.push_back( "Calibration" );
186  L1GlobalType_.push_back( "Random" );
187  }
188 
189  const unsigned int n = hltNames_.size();
190  const unsigned int d = datasetNames_.size();
191  const unsigned int la = L1AlgoNames_.size();
192  const unsigned int lt = L1TechNames_.size();
193  const unsigned int lg = L1GlobalType_.size();
194 
195  if (changed) {
196  //Resize per-path counters
197  hltWasRun_.resize(n);
198  hltL1s_.resize(n);
199  hltPre_.resize(n);
200  hltAccept_.resize(n);
201  hltReject_.resize(n);
202  hltErrors_.resize(n);
203 
204  L1AlgoAccept_.resize(la);
205  L1AlgoAcceptPhysics_.resize(la);
206  L1AlgoAcceptCalibration_.resize(la);
207  L1AlgoAcceptRandom_.resize(la);
208 
209  L1TechAccept_.resize(lt);
210  L1TechAcceptPhysics_.resize(lt);
211  L1TechAcceptCalibration_.resize(lt);
212  L1TechAcceptRandom_.resize(lt);
213 
214  L1Global_.resize(lg);
215  //Resize per-dataset counter
216  hltDatasets_.resize(d);
217  //Resize htlIndex
218  hltIndex_.resize(d);
219  //Set-up hltIndex
220  for (unsigned int ds = 0; ds < d; ds++) {
221  unsigned int size = datasetContents_[ds].size();
222  hltIndex_[ds].reserve(size);
223  for (unsigned int p = 0; p < size; p++) {
224  unsigned int i = hltConfig_.triggerIndex(datasetContents_[ds][p]);
225  if (i<n) {
226  hltIndex_[ds].push_back(i);
227  }
228  }
229  }
230  //Find the positions of seeding and prescaler modules
231  posL1s_.resize(n);
232  posPre_.resize(n);
233  for (unsigned int i = 0; i < n; ++i) {
234  posL1s_[i] = -1;
235  posPre_[i] = -1;
236  const std::vector<std::string> & moduleLabels(hltConfig_.moduleLabels(i));
237  for (unsigned int j = 0; j < moduleLabels.size(); ++j) {
238  const std::string & label = hltConfig_.moduleType(moduleLabels[j]);
239  if (label == "HLTLevel1GTSeed")
240  posL1s_[i] = j;
241  else if (label == "HLTPrescaler")
242  posPre_[i] = j;
243  }
244  }
245  }
246  resetLumi();
247 }//End resetRun function
size
Write out results.
const std::string moduleType(const std::string &module) const
C++ class name of module.
std::vector< unsigned int > hltDatasets_
std::vector< unsigned int > L1AlgoAccept_
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::vector< unsigned int > L1AlgoAcceptPhysics_
std::vector< unsigned int > hltErrors_
std::vector< unsigned int > L1TechAcceptRandom_
std::vector< unsigned int > hltL1s_
std::vector< unsigned int > L1TechAcceptCalibration_
std::vector< unsigned int > L1AlgoAcceptRandom_
std::vector< std::vector< unsigned int > > hltIndex_
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
std::vector< unsigned int > hltAccept_
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
std::vector< std::string > hltNames_
HLTConfigProvider hltConfig_
const L1GtTriggerMask * m_l1tTechMask
std::vector< std::string > datasetNames_
std::vector< std::string > L1GlobalType_
std::vector< unsigned int > hltReject_
std::vector< int > posL1s_
std::vector< std::string > L1AlgoNames_
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< unsigned int > L1TechAccept_
const L1GtTriggerMask * m_l1tAlgoMask
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_
std::vector< int > posPre_
std::vector< unsigned int > L1TechAcceptPhysics_
std::vector< std::string > L1TechNames_
std::vector< unsigned int > L1AlgoAcceptCalibration_
const std::vector< std::string > & datasetNames() const
std::vector< unsigned int > hltPre_
void TriggerJSONMonitoring::writeDefJson ( std::string  path)

Definition at line 740 of file TriggerJSONMonitoring.cc.

References HIPAlignmentAlgorithm_cfi::outfile.

Referenced by beginRun().

740  {
741 
742  std::ofstream outfile( path );
743  outfile << "{" << std::endl;
744  outfile << " \"data\" : [" << std::endl;
745  outfile << " {" ;
746  outfile << " \"name\" : \"Processed\"," ; //***
747  outfile << " \"type\" : \"integer\"," ;
748  outfile << " \"operation\" : \"histo\"}," << std::endl;
749 
750  outfile << " {" ;
751  outfile << " \"name\" : \"Path-WasRun\"," ;
752  outfile << " \"type\" : \"integer\"," ;
753  outfile << " \"operation\" : \"histo\"}," << std::endl;
754 
755  outfile << " {" ;
756  outfile << " \"name\" : \"Path-AfterL1Seed\"," ;
757  outfile << " \"type\" : \"integer\"," ;
758  outfile << " \"operation\" : \"histo\"}," << std::endl;
759 
760  outfile << " {" ;
761  outfile << " \"name\" : \"Path-AfterPrescale\"," ;
762  outfile << " \"type\" : \"integer\"," ;
763  outfile << " \"operation\" : \"histo\"}," << std::endl;
764 
765  outfile << " {" ;
766  outfile << " \"name\" : \"Path-Accepted\"," ;
767  outfile << " \"type\" : \"integer\"," ;
768  outfile << " \"operation\" : \"histo\"}," << std::endl;
769 
770  outfile << " {" ;
771  outfile << " \"name\" : \"Path-Rejected\"," ;
772  outfile << " \"type\" : \"integer\"," ;
773  outfile << " \"operation\" : \"histo\"}," << std::endl;
774 
775  outfile << " {" ;
776  outfile << " \"name\" : \"Path-Errors\"," ;
777  outfile << " \"type\" : \"integer\"," ;
778  outfile << " \"operation\" : \"histo\"}," << std::endl;
779 
780  outfile << " {" ;
781  outfile << " \"name\" : \"Dataset-Accepted\"," ;
782  outfile << " \"type\" : \"integer\"," ;
783  outfile << " \"operation\" : \"histo\"}," << std::endl;
784 
785  outfile << " {" ;
786  outfile << " \"name\" : \"Prescale-Index\"," ;
787  outfile << " \"type\" : \"integer\"," ;
788  outfile << " \"operation\" : \"sample\"}" << std::endl;
789 
790  outfile << " ]" << std::endl;
791  outfile << "}" << std::endl;
792 
793  outfile.close();
794 }//End writeDefJson function
void TriggerJSONMonitoring::writeL1DefJson ( std::string  path)

Definition at line 798 of file TriggerJSONMonitoring.cc.

References HIPAlignmentAlgorithm_cfi::outfile.

Referenced by beginRun().

798  {
799 
800  std::ofstream outfile( path );
801  outfile << "{" << std::endl;
802  outfile << " \"data\" : [" << std::endl;
803  outfile << " {" ;
804  outfile << " \"name\" : \"Processed\"," ;
805  outfile << " \"type\" : \"integer\"," ;
806  outfile << " \"operation\" : \"histo\"}," << std::endl;
807 
808  outfile << " {" ;
809  outfile << " \"name\" : \"L1-AlgoAccepted\"," ;
810  outfile << " \"type\" : \"integer\"," ;
811  outfile << " \"operation\" : \"histo\"}," << std::endl;
812 
813  outfile << " {" ;
814  outfile << " \"name\" : \"L1-TechAccepted\"," ;
815  outfile << " \"type\" : \"integer\"," ;
816  outfile << " \"operation\" : \"histo\"}," << std::endl;
817 
818  outfile << " {" ;
819  outfile << " \"name\" : \"L1-AlgoAccepted-Physics\"," ;
820  outfile << " \"type\" : \"integer\"," ;
821  outfile << " \"operation\" : \"histo\"}," << std::endl;
822 
823  outfile << " {" ;
824  outfile << " \"name\" : \"L1-TechAccepted-Physics\"," ;
825  outfile << " \"type\" : \"integer\"," ;
826  outfile << " \"operation\" : \"histo\"}," << std::endl;
827 
828  outfile << " {" ;
829  outfile << " \"name\" : \"L1-AlgoAccepted-Calibration\"," ;
830  outfile << " \"type\" : \"integer\"," ;
831  outfile << " \"operation\" : \"histo\"}," << std::endl;
832 
833  outfile << " {" ;
834  outfile << " \"name\" : \"L1-TechAccepted-Calibration\"," ;
835  outfile << " \"type\" : \"integer\"," ;
836  outfile << " \"operation\" : \"histo\"}," << std::endl;
837 
838  outfile << " {" ;
839  outfile << " \"name\" : \"L1-AlgoAccepted-Random\"," ;
840  outfile << " \"type\" : \"integer\"," ;
841  outfile << " \"operation\" : \"histo\"}," << std::endl;
842 
843  outfile << " {" ;
844  outfile << " \"name\" : \"L1-TechAccepted-Random\"," ;
845  outfile << " \"type\" : \"integer\"," ;
846  outfile << " \"operation\" : \"histo\"}," << std::endl;
847 
848  outfile << " {" ;
849  outfile << " \"name\" : \"L1-Global\"," ;
850  outfile << " \"type\" : \"integer\"," ;
851  outfile << " \"operation\" : \"histo\"}" << std::endl;
852 
853  outfile << " ]" << std::endl;
854  outfile << "}" << std::endl;
855 
856  outfile.close();
857 }//End writeL1DefJson function

Member Data Documentation

AlgorithmMap TriggerJSONMonitoring::algorithmMap

Definition at line 154 of file TriggerJSONMonitoring.h.

Referenced by beginRun(), and resetRun().

std::string TriggerJSONMonitoring::baseRunDir_

Definition at line 160 of file TriggerJSONMonitoring.h.

Referenced by beginRun(), and endLuminosityBlockSummary().

std::vector<std::vector<std::string> > TriggerJSONMonitoring::datasetContents_

Definition at line 166 of file TriggerJSONMonitoring.h.

Referenced by resetRun().

std::vector<std::string> TriggerJSONMonitoring::datasetNames_

Definition at line 165 of file TriggerJSONMonitoring.h.

Referenced by beginRun(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::hltAccept_

Definition at line 188 of file TriggerJSONMonitoring.h.

Referenced by analyze(), endLuminosityBlockSummary(), resetLumi(), and resetRun().

HLTConfigProvider TriggerJSONMonitoring::hltConfig_

Definition at line 152 of file TriggerJSONMonitoring.h.

Referenced by beginRun(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::hltDatasets_

Definition at line 192 of file TriggerJSONMonitoring.h.

Referenced by analyze(), endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::hltErrors_

Definition at line 190 of file TriggerJSONMonitoring.h.

Referenced by analyze(), endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<std::vector<unsigned int> > TriggerJSONMonitoring::hltIndex_

Definition at line 163 of file TriggerJSONMonitoring.h.

Referenced by analyze(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::hltL1s_

Definition at line 186 of file TriggerJSONMonitoring.h.

Referenced by analyze(), endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<std::string> TriggerJSONMonitoring::hltNames_

Definition at line 164 of file TriggerJSONMonitoring.h.

Referenced by analyze(), beginRun(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::hltPre_

Definition at line 187 of file TriggerJSONMonitoring.h.

Referenced by analyze(), endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::hltReject_

Definition at line 189 of file TriggerJSONMonitoring.h.

Referenced by analyze(), endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::hltWasRun_

Definition at line 185 of file TriggerJSONMonitoring.h.

Referenced by analyze(), endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::L1AlgoAccept_

Definition at line 194 of file TriggerJSONMonitoring.h.

Referenced by endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::L1AlgoAcceptCalibration_

Definition at line 198 of file TriggerJSONMonitoring.h.

Referenced by endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::L1AlgoAcceptPhysics_

Definition at line 196 of file TriggerJSONMonitoring.h.

Referenced by endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::L1AlgoAcceptRandom_

Definition at line 200 of file TriggerJSONMonitoring.h.

Referenced by endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<int> TriggerJSONMonitoring::L1AlgoBitNumber_

Definition at line 174 of file TriggerJSONMonitoring.h.

std::vector<std::string> TriggerJSONMonitoring::L1AlgoNames_

Definition at line 173 of file TriggerJSONMonitoring.h.

Referenced by beginRun(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::L1Global_

Definition at line 202 of file TriggerJSONMonitoring.h.

Referenced by analyze(), endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<std::string> TriggerJSONMonitoring::L1GlobalType_

Definition at line 177 of file TriggerJSONMonitoring.h.

Referenced by beginRun(), endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::L1TechAccept_

Definition at line 195 of file TriggerJSONMonitoring.h.

Referenced by endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::L1TechAcceptCalibration_

Definition at line 199 of file TriggerJSONMonitoring.h.

Referenced by endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::L1TechAcceptPhysics_

Definition at line 197 of file TriggerJSONMonitoring.h.

Referenced by endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<unsigned int> TriggerJSONMonitoring::L1TechAcceptRandom_

Definition at line 201 of file TriggerJSONMonitoring.h.

Referenced by endLuminosityBlockSummary(), resetLumi(), and resetRun().

std::vector<int> TriggerJSONMonitoring::L1TechBitNumber_

Definition at line 176 of file TriggerJSONMonitoring.h.

std::vector<std::string> TriggerJSONMonitoring::L1TechNames_

Definition at line 175 of file TriggerJSONMonitoring.h.

Referenced by beginRun(), and resetRun().

edm::InputTag TriggerJSONMonitoring::level1Results_

Definition at line 148 of file TriggerJSONMonitoring.h.

const L1GtTriggerMenu* TriggerJSONMonitoring::m_l1GtMenu

Definition at line 153 of file TriggerJSONMonitoring.h.

Referenced by beginRun().

edm::EDGetTokenT<GlobalAlgBlkBxCollection> TriggerJSONMonitoring::m_l1t_results

Definition at line 149 of file TriggerJSONMonitoring.h.

Referenced by analyze().

const L1GtTriggerMask* TriggerJSONMonitoring::m_l1tAlgoMask

Definition at line 157 of file TriggerJSONMonitoring.h.

Referenced by beginRun(), and resetRun().

const L1GtTriggerMask* TriggerJSONMonitoring::m_l1tTechMask

Definition at line 158 of file TriggerJSONMonitoring.h.

Referenced by beginRun(), and resetRun().

unsigned int TriggerJSONMonitoring::oldLumi

Definition at line 205 of file TriggerJSONMonitoring.h.

Referenced by analyze(), and beginRun().

unsigned int TriggerJSONMonitoring::oldPrescaleIndex

Definition at line 206 of file TriggerJSONMonitoring.h.

Referenced by analyze(), and beginRun().

std::vector<int> TriggerJSONMonitoring::posL1s_

Definition at line 168 of file TriggerJSONMonitoring.h.

Referenced by analyze(), and resetRun().

std::vector<int> TriggerJSONMonitoring::posPre_

Definition at line 169 of file TriggerJSONMonitoring.h.

Referenced by analyze(), and resetRun().

unsigned int TriggerJSONMonitoring::prescaleIndex_

Definition at line 183 of file TriggerJSONMonitoring.h.

Referenced by analyze(), endLuminosityBlockSummary(), and resetLumi().

unsigned int TriggerJSONMonitoring::processed_

Definition at line 182 of file TriggerJSONMonitoring.h.

Referenced by analyze(), endLuminosityBlockSummary(), and resetLumi().

std::string TriggerJSONMonitoring::stHltJsd_

Definition at line 171 of file TriggerJSONMonitoring.h.

Referenced by beginRun(), and endLuminosityBlockSummary().

std::string TriggerJSONMonitoring::stL1Jsd_

Definition at line 179 of file TriggerJSONMonitoring.h.

Referenced by beginRun(), and endLuminosityBlockSummary().

AlgorithmMap TriggerJSONMonitoring::technicalMap

Definition at line 155 of file TriggerJSONMonitoring.h.

Referenced by beginRun(), and resetRun().

edm::InputTag TriggerJSONMonitoring::triggerResults_

Definition at line 145 of file TriggerJSONMonitoring.h.

Referenced by analyze(), and beginRun().

edm::EDGetTokenT<edm::TriggerResults> TriggerJSONMonitoring::triggerResultsToken_

Definition at line 146 of file TriggerJSONMonitoring.h.

Referenced by analyze().