CMS 3D CMS Logo

HcalOnlineHarvesting.cc
Go to the documentation of this file.
2 
3 using namespace hcaldqm;
4 using namespace hcaldqm::constants;
5 
7  : DQHarvester(ps), _nBad(0), _nTotal(0), _reportSummaryMap(nullptr) {
8  // NOTE: I will leave Run Summary Generators in place
9  // just not triggering on endJob!
10  _vsumgen.resize(nSummary);
11  _vnames.resize(nSummary);
12  _vmarks.resize(nSummary);
13  for (uint32_t i = 0; i < _vmarks.size(); i++)
14  _vmarks[i] = false;
15  _vnames[fRaw] = "RawTask";
16  _vnames[fDigi] = "DigiTask";
17  _vnames[fReco] = "RecHitTask";
18  _vnames[fTP] = "TPTask";
19  _vnames[fPedestal] = "PedestalTask";
20 
21  _vsumgen[fRaw] = new hcaldqm::RawRunSummary("RawRunHarvesting", _vnames[fRaw], ps);
22  _vsumgen[fDigi] = new hcaldqm::DigiRunSummary("DigiRunHarvesting", _vnames[fDigi], ps);
23  _vsumgen[fReco] = new hcaldqm::RecoRunSummary("RecoRunHarvesting", _vnames[fReco], ps);
24  _vsumgen[fTP] = new hcaldqm::TPRunSummary("TPRunHarvesting", _vnames[fTP], ps);
25  _vsumgen[fPedestal] = new hcaldqm::PedestalRunSummary("PedestalRunHarvesting", _vnames[fPedestal], ps);
26 
27  _thresh_bad_bad = ps.getUntrackedParameter("thresh_bad_bad", 0.05);
28 }
29 
30 /* virtual */ void HcalOnlineHarvesting::beginRun(edm::Run const& r, edm::EventSetup const& es) {
31  DQHarvester::beginRun(r, es);
32  for (std::vector<DQClient*>::const_iterator it = _vsumgen.begin(); it != _vsumgen.end(); ++it)
33  (*it)->beginRun(r, es);
34 }
35 
38  edm::LuminosityBlock const&,
39  edm::EventSetup const&) {
40  // DETERMINE WHICH MODULES ARE PRESENT IN DATA
41  if (ig.get(_subsystem + "/" + _vnames[fRaw] + "/EventsTotal") != nullptr)
42  _vmarks[fRaw] = true;
43  if (ig.get(_subsystem + "/" + _vnames[fDigi] + "/EventsTotal") != nullptr)
44  _vmarks[fDigi] = true;
45  if (ig.get(_subsystem + "/" + _vnames[fTP] + "/EventsTotal") != nullptr)
46  _vmarks[fTP] = true;
47  if (ig.get(_subsystem + "/" + _vnames[fReco] + "/EventsTotal") != nullptr)
48  _vmarks[fReco] = true;
49  if (ig.get(_subsystem + "/" + _vnames[fPedestal] + "/EventsTotal") != nullptr)
50  _vmarks[fPedestal] = true;
51 
52  // CREATE SUMMARY REPORT MAP FED vs LS and LOAD MODULE'S SUMMARIES
53  // NOTE: THIS STATEMENTS WILL BE EXECUTED ONLY ONCE!
54  if (!_reportSummaryMap) {
55  ig.setCurrentFolder(_subsystem + "/EventInfo");
57  ib.book2D("reportSummaryMap", "reportSummaryMap", _maxLS, 1, _maxLS + 1, _vFEDs.size(), 0, _vFEDs.size());
58  for (uint32_t i = 0; i < _vFEDs.size(); i++) {
59  char name[5];
60  sprintf(name, "%d", _vFEDs[i]);
62  }
63  // set LS bit to mark Xaxis as LS axis
65 
66  // INITIALIZE ALL THE MODULES
67  for (uint32_t i = 0; i < _vnames.size(); i++)
69  "SummaryvsLS",
73 
74  // LOAD ONLY THOSE MODULES THAT ARE PRESENT IN DATA
75  for (uint32_t i = 0; i < _vmarks.size(); i++) {
76  if (_vmarks[i])
77  _vcSummaryvsLS[i].load(ig, _subsystem);
78  }
79 
80  // Create a map of bad channels and fill
82  "KnownBadChannels",
87  0);
89  for (uintCompactMap::const_iterator it = _xQuality.begin(); it != _xQuality.end(); ++it)
91 
92  ig.setCurrentFolder(_subsystem + "/EventInfo");
93  _runSummary = ib.book2D("runSummary", "runSummary", 1, 0, 1, 1, 0, 1);
94  }
95 
96  int ifed = 0;
98  if (_ptype != fOffline) { // hidefed2crate
99  for (std::vector<uint32_t>::const_iterator it = _vhashFEDs.begin(); it != _vhashFEDs.end(); ++it) {
100  HcalElectronicsId eid(*it);
102  for (uint32_t im = 0; im < _vmarks.size(); im++)
103  if (_vmarks[im]) {
104  int x = _vcSummaryvsLS[im].getBinContent(eid, _currentLS);
106  fSum += flag;
107  }
108  _reportSummaryMap->setBinContent(_currentLS, ifed + 1, int(fSum._state));
109  ifed++;
110  fTotal += fSum;
111  }
112  }
113 
114  // update the Run Summary
115  // ^^^TEMPORARY AT THIS POINT!
116  if (fTotal._state == hcaldqm::flag::fBAD)
117  _nBad++;
118  _nTotal++;
119  if (double(_nBad) / double(_nTotal) >= _thresh_bad_bad)
121  else if (fTotal._state == hcaldqm::flag::fNCDAQ)
123  else
125 
126  // HF TDC TP efficiency
127  if (_vmarks[fTP]) {
128  MonitorElement* meOccupancy_HF_depth = ig.get("Hcal/TPTask/OccupancyDataHF_depth/OccupancyDataHF_depth");
129  MonitorElement* meOccupancyNoTDC_HF_depth =
130  ig.get("Hcal/TPTask/OccupancyEmulHFNoTDC_depth/OccupancyEmulHFNoTDC_depth");
131  MonitorElement* meOccupancy_HF_ieta = ig.get("Hcal/TPTask/OccupancyDataHF_ieta/OccupancyDataHF_ieta");
132  MonitorElement* meOccupancyNoTDC_HF_ieta =
133  ig.get("Hcal/TPTask/OccupancyEmulHFNoTDC_ieta/OccupancyEmulHFNoTDC_ieta");
134 
135  if (meOccupancy_HF_depth && meOccupancyNoTDC_HF_depth && meOccupancy_HF_ieta && meOccupancyNoTDC_HF_ieta) {
136  TH2F* hOccupancy_HF_depth = meOccupancy_HF_depth->getTH2F();
137  TH2F* hOccupancyNoTDC_HF_depth = meOccupancyNoTDC_HF_depth->getTH2F();
138  TH1F* hOccupancy_HF_ieta = meOccupancy_HF_ieta->getTH1F();
139  TH1F* hOccupancyNoTDC_HF_ieta = meOccupancyNoTDC_HF_ieta->getTH1F();
140 
141  TH2F* hEfficiency_HF_depth = (TH2F*)hOccupancy_HF_depth->Clone();
142  hEfficiency_HF_depth->Divide(hOccupancyNoTDC_HF_depth);
143  TH1F* hEfficiency_HF_ieta = (TH1F*)hOccupancy_HF_ieta->Clone();
144  hEfficiency_HF_ieta->Divide(hOccupancyNoTDC_HF_ieta);
145 
146  ib.setCurrentFolder("Hcal/TPTask");
147 
148  MonitorElement* meEfficiency_HF_depth = ib.book2D("TDCCutEfficiency_depth", hEfficiency_HF_depth);
149  meEfficiency_HF_depth->setEfficiencyFlag();
150  MonitorElement* meEfficiency_HF_ieta = ib.book1D("TDCCutEfficiency_ieta", hEfficiency_HF_ieta);
151  meEfficiency_HF_ieta->setEfficiencyFlag();
152 
153  delete hEfficiency_HF_depth;
154  delete hEfficiency_HF_ieta;
155  }
156  }
157 }
158 
159 /*
160  * NO END JOB PROCESSING FOR ONLINE!
161  */
163 
hcaldqm::flag::Flag
Definition: Flag.h:24
hcaldqm::quantity::FEDQuantity
Definition: ElectronicsQuantity.h:356
HcalOnlineHarvesting.h
hcaldqm::flag::Flag::_state
State _state
Definition: Flag.h:62
mps_fire.i
i
Definition: mps_fire.py:428
hcaldqm::constants
Definition: Constants.h:9
hcaldqm::Container2D::initialize
virtual void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: Container2D.cc:25
HcalOnlineHarvesting::_dqmEndLuminosityBlock
void _dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: HcalOnlineHarvesting.cc:36
HcalOnlineHarvesting.name
name
Definition: HcalOnlineHarvesting.py:8
hcaldqm::flag::State
State
Definition: Flag.h:13
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
HcalOnlineHarvesting::fDigi
Definition: HcalOnlineHarvesting.h:60
edm::Run
Definition: Run.h:45
hcaldqm::quantity::ValueQuantity
Definition: ValueQuantity.h:309
hcaldqm::DQHarvester::_emap
const HcalElectronicsMap * _emap
Definition: DQHarvester.h:35
hcaldqm::DQHarvester::_vFEDs
std::vector< int > _vFEDs
Definition: DQHarvester.h:45
hcaldqm::flag::fGOOD
Definition: Flag.h:17
hcaldqm
Definition: Constants.h:8
dqm::impl::MonitorElement::setEfficiencyFlag
void setEfficiencyFlag()
Definition: MonitorElement.h:267
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
HcalOnlineHarvesting::_cKnownBadChannels_depth
hcaldqm::Container2D _cKnownBadChannels_depth
Definition: HcalOnlineHarvesting.h:77
hcaldqm::ContainerSingle2D
Definition: ContainerSingle2D.h:20
hcaldqm::constants::BIT_OFFSET
const int BIT_OFFSET
Definition: Constants.h:279
hcaldqm::DQModule::_ptype
ProcessingType _ptype
Definition: DQModule.h:43
hcaldqm::flag::fBAD
Definition: Flag.h:19
HcalOnlineHarvesting::nSummary
Definition: HcalOnlineHarvesting.h:60
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:478
hcaldqm::hashfunctions::fdepth
Definition: HashFunctions.h:131
hcaldqm::DQHarvester::_vhashFEDs
std::vector< uint32_t > _vhashFEDs
Definition: DQHarvester.h:46
hcaldqm::RawRunSummary
Definition: RawRunSummary.h:8
HcalOnlineHarvesting::fReco
Definition: HcalOnlineHarvesting.h:60
HcalOnlineHarvesting::_nBad
int _nBad
Definition: HcalOnlineHarvesting.h:71
HcalOnlineHarvesting::_reportSummaryMap
MonitorElement * _reportSummaryMap
Definition: HcalOnlineHarvesting.h:80
hcaldqm::ContainerXXX::begin
virtual CompactMap::const_iterator begin()
Definition: ContainerXXX.h:69
hcaldqm::quantity::fieta
Definition: DetectorQuantity.h:15
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
hcaldqm::quantity::fiphi
Definition: DetectorQuantity.h:14
hcaldqm::DQModule::_currentLS
int _currentLS
Definition: DQModule.h:52
hcaldqm::ContainerXXX::end
virtual CompactMap::const_iterator end()
Definition: ContainerXXX.h:70
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
HcalOnlineHarvesting::_vcSummaryvsLS
std::vector< hcaldqm::ContainerSingle2D > _vcSummaryvsLS
Definition: HcalOnlineHarvesting.h:75
hcaldqm::quantity::DetectorQuantity
Definition: DetectorQuantity.h:59
dqm::legacy::MonitorElement::getTH1
virtual TH1 * getTH1() const
Definition: MonitorElement.h:474
hcaldqm::DigiRunSummary
Definition: DigiRunSummary.h:9
hcaldqm::quantity::fN
Definition: ValueQuantity.h:11
HcalOnlineHarvesting::fPedestal
Definition: HcalOnlineHarvesting.h:60
hcaldqm::PedestalRunSummary
Definition: PedestalRunSummary.h:8
edm::ParameterSet
Definition: ParameterSet.h:47
hcaldqm::Container2D::book
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: Container2D.cc:558
hcaldqm::Container2D::fill
void fill(HcalDetId const &) override
Definition: Container2D.cc:52
HcalOnlineHarvesting::_nTotal
int _nTotal
Definition: HcalOnlineHarvesting.h:72
HcalDetId
Definition: HcalDetId.h:12
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
hcaldqm::constants::BIT_AXIS_LS
const int BIT_AXIS_LS
Definition: Constants.h:283
dqm::impl::MonitorElement::setBinLabel
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:771
HcalOnlineHarvesting::_vmarks
std::vector< bool > _vmarks
Definition: HcalOnlineHarvesting.h:63
HcalOnlineHarvesting::_dqmEndJob
void _dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: HcalOnlineHarvesting.cc:162
HcalOnlineHarvesting::fTP
Definition: HcalOnlineHarvesting.h:60
cuy.ib
ib
Definition: cuy.py:662
HcalOnlineHarvesting::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: HcalOnlineHarvesting.cc:30
edm::EventSetup
Definition: EventSetup.h:57
hcaldqm::DQModule::_subsystem
std::string _subsystem
Definition: DQModule.h:48
alignCSCRings.r
r
Definition: alignCSCRings.py:93
hcaldqm::DQModule::_maxLS
int _maxLS
Definition: DQModule.h:53
hcaldqm::DQHarvester::_xQuality
ContainerXXX< uint32_t > _xQuality
Definition: DQHarvester.h:48
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
dqm::implementation::IGetter
Definition: DQMStore.h:484
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
dqm::implementation::IBooker
Definition: DQMStore.h:43
hcaldqm::DQHarvester
Definition: DQHarvester.h:17
hcaldqm::TPRunSummary
Definition: TPRunSummary.h:8
HcalOnlineHarvesting::_thresh_bad_bad
double _thresh_bad_bad
Definition: HcalOnlineHarvesting.h:68
HcalOnlineHarvesting::_runSummary
MonitorElement * _runSummary
Definition: HcalOnlineHarvesting.h:81
hcaldqm::flag::fNCDAQ
Definition: Flag.h:15
hcaldqm::quantity::fState
Definition: ValueQuantity.h:47
HcalOnlineHarvesting::HcalOnlineHarvesting
HcalOnlineHarvesting(edm::ParameterSet const &)
Definition: HcalOnlineHarvesting.cc:6
HcalOnlineHarvesting::_vsumgen
std::vector< hcaldqm::DQClient * > _vsumgen
Definition: HcalOnlineHarvesting.h:64
hcaldqm::RecoRunSummary
Definition: RecoRunSummary.h:8
HcalOnlineHarvesting
Definition: HcalOnlineHarvesting.py:1
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
HcalOnlineHarvesting::_vnames
std::vector< std::string > _vnames
Definition: HcalOnlineHarvesting.h:65
HcalOnlineHarvesting::fRaw
Definition: HcalOnlineHarvesting.h:60
hcaldqm::fOffline
Definition: DQModule.h:26
dqm::legacy::MonitorElement::getTH2F
virtual TH2F * getTH2F() const
Definition: MonitorElement.h:490
hcaldqm::quantity::LumiSection
Definition: ValueQuantity.h:390