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
 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 9 of file TPRunSummary.h.

Member Enumeration Documentation

Enumerator
fEtMsm 
fFGMsm 
nTPFlag 

Definition at line 30 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 6 of file TPRunSummary.cc.

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

7  :
8  DQClient(name, taskname, ps)
9  {
10  _thresh_EtMsmRate_high = ps.getUntrackedParameter<double>(
11  "thresh_EtMsmRate_high", 0.2);
12  _thresh_EtMsmRate_low = ps.getUntrackedParameter<double>(
13  "thresh_EtMsmRate_low", 0.05);
14  _thresh_FGMsmRate_high = ps.getUntrackedParameter<double>(
15  "thresh_FGMsmRate_high", 0.2);
16  _thresh_FGMsmRate_low = ps.getUntrackedParameter<double>(
17  "thresh_FGMsmRate_low", 0.05);
18  }
DQClient(std::string const &, std::string const &, edm::ParameterSet const &)
Definition: DQClient.cc:6
hcaldqm::TPRunSummary::~TPRunSummary ( )
inlineoverride

Definition at line 14 of file TPRunSummary.h.

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

14 {}

Member Function Documentation

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

Reimplemented from hcaldqm::DQClient.

Definition at line 20 of file TPRunSummary.cc.

References hcaldqm::DQClient::beginRun().

Referenced by ~TPRunSummary().

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

Reimplemented from hcaldqm::DQClient.

Definition at line 33 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().

