CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Types | Protected Attributes
hcaldqm::DigiRunSummary Class Reference

#include <DigiRunSummary.h>

Inheritance diagram for hcaldqm::DigiRunSummary:
hcaldqm::DQClient hcaldqm::DQModule

Public Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DigiRunSummary (std::string const &, std::string const &, edm::ParameterSet const &, edm::ConsumesCollector &iC)
 
std::vector< flag::FlagendJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void endLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 ~DigiRunSummary () override
 
- Public Member Functions inherited from hcaldqm::DQClient
virtual void beginLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &lb, edm::EventSetup const &)
 
 DQClient (std::string const &, std::string const &, edm::ParameterSet const &, edm::ConsumesCollector &iC)
 
 ~DQClient () override
 
- Public Member Functions inherited from hcaldqm::DQModule
 DQModule (edm::ParameterSet const &)
 
virtual ~DQModule () noexcept(false)
 

Protected Types

enum  DigiLSFlag {
  fDigiSize = 0, fNChsHF = 1, fUnknownIds = 2, fLED = 3,
  nLSFlags = 4, fUniHF = 5, fDead = 6, nDigiFlag = 7
}
 

Protected Attributes

bool _booked
 
Container2D _cOccupancy_depth
 
electronicsmap::ElectronicsMap _ehashmap
 
filter::HashFilter _filter_FEDHF
 
filter::HashFilter _filter_uTCA
 
filter::HashFilter _filter_VME
 
MonitorElement_meNumEvents
 
std::map< HcalSubdetector, uint32_t > _refDigiSize
 
double _thresh_unihf
 
std::vector< int > _vFEDsuTCA
 
std::vector< int > _vFEDsVME
 
std::vector< LSSummary_vflagsLS
 
std::vector< uint32_t > _vhashFEDHF
 
std::vector< uint32_t > _vhashuTCA
 
std::vector< uint32_t > _vhashVME
 
ContainerXXX< uint32_t > _xDead
 
ContainerXXX< uint32_t > _xDigiSize
 
ContainerXXX< uint32_t > _xNChs
 
ContainerXXX< uint32_t > _xNChsNominal
 
ContainerXXX< uint32_t > _xUni
 
ContainerXXX< uint32_t > _xUniHF
 
- Protected Attributes inherited from hcaldqm::DQClient
HcalElectronicsMap const * _emap
 
int _maxProcessedLS
 
std::string _taskname
 
int _totalLS
 
std::vector< uint32_t > _vcdaqEids
 
std::vector< int > _vCrates
 
std::vector< int > _vFEDs
 
std::vector< uint32_t > _vhashCrates
 
std::vector< uint32_t > _vhashFEDs
 
ContainerXXX< uint32_t > _xQuality
 
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcdhcalChannelQualityToken_
 
edm::ESGetToken< HcalDbService, HcalDbRecordhcalDbServiceToken_
 
edm::ESGetToken< RunInfo, RunInfoRcdrunInfoToken_
 
- Protected Attributes inherited from hcaldqm::DQModule
int _currentLS
 
int _debug
 
int _evsPerLS
 
int _evsTotal
 
Logger _logger
 
int _maxLS
 
ModuleType _mtype
 
std::string _name
 
ProcessingType _ptype
 
std::string _runkeyName
 
int _runkeyVal
 
std::string _subsystem
 

Additional Inherited Members

- Public Types inherited from hcaldqm::DQClient
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Static Public Member Functions inherited from hcaldqm::DQModule
static void fillPSetDescription (edm::ParameterSetDescription &desc)
 

Detailed Description

Definition at line 9 of file DigiRunSummary.h.

Member Enumeration Documentation

◆ DigiLSFlag

Enumerator
fDigiSize 
fNChsHF 
fUnknownIds 
fLED 
nLSFlags 
fUniHF 
fDead 
nDigiFlag 

Definition at line 41 of file DigiRunSummary.h.

Constructor & Destructor Documentation

◆ DigiRunSummary()

hcaldqm::DigiRunSummary::DigiRunSummary ( std::string const &  name,
std::string const &  taskname,
edm::ParameterSet const &  ps,
edm::ConsumesCollector iC 
)

Definition at line 6 of file DigiRunSummary.cc.

References _refDigiSize, _thresh_unihf, edm::ParameterSet::getUntrackedParameter(), HcalBarrel, HcalEndcap, HcalForward, and HcalOuter.

