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

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

6  :
7  DQClient(name, taskname, ps)
8  {
9  _thresh_unihf = ps.getUntrackedParameter<double>("thresh_unihf",
10  0.2);
11  _thresh_tcds = ps.getUntrackedParameter<double>("thresh_tcds",
12  1.5);
13  }
DQClient(std::string const &, std::string const &, edm::ParameterSet const &)
Definition: DQClient.cc:5
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 15 of file RecoRunSummary.cc.

References hcaldqm::DQClient::beginRun().

Referenced by ~RecoRunSummary().

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

Reimplemented from hcaldqm::DQClient.

Definition at line 34 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_cfi::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::Container2D::initialize(), hcaldqm::ContainerXXX< STDTYPE >::initialize(), hcaldqm::ContainerSingle2D::initialize(), hcaldqm::filter::HashFilter::initialize(), hcaldqm::electronicsmap::ElectronicsMap::initialize(), hcaldqm::Container1D::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().

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

References hcaldqm::DQClient::endLuminosityBlock().

Referenced by ~RecoRunSummary().

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

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