35  {
36  // hahs maps
37  electronicsmap::ElectronicsMap ehashmap;
38  ehashmap.initialize(_emap, electronicsmap::fT2EHashMap);
39  std::vector<flag::Flag> vflags; vflags.resize(nTPFlag);
40  vflags[fEtMsm]=flag::Flag("EtMsm");
41  vflags[fFGMsm]=flag::Flag("FGMsm");
42 
43  // INITIALIZE
44  ContainerSingle2D cOccupancyData_depthlike, cOccupancyEmul_depthlike;
45  ContainerSingle2D cEtMsm_depthlike, cFGMsm_depthlike,
46  cEtCorrRatio_depthlike;
47  ContainerSingle2D cSummary;
48  ContainerXXX<double> xDeadD, xDeadE, xEtMsm, xFGMsm;
49  ContainerXXX<double> xNumCorr;
50  xDeadD.initialize(hashfunctions::fCrate);
51  xDeadE.initialize(hashfunctions::fCrate);
52  xEtMsm.initialize(hashfunctions::fCrate);
53  xFGMsm.initialize(hashfunctions::fCrate);
54  xNumCorr.initialize(hashfunctions::fCrate);
55  cOccupancyData_depthlike.initialize(_taskname, "OccupancyData",
56  new quantity::TrigTowerQuantity(quantity::fTTieta),
57  new quantity::TrigTowerQuantity(quantity::fTTiphi),
58  new quantity::ValueQuantity(quantity::fN, true),0);
59  cOccupancyEmul_depthlike.initialize(_taskname, "OccupancyEmul",
60  new quantity::TrigTowerQuantity(quantity::fTTieta),
61  new quantity::TrigTowerQuantity(quantity::fTTiphi),
62  new quantity::ValueQuantity(quantity::fN, true),0);
63  cEtMsm_depthlike.initialize(_taskname, "EtMsm",
64  new quantity::TrigTowerQuantity(quantity::fTTieta),
65  new quantity::TrigTowerQuantity(quantity::fTTiphi),
66  new quantity::ValueQuantity(quantity::fN),0);
67  cFGMsm_depthlike.initialize(_taskname, "FGMsm",
68  new quantity::TrigTowerQuantity(quantity::fTTieta),
69  new quantity::TrigTowerQuantity(quantity::fTTiphi),
70  new quantity::ValueQuantity(quantity::fN),0);
71  cEtCorrRatio_depthlike.initialize(_taskname, "EtCorrRatio",
72  new quantity::TrigTowerQuantity(quantity::fTTieta),
73  new quantity::TrigTowerQuantity(quantity::fTTiphi),
74  new quantity::ValueQuantity(quantity::fRatio_0to2),0);
76  new quantity::TrigTowerQuantity(quantity::fTTieta),
77  new quantity::TrigTowerQuantity(quantity::fTTiphi),
78  new quantity::ValueQuantity(quantity::fRatio_0to2),0);
80  new quantity::TrigTowerQuantity(quantity::fTTieta),
81  new quantity::TrigTowerQuantity(quantity::fTTiphi),
82  new quantity::ValueQuantity(quantity::fRatio_0to2),0);
83  cSummary.initialize(_name, "Summary",
84  new quantity::CrateQuantity(_emap),
85  new quantity::FlagQuantity(vflags),
86  new quantity::ValueQuantity(quantity::fState),0);
87 
88  // BOOK
89  xDeadD.book(_emap); xDeadE.book(_emap); xEtMsm.book(_emap);
90  xFGMsm.book(_emap); xNumCorr.book(_emap);
91 
92  // LOAD
93  cOccupancyData_depthlike.load(ig, _subsystem);
94  cOccupancyEmul_depthlike.load(ig, _subsystem);
95  cEtMsm_depthlike.load(ig, _subsystem);
96  cFGMsm_depthlike.load(ig, _subsystem);
97  cEtCorrRatio_depthlike.load(ig, _subsystem);
100  cSummary.book(ib, _subsystem);
101 
102  // iterate
103  std::vector<HcalTrigTowerDetId> tids = _emap->allTriggerId();
104  for (std::vector<HcalTrigTowerDetId>::const_iterator it=tids.begin();
105  it!=tids.end(); ++it)
106  {
107  // skip 2x3
109  if (tid.version()==0 && tid.ietaAbs()>=29)
110  continue;
111 
112  // do the comparison if there are channels that were correlated
113  // both had emul and data tps
114  if (cEtCorrRatio_depthlike.getBinEntries(tid)>0)
115  {
116  HcalElectronicsId eid=HcalElectronicsId(ehashmap.lookup(*it));
117 
118  double numetmsm = cEtMsm_depthlike.getBinContent(tid);
119  double numfgmsm = cFGMsm_depthlike.getBinContent(tid);
120  double numcorr = cEtCorrRatio_depthlike.getBinEntries(tid);
121 
122  xEtMsm.get(eid) += numetmsm;
123  xFGMsm.get(eid) += numfgmsm;
124  xNumCorr.get(eid) += numcorr;
125 
127  numetmsm/numcorr);
129  numfgmsm/numcorr);
130  }
131  }
132 
133  std::vector<flag::Flag> sumflags;
134  for (auto& it_hashcrate : _vhashCrates) {
135  flag::Flag fSum("TP");
136  HcalElectronicsId eid(it_hashcrate);
137  HcalDetId did = HcalDetId(_emap->lookup(eid));
138 
139  if (did.subdet() == HcalBarrel || did.subdet() == HcalEndcap || did.subdet() == HcalForward) {
140  double etmsmfr = xNumCorr.get(eid)>0?
141  double(xEtMsm.get(eid))/double(xNumCorr.get(eid)):0;
142  double fgmsmfr = xNumCorr.get(eid)>0?
143  double(xFGMsm.get(eid))/double(xNumCorr.get(eid)):0;
144 
145  if (etmsmfr>=_thresh_EtMsmRate_high)
146  vflags[fEtMsm]._state = flag::fBAD;
147  else if (etmsmfr>=_thresh_EtMsmRate_low)
148  vflags[fEtMsm]._state = flag::fPROBLEMATIC;
149  else
150  vflags[fEtMsm]._state = flag::fGOOD;
151  if (fgmsmfr>=_thresh_FGMsmRate_high)
152  vflags[fFGMsm]._state = flag::fBAD;
153  else if (fgmsmfr>=_thresh_FGMsmRate_low)
154  vflags[fFGMsm]._state = flag::fPROBLEMATIC;
155  else
156  vflags[fFGMsm]._state = flag::fGOOD;
157  }
158 
159  // combine
160  int iflag=0;
161  for (std::vector<flag::Flag>::iterator ft=vflags.begin();
162  ft!=vflags.end(); ++ft)
163  {
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  }
ContainerSingle2D _cFGMsmFraction_depthlike
Definition: TPRunSummary.h:25
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:142
std::string _taskname
Definition: DQClient.h:47
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:54
std::vector< uint32_t > _vhashCrates
Definition: DQClient.h:58
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
virtual void setBinContent(int, int, int)
std::string _name
Definition: DQModule.h:57
int version() const
get the version code for the trigger tower
ContainerSingle2D _cEtMsmFraction_depthlike
Definition: TPRunSummary.h:24
std::string _subsystem
Definition: DQModule.h:64
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 26 of file TPRunSummary.cc.

References hcaldqm::DQClient::endLuminosityBlock().

Referenced by ~TPRunSummary().

29  {
30  DQClient::endLuminosityBlock(ib, ig, lb, es);
31  }
virtual void endLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: DQClient.cc:115

Member Data Documentation

ContainerSingle2D hcaldqm::TPRunSummary::_cEtMsmFraction_depthlike
protected

Definition at line 24 of file TPRunSummary.h.

Referenced by endJob().

ContainerSingle2D hcaldqm::TPRunSummary::_cFGMsmFraction_depthlike
protected

Definition at line 25 of file TPRunSummary.h.

Referenced by endJob().

double hcaldqm::TPRunSummary::_thresh_EtMsmRate_high
protected

Definition at line 28 of file TPRunSummary.h.

Referenced by endJob(), and TPRunSummary().

double hcaldqm::TPRunSummary::_thresh_EtMsmRate_low
protected

Definition at line 28 of file TPRunSummary.h.

Referenced by endJob(), and TPRunSummary().

double hcaldqm::TPRunSummary::_thresh_FGMsmRate_high
protected

Definition at line 27 of file TPRunSummary.h.

Referenced by endJob(), and TPRunSummary().

double hcaldqm::TPRunSummary::_thresh_FGMsmRate_low
protected

Definition at line 27 of file TPRunSummary.h.

Referenced by endJob(), and TPRunSummary().