10  : DQClient(name, taskname, ps, iC), _booked(false) {
11  _thresh_unihf = ps.getUntrackedParameter<double>("thresh_unihf", 0.2);
12 
13  std::vector<uint32_t> vrefDigiSize = ps.getUntrackedParameter<std::vector<uint32_t>>("refDigiSize");
14  _refDigiSize[HcalBarrel] = vrefDigiSize[0];
15  _refDigiSize[HcalEndcap] = vrefDigiSize[1];
16  _refDigiSize[HcalOuter] = vrefDigiSize[2];
17  _refDigiSize[HcalForward] = vrefDigiSize[3];
18  }
DQClient(std::string const &, std::string const &, edm::ParameterSet const &, edm::ConsumesCollector &iC)
Definition: DQClient.cc:5
std::map< HcalSubdetector, uint32_t > _refDigiSize

◆ ~DigiRunSummary()

hcaldqm::DigiRunSummary::~DigiRunSummary ( )
inlineoverride

Definition at line 12 of file DigiRunSummary.h.

12 {}

Member Function Documentation

◆ beginRun()

void hcaldqm::DigiRunSummary::beginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
overridevirtual

Reimplemented from hcaldqm::DQClient.

Definition at line 20 of file DigiRunSummary.cc.

References _cOccupancy_depth, _ehashmap, hcaldqm::DQClient::_emap, _filter_FEDHF, _filter_uTCA, _filter_VME, hcaldqm::DQModule::_name, hcaldqm::DQModule::_ptype, _vhashFEDHF, _vhashuTCA, _vhashVME, _xDead, _xDigiSize, _xNChs, _xNChsNominal, _xUni, _xUniHF, HcalElectronicsMap::allPrecisionId(), hcaldqm::DQClient::beginRun(), hcaldqm::ContainerXXX< STDTYPE >::book(), hcaldqm::constants::CRATE_uTCA_MIN, hcaldqm::constants::CRATE_VME_MIN, runTauDisplay::eid, hcaldqm::electronicsmap::fD2EHashMap, hcaldqm::hashfunctions::fdepth, hcaldqm::hashfunctions::fElectronics, hcaldqm::hashfunctions::fFED, hcaldqm::hashfunctions::fFEDSlot, hcaldqm::filter::fFilter, hcaldqm::constants::FIBER_uTCA_MIN1, hcaldqm::constants::FIBER_VME_MIN, hcaldqm::constants::FIBERCH_MIN, hcaldqm::quantity::fieta, hcaldqm::quantity::fiphi, hcaldqm::quantity::fN, hcaldqm::fOffline, hcaldqm::filter::fPreserver, hcaldqm::ContainerXXX< STDTYPE >::get(), hcaldqm::ContainerXXX< STDTYPE >::initialize(), hcaldqm::filter::HashFilter::initialize(), hcaldqm::Container2D::initialize(), hcaldqm::electronicsmap::ElectronicsMap::initialize(), hcaldqm::electronicsmap::ElectronicsMap::lookup(), nano_mu_digi_cff::rawId, hcaldqm::constants::SLOT_uTCA_MIN, and hcaldqm::constants::SPIGOT_MIN.

