CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
Phase1PixelMaps Class Reference

#include <Phase1PixelMaps.h>

Public Member Functions

void beautifyAllHistograms ()
 
void bookBarrelBins (const std::string &currentHistoName)
 
void bookBarrelHistograms (const std::string &currentHistoName, const char *what, const char *zaxis)
 
void bookForwardBins (const std::string &currentHistoName)
 
void bookForwardHistograms (const std::string &currentHistoName, const char *what, const char *zaxis)
 
void drawBarrelMaps (const std::string &currentHistoName, TCanvas &canvas, const char *drawOption=nullptr)
 
void drawForwardMaps (const std::string &currentHistoName, TCanvas &canvas, const char *drawOption=nullptr)
 
void drawSummaryMaps (const std::string &currentHistoName, TCanvas &canvas)
 
void fillBarrelBin (const std::string &currentHistoName, unsigned int id, double value)
 
void fillForwardBin (const std::string &currentHistoName, unsigned int id, double value)
 
 Phase1PixelMaps (const char *option)
 
void resetOption (const char *option)
 
void setBarrelScale (const std::string &currentHistoName, std::pair< float, float > extrema)
 
void setForwardScale (const std::string &currentHistoName, std::pair< float, float > extrema)
 
void setNoRescale ()
 
 ~Phase1PixelMaps ()=default
 

Private Member Functions

void adjustCanvasMargins (TVirtualPad *pad, float top, float bottom, float left, float right)
 
void makeNicePlotStyle (TH1 *hist)
 
void rescaleAllBarrel (const std::string &currentHistoName)
 
void rescaleAllForward (const std::string &currentHistoName)
 
const indexedCorners retrieveCorners (const std::vector< edm::FileInPath > &cornerFiles, const unsigned int reads)
 

Private Attributes

std::map< uint32_t, std::shared_ptr< TGraph > > bins
 
std::map< uint32_t, std::shared_ptr< TGraph > > binsSummary
 
bool m_autorescale
 
std::vector< edm::FileInPathm_cornersBPIX
 
std::vector< edm::FileInPathm_cornersFPIX
 
Option_t * m_option
 
TrackerTopology m_trackerTopo
 
std::map< std::string, std::vector< std::shared_ptr< TH2Poly > > > pxbTh2PolyBarrel
 
std::map< std::string, std::shared_ptr< TH2Poly > > pxbTh2PolyBarrelSummary
 
std::map< std::string, std::vector< std::shared_ptr< TH2Poly > > > pxfTh2PolyForward
 
std::map< std::string, std::shared_ptr< TH2Poly > > pxfTh2PolyForwardSummary
 

Detailed Description

Definition at line 31 of file Phase1PixelMaps.h.

Constructor & Destructor Documentation

◆ Phase1PixelMaps()

Phase1PixelMaps::Phase1PixelMaps ( const char *  option)
inline

Definition at line 33 of file Phase1PixelMaps.h.

34  : m_option{option},
36  edm::FileInPath("Geometry/TrackerCommonData/data/PhaseI/trackerParameters.xml").fullPath())} {
37  // set the rescale to true by default
38  m_autorescale = true;
39 
40  // store the file in path for the corners (BPIX)
41  for (unsigned int i = 1; i <= 4; i++) {
42  m_cornersBPIX.push_back(edm::FileInPath(Form("DQM/SiStripMonitorClient/data/Geometry/vertices_barrel_%i", i)));
43  }
44 
45  // store the file in path for the corners (BPIX)
46  for (int j : {-3, -2, -1, 1, 2, 3}) {
47  m_cornersFPIX.push_back(edm::FileInPath(Form("DQM/SiStripMonitorClient/data/Geometry/vertices_forward_%i", j)));
48  }
49  }

References fileinputsource_cfi::option.

◆ ~Phase1PixelMaps()

Phase1PixelMaps::~Phase1PixelMaps ( )
default

Member Function Documentation

◆ adjustCanvasMargins()

void Phase1PixelMaps::adjustCanvasMargins ( TVirtualPad *  pad,
float  top,
float  bottom,
float  left,
float  right 
)
private

Definition at line 413 of file Phase1PixelMaps.cc.

413  {
414  if (top > 0)
415  pad->SetTopMargin(top);
416  if (bottom > 0)
417  pad->SetBottomMargin(bottom);
418  if (left > 0)
419  pad->SetLeftMargin(left);
420  if (right > 0)
421  pad->SetRightMargin(right);
422 }

Referenced by drawBarrelMaps(), drawForwardMaps(), and drawSummaryMaps().

◆ beautifyAllHistograms()

void Phase1PixelMaps::beautifyAllHistograms ( )

Definition at line 222 of file Phase1PixelMaps.cc.

