CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Types | Protected Attributes
hcaldqm::RecoRunSummary Class Reference

#include <RecoRunSummary.h>

Inheritance diagram for hcaldqm::RecoRunSummary:
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
 
 RecoRunSummary (std::string const &, std::string const &, edm::ParameterSet const &)
 
 ~RecoRunSummary () 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  RecoFlag { fTCDS = 0, fUniSlotHF =1, nRecoFlag =2 }
 

Protected Attributes

double _thresh_tcds
 
double _thresh_unihf
 
- 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 RecoRunSummary.h.

Member Enumeration Documentation

Enumerator
fTCDS 
fUniSlotHF 
nRecoFlag 

Definition at line 26 of file RecoRunSummary.h.

Constructor & Destructor Documentation

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

Definition at line 7 of file RecoRunSummary.cc.

References _thresh_tcds, _thresh_unihf, and edm::ParameterSet::getUntrackedParameter().

8  :
9  DQClient(name, taskname, ps)
10  {
11  _thresh_unihf = ps.getUntrackedParameter<double>("thresh_unihf",
12  0.2);
13  _thresh_tcds = ps.getUntrackedParameter<double>("thresh_tcds",
14  1.5);
15  }
DQClient(std::string const &, std::string const &, edm::ParameterSet const &)
Definition: DQClient.cc:6
hcaldqm::RecoRunSummary::~RecoRunSummary ( )
inlineoverride

Definition at line 14 of file RecoRunSummary.h.

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

14 {}

Member Function Documentation

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

Reimplemented from hcaldqm::DQClient.

Definition at line 17 of file RecoRunSummary.cc.

References hcaldqm::DQClient::beginRun().

Referenced by ~RecoRunSummary().

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

Reimplemented from hcaldqm::DQClient.

Definition at line 36 of file RecoRunSummary.cc.

References hcaldqm::DQClient::_emap, hcaldqm::DQModule::_name, hcaldqm::DQModule::_ptype, hcaldqm::DQModule::_subsystem, hcaldqm::DQClient::_taskname, _thresh_tcds, _thresh_unihf, hcaldqm::DQClient::_vhashCrates, a, HcalElectronicsMap::allPrecisionId(), b, hcaldqm::ContainerXXX< STDTYPE >::begin(), hcaldqm::ContainerXXX< STDTYPE >::book(), hcaldqm::ContainerSingle2D::book(), hcaldqm::Container1D::book(), EnergyCorrector::c, runTauDisplay::eid, hcaldqm::ContainerXXX< STDTYPE >::end(), hcaldqm::flag::fBAD, hcaldqm::hashfunctions::fCrate, hcaldqm::hashfunctions::fCrateSlot, hcaldqm::electronicsmap::fD2EHashMap, hcaldqm::hashfunctions::fdepth, hcaldqm::flag::fGOOD, hcaldqm::hashfunctions::fHBHEPartition, hcaldqm::constants::FIBER_uTCA_MIN1, hcaldqm::constants::FIBERCH_MIN, hcaldqm::quantity::fieta, hcaldqm::quantity::fiphi, nanoDQM_cff::Flag, hcaldqm::quantity::fN, hcaldqm::fOffline, hcaldqm::filter::fPreserver, hcaldqm::quantity::fState, fTCDS, hcaldqm::quantity::fTiming_ns, fUniSlotHF, hcaldqm::ContainerXXX< STDTYPE >::get(), hcaldqm::Container2D::getBinContent(), hcaldqm::Container1D::getMean(), HcalBarrel, HcalEndcap, HcalForward, hcaldqm::ContainerXXX< STDTYPE >::initialize(), hcaldqm::Container2D::initialize(), hcaldqm::ContainerSingle2D::initialize(), hcaldqm::filter::HashFilter::initialize(), hcaldqm::Container1D::initialize(), hcaldqm::electronicsmap::ElectronicsMap::initialize(), hcaldqm::Container1D::load(), hcaldqm::electronicsmap::ElectronicsMap::lookup(), HcalElectronicsMap::lookup(), nRecoFlag, hcaldqm::flag::Flag::reset(), hcaldqm::ContainerSingle2D::setBinContent(), hcaldqm::constants::SLOT_uTCA_MIN, HcalDetId::subdet(), globals_cff::x1, and globals_cff::x2.