20  {
21  DQClient::beginRun(r, es);
22 
23  if (_ptype != fOffline)
24  return;
25 
26  // INITIALIZE WHAT NEEDS TO BE INITIALIZE ONLY ONCE!
28  _vhashVME.push_back(
32  _vhashVME); // filter out VME
34  _vhashuTCA); // filter out uTCA
42  _vhashFEDHF); // preserve only HF FEDs
43 
48 
49  _xDead.book(_emap);
55  _xNChs.book(_emap);
57 
59  "Occupancy",
61  new quantity::DetectorQuantity(quantity::fieta),
62  new quantity::DetectorQuantity(quantity::fiphi),
63  new quantity::ValueQuantity(quantity::fN),
64  0);
65 
66  // GET THE NOMINAL NUMBER OF CHANNELS PER FED
67  std::vector<HcalGenericDetId> gids = _emap->allPrecisionId();
68  for (std::vector<HcalGenericDetId>::const_iterator it = gids.begin(); it != gids.end(); ++it) {
69  if (!it->isHcalDetId())
70  continue;
71  HcalDetId did(it->rawId());
74  }
75  }
ContainerXXX< uint32_t > _xDigiSize
int const CRATE_VME_MIN
Definition: Constants.h:99
ContainerXXX< uint32_t > _xUni
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
Definition: DQClient.cc:24
int const SPIGOT_MIN
Definition: Constants.h:124
HcalElectronicsMap const * _emap
Definition: DQClient.h:60
filter::HashFilter _filter_FEDHF
int const FIBER_VME_MIN
Definition: Constants.h:129
int const FIBERCH_MIN
Definition: Constants.h:138
ProcessingType _ptype
Definition: DQModule.h:44
std::vector< uint32_t > _vhashuTCA
filter::HashFilter _filter_uTCA
Container2D _cOccupancy_depth
int const FIBER_uTCA_MIN1
Definition: Constants.h:132
ContainerXXX< uint32_t > _xNChsNominal
std::string _name
Definition: DQModule.h:42
std::vector< uint32_t > _vhashFEDHF
int const CRATE_uTCA_MIN
Definition: Constants.h:104
std::vector< uint32_t > _vhashVME
virtual void book(HcalElectronicsMap const *)
Definition: ContainerXXX.h:87
virtual void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: Container2D.cc:25
ContainerXXX< uint32_t > _xNChs
virtual STDTYPE & get(HcalDetId const &)
Definition: ContainerXXX.h:197
std::vector< HcalGenericDetId > allPrecisionId() const
electronicsmap::ElectronicsMap _ehashmap
virtual void initialize(FilterType ftype, hashfunctions::HashType htype, std::vector< uint32_t > const &)
Definition: HashFilter.cc:17
virtual void initialize(hashfunctions::HashType, int debug=0)
Definition: ContainerXXX.h:81
filter::HashFilter _filter_VME
Readout chain identification for Hcal.
ContainerXXX< uint32_t > _xUniHF
int const SLOT_uTCA_MIN
Definition: Constants.h:111
ContainerXXX< uint32_t > _xDead

◆ endJob()

std::vector< flag::Flag > hcaldqm::DigiRunSummary::endJob ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
overridevirtual

Reimplemented from hcaldqm::DQClient.

Definition at line 227 of file DigiRunSummary.cc.

References _cOccupancy_depth, _ehashmap, hcaldqm::DQClient::_emap, hcaldqm::DQClient::_maxProcessedLS, hcaldqm::DQModule::_name, hcaldqm::DQModule::_ptype, hcaldqm::flag::Flag::_state, hcaldqm::DQModule::_subsystem, hcaldqm::DQClient::_taskname, _thresh_unihf, _vflagsLS, hcaldqm::DQClient::_vhashCrates, _xDead, _xUni, _xUniHF, HcalElectronicsMap::allPrecisionId(), hcaldqm::ContainerXXX< STDTYPE >::begin(), hcaldqm::ContainerSingle2D::book(), hcaldqm::Container2D::book(), runTauDisplay::eid, hcaldqm::ContainerXXX< STDTYPE >::end(), hcaldqm::flag::fBAD, hcaldqm::hashfunctions::fCrate, fDead, hcaldqm::hashfunctions::fdepth, fDigiSize, hcaldqm::quantity::fFiberVMEFiberCh, hcaldqm::flag::fGOOD, hcaldqm::quantity::fieta, hcaldqm::Container2D::fill(), hcaldqm::quantity::fiphi, nanoDQM_cfi::Flag, fLED, hcaldqm::quantity::fN, fNChsHF, hcaldqm::fOffline, hcaldqm::quantity::fSpigot, hcaldqm::quantity::fState, fUniHF, fUnknownIds, hcaldqm::ContainerXXX< STDTYPE >::get(), hcaldqm::Container2D::getBinContent(), HcalForward, cuy::ib, caHitNtupletGeneratorKernels::if(), hcaldqm::Container2D::initialize(), hcaldqm::ContainerSingle2D::initialize(), hcaldqm::Container1D::load(), hcaldqm::electronicsmap::ElectronicsMap::lookup(), HcalElectronicsMap::lookup(), nDigiFlag, nLSFlags, hcaldqm::ContainerXXX< STDTYPE >::reset(), hcaldqm::ContainerSingle2D::setBinContent(), hcaldqm::Container2D::setBinContent(), and HcalDetId::subdet().