222  {
223  for (const auto& vec : pxbTh2PolyBarrel) {
224  for (const auto& plot : vec.second) {
225  this->makeNicePlotStyle(plot.get());
226  plot->GetXaxis()->SetTitleOffset(0.9);
227  plot->GetYaxis()->SetTitleOffset(0.9);
228  plot->GetZaxis()->SetTitleOffset(1.2);
229  plot->GetZaxis()->SetTitleSize(0.05);
230  }
231  }
232 
233  for (const auto& vec : pxfTh2PolyForward) {
234  for (const auto& plot : vec.second) {
235  this->makeNicePlotStyle(plot.get());
236  plot->GetXaxis()->SetTitleOffset(0.9);
237  plot->GetYaxis()->SetTitleOffset(0.9);
238  plot->GetZaxis()->SetTitleOffset(1.2);
239  plot->GetZaxis()->SetTitleSize(0.05);
240  }
241  }
242 }

References makeNicePlotStyle(), plotFactory::plot, pxbTh2PolyBarrel, and pxfTh2PolyForward.

Referenced by templateHelper::SiPixelIDs< PayloadType, myType >::fill().

◆ bookBarrelBins()

void Phase1PixelMaps::bookBarrelBins ( const std::string &  currentHistoName)

Definition at line 102 of file Phase1PixelMaps.cc.

102  {
103  auto theIndexedCorners = this->retrieveCorners(m_cornersBPIX, 4);
104 
105  for (const auto& entry : theIndexedCorners) {
106  auto id = entry.first;
107  auto detid = DetId(id);
108  if (detid.subdetId() != PixelSubdetector::PixelBarrel)
109  continue;
110 
111  int layer = m_trackerTopo.pxbLayer(detid);
112  int ladder = m_trackerTopo.pxbLadder(detid);
113 
114  auto theVectX = entry.second.first;
115  auto theVectY = entry.second.second;
116 
117  float vertX[] = {theVectX[0], theVectX[1], theVectX[2], theVectX[3], theVectX[4]};
118  float vertY[] = {(ladder - 1.0f), (ladder - 1.0f), (float)ladder, (float)ladder, (ladder - 1.0f)};
119 
120  bins[id] = std::make_shared<TGraph>(5, vertX, vertY);
121  bins[id]->SetName(TString::Format("%u", id));
122 
123  // Summary plot
124  for (unsigned k = 0; k < 5; ++k) {
125  vertX[k] += ((layer == 2 || layer == 3) ? 0.0f : -60.0f);
126  vertY[k] += ((layer > 2) ? 30.0f : 0.0f);
127  }
128 
129  binsSummary[id] = std::make_shared<TGraph>(5, vertX, vertY);
130  binsSummary[id]->SetName(TString::Format("%u", id));
131 
132  if (pxbTh2PolyBarrel.find(currentHistoName) != pxbTh2PolyBarrel.end()) {
133  pxbTh2PolyBarrel[currentHistoName][layer - 1]->AddBin(bins[id]->Clone());
134  } else {
135  throw cms::Exception("LogicError") << currentHistoName << " is not found in the Barrel map! Aborting.";
136  }
137 
138  if (pxbTh2PolyBarrelSummary.find(currentHistoName) != pxbTh2PolyBarrelSummary.end()) {
139  pxbTh2PolyBarrelSummary[currentHistoName]->AddBin(binsSummary[id]->Clone());
140  } else {
141  throw cms::Exception("LocalError") << currentHistoName << " is not found in the Barrel Summary map! Aborting.";
142  }
143  }
144 }

References bins, binsSummary, mps_splice::entry, Exception, f, dqmMemoryStats::float, triggerObjects_cff::id, dqmdumpme::k, PVValHelper::ladder, phase1PixelTopology::layer, m_cornersBPIX, m_trackerTopo, PixelSubdetector::PixelBarrel, TrackerTopology::pxbLadder(), TrackerTopology::pxbLayer(), pxbTh2PolyBarrel, pxbTh2PolyBarrelSummary, and retrieveCorners().

Referenced by templateHelper::SiPixelIDs< PayloadType, myType >::fill().

◆ bookBarrelHistograms()

void Phase1PixelMaps::bookBarrelHistograms ( const std::string &  currentHistoName,
const char *  what,
const char *  zaxis 
)

Definition at line 30 of file Phase1PixelMaps.cc.

30  {
31  std::string histName;
32  std::shared_ptr<TH2Poly> th2p;
33 
34  for (unsigned i = 0; i < 4; ++i) {
35  histName = "barrel_layer_";
36 
37  th2p = std::make_shared<TH2Poly>(
38  (histName + std::to_string(i + 1)).c_str(), Form("PXBMap of %s - Layer %i", what, i + 1), -15.0, 15.0, 0.0, 5.0);
39 
40  th2p->SetFloat();
41 
42  th2p->GetXaxis()->SetTitle("z [cm]");
43  th2p->GetYaxis()->SetTitle("ladder");
44  th2p->GetZaxis()->SetTitle(zaxis);
45  th2p->GetZaxis()->CenterTitle();
46  th2p->SetStats(false);
47  th2p->SetOption(m_option);
48  pxbTh2PolyBarrel[currentHistoName].push_back(th2p);
49  }
50 
51  th2p = std::make_shared<TH2Poly>("barrel_summary", Form("Barrel Pixel Map of %s", what), -5.0, 5.0, 0.0, 15.0);
52  th2p->SetFloat();
53 
54  th2p->GetXaxis()->SetTitle("");
55  th2p->GetYaxis()->SetTitle("");
56  th2p->GetZaxis()->SetTitle(zaxis);
57  th2p->GetZaxis()->CenterTitle();
58  th2p->SetStats(false);
59  th2p->SetOption(m_option);
60  pxbTh2PolyBarrelSummary[currentHistoName] = th2p;
61 }

