CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Types | Protected Attributes
hcaldqm::TPRunSummary Class Reference

#include <TPRunSummary.h>

Inheritance diagram for hcaldqm::TPRunSummary:
hcaldqm::DQClient hcaldqm::DQModule

Public Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
std::vector< flag::FlagendJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void endLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 TPRunSummary (std::string const &, std::string const &, edm::ParameterSet const &)
 
 ~TPRunSummary () 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  TPFlag { fEtMsm = 0, fFGMsm = 1, nTPFlag = 3 }
 

Protected Attributes

ContainerSingle2D _cEtMsmFraction_depthlike
 
ContainerSingle2D _cFGMsmFraction_depthlike
 
double _thresh_EtMsmRate_high
 
double _thresh_EtMsmRate_low
 
double _thresh_FGMsmRate_high
 
double _thresh_FGMsmRate_low
 
- 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 8 of file TPRunSummary.h.

Member Enumeration Documentation

Enumerator
fEtMsm 
fFGMsm 
nTPFlag 

Definition at line 27 of file TPRunSummary.h.

Constructor & Destructor Documentation

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

Definition at line 5 of file TPRunSummary.cc.

References _thresh_EtMsmRate_high, _thresh_EtMsmRate_low, _thresh_FGMsmRate_high, _thresh_FGMsmRate_low, and edm::ParameterSet::getUntrackedParameter().

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  }
DQClient(std::string const &, std::string const &, edm::ParameterSet const &)
Definition: DQClient.cc:5
hcaldqm::TPRunSummary::~TPRunSummary ( )
inlineoverride

Definition at line 11 of file TPRunSummary.h.

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

11 {}

Member Function Documentation

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

Reimplemented from hcaldqm::DQClient.

Definition at line 13 of file TPRunSummary.cc.

References hcaldqm::DQClient::beginRun().

Referenced by ~TPRunSummary().

13 { DQClient::beginRun(r, es); }
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
Definition: DQClient.cc:13
std::vector< flag::Flag > hcaldqm::TPRunSummary::endJob ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
overridevirtual

Reimplemented from hcaldqm::DQClient.

Definition at line 22 of file TPRunSummary.cc.

References _cEtMsmFraction_depthlike, _cFGMsmFraction_depthlike, hcaldqm::DQClient::_emap, hcaldqm::DQModule::_name, hcaldqm::DQModule::_subsystem, hcaldqm::DQClient::_taskname, _thresh_EtMsmRate_high, _thresh_EtMsmRate_low, _thresh_FGMsmRate_high, _thresh_FGMsmRate_low, hcaldqm::DQClient::_vhashCrates, HcalElectronicsMap::allTriggerId(), hcaldqm::ContainerXXX< STDTYPE >::book(), hcaldqm::ContainerSingle2D::book(), runTauDisplay::eid, hcaldqm::flag::fBAD, hcaldqm::hashfunctions::fCrate, fEtMsm, fFGMsm, hcaldqm::flag::fGOOD, nanoDQM_cff::Flag, hcaldqm::quantity::fN, hcaldqm::flag::fPROBLEMATIC, hcaldqm::quantity::fRatio_0to2, hcaldqm::quantity::fState, hcaldqm::electronicsmap::fT2EHashMap, hcaldqm::quantity::fTTieta, hcaldqm::quantity::fTTiphi, hcaldqm::ContainerXXX< STDTYPE >::get(), hcaldqm::ContainerSingle2D::getBinContent(), hcaldqm::ContainerSingle2D::getBinEntries(), HcalBarrel, HcalEndcap, HcalForward, HcalTrigTowerDetId::ietaAbs(), hcaldqm::ContainerXXX< STDTYPE >::initialize(), hcaldqm::ContainerSingle2D::initialize(), hcaldqm::electronicsmap::ElectronicsMap::initialize(), hcaldqm::ContainerSingle2D::load(), hcaldqm::electronicsmap::ElectronicsMap::lookup(), HcalElectronicsMap::lookup(), nTPFlag, hcaldqm::flag::Flag::reset(), hcaldqm::ContainerSingle2D::setBinContent(), HcalDetId::subdet(), and HcalTrigTowerDetId::version().

Referenced by ~TPRunSummary().

