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 &, edm::ConsumesCollector &iC)
 
 ~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 &, edm::ConsumesCollector &iC)
 
 ~DQClient () override
 
- Public Member Functions inherited from hcaldqm::DQModule
 DQModule (edm::ParameterSet const &)
 
virtual ~DQModule () noexcept(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
 
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcdhcalChannelQualityToken_
 
edm::ESGetToken< HcalDbService, HcalDbRecordhcalDbServiceToken_
 
edm::ESGetToken< RunInfo, RunInfoRcdrunInfoToken_
 
- 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
 

Additional Inherited Members

- Public Types inherited from hcaldqm::DQClient
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Static Public Member Functions inherited from hcaldqm::DQModule
static void fillPSetDescription (edm::ParameterSetDescription &desc)
 

Detailed Description

Definition at line 8 of file TPRunSummary.h.

Member Enumeration Documentation

◆ TPFlag

Enumerator
fEtMsm 
fFGMsm 
nTPFlag 

Definition at line 27 of file TPRunSummary.h.

Constructor & Destructor Documentation

◆ TPRunSummary()

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

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().

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

◆ ~TPRunSummary()

hcaldqm::TPRunSummary::~TPRunSummary ( )
inlineoverride

Definition at line 11 of file TPRunSummary.h.

11 {}

Member Function Documentation

◆ beginRun()

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

Reimplemented from hcaldqm::DQClient.

Definition at line 16 of file TPRunSummary.cc.

References hcaldqm::DQClient::beginRun().

16 { DQClient::beginRun(r, es); }
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
Definition: DQClient.cc:24

◆ endJob()

std::vector< flag::Flag > hcaldqm::TPRunSummary::endJob ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
overridevirtual

Reimplemented from hcaldqm::DQClient.

Definition at line 25 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_cfi::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, cuy::ib, HcalTrigTowerDetId::ietaAbs(), hcaldqm::ContainerXXX< STDTYPE >::initialize(), hcaldqm::ContainerSingle2D::initialize(), hcaldqm::electronicsmap::ElectronicsMap::initialize(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, hcaldqm::ContainerSingle2D::load(), hcaldqm::electronicsmap::ElectronicsMap::lookup(), HcalElectronicsMap::lookup(), nTPFlag, hcaldqm::flag::Flag::reset(), hcaldqm::ContainerSingle2D::setBinContent(), HcalDetId::subdet(), and HcalTrigTowerDetId::version().

25  {
26  // hahs maps
28  ehashmap.initialize(_emap, electronicsmap::fT2EHashMap);
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;
40  xDeadD.initialize(hashfunctions::fCrate);
41  xDeadE.initialize(hashfunctions::fCrate);
42  xEtMsm.initialize(hashfunctions::fCrate);
43  xFGMsm.initialize(hashfunctions::fCrate);
44  xNumCorr.initialize(hashfunctions::fCrate);
45  cOccupancyData_depthlike.initialize(_taskname,
46  "OccupancyData",
47  new quantity::TrigTowerQuantity(quantity::fTTieta),
48  new quantity::TrigTowerQuantity(quantity::fTTiphi),
49  new quantity::ValueQuantity(quantity::fN, true),
50  0);
51  cOccupancyEmul_depthlike.initialize(_taskname,
52  "OccupancyEmul",
53  new quantity::TrigTowerQuantity(quantity::fTTieta),
54  new quantity::TrigTowerQuantity(quantity::fTTiphi),
55  new quantity::ValueQuantity(quantity::fN, true),
56  0);
57  cEtMsm_depthlike.initialize(_taskname,
58  "EtMsm",
59  new quantity::TrigTowerQuantity(quantity::fTTieta),
60  new quantity::TrigTowerQuantity(quantity::fTTiphi),
61  new quantity::ValueQuantity(quantity::fN),
62  0);
63  cFGMsm_depthlike.initialize(_taskname,
64  "FGMsm",
65  new quantity::TrigTowerQuantity(quantity::fTTieta),
66  new quantity::TrigTowerQuantity(quantity::fTTiphi),
67  new quantity::ValueQuantity(quantity::fN),
68  0);
69  cEtCorrRatio_depthlike.initialize(_taskname,
70  "EtCorrRatio",
71  new quantity::TrigTowerQuantity(quantity::fTTieta),
72  new quantity::TrigTowerQuantity(quantity::fTTiphi),
73  new quantity::ValueQuantity(quantity::fRatio_0to2),
74  0);
76  "EtMsmFraction",
77  new quantity::TrigTowerQuantity(quantity::fTTieta),
78  new quantity::TrigTowerQuantity(quantity::fTTiphi),
79  new quantity::ValueQuantity(quantity::fRatio_0to2),
80  0);
82  "FGMsmFraction",
83  new quantity::TrigTowerQuantity(quantity::fTTieta),
84  new quantity::TrigTowerQuantity(quantity::fTTiphi),
85  new quantity::ValueQuantity(quantity::fRatio_0to2),
86  0);
87  cSummary.initialize(_name,
88  "Summary",
89  new quantity::CrateQuantity(_emap),
90  new quantity::FlagQuantity(vflags),
91  new quantity::ValueQuantity(quantity::fState),
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) {
122  HcalElectronicsId eid = HcalElectronicsId(ehashmap.lookup(*it));
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);
141 
142  // skip monitoring for ZDC crate for now (Oct. 1 2023), the Hcal DQM group need to discuss with the ZDC group on the monitoring settings.
143  if (HcalGenericDetId(_emap->lookup(eid)).isHcalZDCDetId()) {
144  sumflags.push_back(fSum);
145  continue;
146  }
147 
149 
150  if (did.subdet() == HcalBarrel || did.subdet() == HcalEndcap || did.subdet() == HcalForward) {
151  double etmsmfr = xNumCorr.get(eid) > 0 ? double(xEtMsm.get(eid)) / double(xNumCorr.get(eid)) : 0;
152  double fgmsmfr = xNumCorr.get(eid) > 0 ? double(xFGMsm.get(eid)) / double(xNumCorr.get(eid)) : 0;
153 
154  if (etmsmfr >= _thresh_EtMsmRate_high)
155  vflags[fEtMsm]._state = flag::fBAD;
156  else if (etmsmfr >= _thresh_EtMsmRate_low)
157  vflags[fEtMsm]._state = flag::fPROBLEMATIC;
158  else
159  vflags[fEtMsm]._state = flag::fGOOD;
160  if (fgmsmfr >= _thresh_FGMsmRate_high)
161  vflags[fFGMsm]._state = flag::fBAD;
162  else if (fgmsmfr >= _thresh_FGMsmRate_low)
163  vflags[fFGMsm]._state = flag::fPROBLEMATIC;
164  else
165  vflags[fFGMsm]._state = flag::fGOOD;
166  }
167 
168  // combine
169  int iflag = 0;
170  for (std::vector<flag::Flag>::iterator ft = vflags.begin(); ft != vflags.end(); ++ft) {
171  cSummary.setBinContent(eid, iflag, ft->_state);
172  fSum += (*ft);
173  iflag++;
174  ft->reset();
175  }
176  sumflags.push_back(fSum);
177  }
178 
179  return sumflags;
180  }
ContainerSingle2D _cFGMsmFraction_depthlike
Definition: TPRunSummary.h:22
std::vector< HcalTrigTowerDetId > allTriggerId() const
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
std::string _taskname
Definition: DQClient.h:50
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:60
std::vector< uint32_t > _vhashCrates
Definition: DQClient.h:64
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
virtual void setBinContent(int, int, int)
std::string _name
Definition: DQModule.h:42
ContainerSingle2D _cEtMsmFraction_depthlike
Definition: TPRunSummary.h:21
int ietaAbs() const
get the absolute value of the tower ieta
std::string _subsystem
Definition: DQModule.h:49
int version() const
get the version code for the trigger tower
Readout chain identification for Hcal.
ib
Definition: cuy.py:661

