CMS 3D CMS Logo

TPRunSummary.cc
Go to the documentation of this file.
2 
3 namespace hcaldqm {
4  using namespace constants;
6  : DQClient(name, taskname, ps) {
7  _thresh_EtMsmRate_high = ps.getUntrackedParameter<double>("thresh_EtMsmRate_high", 0.2);
8  _thresh_EtMsmRate_low = ps.getUntrackedParameter<double>("thresh_EtMsmRate_low", 0.05);
9  _thresh_FGMsmRate_high = ps.getUntrackedParameter<double>("thresh_FGMsmRate_high", 0.2);
10  _thresh_FGMsmRate_low = ps.getUntrackedParameter<double>("thresh_FGMsmRate_low", 0.05);
11  }
12 
13  /* virtual */ void TPRunSummary::beginRun(edm::Run const& r, edm::EventSetup const& es) { DQClient::beginRun(r, es); }
14 
17  edm::LuminosityBlock const& lb,
18  edm::EventSetup const& es) {
19  DQClient::endLuminosityBlock(ib, ig, lb, es);
20  }
21 
22  /* virtual */ std::vector<flag::Flag> TPRunSummary::endJob(DQMStore::IBooker& ib, DQMStore::IGetter& ig) {
23  // hahs maps
26  std::vector<flag::Flag> vflags;
27  vflags.resize(nTPFlag);
28  vflags[fEtMsm] = flag::Flag("EtMsm");
29  vflags[fFGMsm] = flag::Flag("FGMsm");
30 
31  // INITIALIZE
32  ContainerSingle2D cOccupancyData_depthlike, cOccupancyEmul_depthlike;
33  ContainerSingle2D cEtMsm_depthlike, cFGMsm_depthlike, cEtCorrRatio_depthlike;
34  ContainerSingle2D cSummary;
35  ContainerXXX<double> xDeadD, xDeadE, xEtMsm, xFGMsm;
36  ContainerXXX<double> xNumCorr;
42  cOccupancyData_depthlike.initialize(_taskname,
43  "OccupancyData",
47  0);
48  cOccupancyEmul_depthlike.initialize(_taskname,
49  "OccupancyEmul",
53  0);
54  cEtMsm_depthlike.initialize(_taskname,
55  "EtMsm",
59  0);
60  cFGMsm_depthlike.initialize(_taskname,
61  "FGMsm",
65  0);
66  cEtCorrRatio_depthlike.initialize(_taskname,
67  "EtCorrRatio",
71  0);
73  "EtMsmFraction",
77  0);
79  "FGMsmFraction",
83  0);
84  cSummary.initialize(_name,
85  "Summary",
87  new quantity::FlagQuantity(vflags),
89  0);
90 
91  // BOOK
92  xDeadD.book(_emap);
93  xDeadE.book(_emap);
94  xEtMsm.book(_emap);
95  xFGMsm.book(_emap);
96  xNumCorr.book(_emap);
97 
98  // LOAD
99  cOccupancyData_depthlike.load(ig, _subsystem);
100  cOccupancyEmul_depthlike.load(ig, _subsystem);
101  cEtMsm_depthlike.load(ig, _subsystem);
102  cFGMsm_depthlike.load(ig, _subsystem);
103  cEtCorrRatio_depthlike.load(ig, _subsystem);
106  cSummary.book(ib, _subsystem);
107 
108  // iterate
109  std::vector<HcalTrigTowerDetId> tids = _emap->allTriggerId();
110  for (std::vector<HcalTrigTowerDetId>::const_iterator it = tids.begin(); it != tids.end(); ++it) {
111  // skip 2x3
113  if (tid.version() == 0 && tid.ietaAbs() >= 29)
114  continue;
115 
116  // do the comparison if there are channels that were correlated
117  // both had emul and data tps
118  if (cEtCorrRatio_depthlike.getBinEntries(tid) > 0) {
120 
121  double numetmsm = cEtMsm_depthlike.getBinContent(tid);
122  double numfgmsm = cFGMsm_depthlike.getBinContent(tid);
123  double numcorr = cEtCorrRatio_depthlike.getBinEntries(tid);
124 
125  xEtMsm.get(eid) += numetmsm;
126  xFGMsm.get(eid) += numfgmsm;
127  xNumCorr.get(eid) += numcorr;
128 
129  _cEtMsmFraction_depthlike.setBinContent(tid, numetmsm / numcorr);
130  _cFGMsmFraction_depthlike.setBinContent(tid, numfgmsm / numcorr);
131  }
132  }
133 
134  std::vector<flag::Flag> sumflags;
135  for (auto& it_hashcrate : _vhashCrates) {
136  flag::Flag fSum("TP");
137  HcalElectronicsId eid(it_hashcrate);
139 
140  if (did.subdet() == HcalBarrel || did.subdet() == HcalEndcap || did.subdet() == HcalForward) {
141  double etmsmfr = xNumCorr.get(eid) > 0 ? double(xEtMsm.get(eid)) / double(xNumCorr.get(eid)) : 0;
142  double fgmsmfr = xNumCorr.get(eid) > 0 ? double(xFGMsm.get(eid)) / double(xNumCorr.get(eid)) : 0;
143 
144  if (etmsmfr >= _thresh_EtMsmRate_high)
145  vflags[fEtMsm]._state = flag::fBAD;
146  else if (etmsmfr >= _thresh_EtMsmRate_low)
147  vflags[fEtMsm]._state = flag::fPROBLEMATIC;
148  else
149  vflags[fEtMsm]._state = flag::fGOOD;
150  if (fgmsmfr >= _thresh_FGMsmRate_high)
151  vflags[fFGMsm]._state = flag::fBAD;
152  else if (fgmsmfr >= _thresh_FGMsmRate_low)
153  vflags[fFGMsm]._state = flag::fPROBLEMATIC;
154  else
155  vflags[fFGMsm]._state = flag::fGOOD;
156  }
157 
158  // combine
159  int iflag = 0;
160  for (std::vector<flag::Flag>::iterator ft = vflags.begin(); ft != vflags.end(); ++ft) {
161  cSummary.setBinContent(eid, iflag, ft->_state);
162  fSum += (*ft);
163  iflag++;
164  ft->reset();
165  }
166  sumflags.push_back(fSum);
167  }
168 
169  return sumflags;
170  }
171 } // 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:364
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:13
edm::Run
Definition: Run.h:45
hcaldqm::quantity::ValueQuantity
Definition: ValueQuantity.h:309
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:98
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::TPRunSummary::TPRunSummary
TPRunSummary(std::string const &, std::string const &, edm::ParameterSet const &)
Definition: TPRunSummary.cc:5
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:49
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:22
hcaldqm::hashfunctions::fCrate
Definition: HashFunctions.h:139
hcaldqm::DQClient::beginRun
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
Definition: DQClient.cc:13
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
hcaldqm::DQModule::_name
std::string _name
Definition: DQModule.h:41
HcalTrigTowerDetId::version
int version() const
get the version code for the trigger tower
Definition: HcalTrigTowerDetId.h:60
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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:662
edm::EventSetup
Definition: EventSetup.h:57
hcaldqm::TPRunSummary::_cEtMsmFraction_depthlike
ContainerSingle2D _cEtMsmFraction_depthlike
Definition: TPRunSummary.h:21
hcaldqm::DQModule::_subsystem
std::string _subsystem
Definition: DQModule.h:48
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HcalForward
Definition: HcalAssistant.h:36
hcaldqm::DQClient::_vhashCrates
std::vector< uint32_t > _vhashCrates
Definition: DQClient.h:60
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:56
dqm::implementation::IGetter
Definition: DQMStore.h:484
nanoDQM_cff.Flag
Flag
Definition: nanoDQM_cff.py:65
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::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:15
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:47
hcaldqm::TPRunSummary::_cFGMsmFraction_depthlike
ContainerSingle2D _cFGMsmFraction_depthlike
Definition: TPRunSummary.h:22
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14