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

Protected Types

enum  TPFlag { fEtMsm =0, fFGMsm =1, nTPFlag =2 }
 

Protected Attributes

ContainerSingle2D _cEtMsmFraction_depthlike
 
ContainerSingle2D _cFGMsmFraction_depthlike
 
double _thresh_etmsm
 
double _thresh_fgmsm
 
- 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 29 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_etmsm, _thresh_fgmsm, and edm::ParameterSet::getUntrackedParameter().

6  :
7  DQClient(name, taskname, ps)
8  {
9  _thresh_fgmsm = ps.getUntrackedParameter<double>("thresh_fgmsm",
10  0.1);
11  _thresh_etmsm = ps.getUntrackedParameter<double>("thresh_etmsm",
12  0.1);
13  }
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 15 of file TPRunSummary.cc.

References hcaldqm::DQClient::beginRun().

17  {
19  }
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 28 of file TPRunSummary.cc.

References _cEtMsmFraction_depthlike, _cFGMsmFraction_depthlike, hcaldqm::DQClient::_emap, hcaldqm::DQModule::_name, hcaldqm::DQModule::_subsystem, hcaldqm::DQClient::_taskname, hcaldqm::DQClient::_vcdaqEids, hcaldqm::DQClient::_vFEDs, hcaldqm::DQClient::_vhashFEDs, HcalElectronicsMap::allTriggerId(), hcaldqm::ContainerXXX< STDTYPE >::book(), hcaldqm::ContainerSingle2D::book(), hcaldqm::flag::fBAD, fEtMsm, hcaldqm::hashfunctions::fFED, fFGMsm, hcaldqm::flag::fGOOD, spr::find(), hcaldqm::quantity::fN, hcaldqm::flag::fNCDAQ, 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().

