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
virtual void beginLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &lb, edm::EventSetup const &)
 
 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 () 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
const HcalElectronicsMap_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
 

Additional Inherited Members

- Public Types inherited from hcaldqm::DQClient
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 

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.

23 { fTCDS = 0, fUniSlotHF = 1, nRecoFlag = 2 };

Constructor & Destructor Documentation

◆ RecoRunSummary()

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

Definition at line 6 of file RecoRunSummary.cc.

7  : DQClient(name, taskname, ps) {
8  _thresh_unihf = ps.getUntrackedParameter<double>("thresh_unihf", 0.2);
9  _thresh_tcds = ps.getUntrackedParameter<double>("thresh_tcds", 1.5);
10  }

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

◆ ~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 12 of file RecoRunSummary.cc.

12  {
13  DQClient::beginRun(r, es);
14  }

References hcaldqm::DQClient::beginRun(), and alignCSCRings::r.

◆ endJob()

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

Reimplemented from hcaldqm::DQClient.

Definition at line 29 of file RecoRunSummary.cc.

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

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_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, 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, HcalDetId::subdet(), testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

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

22  {
23  DQClient::endLuminosityBlock(ib, ig, lb, es);
24  }

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

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

testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
hcaldqm::flag::fGOOD
Definition: Flag.h:17
hcaldqm::filter::fPreserver
Definition: HashFilter.h:19
hcaldqm::constants::SLOT_uTCA_MIN
const int SLOT_uTCA_MIN
Definition: Constants.h:105
hcaldqm::constants::FIBER_uTCA_MIN1
const int FIBER_uTCA_MIN1
Definition: Constants.h:126
hcaldqm::RecoRunSummary::_thresh_unihf
double _thresh_unihf
Definition: RecoRunSummary.h:21
hcaldqm::RecoRunSummary::nRecoFlag
Definition: RecoRunSummary.h:23
hcaldqm::DQClient::endLuminosityBlock
virtual void endLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: DQClient.cc:98
HcalBarrel
Definition: HcalAssistant.h:33
hcaldqm::DQModule::_ptype
ProcessingType _ptype
Definition: DQModule.h:43
hcaldqm::flag::fBAD
Definition: Flag.h:19
hcaldqm::hashfunctions::fdepth
Definition: HashFunctions.h:131
hcaldqm::hashfunctions::fCrateSlot
Definition: HashFunctions.h:141
HcalElectronicsMap::allPrecisionId
std::vector< HcalGenericDetId > allPrecisionId() const
Definition: HcalElectronicsMap.cc:139
hcaldqm::RecoRunSummary::_thresh_tcds
double _thresh_tcds
Definition: RecoRunSummary.h:21
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
hcaldqm::quantity::fieta
Definition: DetectorQuantity.h:15
hcaldqm::DQClient::_taskname
std::string _taskname
Definition: DQClient.h:49
hcaldqm::quantity::fiphi
Definition: DetectorQuantity.h:14
hcaldqm::hashfunctions::fCrate
Definition: HashFunctions.h:139
hcaldqm::DQClient::beginRun
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
Definition: DQClient.cc:13
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
hcaldqm::DQModule::_name
std::string _name
Definition: DQModule.h:41
hcaldqm::constants::FIBERCH_MIN
const int FIBERCH_MIN
Definition: Constants.h:132
b
double b
Definition: hdecay.h:118
hcaldqm::DQClient::DQClient
DQClient(std::string const &, std::string const &, edm::ParameterSet const &)
Definition: DQClient.cc:5
hcaldqm::quantity::fN
Definition: ValueQuantity.h:11
a
double a
Definition: hdecay.h:119
hcaldqm::quantity::fTiming_ns
Definition: ValueQuantity.h:14
hcaldqm::RecoRunSummary::fUniSlotHF
Definition: RecoRunSummary.h:23
HcalDetId::subdet
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
HcalDetId
Definition: HcalDetId.h:12
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
cuy.ib
ib
Definition: cuy.py:662
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
hcaldqm::DQModule::_subsystem
std::string _subsystem
Definition: DQModule.h:48
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HcalForward
Definition: HcalAssistant.h:36
hcaldqm::DQClient::_vhashCrates
std::vector< uint32_t > _vhashCrates
Definition: DQClient.h:60
HcalElectronicsMap::lookup
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
Definition: HcalElectronicsMap.cc:70
hcaldqm::electronicsmap::fD2EHashMap
Definition: ElectronicsMap.h:25
HcalEndcap
Definition: HcalAssistant.h:34
hcaldqm::DQClient::_emap
const HcalElectronicsMap * _emap
Definition: DQClient.h:56
hcaldqm::hashfunctions::fHBHEPartition
Definition: HashFunctions.h:133
nanoDQM_cff.Flag
Flag
Definition: nanoDQM_cff.py:65
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
hcaldqm::quantity::fState
Definition: ValueQuantity.h:47
HLT_2018_cff.ElectronicsMap
ElectronicsMap
Definition: HLT_2018_cff.py:7005
hcaldqm::fOffline
Definition: DQModule.h:26
hcaldqm::RecoRunSummary::fTCDS
Definition: RecoRunSummary.h:23