227  {
228  if (_ptype != fOffline)
229  return std::vector<flag::Flag>();
230 
231  _xDead.reset();
232  _xUniHF.reset();
233  _xUni.reset();
234 
235  // PREPARE LS AND RUN BASED FLAGS TO USE IT FOR BOOKING
236  std::vector<flag::Flag> vflagsPerLS;
237  std::vector<flag::Flag> vflagsPerRun;
238  vflagsPerLS.resize(nLSFlags);
239  vflagsPerRun.resize(nDigiFlag - nLSFlags + 1);
240  vflagsPerLS[fDigiSize] = flag::Flag("DigiSize");
241  vflagsPerLS[fNChsHF] = flag::Flag("NChsHF");
242  vflagsPerLS[fUnknownIds] = flag::Flag("UnknownIds");
243  vflagsPerLS[fLED] = flag::Flag("LEDMisfire");
244  vflagsPerRun[fDigiSize] = flag::Flag("DigiSize");
245  vflagsPerRun[fNChsHF] = flag::Flag("NChsHF");
246  vflagsPerRun[fUniHF - nLSFlags + 1] = flag::Flag("UniSlotHF");
247  vflagsPerRun[fDead - nLSFlags + 1] = flag::Flag("Dead");
248 
249  // INITIALIZE SUMMARY CONTAINERS
250  ContainerSingle2D cSummaryvsLS;
251  Container2D cSummaryvsLS_Crate;
252  cSummaryvsLS.initialize(_name,
253  "SummaryvsLS",
254  new quantity::LumiSection(_maxProcessedLS),
255  new quantity::CrateQuantity(_emap),
256  new quantity::ValueQuantity(quantity::fState),
257  0);
258  cSummaryvsLS.book(ib, _subsystem);
259  cSummaryvsLS_Crate.initialize(_name,
260  "SummaryvsLS",
262  new quantity::LumiSection(_maxProcessedLS),
263  new quantity::FlagQuantity(vflagsPerLS),
264  new quantity::ValueQuantity(quantity::fState),
265  0);
266  cSummaryvsLS_Crate.book(ib, _emap, _subsystem);
267 
268  // INITIALIZE CONTAINERS WE NEED TO LOAD or BOOK
269  Container2D cOccupancyCut_depth;
270  Container2D cDead_depth, cDead_Crate;
271  cOccupancyCut_depth.initialize(_taskname,
272  "OccupancyCut",
274  new quantity::DetectorQuantity(quantity::fieta),
275  new quantity::DetectorQuantity(quantity::fiphi),
276  new quantity::ValueQuantity(quantity::fN),
277  0);
278  cDead_depth.initialize(_name,
279  "Dead",
281  new quantity::DetectorQuantity(quantity::fieta),
282  new quantity::DetectorQuantity(quantity::fiphi),
283  new quantity::ValueQuantity(quantity::fN),
284  0);
285  cDead_Crate.initialize(_name,
286  "Dead",
288  new quantity::ElectronicsQuantity(quantity::fSpigot),
289  new quantity::ElectronicsQuantity(quantity::fFiberVMEFiberCh),
290  new quantity::ValueQuantity(quantity::fN),
291  0);
292 
293  // LOAD
294  cOccupancyCut_depth.load(ig, _emap, _subsystem);
295  cDead_depth.book(ib, _emap, _subsystem);
296  cDead_Crate.book(ib, _emap, _subsystem);
297 
298  // ANALYZE RUN BASED QUANTITIES
299  std::vector<HcalGenericDetId> gids = _emap->allPrecisionId();
300  for (std::vector<HcalGenericDetId>::const_iterator it = gids.begin(); it != gids.end(); ++it) {
301  if (!it->isHcalDetId())
302  continue;
303 
304  HcalDetId did = HcalDetId(it->rawId());
306 
307  if (_cOccupancy_depth.getBinContent(did) < 1) {
308  _xDead.get(eid)++;
309  cDead_depth.fill(did);
310  cDead_Crate.fill(eid);
311  }
312  if (did.subdet() == HcalForward)
313  _xUniHF.get(eid) += cOccupancyCut_depth.getBinContent(did);
314  }
315  // ANALYZE FOR HF SLOT UNIFORMITY
316  for (uintCompactMap::const_iterator it = _xUniHF.begin(); it != _xUniHF.end(); ++it) {
317  uint32_t hash1 = it->first;
318  HcalElectronicsId eid1(hash1);
319  double x1 = it->second;
320 
321  for (uintCompactMap::const_iterator jt = _xUniHF.begin(); jt != _xUniHF.end(); ++jt) {
322  if (jt == it)
323  continue;
324 
325  double x2 = jt->second;
326  if (x2 == 0)
327  continue;
328  if (x1 / x2 < _thresh_unihf)
329  _xUni.get(eid1)++;
330  }
331  }
332 
333  /*
334  * Iterate over each crate
335  * Iterate over each LS Summary
336  * Iterate over all flags
337  * set...
338  */
339  // iterate over all crates
340  std::vector<flag::Flag> sumflags;
341  int icrate = 0;
342  for (auto& it_crate : _vhashCrates) {
343  flag::Flag fSumRun("DIGI"); // summary flag for this FED
344  flag::Flag ffDead("Dead");
345  flag::Flag ffUniSlotHF("UniSlotHF");
346  HcalElectronicsId eid(it_crate);
347 
348  // skip monitoring for ZDC crate for now (Oct. 1 2023), the Hcal DQM group need to discuss with the ZDC group on the monitoring flags settings.
349  if (HcalGenericDetId(_emap->lookup(eid)).isHcalZDCDetId()) {
350  sumflags.push_back(fSumRun);
351  continue;
352  }
353 
355 
356  // ITERATE OVER EACH LS
357  for (std::vector<LSSummary>::const_iterator itls = _vflagsLS.begin(); itls != _vflagsLS.end(); ++itls) {
358  int iflag = 0;
359  flag::Flag fSumLS("DIGI");
360  for (std::vector<flag::Flag>::const_iterator ft = itls->_vflags[icrate].begin();
361  ft != itls->_vflags[icrate].end();
362  ++ft) {
363  cSummaryvsLS_Crate.setBinContent(eid, itls->_LS, int(iflag), ft->_state);
364  fSumLS += (*ft);
365  iflag++;
366  }
367  cSummaryvsLS.setBinContent(eid, itls->_LS, fSumLS._state);
368  fSumRun += fSumLS;
369  }
370 
371  // EVALUATE RUN BASED FLAGS
372  if (_xDead.get(eid) > 0)
373  ffDead._state = flag::fBAD;
374  else
375  ffDead._state = flag::fGOOD;
376  if (did.subdet() == HcalForward) {
377  if (_xUni.get(eid) > 0)
378  ffUniSlotHF._state = flag::fBAD;
379  else
380  ffUniSlotHF._state = flag::fGOOD;
381  }
382  fSumRun += ffDead + ffUniSlotHF;
383 
384  // push the summary flag for this FED for the Whole Run
385  sumflags.push_back(fSumRun);
386 
387  // increment fed
388  icrate++;
389  }
390 
391  return sumflags;
392  }
std::vector< LSSummary > _vflagsLS
ContainerXXX< uint32_t > _xUni
virtual CompactMap::const_iterator begin()
Definition: ContainerXXX.h:69
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
std::string _taskname
Definition: DQClient.h:50
HcalElectronicsMap const * _emap
Definition: DQClient.h:60
virtual void reset()
Definition: ContainerXXX.h:292
std::vector< uint32_t > _vhashCrates
Definition: DQClient.h:64
virtual CompactMap::const_iterator end()
Definition: ContainerXXX.h:70
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
ProcessingType _ptype
Definition: DQModule.h:44
Container2D _cOccupancy_depth
std::string _name
Definition: DQModule.h:42
double getBinContent(HcalDetId const &) override
Definition: Container2D.cc:132
virtual STDTYPE & get(HcalDetId const &)
Definition: ContainerXXX.h:197
std::vector< HcalGenericDetId > allPrecisionId() const
electronicsmap::ElectronicsMap _ehashmap
std::string _subsystem
Definition: DQModule.h:49
Readout chain identification for Hcal.
ContainerXXX< uint32_t > _xUniHF
ContainerXXX< uint32_t > _xDead
ib
Definition: cuy.py:661