References mps_fire::i, m_option, pxbTh2PolyBarrel, pxbTh2PolyBarrelSummary, AlCaHLTBitMon_QueryRunRegistry::string, and LaserClient_cfi::zaxis.

Referenced by templateHelper::SiPixelIDs< PayloadType, myType >::fill().

◆ bookForwardBins()

void Phase1PixelMaps::bookForwardBins ( const std::string &  currentHistoName)

Definition at line 147 of file Phase1PixelMaps.cc.

147  {
148  auto theIndexedCorners = this->retrieveCorners(m_cornersFPIX, 3);
149 
150  for (const auto& entry : theIndexedCorners) {
151  auto id = entry.first;
152  auto detid = DetId(id);
153  if (detid.subdetId() != PixelSubdetector::PixelEndcap)
154  continue;
155 
156  int disk = m_trackerTopo.pxfDisk(detid);
157  int side = m_trackerTopo.pxfSide(detid);
158 
159  unsigned mapIdx = disk + (side - 1) * 3 - 1;
160 
161  auto theVectX = entry.second.first;
162  auto theVectY = entry.second.second;
163 
164  float vertX[] = {theVectX[0], theVectX[1], theVectX[2], theVectX[3]};
165  float vertY[] = {theVectY[0], theVectY[1], theVectY[2], theVectY[3]};
166 
167  bins[id] = std::make_shared<TGraph>(4, vertX, vertY);
168  bins[id]->SetName(TString::Format("%u", id));
169 
170  // Summary plot
171  for (unsigned k = 0; k < 4; ++k) {
172  vertX[k] += (float(side) - 1.5f) * 40.0f;
173  vertY[k] += (disk - 1) * 35.0f;
174  }
175 
176  binsSummary[id] = std::make_shared<TGraph>(4, vertX, vertY);
177  binsSummary[id]->SetName(TString::Format("%u", id));
178 
179  if (pxfTh2PolyForward.find(currentHistoName) != pxfTh2PolyForward.end()) {
180  pxfTh2PolyForward[currentHistoName][mapIdx]->AddBin(bins[id]->Clone());
181  } else {
182  throw cms::Exception("LogicError") << currentHistoName << " is not found in the Forward map! Aborting.";
183  }
184 
185  if (pxfTh2PolyForwardSummary.find(currentHistoName) != pxfTh2PolyForwardSummary.end()) {
186  pxfTh2PolyForwardSummary[currentHistoName]->AddBin(binsSummary[id]->Clone());
187  } else {
188  throw cms::Exception("LogicError") << currentHistoName << " is not found in the Forward Summary map! Aborting.";
189  }
190  }
191 }

References bins, binsSummary, mps_splice::entry, Exception, f, dqmMemoryStats::float, triggerObjects_cff::id, dqmdumpme::k, m_cornersFPIX, m_trackerTopo, PixelSubdetector::PixelEndcap, TrackerTopology::pxfDisk(), TrackerTopology::pxfSide(), pxfTh2PolyForward, pxfTh2PolyForwardSummary, and retrieveCorners().

Referenced by templateHelper::SiPixelIDs< PayloadType, myType >::fill().

◆ bookForwardHistograms()

void Phase1PixelMaps::bookForwardHistograms ( const std::string &  currentHistoName,
const char *  what,
const char *  zaxis 
)

Definition at line 64 of file Phase1PixelMaps.cc.

64  {
65  std::string histName;
66  std::shared_ptr<TH2Poly> th2p;
67 
68  for (unsigned side = 1; side <= 2; ++side) {
69  for (unsigned disk = 1; disk <= 3; ++disk) {
70  histName = "forward_disk_";
71 
72  th2p = std::make_shared<TH2Poly>((histName + std::to_string((side == 1 ? -(int(disk)) : (int)disk))).c_str(),
73  Form("PXFMap of %s - Side %i Disk %i", what, side, disk),
74  -15.0,
75  15.0,
76  -15.0,
77  15.0);
78  th2p->SetFloat();
79  th2p->GetXaxis()->SetTitle("x [cm]");
80  th2p->GetYaxis()->SetTitle("y [cm]");
81  th2p->GetZaxis()->SetTitle(zaxis);
82  th2p->GetZaxis()->CenterTitle();
83  th2p->SetStats(false);
84  th2p->SetOption(m_option);
85  pxfTh2PolyForward[currentHistoName].push_back(th2p);
86  }
87  }
88 
89  th2p = std::make_shared<TH2Poly>("forward_summary", Form("Forward Pixel Map of %s", what), -40.0, 40.0, -20.0, 90.0);
90  th2p->SetFloat();
91 
92  th2p->GetXaxis()->SetTitle("");
93  th2p->GetYaxis()->SetTitle("");
94  th2p->GetZaxis()->SetTitle(zaxis);
95  th2p->GetZaxis()->CenterTitle();
96  th2p->SetStats(false);
97  th2p->SetOption(m_option);
98  pxfTh2PolyForwardSummary[currentHistoName] = th2p;
99 }

