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 &)
 
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 &)
 
 ~DQClient () override
 
- Public Member Functions inherited from hcaldqm::DQModule
 DQModule (edm::ParameterSet const &)
 
virtual ~DQModule ()(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
 
- 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
 

Detailed Description

Definition at line 9 of file DigiRunSummary.h.

Member Enumeration Documentation

Enumerator
fDigiSize 
fNChsHF 
fUnknownIds 
fLED 
nLSFlags 
fUniHF 
fDead 
nDigiFlag 

Definition at line 41 of file DigiRunSummary.h.

Constructor & Destructor Documentation

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

Definition at line 6 of file DigiRunSummary.cc.

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

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

Definition at line 12 of file DigiRunSummary.h.

References beginRun(), endJob(), and endLuminosityBlock().

12 {}

Member Function Documentation

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

Reimplemented from hcaldqm::DQClient.

Definition at line 17 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.

Referenced by ~DigiRunSummary().

17  {
18  DQClient::beginRun(r, es);
19 
20  if (_ptype != fOffline)
21  return;
22 
23  // INITIALIZE WHAT NEEDS TO BE INITIALIZE ONLY ONCE!
25  _vhashVME.push_back(
29  _vhashVME); // filter out VME
31  _vhashuTCA); // filter out uTCA
35  _vhashFEDHF.push_back(HcalElectronicsId(22, SLOT_uTCA_MIN + 6, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
36  _vhashFEDHF.push_back(HcalElectronicsId(29, SLOT_uTCA_MIN + 6, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
37  _vhashFEDHF.push_back(HcalElectronicsId(32, SLOT_uTCA_MIN + 6, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
39  _vhashFEDHF); // preserve only HF FEDs
40 
45 
46  _xDead.book(_emap);
52  _xNChs.book(_emap);
54 
56  "Occupancy",
58  new quantity::DetectorQuantity(quantity::fieta),
59  new quantity::DetectorQuantity(quantity::fiphi),
60  new quantity::ValueQuantity(quantity::fN),
61  0);
62 
63  // GET THE NOMINAL NUMBER OF CHANNELS PER FED
64  std::vector<HcalGenericDetId> gids = _emap->allPrecisionId();
65  for (std::vector<HcalGenericDetId>::const_iterator it = gids.begin(); it != gids.end(); ++it) {
66  if (!it->isHcalDetId())
67  continue;
68  HcalDetId did(it->rawId());
70  _xNChsNominal.get(eid)++;
71  }
72  }
ContainerXXX< uint32_t > _xDigiSize
int const CRATE_VME_MIN
Definition: Constants.h:91
ContainerXXX< uint32_t > _xUni
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
Definition: DQClient.cc:13
int const SPIGOT_MIN
Definition: Constants.h:116
HcalElectronicsMap const * _emap
Definition: DQClient.h:53
filter::HashFilter _filter_FEDHF
int const FIBER_VME_MIN
Definition: Constants.h:121
int const FIBERCH_MIN
Definition: Constants.h:130
ProcessingType _ptype
Definition: DQModule.h:43
std::vector< uint32_t > _vhashuTCA
filter::HashFilter _filter_uTCA
Container2D _cOccupancy_depth
int const FIBER_uTCA_MIN1
Definition: Constants.h:124
ContainerXXX< uint32_t > _xNChsNominal
std::vector< HcalGenericDetId > allPrecisionId() const
std::string _name
Definition: DQModule.h:41
std::vector< uint32_t > _vhashFEDHF
int const CRATE_uTCA_MIN
Definition: Constants.h:96
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
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:103
ContainerXXX< uint32_t > _xDead
std::vector< flag::Flag > hcaldqm::DigiRunSummary::endJob ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
overridevirtual

Reimplemented from hcaldqm::DQClient.

Definition at line 215 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_cff::Flag, fLED, hcaldqm::quantity::fN, fNChsHF, hcaldqm::fOffline, hcaldqm::quantity::fSpigot, hcaldqm::quantity::fState, fUniHF, fUnknownIds, hcaldqm::ContainerXXX< STDTYPE >::get(), hcaldqm::Container2D::getBinContent(), HcalForward, 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(), HcalDetId::subdet(), globals_cff::x1, and globals_cff::x2.

Referenced by ~DigiRunSummary().

215  {
216  if (_ptype != fOffline)
217  return std::vector<flag::Flag>();
218 
219  _xDead.reset();
220  _xUniHF.reset();
221  _xUni.reset();
222 
223  // PREPARE LS AND RUN BASED FLAGS TO USE IT FOR BOOKING
224  std::vector<flag::Flag> vflagsPerLS;
225  std::vector<flag::Flag> vflagsPerRun;
226  vflagsPerLS.resize(nLSFlags);
227  vflagsPerRun.resize(nDigiFlag - nLSFlags + 1);
228  vflagsPerLS[fDigiSize] = flag::Flag("DigiSize");
229  vflagsPerLS[fNChsHF] = flag::Flag("NChsHF");
230  vflagsPerLS[fUnknownIds] = flag::Flag("UnknownIds");
231  vflagsPerLS[fLED] = flag::Flag("LEDMisfire");
232  vflagsPerRun[fDigiSize] = flag::Flag("DigiSize");
233  vflagsPerRun[fNChsHF] = flag::Flag("NChsHF");
234  vflagsPerRun[fUniHF - nLSFlags + 1] = flag::Flag("UniSlotHF");
235  vflagsPerRun[fDead - nLSFlags + 1] = flag::Flag("Dead");
236 
237  // INITIALIZE SUMMARY CONTAINERS
238  ContainerSingle2D cSummaryvsLS;
239  Container2D cSummaryvsLS_Crate;
240  cSummaryvsLS.initialize(_name,
241  "SummaryvsLS",
242  new quantity::LumiSection(_maxProcessedLS),
243  new quantity::CrateQuantity(_emap),
244  new quantity::ValueQuantity(quantity::fState),
245  0);
246  cSummaryvsLS.book(ib, _subsystem);
247  cSummaryvsLS_Crate.initialize(_name,
248  "SummaryvsLS",
250  new quantity::LumiSection(_maxProcessedLS),
251  new quantity::FlagQuantity(vflagsPerLS),
252  new quantity::ValueQuantity(quantity::fState),
253  0);
254  cSummaryvsLS_Crate.book(ib, _emap, _subsystem);
255 
256  // INITIALIZE CONTAINERS WE NEED TO LOAD or BOOK
257  Container2D cOccupancyCut_depth;
258  Container2D cDead_depth, cDead_Crate;
259  cOccupancyCut_depth.initialize(_taskname,
260  "OccupancyCut",
262  new quantity::DetectorQuantity(quantity::fieta),
263  new quantity::DetectorQuantity(quantity::fiphi),
264  new quantity::ValueQuantity(quantity::fN),
265  0);
266  cDead_depth.initialize(_name,
267  "Dead",
269  new quantity::DetectorQuantity(quantity::fieta),
270  new quantity::DetectorQuantity(quantity::fiphi),
271  new quantity::ValueQuantity(quantity::fN),
272  0);
273  cDead_Crate.initialize(_name,
274  "Dead",
276  new quantity::ElectronicsQuantity(quantity::fSpigot),
277  new quantity::ElectronicsQuantity(quantity::fFiberVMEFiberCh),
278  new quantity::ValueQuantity(quantity::fN),
279  0);
280 
281  // LOAD
282  cOccupancyCut_depth.load(ig, _emap, _subsystem);
283  cDead_depth.book(ib, _emap, _subsystem);
284  cDead_Crate.book(ib, _emap, _subsystem);
285 
286  // ANALYZE RUN BASED QUANTITIES
287  std::vector<HcalGenericDetId> gids = _emap->allPrecisionId();
288  for (std::vector<HcalGenericDetId>::const_iterator it = gids.begin(); it != gids.end(); ++it) {
289  if (!it->isHcalDetId())
290  continue;
291 
292  HcalDetId did = HcalDetId(it->rawId());
294 
295  if (_cOccupancy_depth.getBinContent(did) < 1) {
296  _xDead.get(eid)++;
297  cDead_depth.fill(did);
298  cDead_Crate.fill(eid);
299  }
300  if (did.subdet() == HcalForward)
301  _xUniHF.get(eid) += cOccupancyCut_depth.getBinContent(did);
302  }
303  // ANALYZE FOR HF SLOT UNIFORMITY
304  for (uintCompactMap::const_iterator it = _xUniHF.begin(); it != _xUniHF.end(); ++it) {
305  uint32_t hash1 = it->first;
306  HcalElectronicsId eid1(hash1);
307  double x1 = it->second;
308 
309  for (uintCompactMap::const_iterator jt = _xUniHF.begin(); jt != _xUniHF.end(); ++jt) {
310  if (jt == it)
311  continue;
312 
313  double x2 = jt->second;
314  if (x2 == 0)
315  continue;
316  if (x1 / x2 < _thresh_unihf)
317  _xUni.get(eid1)++;
318  }
319  }
320 
321  /*
322  * Iterate over each crate
323  * Iterate over each LS Summary
324  * Iterate over all flags
325  * set...
326  */
327  // iterate over all crates
328  std::vector<flag::Flag> sumflags;
329  int icrate = 0;
330  for (auto& it_crate : _vhashCrates) {
331  flag::Flag fSumRun("DIGI"); // summary flag for this FED
332  flag::Flag ffDead("Dead");
333  flag::Flag ffUniSlotHF("UniSlotHF");
334  HcalElectronicsId eid(it_crate);
335  HcalDetId did = HcalDetId(_emap->lookup(eid));
336 
337  // ITERATE OVER EACH LS
338  for (std::vector<LSSummary>::const_iterator itls = _vflagsLS.begin(); itls != _vflagsLS.end(); ++itls) {
339  int iflag = 0;
340  flag::Flag fSumLS("DIGI");
341  for (std::vector<flag::Flag>::const_iterator ft = itls->_vflags[icrate].begin();
342  ft != itls->_vflags[icrate].end();
343  ++ft) {
344  cSummaryvsLS_Crate.setBinContent(eid, itls->_LS, int(iflag), ft->_state);
345  fSumLS += (*ft);
346  iflag++;
347  }
348  cSummaryvsLS.setBinContent(eid, itls->_LS, fSumLS._state);
349  fSumRun += fSumLS;
350  }
351 
352  // EVALUATE RUN BASED FLAGS
353  if (_xDead.get(eid) > 0)
354  ffDead._state = flag::fBAD;
355  else
356  ffDead._state = flag::fGOOD;
357  if (did.subdet() == HcalForward) {
358  if (_xUni.get(eid) > 0)
359  ffUniSlotHF._state = flag::fBAD;
360  else
361  ffUniSlotHF._state = flag::fGOOD;
362  }
363  fSumRun += ffDead + ffUniSlotHF;
364 
365  // push the summary flag for this FED for the Whole Run
366  sumflags.push_back(fSumRun);
367 
368  // increment fed
369  icrate++;
370  }
371 
372  return sumflags;
373  }
std::vector< LSSummary > _vflagsLS
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:146
ContainerXXX< uint32_t > _xUni
virtual CompactMap::const_iterator begin()
Definition: ContainerXXX.h:69
std::string _taskname
Definition: DQClient.h:46
HcalElectronicsMap const * _emap
Definition: DQClient.h:53
virtual void reset()
Definition: ContainerXXX.h:292
std::vector< uint32_t > _vhashCrates
Definition: DQClient.h:57
virtual CompactMap::const_iterator end()
Definition: ContainerXXX.h:70
ProcessingType _ptype
Definition: DQModule.h:43
Container2D _cOccupancy_depth
std::vector< HcalGenericDetId > allPrecisionId() const
std::string _name
Definition: DQModule.h:41
double getBinContent(HcalDetId const &) override
Definition: Container2D.cc:132
virtual STDTYPE & get(HcalDetId const &)
Definition: ContainerXXX.h:197
electronicsmap::ElectronicsMap _ehashmap
std::string _subsystem
Definition: DQModule.h:48
Readout chain identification for Hcal.
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
ContainerXXX< uint32_t > _xUniHF
ContainerXXX< uint32_t > _xDead
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 77 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(), DQMStore::IBooker::book1D(), 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_cff::Flag, fLED, hcaldqm::quantity::fN, hcaldqm::flag::fNA, fNChsHF, hcaldqm::fOffline, fUnknownIds, hcaldqm::ContainerXXX< STDTYPE >::get(), DQMStore::IGetter::get(), hcaldqm::Container2D::getBinContent(), MonitorElement::getBinContent(), MonitorElement::getEntries(), hcaldqm::Container1D::getMean(), hcaldqm::Container1D::getRMS(), MonitorElement::getTH1(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, hcaldqm::Container2D::initialize(), hcaldqm::Container1D::load(), hcaldqm::electronicsmap::ElectronicsMap::lookup(), HcalElectronicsMap::lookup(), nLSFlags, simpleEdmComparison::numEvents, hcaldqm::ContainerXXX< STDTYPE >::reset(), hcaldqm::Container1D::reset(), MonitorElement::setBinContent(), DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and HcalDetId::subdet().

Referenced by ~DigiRunSummary().

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

Member Data Documentation

bool hcaldqm::DigiRunSummary::_booked
protected

Definition at line 33 of file DigiRunSummary.h.

Referenced by endLuminosityBlock().

Container2D hcaldqm::DigiRunSummary::_cOccupancy_depth
protected

Definition at line 32 of file DigiRunSummary.h.

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

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

Definition at line 26 of file DigiRunSummary.h.

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

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

Definition at line 30 of file DigiRunSummary.h.

Referenced by beginRun().

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

Definition at line 30 of file DigiRunSummary.h.

Referenced by beginRun().

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

Definition at line 30 of file DigiRunSummary.h.

Referenced by beginRun().

MonitorElement* hcaldqm::DigiRunSummary::_meNumEvents
protected

Definition at line 34 of file DigiRunSummary.h.

Referenced by endLuminosityBlock().

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

Definition at line 38 of file DigiRunSummary.h.

Referenced by DigiRunSummary(), and endLuminosityBlock().

double hcaldqm::DigiRunSummary::_thresh_unihf
protected

Definition at line 24 of file DigiRunSummary.h.

Referenced by DigiRunSummary(), and endJob().

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

Definition at line 29 of file DigiRunSummary.h.

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

Definition at line 29 of file DigiRunSummary.h.

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

Definition at line 22 of file DigiRunSummary.h.

Referenced by endJob(), and endLuminosityBlock().

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

Definition at line 28 of file DigiRunSummary.h.

Referenced by beginRun().

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

Definition at line 28 of file DigiRunSummary.h.

Referenced by beginRun().

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

Definition at line 28 of file DigiRunSummary.h.

Referenced by beginRun().

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

Definition at line 36 of file DigiRunSummary.h.

Referenced by beginRun(), and endJob().

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

Definition at line 36 of file DigiRunSummary.h.

Referenced by beginRun(), and endLuminosityBlock().

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

Definition at line 36 of file DigiRunSummary.h.

Referenced by beginRun(), and endLuminosityBlock().

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

Definition at line 36 of file DigiRunSummary.h.

Referenced by beginRun(), and endLuminosityBlock().

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

Definition at line 36 of file DigiRunSummary.h.

Referenced by beginRun(), and endJob().

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

Definition at line 36 of file DigiRunSummary.h.

Referenced by beginRun(), and endJob().