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 () 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
const HcalElectronicsMap_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
 

Additional Inherited Members

- Public Types inherited from hcaldqm::DQClient
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 

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.

27 { fEtMsm = 0, fFGMsm = 1, nTPFlag = 3 };

Constructor & Destructor Documentation

◆ TPRunSummary()

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

Definition at line 5 of file TPRunSummary.cc.

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  }

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

◆ ~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 13 of file TPRunSummary.cc.

13 { DQClient::beginRun(r, es); }

References hcaldqm::DQClient::beginRun(), and alignCSCRings::r.

◆ endJob()

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.

22  {
23  // hahs maps
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);
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  }

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, cuy::ib, 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().

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

18  {
19  DQClient::endLuminosityBlock(ib, ig, lb, es);
20  }

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

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

hcaldqm::quantity::fRatio_0to2
Definition: ValueQuantity.h:39
hcaldqm::TPRunSummary::_thresh_EtMsmRate_high
double _thresh_EtMsmRate_high
Definition: TPRunSummary.h:25
hcaldqm::flag::fGOOD
Definition: Flag.h:17
hcaldqm::TPRunSummary::nTPFlag
Definition: TPRunSummary.h:27
hcaldqm::quantity::fTTiphi
Definition: TrigTowerQuantity.h:14
hcaldqm::TPRunSummary::_thresh_FGMsmRate_low
double _thresh_FGMsmRate_low
Definition: TPRunSummary.h:24
hcaldqm::DQClient::endLuminosityBlock
virtual void endLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: DQClient.cc:98
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::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::TPRunSummary::_thresh_FGMsmRate_high
double _thresh_FGMsmRate_high
Definition: TPRunSummary.h:24
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
hcaldqm::DQClient::DQClient
DQClient(std::string const &, std::string const &, edm::ParameterSet const &)
Definition: DQClient.cc:5
hcaldqm::quantity::fN
Definition: ValueQuantity.h:11
hcaldqm::TPRunSummary::fEtMsm
Definition: TPRunSummary.h:27
HcalDetId::subdet
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
HcalDetId
Definition: HcalDetId.h:12
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
cuy.ib
ib
Definition: cuy.py:662
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
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
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::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::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
HLT_FULL_cff.ElectronicsMap
ElectronicsMap
Definition: HLT_FULL_cff.py:8322
hcaldqm::TPRunSummary::_cFGMsmFraction_depthlike
ContainerSingle2D _cFGMsmFraction_depthlike
Definition: TPRunSummary.h:22
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14