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(), 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
38  _vhashFEDHF.push_back(HcalElectronicsId(22, SLOT_uTCA_MIN + 6, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
39  _vhashFEDHF.push_back(HcalElectronicsId(29, SLOT_uTCA_MIN + 6, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
40  _vhashFEDHF.push_back(HcalElectronicsId(32, SLOT_uTCA_MIN + 6, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
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:95
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:120
HcalElectronicsMap const * _emap
Definition: DQClient.h:60
filter::HashFilter _filter_FEDHF
int const FIBER_VME_MIN
Definition: Constants.h:125
int const FIBERCH_MIN
Definition: Constants.h:134
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:128
ContainerXXX< uint32_t > _xNChsNominal
std::string _name
Definition: DQModule.h:42
std::vector< uint32_t > _vhashFEDHF
int const CRATE_uTCA_MIN
Definition: Constants.h:100
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:107
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 218 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().

218  {
219  if (_ptype != fOffline)
220  return std::vector<flag::Flag>();
221 
222  _xDead.reset();
223  _xUniHF.reset();
224  _xUni.reset();
225 
226  // PREPARE LS AND RUN BASED FLAGS TO USE IT FOR BOOKING
227  std::vector<flag::Flag> vflagsPerLS;
228  std::vector<flag::Flag> vflagsPerRun;
229  vflagsPerLS.resize(nLSFlags);
230  vflagsPerRun.resize(nDigiFlag - nLSFlags + 1);
231  vflagsPerLS[fDigiSize] = flag::Flag("DigiSize");
232  vflagsPerLS[fNChsHF] = flag::Flag("NChsHF");
233  vflagsPerLS[fUnknownIds] = flag::Flag("UnknownIds");
234  vflagsPerLS[fLED] = flag::Flag("LEDMisfire");
235  vflagsPerRun[fDigiSize] = flag::Flag("DigiSize");
236  vflagsPerRun[fNChsHF] = flag::Flag("NChsHF");
237  vflagsPerRun[fUniHF - nLSFlags + 1] = flag::Flag("UniSlotHF");
238  vflagsPerRun[fDead - nLSFlags + 1] = flag::Flag("Dead");
239 
240  // INITIALIZE SUMMARY CONTAINERS
241  ContainerSingle2D cSummaryvsLS;
242  Container2D cSummaryvsLS_Crate;
243  cSummaryvsLS.initialize(_name,
244  "SummaryvsLS",
245  new quantity::LumiSection(_maxProcessedLS),
246  new quantity::CrateQuantity(_emap),
247  new quantity::ValueQuantity(quantity::fState),
248  0);
249  cSummaryvsLS.book(ib, _subsystem);
250  cSummaryvsLS_Crate.initialize(_name,
251  "SummaryvsLS",
253  new quantity::LumiSection(_maxProcessedLS),
254  new quantity::FlagQuantity(vflagsPerLS),
255  new quantity::ValueQuantity(quantity::fState),
256  0);
257  cSummaryvsLS_Crate.book(ib, _emap, _subsystem);
258 
259  // INITIALIZE CONTAINERS WE NEED TO LOAD or BOOK
260  Container2D cOccupancyCut_depth;
261  Container2D cDead_depth, cDead_Crate;
262  cOccupancyCut_depth.initialize(_taskname,
263  "OccupancyCut",
265  new quantity::DetectorQuantity(quantity::fieta),
266  new quantity::DetectorQuantity(quantity::fiphi),
267  new quantity::ValueQuantity(quantity::fN),
268  0);
269  cDead_depth.initialize(_name,
270  "Dead",
272  new quantity::DetectorQuantity(quantity::fieta),
273  new quantity::DetectorQuantity(quantity::fiphi),
274  new quantity::ValueQuantity(quantity::fN),
275  0);
276  cDead_Crate.initialize(_name,
277  "Dead",
279  new quantity::ElectronicsQuantity(quantity::fSpigot),
280  new quantity::ElectronicsQuantity(quantity::fFiberVMEFiberCh),
281  new quantity::ValueQuantity(quantity::fN),
282  0);
283 
284  // LOAD
285  cOccupancyCut_depth.load(ig, _emap, _subsystem);
286  cDead_depth.book(ib, _emap, _subsystem);
287  cDead_Crate.book(ib, _emap, _subsystem);
288 
289  // ANALYZE RUN BASED QUANTITIES
290  std::vector<HcalGenericDetId> gids = _emap->allPrecisionId();
291  for (std::vector<HcalGenericDetId>::const_iterator it = gids.begin(); it != gids.end(); ++it) {
292  if (!it->isHcalDetId())
293  continue;
294 
295  HcalDetId did = HcalDetId(it->rawId());
297 
298  if (_cOccupancy_depth.getBinContent(did) < 1) {
299  _xDead.get(eid)++;
300  cDead_depth.fill(did);
301  cDead_Crate.fill(eid);
302  }
303  if (did.subdet() == HcalForward)
304  _xUniHF.get(eid) += cOccupancyCut_depth.getBinContent(did);
305  }
306  // ANALYZE FOR HF SLOT UNIFORMITY
307  for (uintCompactMap::const_iterator it = _xUniHF.begin(); it != _xUniHF.end(); ++it) {
308  uint32_t hash1 = it->first;
309  HcalElectronicsId eid1(hash1);
310  double x1 = it->second;
311 
312  for (uintCompactMap::const_iterator jt = _xUniHF.begin(); jt != _xUniHF.end(); ++jt) {
313  if (jt == it)
314  continue;
315 
316  double x2 = jt->second;
317  if (x2 == 0)
318  continue;
319  if (x1 / x2 < _thresh_unihf)
320  _xUni.get(eid1)++;
321  }
322  }
323 
324  /*
325  * Iterate over each crate
326  * Iterate over each LS Summary
327  * Iterate over all flags
328  * set...
329  */
330  // iterate over all crates
331  std::vector<flag::Flag> sumflags;
332  int icrate = 0;
333  for (auto& it_crate : _vhashCrates) {
334  flag::Flag fSumRun("DIGI"); // summary flag for this FED
335  flag::Flag ffDead("Dead");
336  flag::Flag ffUniSlotHF("UniSlotHF");
337  HcalElectronicsId eid(it_crate);
339 
340  // ITERATE OVER EACH LS
341  for (std::vector<LSSummary>::const_iterator itls = _vflagsLS.begin(); itls != _vflagsLS.end(); ++itls) {
342  int iflag = 0;
343  flag::Flag fSumLS("DIGI");
344  for (std::vector<flag::Flag>::const_iterator ft = itls->_vflags[icrate].begin();
345  ft != itls->_vflags[icrate].end();
346  ++ft) {
347  cSummaryvsLS_Crate.setBinContent(eid, itls->_LS, int(iflag), ft->_state);
348  fSumLS += (*ft);
349  iflag++;
350  }
351  cSummaryvsLS.setBinContent(eid, itls->_LS, fSumLS._state);
352  fSumRun += fSumLS;
353  }
354 
355  // EVALUATE RUN BASED FLAGS
356  if (_xDead.get(eid) > 0)
357  ffDead._state = flag::fBAD;
358  else
359  ffDead._state = flag::fGOOD;
360  if (did.subdet() == HcalForward) {
361  if (_xUni.get(eid) > 0)
362  ffUniSlotHF._state = flag::fBAD;
363  else
364  ffUniSlotHF._state = flag::fGOOD;
365  }
366  fSumRun += ffDead + ffUniSlotHF;
367 
368  // push the summary flag for this FED for the Whole Run
369  sumflags.push_back(fSumRun);
370 
371  // increment fed
372  icrate++;
373  }
374 
375  return sumflags;
376  }
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);
155 
156  // reset all the tmp flags to fNA
157  // MUST DO IT NOW! AS NCDAQ MIGHT OVERWRITE IT!
158  for (std::vector<flag::Flag>::iterator ft = vtmpflags.begin(); ft != vtmpflags.end(); ++ft)
159  ft->reset();
160 
161  if (_xDigiSize.get(eid) > 0)
162  vtmpflags[fDigiSize]._state = flag::fBAD;
163  else
164  vtmpflags[fDigiSize]._state = flag::fGOOD;
165 
166  if (did.subdet() == HcalForward) {
167  if (_xNChs.get(eid) != _xNChsNominal.get(eid))
168  vtmpflags[fNChsHF]._state = flag::fBAD;
169  else
170  vtmpflags[fNChsHF]._state = flag::fGOOD;
171  } else {
172  vtmpflags[fNChsHF]._state = flag::fNA;
173  }
174  if (unknownIdsPresent)
175  vtmpflags[fUnknownIds]._state = flag::fBAD;
176  else
177  vtmpflags[fUnknownIds]._state = flag::fGOOD;
178 
179  if ((did.subdet() == HcalBarrel) || (did.subdet() == HcalBarrel) || (did.subdet() == HcalBarrel) ||
180  (did.subdet() == HcalBarrel)) {
181  std::string ledHistName = _subsystem + "/" + _taskname + "/LED_CUCountvsLS/Subdet/";
182  if (did.subdet() == HcalBarrel) {
183  ledHistName += "HB";
184  } else if (did.subdet() == HcalEndcap) {
185  ledHistName += "HE";
186  } else if (did.subdet() == HcalOuter) {
187  ledHistName += "HO";
188  } else if (did.subdet() == HcalForward) {
189  ledHistName += "HF";
190  }
191  MonitorElement* ledHist = ig.get(ledHistName);
192  if (ledHist) {
193  bool ledSignalPresent = (ledHist->getEntries() > 0);
194  if (ledSignalPresent)
195  vtmpflags[fLED]._state = flag::fBAD;
196  else
197  vtmpflags[fLED]._state = flag::fGOOD;
198  } else {
199  vtmpflags[fLED]._state = flag::fNA;
200  }
201  } else {
202  vtmpflags[fLED]._state = flag::fNA;
203  }
204 
205  // push all the flags for this crate
206  lssum._vflags.push_back(vtmpflags);
207  }
208 
209  // push all the flags for all FEDs for this LS
210  _vflagsLS.push_back(lssum);
211  cDigiSize_Crate.reset();
212  cOccupancy_depth.reset();
213  }
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:697
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().