CMS 3D CMS Logo

TPRunSummary.cc
Go to the documentation of this file.
2 
3 namespace hcaldqm {
4  using namespace constants;
6  std::string const& taskname,
7  edm::ParameterSet const& ps,
9  : DQClient(name, taskname, ps, iC) {
10  _thresh_EtMsmRate_high = ps.getUntrackedParameter<double>("thresh_EtMsmRate_high", 0.2);
11  _thresh_EtMsmRate_low = ps.getUntrackedParameter<double>("thresh_EtMsmRate_low", 0.05);
12  _thresh_FGMsmRate_high = ps.getUntrackedParameter<double>("thresh_FGMsmRate_high", 0.2);
13  _thresh_FGMsmRate_low = ps.getUntrackedParameter<double>("thresh_FGMsmRate_low", 0.05);
14  }
15 
16  /* virtual */ void TPRunSummary::beginRun(edm::Run const& r, edm::EventSetup const& es) { DQClient::beginRun(r, es); }
17 
20  edm::LuminosityBlock const& lb,
21  edm::EventSetup const& es) {
22  DQClient::endLuminosityBlock(ib, ig, lb, es);
23  }
24 
25  /* virtual */ std::vector<flag::Flag> TPRunSummary::endJob(DQMStore::IBooker& ib, DQMStore::IGetter& ig) {
26  // hahs maps
29  std::vector<flag::Flag> vflags;
30  vflags.resize(nTPFlag);
31  vflags[fEtMsm] = flag::Flag("EtMsm");
32  vflags[fFGMsm] = flag::Flag("FGMsm");
33 
34  // INITIALIZE
35  ContainerSingle2D cOccupancyData_depthlike, cOccupancyEmul_depthlike;
36  ContainerSingle2D cEtMsm_depthlike, cFGMsm_depthlike, cEtCorrRatio_depthlike;
37  ContainerSingle2D cSummary;
38  ContainerXXX<double> xDeadD, xDeadE, xEtMsm, xFGMsm;
39  ContainerXXX<double> xNumCorr;
45  cOccupancyData_depthlike.initialize(_taskname,
46  "OccupancyData",
50  0);
51  cOccupancyEmul_depthlike.initialize(_taskname,
52  "OccupancyEmul",
56  0);
57  cEtMsm_depthlike.initialize(_taskname,
58  "EtMsm",
62  0);
63  cFGMsm_depthlike.initialize(_taskname,
64  "FGMsm",
68  0);
69  cEtCorrRatio_depthlike.initialize(_taskname,
70  "EtCorrRatio",
74  0);
76  "EtMsmFraction",
80  0);
82  "FGMsmFraction",
86  0);
87  cSummary.initialize(_name,
88  "Summary",
90  new quantity::FlagQuantity(vflags),
92  0);
93 
94  // BOOK
95  xDeadD.book(_emap);
96  xDeadE.book(_emap);
97  xEtMsm.book(_emap);
98  xFGMsm.book(_emap);
99  xNumCorr.book(_emap);
100 
101  // LOAD
102  cOccupancyData_depthlike.load(ig, _subsystem);
103  cOccupancyEmul_depthlike.load(ig, _subsystem);
104  cEtMsm_depthlike.load(ig, _subsystem);
105  cFGMsm_depthlike.load(ig, _subsystem);
106  cEtCorrRatio_depthlike.load(ig, _subsystem);
109  cSummary.book(ib, _subsystem);
110 
111  // iterate
112  std::vector<HcalTrigTowerDetId> tids = _emap->allTriggerId();
113  for (std::vector<HcalTrigTowerDetId>::const_iterator it = tids.begin(); it != tids.end(); ++it) {
114  // skip 2x3
116  if (tid.version() == 0 && tid.ietaAbs() >= 29)
117  continue;
118 
119  // do the comparison if there are channels that were correlated
120  // both had emul and data tps
121  if (cEtCorrRatio_depthlike.getBinEntries(tid) > 0) {
123 
124  double numetmsm = cEtMsm_depthlike.getBinContent(tid);
125  double numfgmsm = cFGMsm_depthlike.getBinContent(tid);
126  double numcorr = cEtCorrRatio_depthlike.getBinEntries(tid);
127 
128  xEtMsm.get(eid) += numetmsm;
129  xFGMsm.get(eid) += numfgmsm;
130  xNumCorr.get(eid) += numcorr;
131 
132  _cEtMsmFraction_depthlike.setBinContent(tid, numetmsm / numcorr);
133  _cFGMsmFraction_depthlike.setBinContent(tid, numfgmsm / numcorr);
134  }
135  }
136 
137  std::vector<flag::Flag> sumflags;
138  for (auto& it_hashcrate : _vhashCrates) {
139  flag::Flag fSum("TP");
140  HcalElectronicsId eid(it_hashcrate);
142 
143  if (did.subdet() == HcalBarrel || did.subdet() == HcalEndcap || did.subdet() == HcalForward) {
144  double etmsmfr = xNumCorr.get(eid) > 0 ? double(xEtMsm.get(eid)) / double(xNumCorr.get(eid)) : 0;
145  double fgmsmfr = xNumCorr.get(eid) > 0 ? double(xFGMsm.get(eid)) / double(xNumCorr.get(eid)) : 0;
146 
147  if (etmsmfr >= _thresh_EtMsmRate_high)
148  vflags[fEtMsm]._state = flag::fBAD;
149  else if (etmsmfr >= _thresh_EtMsmRate_low)
150  vflags[fEtMsm]._state = flag::fPROBLEMATIC;
151  else
152  vflags[fEtMsm]._state = flag::fGOOD;
153  if (fgmsmfr >= _thresh_FGMsmRate_high)
154  vflags[fFGMsm]._state = flag::fBAD;
155  else if (fgmsmfr >= _thresh_FGMsmRate_low)
156  vflags[fFGMsm]._state = flag::fPROBLEMATIC;
157  else
158  vflags[fFGMsm]._state = flag::fGOOD;
159  }
160 
161  // combine
162  int iflag = 0;
163  for (std::vector<flag::Flag>::iterator ft = vflags.begin(); ft != vflags.end(); ++ft) {
164  cSummary.setBinContent(eid, iflag, ft->_state);
165  fSum += (*ft);
166  iflag++;
167  ft->reset();
168  }
169  sumflags.push_back(fSum);
170  }
171 
172  return sumflags;
173  }
174 } // namespace hcaldqm
hcaldqm::flag::Flag
Definition: Flag.h:24
hcaldqm::ContainerXXX::initialize
virtual void initialize(hashfunctions::HashType, int debug=0)
Definition: ContainerXXX.h:81
hcaldqm::quantity::fRatio_0to2
Definition: ValueQuantity.h:39
hcaldqm::quantity::FlagQuantity
Definition: ValueQuantity.h:374
hcaldqm::electronicsmap::ElectronicsMap::lookup
uint32_t lookup(DetId const &)
Definition: ElectronicsMap.cc:122
hcaldqm::TPRunSummary::_thresh_EtMsmRate_high
double _thresh_EtMsmRate_high
Definition: TPRunSummary.h:25
hcaldqm::DQClient
Definition: DQClient.h:23
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
hcaldqm::TPRunSummary::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: TPRunSummary.cc:16
edm::Run
Definition: Run.h:45
hcaldqm::quantity::ValueQuantity
Definition: ValueQuantity.h:319
hcaldqm::flag::fGOOD
Definition: Flag.h:17
hcaldqm::TPRunSummary::nTPFlag
Definition: TPRunSummary.h:27
hcaldqm
Definition: Constants.h:8
hcaldqm::quantity::fTTiphi
Definition: TrigTowerQuantity.h:14
hcaldqm::electronicsmap::ElectronicsMap::initialize
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
Definition: ElectronicsMap.cc:6
hcaldqm::TPRunSummary::_thresh_FGMsmRate_low
double _thresh_FGMsmRate_low
Definition: TPRunSummary.h:24
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
constants
hcaldqm::ContainerSingle2D
Definition: ContainerSingle2D.h:20
hcaldqm::DQClient::endLuminosityBlock
virtual void endLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: DQClient.cc:104
TPRunSummary.h
HcalBarrel
Definition: HcalAssistant.h:33
hcaldqm::flag::fBAD
Definition: Flag.h:19
hcaldqm::TPRunSummary::_thresh_EtMsmRate_low
double _thresh_EtMsmRate_low
Definition: TPRunSummary.h:25
HcalTrigTowerDetId::ietaAbs
int ietaAbs() const
get the absolute value of the tower ieta
Definition: HcalTrigTowerDetId.h:52
hcaldqm::electronicsmap::fT2EHashMap
Definition: ElectronicsMap.h:26
hcaldqm::ContainerSingle2D::load
virtual void load(DQMStore::IGetter &, std::string subsystem="Hcal", std::string aux="")
Definition: ContainerSingle2D.cc:81
hcaldqm::quantity::fTTieta
Definition: TrigTowerQuantity.h:15
HcalElectronicsMap::allTriggerId
std::vector< HcalTrigTowerDetId > allTriggerId() const
Definition: HcalElectronicsMap.cc:151
hcaldqm::DQClient::_taskname
std::string _taskname
Definition: DQClient.h:50
hcaldqm::ContainerSingle2D::getBinContent
virtual double getBinContent(int, int)
Definition: ContainerSingle2D.cc:129
hcaldqm::TPRunSummary::_thresh_FGMsmRate_high
double _thresh_FGMsmRate_high
Definition: TPRunSummary.h:24
hcaldqm::TPRunSummary::endJob
std::vector< flag::Flag > endJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: TPRunSummary.cc:25
hcaldqm::hashfunctions::fCrate
Definition: HashFunctions.h:148
hcaldqm::DQClient::beginRun
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
Definition: DQClient.cc:23
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
hcaldqm::DQModule::_name
std::string _name
Definition: DQModule.h:42
HcalTrigTowerDetId::version
int version() const
get the version code for the trigger tower
Definition: HcalTrigTowerDetId.h:60
hcaldqm::quantity::fN
Definition: ValueQuantity.h:11
hcaldqm::TPRunSummary::fEtMsm
Definition: TPRunSummary.h:27
edm::ParameterSet
Definition: ParameterSet.h:47
hcaldqm::ContainerSingle2D::getBinEntries
virtual double getBinEntries(int, int)
Definition: ContainerSingle2D.cc:141
hcaldqm::flag::Flag::reset
void reset()
Definition: Flag.h:59
HcalDetId::subdet
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
HcalDetId
Definition: HcalDetId.h:12
hcaldqm::ContainerXXX< double >
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
cuy.ib
ib
Definition: cuy.py:661
edm::EventSetup
Definition: EventSetup.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
hcaldqm::TPRunSummary::_cEtMsmFraction_depthlike
ContainerSingle2D _cEtMsmFraction_depthlike
Definition: TPRunSummary.h:21
hcaldqm::DQModule::_subsystem
std::string _subsystem
Definition: DQModule.h:49
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HcalForward
Definition: HcalAssistant.h:36
hcaldqm::DQClient::_vhashCrates
std::vector< uint32_t > _vhashCrates
Definition: DQClient.h:64
hcaldqm::flag::fPROBLEMATIC
Definition: Flag.h:18
hcaldqm::electronicsmap::ElectronicsMap
Definition: ElectronicsMap.h:32
HcalElectronicsMap::lookup
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
Definition: HcalElectronicsMap.cc:70
HcalEndcap
Definition: HcalAssistant.h:34
hcaldqm::DQClient::_emap
const HcalElectronicsMap * _emap
Definition: DQClient.h:60
dqm::implementation::IGetter
Definition: DQMStore.h:484
nanoDQM_cff.Flag
Flag
Definition: nanoDQM_cff.py:98
hcaldqm::ContainerSingle2D::setBinContent
virtual void setBinContent(int, int, int)
Definition: ContainerSingle2D.cc:154
hcaldqm::TPRunSummary::fFGMsm
Definition: TPRunSummary.h:27
hcaldqm::quantity::TrigTowerQuantity
Definition: TrigTowerQuantity.h:70
hcaldqm::ContainerSingle2D::book
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
Definition: ContainerSingle2D.cc:68
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
hcaldqm::TPRunSummary::TPRunSummary
TPRunSummary(std::string const &, std::string const &, edm::ParameterSet const &, edm::ConsumesCollector &iC)
Definition: TPRunSummary.cc:5
hcaldqm::quantity::CrateQuantity
Definition: ElectronicsQuantity.h:390
hcaldqm::ContainerXXX::book
virtual void book(HcalElectronicsMap const *)
Definition: ContainerXXX.h:87
hcaldqm::ContainerXXX::get
virtual STDTYPE & get(HcalDetId const &)
Definition: ContainerXXX.h:197
dqm::implementation::IBooker
Definition: DQMStore.h:43
hcaldqm::TPRunSummary::endLuminosityBlock
void endLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: TPRunSummary.cc:18
hcaldqm::ContainerSingle2D::initialize
virtual void initialize(std::string const &folder, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: ContainerSingle2D.cc:46
hcaldqm::quantity::fState
Definition: ValueQuantity.h:49
hcaldqm::TPRunSummary::_cFGMsmFraction_depthlike
ContainerSingle2D _cFGMsmFraction_depthlike
Definition: TPRunSummary.h:22
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14