◆ endLuminosityBlock()

void hcaldqm::DigiRunSummary::endLuminosityBlock ( DQMStore::IBooker ib,
DQMStore::IGetter ig,
edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
)
overridevirtual

Reimplemented from hcaldqm::DQClient.

Definition at line 80 of file DigiRunSummary.cc.

References _booked, _cOccupancy_depth, hcaldqm::DQModule::_currentLS, _ehashmap, hcaldqm::DQClient::_emap, _meNumEvents, hcaldqm::DQModule::_ptype, _refDigiSize, hcaldqm::DQModule::_subsystem, hcaldqm::DQClient::_taskname, _vflagsLS, hcaldqm::DQClient::_vhashCrates, _xDigiSize, _xNChs, _xNChsNominal, HcalElectronicsMap::allPrecisionId(), hcaldqm::Container2D::book(), runTauDisplay::eid, hcaldqm::DQClient::endLuminosityBlock(), hcaldqm::flag::fBAD, hcaldqm::hashfunctions::fCrate, hcaldqm::hashfunctions::fdepth, hcaldqm::quantity::fDigiSize, fDigiSize, hcaldqm::flag::fGOOD, hcaldqm::quantity::fieta, hcaldqm::Container2D::fill(), hcaldqm::quantity::fiphi, nanoDQM_cfi::Flag, fLED, hcaldqm::quantity::fN, hcaldqm::flag::fNA, fNChsHF, hcaldqm::fOffline, fUnknownIds, hcaldqm::ContainerXXX< STDTYPE >::get(), dqm::implementation::IGetter::get(), hcaldqm::Container2D::getBinContent(), dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getEntries(), hcaldqm::Container1D::getMean(), hcaldqm::Container1D::getRMS(), dqm::legacy::MonitorElement::getTH1(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, cuy::ib, hcaldqm::Container2D::initialize(), hcaldqm::Container1D::load(), hcaldqm::electronicsmap::ElectronicsMap::lookup(), HcalElectronicsMap::lookup(), nLSFlags, simpleEdmComparison::numEvents, hcaldqm::ContainerXXX< STDTYPE >::reset(), hcaldqm::Container1D::reset(), dqm::impl::MonitorElement::setBinContent(), AlCaHLTBitMon_QueryRunRegistry::string, and HcalDetId::subdet().

83  {
84  DQClient::endLuminosityBlock(ib, ig, lb, es);
85 
86  if (_ptype != fOffline)
87  return;
88 
89  LSSummary lssum;
90  lssum._LS = _currentLS;
91 
92  _xDigiSize.reset();
93  _xNChs.reset();
94 
95  // INITIALIZE LUMI BASED HISTOGRAMS
96  Container2D cDigiSize_Crate, cOccupancy_depth;
97  cDigiSize_Crate.initialize(_taskname,
98  "DigiSize",
100  new quantity::ValueQuantity(quantity::fDigiSize),
101  new quantity::ValueQuantity(quantity::fN),
102  0);
103  cOccupancy_depth.initialize(_taskname,
104  "Occupancy",
106  new quantity::DetectorQuantity(quantity::fieta),
107  new quantity::DetectorQuantity(quantity::fiphi),
108  new quantity::ValueQuantity(quantity::fN),
109  0);
110 
111  // LOAD LUMI BASED HISTOGRAMS
112  cOccupancy_depth.load(ig, _emap, _subsystem);
113  cDigiSize_Crate.load(ig, _emap, _subsystem);
114  MonitorElement* meNumEvents = ig.get(_subsystem + "/RunInfo/NumberOfEvents");
115  int numEvents = meNumEvents->getBinContent(1);
116  bool unknownIdsPresent = ig.get(_subsystem + "/" + _taskname + "/UnknownIds")->getBinContent(1) > 0;
117 
118  // book the Numer of Events - set axis extendable
119  if (!_booked) {
120  ib.setCurrentFolder(_subsystem + "/" + _taskname);
121  _meNumEvents = ib.book1DD("NumberOfEvents", "NumberOfEvents", 1000, 1, 1001); // 1000 to start with
122  _meNumEvents->getTH1()->SetCanExtend(TH1::kXaxis);
123 
125  _booked = true;
126  }
128 
129  // ANALYZE THIS LS for LS BASED FLAGS
130  std::vector<HcalGenericDetId> gids = _emap->allPrecisionId();
131  for (std::vector<HcalGenericDetId>::const_iterator it = gids.begin(); it != gids.end(); ++it) {
132  if (!it->isHcalDetId())
133  continue;
134 
135  HcalDetId did = HcalDetId(it->rawId());
137 
138  cOccupancy_depth.getBinContent(did) > 0 ? _xNChs.get(eid)++ : _xNChs.get(eid) += 0;
139  _cOccupancy_depth.fill(did, cOccupancy_depth.getBinContent(did));
140  // digi size
141  cDigiSize_Crate.getMean(eid) != _refDigiSize[did.subdet()] ? _xDigiSize.get(eid)++ : _xDigiSize.get(eid) += 0;
142  cDigiSize_Crate.getRMS(eid) != 0 ? _xDigiSize.get(eid)++ : _xDigiSize.get(eid) += 0;
143  }
144 
145  // GENERATE SUMMARY AND STORE IT
146  std::vector<flag::Flag> vtmpflags;
147  vtmpflags.resize(nLSFlags);
148  vtmpflags[fDigiSize] = flag::Flag("DigiSize");
149  vtmpflags[fNChsHF] = flag::Flag("NChsHF");
150  vtmpflags[fUnknownIds] = flag::Flag("UnknownIds");
151  vtmpflags[fLED] = flag::Flag("LEDMisfire");
152  for (std::vector<uint32_t>::const_iterator it = _vhashCrates.begin(); it != _vhashCrates.end(); ++it) {
153  HcalElectronicsId eid(*it);
154 
155  // skip monitoring for ZDC crate for now (Oct. 1 2023), the Hcal DQM group need to discuss with the ZDC group on the monitoring flags settings.
156  if (HcalGenericDetId(_emap->lookup(eid)).isHcalZDCDetId()) {
157  for (std::vector<flag::Flag>::iterator ft = vtmpflags.begin(); ft != vtmpflags.end(); ++ft)
158  ft->reset();
159  lssum._vflags.push_back(vtmpflags);
160  continue;
161  }
162 
164 
165  // reset all the tmp flags to fNA
166  // MUST DO IT NOW! AS NCDAQ MIGHT OVERWRITE IT!
167  for (std::vector<flag::Flag>::iterator ft = vtmpflags.begin(); ft != vtmpflags.end(); ++ft)
168  ft->reset();
169 
170  if (_xDigiSize.get(eid) > 0)
171  vtmpflags[fDigiSize]._state = flag::fBAD;
172  else
173  vtmpflags[fDigiSize]._state = flag::fGOOD;
174 
175  if (did.subdet() == HcalForward) {
176  if (_xNChs.get(eid) != _xNChsNominal.get(eid))
177  vtmpflags[fNChsHF]._state = flag::fBAD;
178  else
179  vtmpflags[fNChsHF]._state = flag::fGOOD;
180  } else {
181  vtmpflags[fNChsHF]._state = flag::fNA;
182  }
183  if (unknownIdsPresent)
184  vtmpflags[fUnknownIds]._state = flag::fBAD;
185  else
186  vtmpflags[fUnknownIds]._state = flag::fGOOD;
187 
188  if ((did.subdet() == HcalBarrel) || (did.subdet() == HcalBarrel) || (did.subdet() == HcalBarrel) ||
189  (did.subdet() == HcalBarrel)) {
190  std::string ledHistName = _subsystem + "/" + _taskname + "/LED_CUCountvsLS/Subdet/";
191  if (did.subdet() == HcalBarrel) {
192  ledHistName += "HB";
193  } else if (did.subdet() == HcalEndcap) {
194  ledHistName += "HE";
195  } else if (did.subdet() == HcalOuter) {
196  ledHistName += "HO";
197  } else if (did.subdet() == HcalForward) {
198  ledHistName += "HF";
199  }
200  MonitorElement* ledHist = ig.get(ledHistName);
201  if (ledHist) {
202  bool ledSignalPresent = (ledHist->getEntries() > 0);
203  if (ledSignalPresent)
204  vtmpflags[fLED]._state = flag::fBAD;
205  else
206  vtmpflags[fLED]._state = flag::fGOOD;
207  } else {
208  vtmpflags[fLED]._state = flag::fNA;
209  }
210  } else {
211  vtmpflags[fLED]._state = flag::fNA;
212  }
213 
214  // push all the flags for this crate
215  lssum._vflags.push_back(vtmpflags);
216  }
217 
218  // push all the flags for all FEDs for this LS
219  _vflagsLS.push_back(lssum);
220  cDigiSize_Crate.reset();
221  cOccupancy_depth.reset();
222  }
std::vector< LSSummary > _vflagsLS
MonitorElement * _meNumEvents
ContainerXXX< uint32_t > _xDigiSize
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
std::string _taskname
Definition: DQClient.h:50
HcalElectronicsMap const * _emap
Definition: DQClient.h:60
virtual void reset()
Definition: ContainerXXX.h:292
std::vector< uint32_t > _vhashCrates
Definition: DQClient.h:64
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
ProcessingType _ptype
Definition: DQModule.h:44
Container2D _cOccupancy_depth
virtual void endLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: DQClient.cc:105
ContainerXXX< uint32_t > _xNChsNominal
virtual double getEntries() const
get # of entries
std::map< HcalSubdetector, uint32_t > _refDigiSize
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
ContainerXXX< uint32_t > _xNChs
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
virtual TH1 * getTH1() const
virtual STDTYPE & get(HcalDetId const &)
Definition: ContainerXXX.h:197
std::vector< HcalGenericDetId > allPrecisionId() const
electronicsmap::ElectronicsMap _ehashmap
void fill(HcalDetId const &) override
Definition: Container2D.cc:52
std::string _subsystem
Definition: DQModule.h:49
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: Container2D.cc:567
Readout chain identification for Hcal.
ib
Definition: cuy.py:661
virtual double getBinContent(int binx) const
get content of bin (1-D)

Member Data Documentation

◆ _booked

bool hcaldqm::DigiRunSummary::_booked
protected

Definition at line 33 of file DigiRunSummary.h.

Referenced by endLuminosityBlock().

◆ _cOccupancy_depth

Container2D hcaldqm::DigiRunSummary::_cOccupancy_depth
protected

Definition at line 32 of file DigiRunSummary.h.

Referenced by beginRun(), endJob(), and endLuminosityBlock().

◆ _ehashmap

electronicsmap::ElectronicsMap hcaldqm::DigiRunSummary::_ehashmap
protected

Definition at line 26 of file DigiRunSummary.h.

Referenced by beginRun(), endJob(), and endLuminosityBlock().

◆ _filter_FEDHF

filter::HashFilter hcaldqm::DigiRunSummary::_filter_FEDHF
protected

Definition at line 30 of file DigiRunSummary.h.

Referenced by beginRun().

◆ _filter_uTCA

filter::HashFilter hcaldqm::DigiRunSummary::_filter_uTCA
protected

Definition at line 30 of file DigiRunSummary.h.

Referenced by beginRun().

◆ _filter_VME

filter::HashFilter hcaldqm::DigiRunSummary::_filter_VME
protected

Definition at line 30 of file DigiRunSummary.h.

Referenced by beginRun().

◆ _meNumEvents

MonitorElement* hcaldqm::DigiRunSummary::_meNumEvents
protected

Definition at line 34 of file DigiRunSummary.h.

Referenced by endLuminosityBlock().

◆ _refDigiSize

std::map<HcalSubdetector, uint32_t> hcaldqm::DigiRunSummary::_refDigiSize
protected

Definition at line 38 of file DigiRunSummary.h.

Referenced by DigiRunSummary(), and endLuminosityBlock().

◆ _thresh_unihf

double hcaldqm::DigiRunSummary::_thresh_unihf
protected

Definition at line 24 of file DigiRunSummary.h.

Referenced by DigiRunSummary(), and endJob().

◆ _vFEDsuTCA

std::vector<int> hcaldqm::DigiRunSummary::_vFEDsuTCA
protected

Definition at line 29 of file DigiRunSummary.h.

◆ _vFEDsVME

std::vector<int> hcaldqm::DigiRunSummary::_vFEDsVME
protected

Definition at line 29 of file DigiRunSummary.h.

◆ _vflagsLS

std::vector<LSSummary> hcaldqm::DigiRunSummary::_vflagsLS
protected

Definition at line 22 of file DigiRunSummary.h.

Referenced by endJob(), and endLuminosityBlock().

◆ _vhashFEDHF

std::vector<uint32_t> hcaldqm::DigiRunSummary::_vhashFEDHF
protected

Definition at line 28 of file DigiRunSummary.h.

Referenced by beginRun().

◆ _vhashuTCA

std::vector<uint32_t> hcaldqm::DigiRunSummary::_vhashuTCA
protected

Definition at line 28 of file DigiRunSummary.h.

Referenced by beginRun().

◆ _vhashVME

std::vector<uint32_t> hcaldqm::DigiRunSummary::_vhashVME
protected

Definition at line 28 of file DigiRunSummary.h.

Referenced by beginRun().

◆ _xDead

ContainerXXX<uint32_t> hcaldqm::DigiRunSummary::_xDead
protected

Definition at line 36 of file DigiRunSummary.h.

Referenced by beginRun(), and endJob().

◆ _xDigiSize

ContainerXXX<uint32_t> hcaldqm::DigiRunSummary::_xDigiSize
protected

Definition at line 36 of file DigiRunSummary.h.

Referenced by beginRun(), and endLuminosityBlock().

◆ _xNChs

ContainerXXX<uint32_t> hcaldqm::DigiRunSummary::_xNChs
protected

Definition at line 36 of file DigiRunSummary.h.

Referenced by beginRun(), and endLuminosityBlock().

◆ _xNChsNominal

ContainerXXX<uint32_t> hcaldqm::DigiRunSummary::_xNChsNominal
protected

Definition at line 36 of file DigiRunSummary.h.

Referenced by beginRun(), and endLuminosityBlock().

◆ _xUni

ContainerXXX<uint32_t> hcaldqm::DigiRunSummary::_xUni
protected

Definition at line 36 of file DigiRunSummary.h.

Referenced by beginRun(), and endJob().

◆ _xUniHF

ContainerXXX<uint32_t> hcaldqm::DigiRunSummary::_xUniHF
protected

Definition at line 36 of file DigiRunSummary.h.

Referenced by beginRun(), and endJob().