22  {
23  // hahs maps
24  electronicsmap::ElectronicsMap ehashmap;
25  ehashmap.initialize(_emap, electronicsmap::fT2EHashMap);
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;
37  xDeadD.initialize(hashfunctions::fCrate);
38  xDeadE.initialize(hashfunctions::fCrate);
39  xEtMsm.initialize(hashfunctions::fCrate);
40  xFGMsm.initialize(hashfunctions::fCrate);
41  xNumCorr.initialize(hashfunctions::fCrate);
42  cOccupancyData_depthlike.initialize(_taskname,
43  "OccupancyData",
44  new quantity::TrigTowerQuantity(quantity::fTTieta),
45  new quantity::TrigTowerQuantity(quantity::fTTiphi),
46  new quantity::ValueQuantity(quantity::fN, true),
47  0);
48  cOccupancyEmul_depthlike.initialize(_taskname,
49  "OccupancyEmul",
50  new quantity::TrigTowerQuantity(quantity::fTTieta),
51  new quantity::TrigTowerQuantity(quantity::fTTiphi),
52  new quantity::ValueQuantity(quantity::fN, true),
53  0);
54  cEtMsm_depthlike.initialize(_taskname,
55  "EtMsm",
56  new quantity::TrigTowerQuantity(quantity::fTTieta),
57  new quantity::TrigTowerQuantity(quantity::fTTiphi),
58  new quantity::ValueQuantity(quantity::fN),
59  0);
60  cFGMsm_depthlike.initialize(_taskname,
61  "FGMsm",
62  new quantity::TrigTowerQuantity(quantity::fTTieta),
63  new quantity::TrigTowerQuantity(quantity::fTTiphi),
64  new quantity::ValueQuantity(quantity::fN),
65  0);
66  cEtCorrRatio_depthlike.initialize(_taskname,
67  "EtCorrRatio",
68  new quantity::TrigTowerQuantity(quantity::fTTieta),
69  new quantity::TrigTowerQuantity(quantity::fTTiphi),
70  new quantity::ValueQuantity(quantity::fRatio_0to2),
71  0);
73  "EtMsmFraction",
74  new quantity::TrigTowerQuantity(quantity::fTTieta),
75  new quantity::TrigTowerQuantity(quantity::fTTiphi),
76  new quantity::ValueQuantity(quantity::fRatio_0to2),
77  0);
79  "FGMsmFraction",
80  new quantity::TrigTowerQuantity(quantity::fTTieta),
81  new quantity::TrigTowerQuantity(quantity::fTTiphi),
82  new quantity::ValueQuantity(quantity::fRatio_0to2),
83  0);
84  cSummary.initialize(_name,
85  "Summary",
86  new quantity::CrateQuantity(_emap),
87  new quantity::FlagQuantity(vflags),
88  new quantity::ValueQuantity(quantity::fState),
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) {
119  HcalElectronicsId eid = HcalElectronicsId(ehashmap.lookup(*it));
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);
138  HcalDetId did = HcalDetId(_emap->lookup(eid));
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  }
ContainerSingle2D _cFGMsmFraction_depthlike
Definition: TPRunSummary.h:22
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:146
std::string _taskname
Definition: DQClient.h:46
virtual void initialize(std::string const &folder, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fN), int debug=0)
HcalElectronicsMap const * _emap
Definition: DQClient.h:53
std::vector< uint32_t > _vhashCrates
Definition: DQClient.h:57
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
virtual void setBinContent(int, int, int)
std::string _name
Definition: DQModule.h:41
int version() const
get the version code for the trigger tower
ContainerSingle2D _cEtMsmFraction_depthlike
Definition: TPRunSummary.h:21
std::string _subsystem
Definition: DQModule.h:48
Readout chain identification for Hcal.
std::vector< HcalTrigTowerDetId > allTriggerId() const
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
int ietaAbs() const
get the absolute value of the tower ieta
void hcaldqm::TPRunSummary::endLuminosityBlock ( DQMStore::IBooker ib,
DQMStore::IGetter ig,
edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
)
overridevirtual

Reimplemented from hcaldqm::DQClient.

Definition at line 15 of file TPRunSummary.cc.

References hcaldqm::DQClient::endLuminosityBlock().

Referenced by ~TPRunSummary().

18  {
19  DQClient::endLuminosityBlock(ib, ig, lb, es);
20  }
virtual void endLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: DQClient.cc:98

Member Data Documentation

ContainerSingle2D hcaldqm::TPRunSummary::_cEtMsmFraction_depthlike
protected

Definition at line 21 of file TPRunSummary.h.

Referenced by endJob().

ContainerSingle2D hcaldqm::TPRunSummary::_cFGMsmFraction_depthlike
protected

Definition at line 22 of file TPRunSummary.h.

Referenced by endJob().

double hcaldqm::TPRunSummary::_thresh_EtMsmRate_high
protected

Definition at line 25 of file TPRunSummary.h.

Referenced by endJob(), and TPRunSummary().

double hcaldqm::TPRunSummary::_thresh_EtMsmRate_low
protected

Definition at line 25 of file TPRunSummary.h.

Referenced by endJob(), and TPRunSummary().

double hcaldqm::TPRunSummary::_thresh_FGMsmRate_high
protected

Definition at line 24 of file TPRunSummary.h.

Referenced by endJob(), and TPRunSummary().

double hcaldqm::TPRunSummary::_thresh_FGMsmRate_low
protected

Definition at line 24 of file TPRunSummary.h.

Referenced by endJob(), and TPRunSummary().