References m_option, pxfTh2PolyForward, pxfTh2PolyForwardSummary, AlCaHLTBitMon_QueryRunRegistry::string, and LaserClient_cfi::zaxis.

Referenced by templateHelper::SiPixelIDs< PayloadType, myType >::fill().

◆ drawBarrelMaps()

void Phase1PixelMaps::drawBarrelMaps ( const std::string &  currentHistoName,
TCanvas &  canvas,
const char *  drawOption = nullptr 
)

Definition at line 259 of file Phase1PixelMaps.cc.

259  {
260  canvas.Divide(2, 2);
261  for (int i = 1; i <= 4; i++) {
262  canvas.cd(i);
263  if (strcmp(m_option, "text") == 0) {
264  canvas.cd(i)->SetRightMargin(0.02);
265  pxbTh2PolyBarrel[currentHistoName].at(i - 1)->SetMarkerColor(kRed);
266  } else {
267  if (m_autorescale)
268  rescaleAllBarrel(currentHistoName);
269  adjustCanvasMargins(canvas.cd(i), 0.07, 0.12, 0.10, 0.18);
270  }
271  if (drawOption) {
272  pxbTh2PolyBarrel[currentHistoName].at(i - 1)->Draw("L");
273  pxbTh2PolyBarrel[currentHistoName].at(i - 1)->Draw(fmt::sprintf("%s%ssame", m_option, drawOption).c_str());
274  } else {
275  pxbTh2PolyBarrel[currentHistoName].at(i - 1)->Draw("L");
276  pxbTh2PolyBarrel[currentHistoName].at(i - 1)->Draw(fmt::sprintf("%ssame", m_option).c_str());
277  }
278  }
279 }

References adjustCanvasMargins(), svgfig::canvas(), histoStyle::drawOption, mps_fire::i, m_autorescale, m_option, pxbTh2PolyBarrel, and rescaleAllBarrel().

Referenced by templateHelper::SiPixelIDs< PayloadType, myType >::fill().

◆ drawForwardMaps()

void Phase1PixelMaps::drawForwardMaps ( const std::string &  currentHistoName,
TCanvas &  canvas,
const char *  drawOption = nullptr 
)

Definition at line 282 of file Phase1PixelMaps.cc.

282  {
283  canvas.Divide(3, 2);
284  for (int i = 1; i <= 6; i++) {
285  canvas.cd(i);
286  if (strcmp(m_option, "text") == 0) {
287  canvas.cd(i)->SetRightMargin(0.02);
288  pxfTh2PolyForward[currentHistoName].at(i - 1)->SetMarkerColor(kRed);
289  } else {
290  if (m_autorescale)
291  rescaleAllForward(currentHistoName);
292  adjustCanvasMargins(canvas.cd(i), 0.07, 0.12, 0.10, 0.18);
293  }
294  if (drawOption) {
295  pxfTh2PolyForward[currentHistoName].at(i - 1)->Draw("L");
296  pxfTh2PolyForward[currentHistoName].at(i - 1)->Draw(fmt::sprintf("%s%ssame", m_option, drawOption).c_str());
297  } else {
298  pxfTh2PolyForward[currentHistoName].at(i - 1)->Draw("L");
299  pxfTh2PolyForward[currentHistoName].at(i - 1)->Draw(fmt::sprintf("%ssame", m_option).c_str());
300  }
301  }
302 }

References adjustCanvasMargins(), svgfig::canvas(), histoStyle::drawOption, mps_fire::i, m_autorescale, m_option, pxfTh2PolyForward, and rescaleAllForward().

Referenced by templateHelper::SiPixelIDs< PayloadType, myType >::fill().

◆ drawSummaryMaps()

void Phase1PixelMaps::drawSummaryMaps ( const std::string &  currentHistoName,
TCanvas &  canvas 
)

Definition at line 305 of file Phase1PixelMaps.cc.

