CMS 3D CMS Logo

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