CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual std::vector< flag::FlagendJob (DQMStore::IBooker &, DQMStore::IGetter &)
 
virtual void endLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
 TPRunSummary (std::string const &, std::string const &, edm::ParameterSet const &)
 
virtual ~TPRunSummary ()
 
- Public Member Functions inherited from hcaldqm::DQClient
 DQClient (std::string const &, std::string const &, edm::ParameterSet const &)
 
virtual ~DQClient ()
 
- 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 > _vFEDs
 
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
virtual hcaldqm::TPRunSummary::~TPRunSummary ( )
inlinevirtual

Definition at line 14 of file TPRunSummary.h.

14 {}

Member Function Documentation

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

Reimplemented from hcaldqm::DQClient.

Definition at line 19 of file TPRunSummary.cc.

References hcaldqm::DQClient::beginRun().

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 
)
virtual

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::_vcdaqEids, hcaldqm::DQClient::_vFEDs, hcaldqm::DQClient::_vhashFEDs, HcalElectronicsMap::allTriggerId(), hcaldqm::ContainerXXX< STDTYPE >::book(), hcaldqm::ContainerSingle2D::book(), runTauDisplay::eid, hcaldqm::flag::fBAD, fEtMsm, hcaldqm::hashfunctions::fFED, fFGMsm, hcaldqm::flag::fGOOD, spr::find(), hcaldqm::quantity::fN, hcaldqm::flag::fNCDAQ, 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(), HcalTrigTowerDetId::ietaAbs(), hcaldqm::ContainerXXX< STDTYPE >::initialize(), hcaldqm::ContainerSingle2D::initialize(), hcaldqm::electronicsmap::ElectronicsMap::initialize(), hcaldqm::utilities::isFEDHBHE(), hcaldqm::utilities::isFEDHF(), hcaldqm::ContainerSingle2D::load(), hcaldqm::electronicsmap::ElectronicsMap::lookup(), nTPFlag, hcaldqm::flag::Flag::reset(), hcaldqm::ContainerSingle2D::setBinContent(), and HcalTrigTowerDetId::version().

34  {
35  // hahs maps
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::fFED);
50  xDeadE.initialize(hashfunctions::fFED);
51  xEtMsm.initialize(hashfunctions::fFED);
52  xFGMsm.initialize(hashfunctions::fFED);
53  xNumCorr.initialize(hashfunctions::fFED);
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::FEDQuantity(_vFEDs),
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 (std::vector<uint32_t>::const_iterator it=_vhashFEDs.begin();
134  it!=_vhashFEDs.end(); ++it)
135  {
136  flag::Flag fSum("TP");
137  HcalElectronicsId eid(*it);
138 
139  std::vector<uint32_t>::const_iterator cit=std::find(
140  _vcdaqEids.begin(), _vcdaqEids.end(), *it);
141  if (cit==_vcdaqEids.end())
142  {
143  // not @cDAQ
144  sumflags.push_back(flag::Flag("TP", flag::fNCDAQ));
145  continue;
146  }
147 
148  // @cDAQ
149  if (utilities::isFEDHBHE(eid) || utilities::isFEDHF(eid))
150  {
151  double etmsmfr = xNumCorr.get(eid)>0?
152  double(xEtMsm.get(eid))/double(xNumCorr.get(eid)):0;
153  double fgmsmfr = xNumCorr.get(eid)>0?
154  double(xFGMsm.get(eid))/double(xNumCorr.get(eid)):0;
155 
156  if (etmsmfr>=_thresh_EtMsmRate_high)
157  vflags[fEtMsm]._state = flag::fBAD;
158  else if (etmsmfr>=_thresh_EtMsmRate_low)
159  vflags[fEtMsm]._state = flag::fPROBLEMATIC;
160  else
161  vflags[fEtMsm]._state = flag::fGOOD;
162  if (fgmsmfr>=_thresh_FGMsmRate_high)
163  vflags[fFGMsm]._state = flag::fBAD;
164  else if (fgmsmfr>=_thresh_FGMsmRate_low)
165  vflags[fFGMsm]._state = flag::fPROBLEMATIC;
166  else
167  vflags[fFGMsm]._state = flag::fGOOD;
168  }
169 
170  // combine
171  int iflag=0;
172  for (std::vector<flag::Flag>::iterator ft=vflags.begin();
173  ft!=vflags.end(); ++ft)
174  {
175  cSummary.setBinContent(eid, iflag, ft->_state);
176  fSum+=(*ft);
177  iflag++;
178  ft->reset();
179  }
180  sumflags.push_back(fSum);
181  }
182 
183  return sumflags;
184  }
std::vector< uint32_t > _vcdaqEids
Definition: DQClient.h:64
ContainerSingle2D _cFGMsmFraction_depthlike
Definition: TPRunSummary.h:25
std::vector< uint32_t > _vhashFEDs
Definition: DQClient.h:58
std::string _taskname
Definition: DQClient.h:47
HcalElectronicsMap const * _emap
Definition: DQClient.h:54
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
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
bool isFEDHBHE(HcalElectronicsId const &)
Definition: Utilities.cc:131
virtual void initialize(std::string const &folder, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fN), int debug=0)
std::vector< int > _vFEDs
Definition: DQClient.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
tuple ElectronicsMap
Readout chain identification for Hcal.
std::vector< HcalTrigTowerDetId > allTriggerId() const
bool isFEDHF(HcalElectronicsId const &)
Definition: Utilities.cc:153
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 
)
virtual

Reimplemented from hcaldqm::DQClient.

Definition at line 25 of file TPRunSummary.cc.

References hcaldqm::DQClient::endLuminosityBlock().

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:105

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