305  {
306  canvas.Divide(2, 1);
307  canvas.cd(1);
308  adjustCanvasMargins(canvas.cd(1), 0.07, 0.02, 0.01, 0.05);
309  std::string temp(m_option); // create a std string
310  if (temp.find("text") != 0) {
311  pxbTh2PolyBarrelSummary[currentHistoName]->SetMarkerColor(kRed);
312  pxbTh2PolyBarrelSummary[currentHistoName]->SetMarkerSize(0.5);
313  }
314  pxbTh2PolyBarrelSummary[currentHistoName]->GetZaxis()->SetTitleOffset(1.4);
315  pxbTh2PolyBarrelSummary[currentHistoName]->Draw();
316 
317  canvas.cd(2);
318  adjustCanvasMargins(canvas.cd(2), 0.07, 0.02, 0.01, 0.05);
319  if (temp.find("text") != 0) {
320  pxfTh2PolyForwardSummary[currentHistoName]->SetMarkerColor(kRed);
321  pxfTh2PolyForwardSummary[currentHistoName]->SetMarkerSize(0.5);
322  }
323  pxfTh2PolyForwardSummary[currentHistoName]->GetZaxis()->SetTitleOffset(1.4);
324  pxfTh2PolyForwardSummary[currentHistoName]->Draw();
325 }

References adjustCanvasMargins(), svgfig::canvas(), m_option, pxbTh2PolyBarrelSummary, pxfTh2PolyForwardSummary, AlCaHLTBitMon_QueryRunRegistry::string, and groupFilesInBlocks::temp.

◆ fillBarrelBin()

void Phase1PixelMaps::fillBarrelBin ( const std::string &  currentHistoName,
unsigned int  id,
double  value 
)

Definition at line 194 of file Phase1PixelMaps.cc.

194  {
195  auto detid = DetId(id);
196  if (detid.subdetId() != PixelSubdetector::PixelBarrel) {
197  edm::LogError("Phase1PixelMaps") << "fillBarrelBin() The following detid " << id << " is not Pixel Barrel!"
198  << std::endl;
199  return;
200  }
201  int layer = m_trackerTopo.pxbLayer(id);
202  pxbTh2PolyBarrel[currentHistoName][layer - 1]->Fill(TString::Format("%u", id), value);
203  pxbTh2PolyBarrelSummary[currentHistoName]->Fill(TString::Format("%u", id), value);
204 }

References phase1PixelTopology::layer, m_trackerTopo, PixelSubdetector::PixelBarrel, TrackerTopology::pxbLayer(), pxbTh2PolyBarrel, and pxbTh2PolyBarrelSummary.

Referenced by templateHelper::SiPixelIDs< PayloadType, myType >::fill().

◆ fillForwardBin()

void Phase1PixelMaps::fillForwardBin ( const std::string &  currentHistoName,
unsigned int  id,
double  value 
)

Definition at line 207 of file Phase1PixelMaps.cc.

207  {
208  auto detid = DetId(id);
209  if (detid.subdetId() != PixelSubdetector::PixelEndcap) {
210  edm::LogError("Phase1PixelMaps") << "fillForwardBin() The following detid " << id << " is not Pixel Forward!"
211  << std::endl;
212  return;
213  }
214  int disk = m_trackerTopo.pxfDisk(id);
215  int side = m_trackerTopo.pxfSide(id);
216  unsigned mapIdx = disk + (side - 1) * 3 - 1;
217  pxfTh2PolyForward[currentHistoName][mapIdx]->Fill(TString::Format("%u", id), value);
218  pxfTh2PolyForwardSummary[currentHistoName]->Fill(TString::Format("%u", id), value);
219 }

References m_trackerTopo, PixelSubdetector::PixelEndcap, TrackerTopology::pxfDisk(), TrackerTopology::pxfSide(), pxfTh2PolyForward, and pxfTh2PolyForwardSummary.

Referenced by templateHelper::SiPixelIDs< PayloadType, myType >::fill().

◆ makeNicePlotStyle()

void Phase1PixelMaps::makeNicePlotStyle ( TH1 *  hist)
private

Definition at line 388 of file Phase1PixelMaps.cc.

388  {
389  hist->SetStats(kFALSE);
390  hist->SetLineWidth(2);
391  hist->GetXaxis()->CenterTitle(true);
392  hist->GetYaxis()->CenterTitle(true);
393  hist->GetXaxis()->SetTitleFont(42);
394  hist->GetYaxis()->SetTitleFont(42);
395  hist->GetXaxis()->SetTitleSize(0.05);
396  hist->GetYaxis()->SetTitleSize(0.05);
397  hist->GetXaxis()->SetTitleOffset(1.1);
398  hist->GetYaxis()->SetTitleOffset(1.3);
399  hist->GetXaxis()->SetLabelFont(42);
400  hist->GetYaxis()->SetLabelFont(42);
401  hist->GetYaxis()->SetLabelSize(.05);
402  hist->GetXaxis()->SetLabelSize(.05);
403 
404  if (hist->InheritsFrom(TH2::Class())) {
405  hist->GetZaxis()->SetLabelFont(42);
406  hist->GetZaxis()->SetLabelFont(42);
407  hist->GetZaxis()->SetLabelSize(.05);
408  hist->GetZaxis()->SetLabelSize(.05);
409  }
410 }