◆ endLuminosityBlock()

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 18 of file TPRunSummary.cc.

References hcaldqm::DQClient::endLuminosityBlock(), and cuy::ib.

21  {
22  DQClient::endLuminosityBlock(ib, ig, lb, es);
23  }
virtual void endLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: DQClient.cc:105
ib
Definition: cuy.py:661

Member Data Documentation

◆ _cEtMsmFraction_depthlike

ContainerSingle2D hcaldqm::TPRunSummary::_cEtMsmFraction_depthlike
protected

Definition at line 21 of file TPRunSummary.h.

Referenced by endJob().

◆ _cFGMsmFraction_depthlike

ContainerSingle2D hcaldqm::TPRunSummary::_cFGMsmFraction_depthlike
protected

Definition at line 22 of file TPRunSummary.h.

Referenced by endJob().

◆ _thresh_EtMsmRate_high

double hcaldqm::TPRunSummary::_thresh_EtMsmRate_high
protected

Definition at line 25 of file TPRunSummary.h.

Referenced by endJob(), and TPRunSummary().

◆ _thresh_EtMsmRate_low

double hcaldqm::TPRunSummary::_thresh_EtMsmRate_low
protected

Definition at line 25 of file TPRunSummary.h.

Referenced by endJob(), and TPRunSummary().

◆ _thresh_FGMsmRate_high

double hcaldqm::TPRunSummary::_thresh_FGMsmRate_high
protected

Definition at line 24 of file TPRunSummary.h.

Referenced by endJob(), and TPRunSummary().

◆ _thresh_FGMsmRate_low

double hcaldqm::TPRunSummary::_thresh_FGMsmRate_low
protected

Definition at line 24 of file TPRunSummary.h.

Referenced by endJob(), and TPRunSummary().