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

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

6  :
7  DQClient(name, taskname, ps)
8  {
9  _thresh_EtMsmRate_high = ps.getUntrackedParameter<double>(
10  "thresh_EtMsmRate_high", 0.2);
11  _thresh_EtMsmRate_low = ps.getUntrackedParameter<double>(
12  "thresh_EtMsmRate_low", 0.05);
13  _thresh_FGMsmRate_high = ps.getUntrackedParameter<double>(
14  "thresh_FGMsmRate_high", 0.2);
15  _thresh_FGMsmRate_low = ps.getUntrackedParameter<double>(
16  "thresh_FGMsmRate_low", 0.05);
17  }
DQClient(std::string const &, std::string const &, edm::ParameterSet const &)
Definition: DQClient.cc:5
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 19 of file TPRunSummary.cc.

References hcaldqm::DQClient::beginRun().

Referenced by ~TPRunSummary().

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

Reimplemented from hcaldqm::DQClient.

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

34  {
35  // hahs maps
36  electronicsmap::ElectronicsMap ehashmap;
37  ehashmap.initialize(_emap, electronicsmap::fT2EHashMap);
38  std::vector<flag::Flag> vflags; vflags.resize(nTPFlag);
39  vflags[fEtMsm]=flag::Flag("EtMsm");
40  vflags[fFGMsm]=flag::Flag("FGMsm");
41 
42  // INITIALIZE
43  ContainerSingle2D cOccupancyData_depthlike, cOccupancyEmul_depthlike;
44  ContainerSingle2D cEtMsm_depthlike, cFGMsm_depthlike,
45  cEtCorrRatio_depthlike;
46  ContainerSingle2D cSummary;
47  ContainerXXX<double> xDeadD, xDeadE, xEtMsm, xFGMsm;
48  ContainerXXX<double> xNumCorr;
49  xDeadD.initialize(hashfunctions::fCrate);
50  xDeadE.initialize(hashfunctions::fCrate);
51  xEtMsm.initialize(hashfunctions::fCrate);
52  xFGMsm.initialize(hashfunctions::fCrate);
53  xNumCorr.initialize(hashfunctions::fCrate);
54  cOccupancyData_depthlike.initialize(_taskname, "OccupancyData",
55  new quantity::TrigTowerQuantity(quantity::fTTieta),
56  new quantity::TrigTowerQuantity(quantity::fTTiphi),
57  new quantity::ValueQuantity(quantity::fN, true),0);
58  cOccupancyEmul_depthlike.initialize(_taskname, "OccupancyEmul",
59  new quantity::TrigTowerQuantity(quantity::fTTieta),
60  new quantity::TrigTowerQuantity(quantity::fTTiphi),
61  new quantity::ValueQuantity(quantity::fN, true),0);
62  cEtMsm_depthlike.initialize(_taskname, "EtMsm",
63  new quantity::TrigTowerQuantity(quantity::fTTieta),
64  new quantity::TrigTowerQuantity(quantity::fTTiphi),
65  new quantity::ValueQuantity(quantity::fN),0);
66  cFGMsm_depthlike.initialize(_taskname, "FGMsm",
67  new quantity::TrigTowerQuantity(quantity::fTTieta),
68  new quantity::TrigTowerQuantity(quantity::fTTiphi),
69  new quantity::ValueQuantity(quantity::fN),0);
70  cEtCorrRatio_depthlike.initialize(_taskname, "EtCorrRatio",
71  new quantity::TrigTowerQuantity(quantity::fTTieta),
72  new quantity::TrigTowerQuantity(quantity::fTTiphi),
73  new quantity::ValueQuantity(quantity::fRatio_0to2),0);
75  new quantity::TrigTowerQuantity(quantity::fTTieta),
76  new quantity::TrigTowerQuantity(quantity::fTTiphi),
77  new quantity::ValueQuantity(quantity::fRatio_0to2),0);
79  new quantity::TrigTowerQuantity(quantity::fTTieta),
80  new quantity::TrigTowerQuantity(quantity::fTTiphi),
81  new quantity::ValueQuantity(quantity::fRatio_0to2),0);
82  cSummary.initialize(_name, "Summary",
83  new quantity::CrateQuantity(_emap),
84  new quantity::FlagQuantity(vflags),
85  new quantity::ValueQuantity(quantity::fState),0);
86 
87  // BOOK
88  xDeadD.book(_emap); xDeadE.book(_emap); xEtMsm.book(_emap);
89  xFGMsm.book(_emap); xNumCorr.book(_emap);
90 
91  // LOAD
92  cOccupancyData_depthlike.load(ig, _subsystem);
93  cOccupancyEmul_depthlike.load(ig, _subsystem);
94  cEtMsm_depthlike.load(ig, _subsystem);
95  cFGMsm_depthlike.load(ig, _subsystem);
96  cEtCorrRatio_depthlike.load(ig, _subsystem);
99  cSummary.book(ib, _subsystem);
100 
101  // iterate
102  std::vector<HcalTrigTowerDetId> tids = _emap->allTriggerId();
103  for (std::vector<HcalTrigTowerDetId>::const_iterator it=tids.begin();
104  it!=tids.end(); ++it)
105  {
106  // skip 2x3
108  if (tid.version()==0 && tid.ietaAbs()>=29)
109  continue;
110 
111  // do the comparison if there are channels that were correlated
112  // both had emul and data tps
113  if (cEtCorrRatio_depthlike.getBinEntries(tid)>0)
114  {
115  HcalElectronicsId eid=HcalElectronicsId(ehashmap.lookup(*it));
116 
117  double numetmsm = cEtMsm_depthlike.getBinContent(tid);
118  double numfgmsm = cFGMsm_depthlike.getBinContent(tid);
119  double numcorr = cEtCorrRatio_depthlike.getBinEntries(tid);
120 
121  xEtMsm.get(eid) += numetmsm;
122  xFGMsm.get(eid) += numfgmsm;
123  xNumCorr.get(eid) += numcorr;
124 
126  numetmsm/numcorr);
128  numfgmsm/numcorr);
129  }
130  }
131 
132  std::vector<flag::Flag> sumflags;
133  for (auto& it_hashcrate : _vhashCrates) {
134  flag::Flag fSum("TP");
135  HcalElectronicsId eid(it_hashcrate);
136  HcalDetId did = HcalDetId(_emap->lookup(eid));
137 
138  if (did.subdet() == HcalBarrel || did.subdet() == HcalEndcap || did.subdet() == HcalForward) {
139  double etmsmfr = xNumCorr.get(eid)>0?
140  double(xEtMsm.get(eid))/double(xNumCorr.get(eid)):0;
141  double fgmsmfr = xNumCorr.get(eid)>0?
142  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();
161  ft!=vflags.end(); ++ft)
162  {
163  cSummary.setBinContent(eid, iflag, ft->_state);
164  fSum+=(*ft);
165  iflag++;
166  ft->reset();
167  }
168  sumflags.push_back(fSum);
169  }
170 
171  return sumflags;
172  }
ContainerSingle2D _cFGMsmFraction_depthlike
Definition: TPRunSummary.h:25
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
std::string _taskname
Definition: DQClient.h:47
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
virtual void initialize(std::string const &folder, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fN), int debug=0)
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 25 of file TPRunSummary.cc.

References hcaldqm::DQClient::endLuminosityBlock().

Referenced by ~TPRunSummary().

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

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