References HLT_FULL_cff::Class, and gpuVertexFinder::hist.

Referenced by beautifyAllHistograms().

◆ rescaleAllBarrel()

void Phase1PixelMaps::rescaleAllBarrel ( const std::string &  currentHistoName)
private

Definition at line 425 of file Phase1PixelMaps.cc.

425  {
426  std::vector<float> maxima;
427  std::transform(pxbTh2PolyBarrel[currentHistoName].begin(),
428  pxbTh2PolyBarrel[currentHistoName].end(),
429  std::back_inserter(maxima),
430  [](std::shared_ptr<TH2Poly> thp) -> float { return thp->GetMaximum(); });
431  std::vector<float> minima;
432  std::transform(pxbTh2PolyBarrel[currentHistoName].begin(),
433  pxbTh2PolyBarrel[currentHistoName].end(),
434  std::back_inserter(minima),
435  [](std::shared_ptr<TH2Poly> thp) -> float { return thp->GetMinimum(); });
436 
437  auto globalMax = *std::max_element(maxima.begin(), maxima.end());
438  auto globalMin = *std::min_element(minima.begin(), minima.end());
439 
440  for (auto& histo : pxbTh2PolyBarrel[currentHistoName]) {
441  histo->GetZaxis()->SetRangeUser(globalMin, globalMax);
442  }
443 }

References mps_fire::end, timingPdfMaker::histo, pxbTh2PolyBarrel, and HcalDetIdTransform::transform().

Referenced by drawBarrelMaps().

◆ rescaleAllForward()

void Phase1PixelMaps::rescaleAllForward ( const std::string &  currentHistoName)
private

Definition at line 446 of file Phase1PixelMaps.cc.

446  {
447  std::vector<float> maxima;
448  std::transform(pxfTh2PolyForward[currentHistoName].begin(),
449  pxfTh2PolyForward[currentHistoName].end(),
450  std::back_inserter(maxima),
451  [](std::shared_ptr<TH2Poly> thp) -> float { return thp->GetMaximum(); });
452  std::vector<float> minima;
453  std::transform(pxfTh2PolyForward[currentHistoName].begin(),
454  pxfTh2PolyForward[currentHistoName].end(),
455  std::back_inserter(minima),
456  [](std::shared_ptr<TH2Poly> thp) -> float { return thp->GetMinimum(); });
457 
458  auto globalMax = *std::max_element(maxima.begin(), maxima.end());
459  auto globalMin = *std::min_element(minima.begin(), minima.end());
460 
461  for (auto& histo : pxfTh2PolyForward[currentHistoName]) {
462  histo->GetZaxis()->SetRangeUser(globalMin, globalMax);
463  }
464 }

References mps_fire::end, timingPdfMaker::histo, pxfTh2PolyForward, and HcalDetIdTransform::transform().

Referenced by drawForwardMaps().

◆ resetOption()

void Phase1PixelMaps::resetOption ( const char *  option)

Definition at line 20 of file Phase1PixelMaps.cc.

20  {
21  if (m_option != nullptr && !m_option[0]) {
22  m_option = option;
23  } else {
24  edm::LogError("Phase1PixelMaps") << "Option has already been set to " << m_option
25  << ". It's not possible to reset it.";
26  }
27 }

References m_option, and fileinputsource_cfi::option.

◆ retrieveCorners()

const indexedCorners Phase1PixelMaps::retrieveCorners ( const std::vector< edm::FileInPath > &  cornerFiles,
const unsigned int  reads 
)
private

Definition at line 328 of file Phase1PixelMaps.cc.

329  {
330  indexedCorners theOutMap;
331 
332  for (const auto& file : cornerFiles) {
333  auto cornerFileName = file.fullPath();
334  std::ifstream cornerFile(cornerFileName.c_str());
335  if (!cornerFile.good()) {
336  throw cms::Exception("FileError") << "Problem opening corner file: " << cornerFileName;
337  }
339  while (std::getline(cornerFile, line)) {
340  if (!line.empty()) {
341  std::istringstream iss(line);
342  unsigned int id;
344  std::vector<std::string> corners(reads, "");
345  std::vector<float> xP, yP;
346 
347  iss >> id >> name;
348  for (unsigned int i = 0; i < reads; ++i) {
349  iss >> corners.at(i);
350  }
351 
352  LOGDEBUG("Phase1PixelMaps") << id << " : ";
353  for (unsigned int i = 0; i < reads; i++) {
354  // remove the leading and trailing " signs in the corners list
355  (corners[i]).erase(std::remove(corners[i].begin(), corners[i].end(), '"'), corners[i].end());
356  LOGDEBUG("Phase1PixelMaps") << corners.at(i) << " ";
357  typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
358  boost::char_separator<char> sep{","};
359  tokenizer tok{corners.at(i), sep};
360  for (const auto& t : tok | boost::adaptors::indexed(0)) {
361  if (t.index() == 0) {
362  xP.push_back(atof((t.value()).c_str()));
363  } else if (t.index() == 1) {
364  yP.push_back(atof((t.value()).c_str()));
365  } else {
366  edm::LogError("LogicError") << "There should not be any token with index " << t.index() << std::endl;
367  }
368  }
369  }
370  LOGDEBUG("Phase1PixelMaps") << std::endl;
371 
372  xP.push_back(xP.front());
373  yP.push_back(yP.front());
374 
375  for (unsigned int i = 0; i < xP.size(); i++) {
376  LOGDEBUG("Phase1PixelMaps") << "x[" << i << "]=" << xP[i] << " y[" << i << "]" << yP[i] << std::endl;
377  }
378 
379  theOutMap[id] = std::make_pair(xP, yP);
380 
381  } // if line is empty
382  } // loop on lines
383  } // loop on files
384  return theOutMap;
385 }

