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 &, edm::ConsumesCollector &iC)
 
 ~RecoRunSummary () override
 
- Public Member Functions inherited from hcaldqm::DQClient
virtual void beginLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &lb, edm::EventSetup const &)
 
 DQClient (std::string const &, std::string const &, edm::ParameterSet const &, edm::ConsumesCollector &iC)
 
 ~DQClient () override
 
- Public Member Functions inherited from hcaldqm::DQModule
 DQModule (edm::ParameterSet const &)
 
virtual ~DQModule () noexcept(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
 
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcdhcalChannelQualityToken_
 
edm::ESGetToken< HcalDbService, HcalDbRecordhcalDbServiceToken_
 
edm::ESGetToken< RunInfo, RunInfoRcdrunInfoToken_
 
- 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
 

Additional Inherited Members

- Public Types inherited from hcaldqm::DQClient
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Static Public Member Functions inherited from hcaldqm::DQModule
static void fillPSetDescription (edm::ParameterSetDescription &desc)
 

Detailed Description

Definition at line 8 of file RecoRunSummary.h.

Member Enumeration Documentation

◆ RecoFlag

Enumerator
fTCDS 
fUniSlotHF 
nRecoFlag 

Definition at line 23 of file RecoRunSummary.h.

Constructor & Destructor Documentation

◆ RecoRunSummary()

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

Definition at line 6 of file RecoRunSummary.cc.

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

10  : DQClient(name, taskname, ps, iC) {
11  _thresh_unihf = ps.getUntrackedParameter<double>("thresh_unihf", 0.2);
12  _thresh_tcds = ps.getUntrackedParameter<double>("thresh_tcds", 1.5);
13  }
DQClient(std::string const &, std::string const &, edm::ParameterSet const &, edm::ConsumesCollector &iC)
Definition: DQClient.cc:5

◆ ~RecoRunSummary()

hcaldqm::RecoRunSummary::~RecoRunSummary ( )
inlineoverride

Definition at line 11 of file RecoRunSummary.h.

11 {}

Member Function Documentation

◆ beginRun()

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

15  {
16  DQClient::beginRun(r, es);
17  }
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
Definition: DQClient.cc:24

◆ endJob()

std::vector< flag::Flag > hcaldqm::RecoRunSummary::endJob ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
overridevirtual

Reimplemented from hcaldqm::DQClient.

Definition at line 32 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(), HltBtagPostValidation_cff::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, cuy::ib, hcaldqm::ContainerXXX< STDTYPE >::initialize(), hcaldqm::filter::HashFilter::initialize(), hcaldqm::Container2D::initialize(), hcaldqm::ContainerSingle2D::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, and HcalDetId::subdet().

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

◆ endLuminosityBlock()

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

References hcaldqm::DQClient::endLuminosityBlock(), and cuy::ib.

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

Member Data Documentation

◆ _thresh_tcds

double hcaldqm::RecoRunSummary::_thresh_tcds
protected

Definition at line 21 of file RecoRunSummary.h.

Referenced by endJob(), and RecoRunSummary().

◆ _thresh_unihf

double hcaldqm::RecoRunSummary::_thresh_unihf
protected

Definition at line 21 of file RecoRunSummary.h.

Referenced by endJob(), and RecoRunSummary().