CMS 3D CMS Logo

SelectiveReadoutClient.cc
Go to the documentation of this file.
2 
4 
5 #include <cmath>
6 
7 namespace ecaldqm {
9 
11  MESet& meFRDropped(MEs_.at("FRDropped"));
12  MESet& meZSReadout(MEs_.at("ZSReadout"));
13  MESet& meFR(MEs_.at("FR"));
14  MESet& meRUForced(MEs_.at("RUForced"));
15  MESet& meZS1(MEs_.at("ZS1"));
16  MESet& meHighInterest(MEs_.at("HighInterest"));
17  MESet& meMedInterest(MEs_.at("MedInterest"));
18  MESet& meLowInterest(MEs_.at("LowInterest"));
19 
20  MESet const& sFlagCounterMap(sources_.at("FlagCounterMap"));
21  MESet const& sRUForcedMap(sources_.at("RUForcedMap"));
22  MESet const& sFullReadoutMap(sources_.at("FullReadoutMap"));
23  MESet const& sZS1Map(sources_.at("ZS1Map"));
24  MESet const& sZSMap(sources_.at("ZSMap"));
25  MESet const& sZSFullReadoutMap(sources_.at("ZSFullReadoutMap"));
26  MESet const& sFRDroppedMap(sources_.at("FRDroppedMap"));
27  MESet const& sHighIntMap(sources_.at("HighIntMap"));
28  MESet const& sMedIntMap(sources_.at("MedIntMap"));
29  MESet const& sLowIntMap(sources_.at("LowIntMap"));
30 
31  MESet::const_iterator ruItr(GetElectronicsMap(), sRUForcedMap);
32  MESet::const_iterator frItr(GetElectronicsMap(), sFullReadoutMap);
33  MESet::const_iterator zs1Itr(GetElectronicsMap(), sZS1Map);
35  MESet::const_iterator zsfrItr(GetElectronicsMap(), sZSFullReadoutMap);
36  MESet::const_iterator frdItr(GetElectronicsMap(), sFRDroppedMap);
37 
38  MESet::iterator frdRateItr(GetElectronicsMap(), meFRDropped);
39  MESet::iterator zsrRateItr(GetElectronicsMap(), meZSReadout);
40  MESet::iterator frRateItr(GetElectronicsMap(), meFR);
41  MESet::iterator ruRateItr(GetElectronicsMap(), meRUForced);
42  MESet::iterator zs1RateItr(GetElectronicsMap(), meZS1);
43 
44  MESet::const_iterator cEnd(sFlagCounterMap.end(GetElectronicsMap()));
45  for (MESet::const_iterator cItr(sFlagCounterMap.beginChannel(GetElectronicsMap())); cItr != cEnd;
47  ruItr = cItr;
48  frItr = cItr;
49  zs1Itr = cItr;
50  zsItr = cItr;
51  zsfrItr = cItr;
52  frdItr = cItr;
53 
54  frdRateItr = cItr;
55  zsrRateItr = cItr;
56  frRateItr = cItr;
57  ruRateItr = cItr;
58  zs1RateItr = cItr;
59 
60  float nFlags(cItr->getBinContent());
61  float nZS12Flags(zsItr->getBinContent());
62  float nFullReadoutFlags(frItr->getBinContent());
63 
64  if (nFlags > 0.) {
65  frRateItr->setBinContent(nFullReadoutFlags / nFlags);
66  zs1RateItr->setBinContent(zs1Itr->getBinContent() / nFlags);
67  ruRateItr->setBinContent(ruItr->getBinContent() / nFlags);
68  }
69  if (nZS12Flags > 0.)
70  zsrRateItr->setBinContent(zsfrItr->getBinContent() / nZS12Flags);
71  if (nFullReadoutFlags > 0.)
72  frdRateItr->setBinContent(frdItr->getBinContent() / nFullReadoutFlags);
73  }
74 
75  // iterator not supported for kTriggerTower binning yet
76  for (unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; ++iTT) {
78 
79  float nHigh(sHighIntMap.getBinContent(getEcalDQMSetupObjects(), id));
80  float nMed(sMedIntMap.getBinContent(getEcalDQMSetupObjects(), id));
81  float nLow(sLowIntMap.getBinContent(getEcalDQMSetupObjects(), id));
82  float total(nHigh + nMed + nLow);
83 
84  if (total > 0.) {
85  meHighInterest.setBinContent(getEcalDQMSetupObjects(), id, nHigh / total);
86  meMedInterest.setBinContent(getEcalDQMSetupObjects(), id, nMed / total);
87  meLowInterest.setBinContent(getEcalDQMSetupObjects(), id, nLow / total);
88  }
89  }
90  }
91 
93 } // namespace ecaldqm
double getBinContent() const
Definition: MESet.h:192
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition: DQWorker.h:168
MESet & at(const std::string &key)
Definition: MESet.h:399
MESetCollection sources_
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
MESetCollection MEs_
Definition: DQWorker.h:131
const_iterator & toNextChannel(EcalElectronicsMapping const *)
Definition: MESet.cc:413
void setBinContent(double _content)
Definition: MESet.h:243
void producePlots(ProcessType) override