References mps_fire::end, Exception, FrontierConditions_GlobalTag_cff::file, mps_fire::i, triggerObjects_cff::id, mps_splice::line, LOGDEBUG, Skims_PA_cff::name, MatrixUtil::remove(), AlCaHLTBitMon_QueryRunRegistry::string, and submitPVValidationJobs::t.

Referenced by bookBarrelBins(), and bookForwardBins().

◆ setBarrelScale()

void Phase1PixelMaps::setBarrelScale ( const std::string &  currentHistoName,
std::pair< float, float >  extrema 
)

Definition at line 245 of file Phase1PixelMaps.cc.

245  {
246  for (auto& histo : pxbTh2PolyBarrel[currentHistoName]) {
247  histo->GetZaxis()->SetRangeUser(extrema.first, extrema.second);
248  }
249 }

References timingPdfMaker::histo, and pxbTh2PolyBarrel.

◆ setForwardScale()

void Phase1PixelMaps::setForwardScale ( const std::string &  currentHistoName,
std::pair< float, float >  extrema 
)

Definition at line 252 of file Phase1PixelMaps.cc.

252  {
253  for (auto& histo : pxfTh2PolyForward[currentHistoName]) {
254  histo->GetZaxis()->SetRangeUser(extrema.first, extrema.second);
255  }
256 }

References timingPdfMaker::histo, and pxfTh2PolyForward.

◆ setNoRescale()

void Phase1PixelMaps::setNoRescale ( )
inline

Definition at line 54 of file Phase1PixelMaps.h.

54 { m_autorescale = false; }

References m_autorescale.

Member Data Documentation

◆ bins

std::map<uint32_t, std::shared_ptr<TGraph> > Phase1PixelMaps::bins
private

Definition at line 84 of file Phase1PixelMaps.h.

Referenced by bookBarrelBins(), and bookForwardBins().

◆ binsSummary

std::map<uint32_t, std::shared_ptr<TGraph> > Phase1PixelMaps::binsSummary
private

Definition at line 84 of file Phase1PixelMaps.h.

Referenced by bookBarrelBins(), and bookForwardBins().

◆ m_autorescale

bool Phase1PixelMaps::m_autorescale
private

Definition at line 81 of file Phase1PixelMaps.h.

Referenced by drawBarrelMaps(), drawForwardMaps(), and setNoRescale().

◆ m_cornersBPIX

std::vector<edm::FileInPath> Phase1PixelMaps::m_cornersBPIX
private

Definition at line 90 of file Phase1PixelMaps.h.

Referenced by bookBarrelBins().

◆ m_cornersFPIX

std::vector<edm::FileInPath> Phase1PixelMaps::m_cornersFPIX
private

Definition at line 91 of file Phase1PixelMaps.h.

Referenced by bookForwardBins().

◆ m_option

Option_t* Phase1PixelMaps::m_option
private

◆ m_trackerTopo

TrackerTopology Phase1PixelMaps::m_trackerTopo
private

Definition at line 82 of file Phase1PixelMaps.h.

Referenced by bookBarrelBins(), bookForwardBins(), fillBarrelBin(), and fillForwardBin().

◆ pxbTh2PolyBarrel

std::map<std::string, std::vector<std::shared_ptr<TH2Poly> > > Phase1PixelMaps::pxbTh2PolyBarrel
private

◆ pxbTh2PolyBarrelSummary

std::map<std::string, std::shared_ptr<TH2Poly> > Phase1PixelMaps::pxbTh2PolyBarrelSummary
private

◆ pxfTh2PolyForward

std::map<std::string, std::vector<std::shared_ptr<TH2Poly> > > Phase1PixelMaps::pxfTh2PolyForward
private

◆ pxfTh2PolyForwardSummary

