CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions
TotemRPDQMHarvester Class Reference
Inheritance diagram for TotemRPDQMHarvester:

Public Member Functions

 TotemRPDQMHarvester (const edm::ParameterSet &ps)
 
 ~TotemRPDQMHarvester () override
 

Protected Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, const edm::LuminosityBlock &, const edm::EventSetup &) override
 

Private Member Functions

void MakeHitNumberRatios (unsigned int id, DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void MakePlaneEfficiencyHistograms (unsigned int id, DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, bool &rpPlotInitialized)
 

Detailed Description

Definition at line 19 of file TotemRPDQMHarvester.cc.

Constructor & Destructor Documentation

◆ TotemRPDQMHarvester()

TotemRPDQMHarvester::TotemRPDQMHarvester ( const edm::ParameterSet ps)

Definition at line 49 of file TotemRPDQMHarvester.cc.

◆ ~TotemRPDQMHarvester()

TotemRPDQMHarvester::~TotemRPDQMHarvester ( )
override

Definition at line 53 of file TotemRPDQMHarvester.cc.

Member Function Documentation

◆ dqmEndJob()

void TotemRPDQMHarvester::dqmEndJob ( DQMStore::IBooker &  ,
DQMStore::IGetter &   
)
inlineoverrideprotected

Definition at line 30 of file TotemRPDQMHarvester.cc.

◆ dqmEndLuminosityBlock()

void TotemRPDQMHarvester::dqmEndLuminosityBlock ( DQMStore::IBooker &  ibooker,
DQMStore::IGetter &  igetter,
const edm::LuminosityBlock ,
const edm::EventSetup  
)
overrideprotected

Definition at line 180 of file TotemRPDQMHarvester.cc.

184  {
185  // loop over arms
186  for (unsigned int arm = 0; arm < 2; arm++) {
187  // loop over stations
188  for (unsigned int st = 0; st < 3; st += 2) {
189  // loop over RPs
190  for (unsigned int rp = 0; rp < 6; ++rp) {
191  if (st == 2) {
192  // unit 220-nr is not equipped
193  if (rp <= 2)
194  continue;
195 
196  // RP 220-fr-hr contains pixels
197  if (rp == 3)
198  continue;
199  }
200 
201  TotemRPDetId rpId(arm, st, rp);
202 
203  MakeHitNumberRatios(rpId, ibooker, igetter);
204 
205  bool rpPlotInitialized = false;
206 
207  // loop over planes
208  for (unsigned int pl = 0; pl < 10; ++pl) {
209  TotemRPDetId plId(arm, st, rp, pl);
210 
211  MakePlaneEfficiencyHistograms(plId, ibooker, igetter, rpPlotInitialized);
212  }
213  }
214  }
215  }

References year_2016_postTS2_cff::rpId.

◆ MakeHitNumberRatios()

void TotemRPDQMHarvester::MakeHitNumberRatios ( unsigned int  id,
DQMStore::IBooker &  ibooker,
DQMStore::IGetter &  igetter 
)
private

Definition at line 57 of file TotemRPDQMHarvester.cc.

58  {
59  // get source histogram
60  string path;
62 
63  MonitorElement *activity = igetter.get(path + "/activity in planes (2D)");
64 
65  if (!activity)
66  return;
67 
68  // book new histogram, if not yet done
69  const string hit_ratio_name = "hit ratio in hot spot";
70  MonitorElement *hit_ratio = igetter.get(path + "/" + hit_ratio_name);
71 
72  if (hit_ratio == nullptr) {
73  ibooker.setCurrentFolder(path);
74  string title;
76  hit_ratio = ibooker.book1D(hit_ratio_name, title + ";plane;N_hits(320<strip<440) / N_hits(all)", 10, -0.5, 9.5);
77  } else {
78  hit_ratio->getTH1F()->Reset();
79  }
80 
81  // calculate ratios
82  TAxis *y_axis = activity->getTH2F()->GetYaxis();
83  for (int bix = 1; bix <= activity->getNbinsX(); ++bix) {
84  double S_full = 0., S_sel = 0.;
85  for (int biy = 1; biy <= activity->getNbinsY(); ++biy) {
86  double c = activity->getBinContent(bix, biy);
87  double s = y_axis->GetBinCenter(biy);
88 
89  S_full += c;
90 
91  if (s > 320. && s < 440.)
92  S_sel += c;
93  }
94 
95  double r = (S_full > 0.) ? S_sel / S_full : 0.;
96 
97  hit_ratio->setBinContent(bix, r);
98  }

References HltBtagPostValidation_cff::c, dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getNbinsX(), dqm::impl::MonitorElement::getNbinsY(), dqm::legacy::MonitorElement::getTH1F(), dqm::legacy::MonitorElement::getTH2F(), CTPPSDetId::nFull, CTPPSDetId::nPath, castor_dqm_sourceclient_file_cfg::path, alignCSCRings::r, CTPPSDetId::rpName(), alignCSCRings::s, dqm::impl::MonitorElement::setBinContent(), and overlapproblemtsosanalyzer_cfi::title.

◆ MakePlaneEfficiencyHistograms()

void TotemRPDQMHarvester::MakePlaneEfficiencyHistograms ( unsigned int  id,
DQMStore::IBooker &  ibooker,
DQMStore::IGetter &  igetter,
bool &  rpPlotInitialized 
)
private

Definition at line 102 of file TotemRPDQMHarvester.cc.

106  {
107  TotemRPDetId detId(id);
108 
109  // get source histograms
110  string path;
111  detId.planeName(path, TotemRPDetId::nPath);
112 
113  MonitorElement *efficiency_num = igetter.get(path + "/efficiency num");
114  MonitorElement *efficiency_den = igetter.get(path + "/efficiency den");
115 
116  if (!efficiency_num || !efficiency_den)
117  return;
118 
119  // book new plane histogram, if not yet done
120  const string efficiency_name = "efficiency";
121  MonitorElement *efficiency = igetter.get(path + "/" + efficiency_name);
122 
123  if (efficiency == nullptr) {
124  string title;
125  detId.planeName(title, TotemRPDetId::nFull);
126  TAxis *axis = efficiency_den->getTH1()->GetXaxis();
127  ibooker.setCurrentFolder(path);
128  efficiency = ibooker.book1D(
129  efficiency_name, title + ";track position (mm)", axis->GetNbins(), axis->GetXmin(), axis->GetXmax());
130  } else {
131  efficiency->getTH1F()->Reset();
132  }
133 
134  // book new RP histogram, if not yet done
135  CTPPSDetId rpId = detId.rpId();
136  rpId.rpName(path, TotemRPDetId::nPath);
137  const string rp_efficiency_name = "plane efficiency";
138  MonitorElement *rp_efficiency = igetter.get(path + "/" + rp_efficiency_name);
139 
140  if (rp_efficiency == nullptr) {
141  string title;
142  rpId.rpName(title, TotemRPDetId::nFull);
143  TAxis *axis = efficiency_den->getTH1()->GetXaxis();
144  ibooker.setCurrentFolder(path);
145  rp_efficiency = ibooker.book2D(rp_efficiency_name,
146  title + ";plane;track position (mm)",
147  10,
148  -0.5,
149  9.5,
150  axis->GetNbins(),
151  axis->GetXmin(),
152  axis->GetXmax());
153  rpPlotInitialized = true;
154  } else {
155  if (!rpPlotInitialized)
156  rp_efficiency->getTH2F()->Reset();
157  rpPlotInitialized = true;
158  }
159 
160  // calculate and fill efficiencies
161  for (signed int bi = 1; bi <= efficiency->getNbinsX(); bi++) {
162  double num = efficiency_num->getBinContent(bi);
163  double den = efficiency_den->getBinContent(bi);
164 
165  if (den > 0) {
166  double p = num / den;
167  double p_unc = sqrt(p * (1. - p) / den);
168  efficiency->setBinContent(bi, p);
169  efficiency->setBinError(bi, p_unc);
170 
171  int pl_bi = detId.plane() + 1;
172  rp_efficiency->setBinContent(pl_bi, bi, p);
173  } else {
174  efficiency->setBinContent(bi, 0.);
175  }
176  }

References L1TObjectsTimingClient_cff::efficiency, dqm::impl::MonitorElement::getBinContent(), dqm::legacy::MonitorElement::getTH1(), dqm::legacy::MonitorElement::getTH2F(), CTPPSDetId::nFull, CTPPSDetId::nPath, EgammaValidation_cff::num, AlCaHLTBitMon_ParallelJobs::p, castor_dqm_sourceclient_file_cfg::path, TotemRPDetId::plane(), TotemRPDetId::planeName(), year_2016_postTS2_cff::rpId, CTPPSDetId::rpId(), dqm::impl::MonitorElement::setBinContent(), mathSSE::sqrt(), and overlapproblemtsosanalyzer_cfi::title.

AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
L1TObjectsTimingClient_cff.efficiency
efficiency
Definition: L1TObjectsTimingClient_cff.py:10
year_2016_postTS2_cff.rpId
rpId
Definition: year_2016_postTS2_cff.py:23
CTPPSDetId::nPath
Definition: CTPPSDetId.h:87
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:478
TotemRPDQMHarvester::MakePlaneEfficiencyHistograms
void MakePlaneEfficiencyHistograms(unsigned int id, DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, bool &rpPlotInitialized)
Definition: TotemRPDQMHarvester.cc:102
alignCSCRings.s
s
Definition: alignCSCRings.py:92
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
dqm::legacy::MonitorElement::getTH1
virtual TH1 * getTH1() const
Definition: MonitorElement.h:474
dqm::impl::MonitorElement::getNbinsY
virtual int getNbinsY() const
get # of bins in Y-axis
Definition: MonitorElement.cc:580
CTPPSDetId::nFull
Definition: CTPPSDetId.h:87
CTPPSDetId
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:31
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
alignCSCRings.r
r
Definition: alignCSCRings.py:93
overlapproblemtsosanalyzer_cfi.title
title
Definition: overlapproblemtsosanalyzer_cfi.py:7
TotemRPDQMHarvester::MakeHitNumberRatios
void MakeHitNumberRatios(unsigned int id, DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TotemRPDQMHarvester.cc:57
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
dqm::impl::MonitorElement::getNbinsX
virtual int getNbinsX() const
get # of bins in X-axis
Definition: MonitorElement.cc:574
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:592
TotemRPDetId
Detector ID class for TOTEM Si strip detectors.
Definition: TotemRPDetId.h:29
dqm::legacy::MonitorElement::getTH2F
virtual TH2F * getTH2F() const
Definition: MonitorElement.h:490
CTPPSDetId::rpName
void rpName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:132