Referenced by ~RecoRunSummary().

38  {
39 
40  if (_ptype!=fOffline)
41  return std::vector<flag::Flag>();
42 
43  // FILTERS, some useful vectors, hash maps
44  std::vector<uint32_t> vhashCrateHF;
45  vhashCrateHF.push_back(HcalElectronicsId(22, SLOT_uTCA_MIN,
46  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
47  vhashCrateHF.push_back(HcalElectronicsId(29, SLOT_uTCA_MIN,
48  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
49  vhashCrateHF.push_back(HcalElectronicsId(32, SLOT_uTCA_MIN,
50  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
51  filter::HashFilter filter_CrateHF;
52  filter_CrateHF.initialize(filter::fPreserver, hashfunctions::fCrate,
53  vhashCrateHF); // preserve only HF crates
54  electronicsmap::ElectronicsMap ehashmap;
55  ehashmap.initialize(_emap, electronicsmap::fD2EHashMap);
56  bool tcdsshift = false;
57  std::vector<flag::Flag> vflags; vflags.resize(nRecoFlag);
58  vflags[fUniSlotHF]=flag::Flag("UniSlotHF");
59  vflags[fTCDS]=flag::Flag("TCDS");
60 
61 
62  // INITIALIZE
63  Container2D cOccupancy_depth, cOccupancyCut_depth;
64  ContainerSingle2D cSummary;
65  Container1D cTimingCut_HBHEPartition;
66  ContainerXXX<double> xUniHF, xUni;
67  xUni.initialize(hashfunctions::fCrate);
68  xUniHF.initialize(hashfunctions::fCrateSlot);
69  cOccupancy_depth.initialize(_taskname, "Occupancy",
71  new quantity::DetectorQuantity(quantity::fieta),
72  new quantity::DetectorQuantity(quantity::fiphi),
73  new quantity::ValueQuantity(quantity::fN),0);
74  cOccupancyCut_depth.initialize(_taskname, "OccupancyCut",
76  new quantity::DetectorQuantity(quantity::fieta),
77  new quantity::DetectorQuantity(quantity::fiphi),
78  new quantity::ValueQuantity(quantity::fN),0);
79  cTimingCut_HBHEPartition.initialize(_taskname, "TimingCut",
81  new quantity::ValueQuantity(quantity::fTiming_ns),
82  new quantity::ValueQuantity(quantity::fN),0);
83 
84  cSummary.initialize(_name, "Summary",
85  new quantity::CrateQuantity(_emap),
86  new quantity::FlagQuantity(vflags),
87  new quantity::ValueQuantity(quantity::fState),0);
88 
89  // BOOK
90  xUniHF.book(_emap, filter_CrateHF);
91 
92 
93  // LOAD
94  cOccupancy_depth.load(ig, _emap, _subsystem);
95  cOccupancyCut_depth.load(ig, _emap, _subsystem);
96  cTimingCut_HBHEPartition.book(ib, _emap, _subsystem);
97  cSummary.book(ib, _subsystem);
98 
99  // iterate over all channels
100  std::vector<HcalGenericDetId> gids = _emap->allPrecisionId();
101  for (std::vector<HcalGenericDetId>::const_iterator it=gids.begin();
102  it!=gids.end(); ++it)
103  {
104  if (!it->isHcalDetId())
105  continue;
106 
107  HcalDetId did(it->rawId());
108  HcalElectronicsId eid = HcalElectronicsId(ehashmap.lookup(did));
109 
110  if (did.subdet()==HcalForward)
111  xUniHF.get(eid)+=cOccupancyCut_depth.getBinContent(did);
112  }
113 
114 
115  // iphi/slot HF non uniformity
116  for (doubleCompactMap::const_iterator it=xUniHF.begin();
117  it!=xUniHF.end(); ++it)
118  {
119  uint32_t hash1 = it->first;
120  HcalElectronicsId eid1(hash1);
121  double x1 = it->second;
122  for (doubleCompactMap::const_iterator jt=xUniHF.begin();
123  jt!=xUniHF.end(); ++jt)
124  {
125  if (jt==it)
126  continue;
127 
128  double x2 = jt->second;
129  if (x2==0)
130  continue;
131  if (x1/x2<_thresh_unihf)
132  xUni.get(eid1)++;
133  }
134  }
135 
136 
137  // TCDS shift
138  double a = cTimingCut_HBHEPartition.getMean(
139  HcalDetId(HcalBarrel,1,5,1));
140  double b = cTimingCut_HBHEPartition.getMean(
141  HcalDetId(HcalBarrel,1,30,1));
142  double c = cTimingCut_HBHEPartition.getMean(
143  HcalDetId(HcalBarrel,1,55,1));
144  double dab = fabs(a-b);
145  double dac = fabs(a-c);
146  double dbc = fabs(b-c);
147  if (dab>=_thresh_tcds || dac>=_thresh_tcds || dbc>=_thresh_tcds)
148  tcdsshift = true;
149 
150  // summary flags
151  std::vector<flag::Flag> sumflags;
152  int icrate=0;
153  for (std::vector<uint32_t>::const_iterator it=_vhashCrates.begin();
154  it!=_vhashCrates.end(); ++it)
155  {
156  flag::Flag fSum("RECO");
157  HcalElectronicsId eid(*it);
158  HcalDetId did = HcalDetId(_emap->lookup(eid));
159 
160  // registered @cDAQ
161  if (did.subdet() == HcalBarrel || did.subdet() == HcalEndcap)
162  {
163  if (tcdsshift)
164  vflags[fTCDS]._state = flag::fBAD;
165  else
166  vflags[fTCDS]._state = flag::fGOOD;
167  }
168  if (did.subdet() == HcalForward)
169  {
170  if (xUni.get(eid)>0)
171  vflags[fUniSlotHF]._state = flag::fBAD;
172  else
173  vflags[fUniSlotHF]._state = flag::fGOOD;
174  }
175 
176  // combine
177  int iflag=0;
178  for (std::vector<flag::Flag>::iterator ft=vflags.begin();
179  ft!=vflags.end(); ++ft)
180  {
181  cSummary.setBinContent(eid, iflag, ft->_state);
182  fSum+=(*ft);
183  iflag++;
184  ft->reset();
185  }
186  sumflags.push_back(fSum);
187  icrate++;
188  }
189 
190  return sumflags;
191  }
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:142
std::string _taskname
Definition: DQClient.h:47
HcalElectronicsMap const * _emap
Definition: DQClient.h:54
std::vector< uint32_t > _vhashCrates
Definition: DQClient.h:58
int const FIBERCH_MIN
Definition: Constants.h:151
ProcessingType _ptype
Definition: DQModule.h:59
int const FIBER_uTCA_MIN1
Definition: Constants.h:144
std::vector< HcalGenericDetId > allPrecisionId() const
std::string _name
Definition: DQModule.h:57
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
std::string _subsystem
Definition: DQModule.h:64
Readout chain identification for Hcal.
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
int const SLOT_uTCA_MIN
Definition: Constants.h:123
void hcaldqm::RecoRunSummary::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 RecoRunSummary.cc.

References hcaldqm::DQClient::endLuminosityBlock().

Referenced by ~RecoRunSummary().

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

double hcaldqm::RecoRunSummary::_thresh_tcds
protected

Definition at line 24 of file RecoRunSummary.h.

Referenced by endJob(), and RecoRunSummary().

double hcaldqm::RecoRunSummary::_thresh_unihf
protected

Definition at line 24 of file RecoRunSummary.h.

Referenced by endJob(), and RecoRunSummary().