std::map<std::string, std::shared_ptr<TH2Poly> > Phase1PixelMaps::pxfTh2PolyForwardSummary
private
indexedCorners
std::map< unsigned int, std::pair< std::vector< float >, std::vector< float > >> indexedCorners
Definition: Phase1PixelMaps.h:26
svgfig.canvas
def canvas(*sub, **attr)
Definition: svgfig.py:482
Phase1PixelMaps::bins
std::map< uint32_t, std::shared_ptr< TGraph > > bins
Definition: Phase1PixelMaps.h:84
Phase1PixelMaps::m_cornersFPIX
std::vector< edm::FileInPath > m_cornersFPIX
Definition: Phase1PixelMaps.h:91
mps_fire.i
i
Definition: mps_fire.py:428
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
HLT_FULL_cff.Class
Class
Definition: HLT_FULL_cff.py:8427
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
TrackerTopology::pxfSide
unsigned int pxfSide(const DetId &id) const
Definition: TrackerTopology.h:192
Phase1PixelMaps::makeNicePlotStyle
void makeNicePlotStyle(TH1 *hist)
Definition: Phase1PixelMaps.cc:388
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
mps_splice.entry
entry
Definition: mps_splice.py:68
TrackerTopology::pxbLadder
unsigned int pxbLadder(const DetId &id) const
Definition: TrackerTopology.h:155
Phase1PixelMaps::pxfTh2PolyForward
std::map< std::string, std::vector< std::shared_ptr< TH2Poly > > > pxfTh2PolyForward
Definition: Phase1PixelMaps.h:87
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
LOGDEBUG
#define LOGDEBUG(x)
Definition: Phase1PixelMaps.h:21
Phase1PixelMaps::rescaleAllBarrel
void rescaleAllBarrel(const std::string &currentHistoName)
Definition: Phase1PixelMaps.cc:425
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
plotFactory.plot
plot
Definition: plotFactory.py:109
fileinputsource_cfi.option
option
Definition: fileinputsource_cfi.py:87
LaserClient_cfi.zaxis
zaxis
Definition: LaserClient_cfi.py:91
TrackerTopology::pxbLayer
unsigned int pxbLayer(const DetId &id) const
Definition: TrackerTopology.h:144
Phase1PixelMaps::pxbTh2PolyBarrel
std::map< std::string, std::vector< std::shared_ptr< TH2Poly > > > pxbTh2PolyBarrel
Definition: Phase1PixelMaps.h:85
DetId
Definition: DetId.h:17
edm::FileInPath
Definition: FileInPath.h:64
mps_fire.end
end
Definition: mps_fire.py:242
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
dqmdumpme.k
k
Definition: dqmdumpme.py:60
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Phase1PixelMaps::pxbTh2PolyBarrelSummary
std::map< std::string, std::shared_ptr< TH2Poly > > pxbTh2PolyBarrelSummary
Definition: Phase1PixelMaps.h:86
gpuVertexFinder::hist
__shared__ Hist hist
Definition: gpuClusterTracksDBSCAN.h:48
Phase1PixelMaps::binsSummary
std::map< uint32_t, std::shared_ptr< TGraph > > binsSummary
Definition: Phase1PixelMaps.h:84
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
value
Definition: value.py:1
TrackerTopology::pxfDisk
unsigned int pxfDisk(const DetId &id) const
Definition: TrackerTopology.h:446
Phase1PixelMaps::pxfTh2PolyForwardSummary
std::map< std::string, std::shared_ptr< TH2Poly > > pxfTh2PolyForwardSummary
Definition: Phase1PixelMaps.h:88
Phase1PixelMaps::rescaleAllForward
void rescaleAllForward(const std::string &currentHistoName)
Definition: Phase1PixelMaps.cc:446
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
Phase1PixelMaps::retrieveCorners
const indexedCorners retrieveCorners(const std::vector< edm::FileInPath > &cornerFiles, const unsigned int reads)
Definition: Phase1PixelMaps.cc:328
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
Phase1PixelMaps::adjustCanvasMargins
void adjustCanvasMargins(TVirtualPad *pad, float top, float bottom, float left, float right)
Definition: Phase1PixelMaps.cc:413
Exception
Definition: hltDiff.cc:245
MatrixUtil.remove
def remove(d, key, TELL=False)
Definition: MatrixUtil.py:219
PVValHelper::ladder
Definition: PVValidationHelpers.h:73
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
Phase1PixelMaps::m_cornersBPIX
std::vector< edm::FileInPath > m_cornersBPIX
Definition: Phase1PixelMaps.h:90
Phase1PixelMaps::m_trackerTopo
TrackerTopology m_trackerTopo
Definition: Phase1PixelMaps.h:82
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
mps_splice.line
line
Definition: mps_splice.py:76
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
Phase1PixelMaps::m_option
Option_t * m_option
Definition: Phase1PixelMaps.h:80
StandaloneTrackerTopology::fromTrackerParametersXMLFile
TrackerTopology fromTrackerParametersXMLFile(const std::string &xmlFileName)
Definition: StandaloneTrackerTopology.cc:168
Phase1PixelMaps::m_autorescale
bool m_autorescale
Definition: Phase1PixelMaps.h:81
histoStyle.drawOption
drawOption
Definition: histoStyle.py:56