30  {
31  // hahs maps
33  ehashmap.initialize(_emap, electronicsmap::fT2EHashMap);
34  std::vector<flag::Flag> vflags; vflags.resize(nTPFlag);
35  vflags[fEtMsm]=flag::Flag("EtMsm");
36  vflags[fFGMsm]=flag::Flag("FGMsm");
37 
38  // INITIALIZE
39  ContainerSingle2D cOccupancyData_depthlike, cOccupancyEmul_depthlike;
40  ContainerSingle2D cEtMsm_depthlike, cFGMsm_depthlike,
41  cEtCorrRatio_depthlike;
42  ContainerSingle2D cSummary;
43  ContainerXXX<double> xDeadD, xDeadE, xEtMsm, xFGMsm;
44  xDeadD.initialize(hashfunctions::fFED);
45  xDeadE.initialize(hashfunctions::fFED);
46  xEtMsm.initialize(hashfunctions::fFED);
47  xFGMsm.initialize(hashfunctions::fFED);
48  cOccupancyData_depthlike.initialize(_taskname, "OccupancyData",
49  new quantity::TrigTowerQuantity(quantity::fTTieta),
50  new quantity::TrigTowerQuantity(quantity::fTTiphi),
51  new quantity::ValueQuantity(quantity::fN, true));
52  cOccupancyEmul_depthlike.initialize(_taskname, "OccupancyEmul",
53  new quantity::TrigTowerQuantity(quantity::fTTieta),
54  new quantity::TrigTowerQuantity(quantity::fTTiphi),
55  new quantity::ValueQuantity(quantity::fN, true));
56  cEtMsm_depthlike.initialize(_taskname, "EtMsm",
57  new quantity::TrigTowerQuantity(quantity::fTTieta),
58  new quantity::TrigTowerQuantity(quantity::fTTiphi),
59  new quantity::ValueQuantity(quantity::fN));
60  cFGMsm_depthlike.initialize(_taskname, "FGMsm",
61  new quantity::TrigTowerQuantity(quantity::fTTieta),
62  new quantity::TrigTowerQuantity(quantity::fTTiphi),
63  new quantity::ValueQuantity(quantity::fN));
64  cEtCorrRatio_depthlike.initialize(_taskname, "EtCorrRatio",
65  new quantity::TrigTowerQuantity(quantity::fTTieta),
66  new quantity::TrigTowerQuantity(quantity::fTTiphi),
67  new quantity::ValueQuantity(quantity::fRatio_0to2));
69  new quantity::TrigTowerQuantity(quantity::fTTieta),
70  new quantity::TrigTowerQuantity(quantity::fTTiphi),
71  new quantity::ValueQuantity(quantity::fRatio_0to2));
73  new quantity::TrigTowerQuantity(quantity::fTTieta),
74  new quantity::TrigTowerQuantity(quantity::fTTiphi),
75  new quantity::ValueQuantity(quantity::fRatio_0to2));
76  cSummary.initialize(_name, "Summary",
77  new quantity::FEDQuantity(_vFEDs),
78  new quantity::FlagQuantity(vflags),
79  new quantity::ValueQuantity(quantity::fState));
80 
81  // BOOK
82  xDeadD.book(_emap); xDeadE.book(_emap); xEtMsm.book(_emap);
83  xFGMsm.book(_emap);
84 
85  // LOAD
86  cOccupancyData_depthlike.load(ig, _subsystem);
87  cOccupancyEmul_depthlike.load(ig, _subsystem);
88  cEtMsm_depthlike.load(ig, _subsystem);
89  cFGMsm_depthlike.load(ig, _subsystem);
90  cEtCorrRatio_depthlike.load(ig, _subsystem);
93  cSummary.book(ib, _subsystem);
94 
95  // iterate
96  std::vector<HcalTrigTowerDetId> tids = _emap->allTriggerId();
97  for (std::vector<HcalTrigTowerDetId>::const_iterator it=tids.begin();
98  it!=tids.end(); ++it)
99  {
100  // skip 2x3
102  if (tid.version()==0 && tid.ietaAbs()>=29)
103  continue;
104  HcalElectronicsId eid=HcalElectronicsId(ehashmap.lookup(*it));
105  double etmsmfr = double(cEtMsm_depthlike.getBinContent(tid))/
106  double(cEtCorrRatio_depthlike.getBinEntries(tid));
107  etmsmfr>=0.1?xEtMsm.get(eid)++:xEtMsm.get(eid)+=0;
108  double fgmsmfr = double(cFGMsm_depthlike.getBinContent(tid))/
109  double(cEtCorrRatio_depthlike.getBinEntries(tid));
110  fgmsmfr>=0.1?xFGMsm.get(eid)++:xFGMsm.get(eid)+=0;
111 
114  }
115 
116  std::vector<flag::Flag> sumflags;
117  for (std::vector<uint32_t>::const_iterator it=_vhashFEDs.begin();
118  it!=_vhashFEDs.end(); ++it)
119  {
120  flag::Flag fSum("TP");
121  HcalElectronicsId eid(*it);
122 
123  std::vector<uint32_t>::const_iterator cit=std::find(
124  _vcdaqEids.begin(), _vcdaqEids.end(), *it);
125  if (cit==_vcdaqEids.end())
126  {
127  // not @cDAQ
128  sumflags.push_back(flag::Flag("TP", flag::fNCDAQ));
129  continue;
130  }
131 
132  // @cDAQ
133  if (utilities::isFEDHBHE(eid) || utilities::isFEDHF(eid))
134  {
135  if (xEtMsm.get(eid)>0)
136  vflags[fEtMsm]._state = flag::fBAD;
137  else
138  vflags[fEtMsm]._state = flag::fGOOD;
139  if (xFGMsm.get(eid)>0)
140  vflags[fFGMsm]._state = flag::fBAD;
141  else
142  vflags[fFGMsm]._state = flag::fGOOD;
143  }
144 
145  // combine
146  int iflag=0;
147  for (std::vector<flag::Flag>::iterator ft=vflags.begin();
148  ft!=vflags.end(); ++ft)
149  {
150  cSummary.setBinContent(eid, iflag, ft->_state);
151  fSum+=(*ft);
152  iflag++;
153  ft->reset();
154  }
155  sumflags.push_back(fSum);
156  }
157 
158  return sumflags;
159  }
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:124
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
Readout chain identification for Hcal.
std::vector< HcalTrigTowerDetId > allTriggerId() const
bool isFEDHF(HcalElectronicsId const &)
Definition: Utilities.cc:146
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 21 of file TPRunSummary.cc.

References hcaldqm::DQClient::endLuminosityBlock().

24  {
25  DQClient::endLuminosityBlock(ib, ig, lb, es);
26  }
virtual void endLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: DQClient.cc:84

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_etmsm
protected

Definition at line 27 of file TPRunSummary.h.

Referenced by TPRunSummary().

double hcaldqm::TPRunSummary::_thresh_fgmsm
protected

Definition at line 27 of file TPRunSummary.h.

Referenced by TPRunSummary().