1 #ifndef CONDCORE_SIPIXELPLUGINS_PHASE1PIXELMAPS_H
2 #define CONDCORE_SIPIXELPLUGINS_PHASE1PIXELMAPS_H
18 for (
unsigned int i = 1;
i <= 4;
i++) {
23 for (
int j : {-3, -2, -1, 1, 2, 3}) {
33 std::shared_ptr<TH2Poly> th2p;
35 for (
unsigned i = 0;
i < 4; ++
i) {
36 histName =
"barrel_layer_";
38 th2p = std::make_shared<TH2Poly>((histName + std::to_string(
i + 1)).c_str(),
39 Form(
"PXBMap of %s - Layer %i", what,
i + 1),
47 th2p->GetXaxis()->SetTitle(
"z [cm]");
48 th2p->GetYaxis()->SetTitle(
"ladder");
49 th2p->GetZaxis()->SetTitle(
zaxis);
50 th2p->GetZaxis()->CenterTitle();
51 th2p->SetStats(
false);
56 th2p = std::make_shared<TH2Poly>(
"barrel_summary",
"PXBMap", -5.0, 5.0, 0.0, 5.0);
59 th2p->GetXaxis()->SetTitle(
"");
60 th2p->GetYaxis()->SetTitle(
"~ladder");
61 th2p->SetStats(
false);
69 std::shared_ptr<TH2Poly> th2p;
71 for (
unsigned side = 1; side <= 2; ++side) {
72 for (
unsigned disk = 1; disk <= 3; ++disk) {
73 histName =
"forward_disk_";
75 th2p = std::make_shared<TH2Poly>((histName + std::to_string((side == 1 ? -(
int(disk)) : (
int)disk))).c_str(),
76 Form(
"PXFMap of %s - Side %i Disk %i", what, side, disk),
82 th2p->GetXaxis()->SetTitle(
"x [cm]");
83 th2p->GetYaxis()->SetTitle(
"y [cm]");
84 th2p->GetZaxis()->SetTitle(
zaxis);
85 th2p->GetZaxis()->CenterTitle();
86 th2p->SetStats(
false);
92 th2p = std::make_shared<TH2Poly>(
"forward_summary",
"PXFMap", -40.0, 50.0, -20.0, 90.0);
95 th2p->GetXaxis()->SetTitle(
"");
96 th2p->GetYaxis()->SetTitle(
"");
97 th2p->SetStats(
false);
106 for (
const auto&
entry : theIndexedCorners) {
107 auto id =
entry.first;
108 auto detid =
DetId(
id);
115 auto theVectX =
entry.second.first;
116 auto theVectY =
entry.second.second;
118 float vertX[] = {theVectX[0], theVectX[1], theVectX[2], theVectX[3], theVectX[4]};
121 bins[
id] = std::make_shared<TGraph>(5, vertX, vertY);
122 bins[
id]->SetName(TString::Format(
"%u",
id));
125 for (
unsigned k = 0;
k < 5; ++
k) {
126 vertX[
k] += ((layer == 2 || layer == 3) ? 0.0
f : -60.0
f);
127 vertY[
k] += ((layer > 2) ? 30.0
f : 0.0
f);
142 for (
const auto&
entry : theIndexedCorners) {
143 auto id =
entry.first;
144 auto detid =
DetId(
id);
151 unsigned mapIdx = disk + (side - 1) * 3 - 1;
153 auto theVectX =
entry.second.first;
154 auto theVectY =
entry.second.second;
156 float vertX[] = {theVectX[0], theVectX[1], theVectX[2], theVectX[3]};
157 float vertY[] = {theVectY[0], theVectY[1], theVectY[2], theVectY[3]};
159 bins[
id] = std::make_shared<TGraph>(4, vertX, vertY);
160 bins[
id]->SetName(TString::Format(
"%u",
id));
163 for (
unsigned k = 0;
k < 4; ++
k) {
164 vertX[
k] += (
float(side) - 1.5f) * 40.0
f;
165 vertY[
k] += (disk - 1) * 35.0
f;
177 template <
typename type>
179 auto detid =
DetId(
id);
181 edm::LogError(
"Phase1PixelMaps") <<
"fillBarrelBin() The following detid " <<
id <<
" is not Pixel Barrel!"
190 template <
typename type>
192 auto detid =
DetId(
id);
194 edm::LogError(
"Phase1PixelMaps") <<
"fillForwardBin() The following detid " <<
id <<
" is not Pixel Forward!"
200 unsigned mapIdx = disk + (side - 1) * 3 - 1;
207 for (
const auto&
plot : vec.second) {
209 plot->GetXaxis()->SetTitleOffset(0.9);
210 plot->GetYaxis()->SetTitleOffset(0.9);
211 plot->GetZaxis()->SetTitleOffset(1.2);
212 plot->GetZaxis()->SetTitleSize(0.05);
217 for (
const auto&
plot : vec.second) {
219 plot->GetXaxis()->SetTitleOffset(0.9);
220 plot->GetYaxis()->SetTitleOffset(0.9);
221 plot->GetZaxis()->SetTitleOffset(1.2);
222 plot->GetZaxis()->SetTitleSize(0.05);
229 std::vector<float> maxima;
232 std::back_inserter(maxima),
233 [](std::shared_ptr<TH2Poly> thp) ->
float {
return thp->GetMaximum(); });
234 std::vector<float> minima;
237 std::back_inserter(minima),
238 [](std::shared_ptr<TH2Poly> thp) ->
float {
return thp->GetMinimum(); });
240 auto globalMax = *std::max_element(maxima.begin(), maxima.end());
241 auto globalMin = *std::min_element(minima.begin(), minima.end());
244 histo->GetZaxis()->SetRangeUser(globalMin, globalMax);
250 std::vector<float> maxima;
253 std::back_inserter(maxima),
254 [](std::shared_ptr<TH2Poly> thp) ->
float {
return thp->GetMaximum(); });
255 std::vector<float> minima;
258 std::back_inserter(minima),
259 [](std::shared_ptr<TH2Poly> thp) ->
float {
return thp->GetMinimum(); });
261 auto globalMax = *std::max_element(maxima.begin(), maxima.end());
262 auto globalMin = *std::min_element(minima.begin(), minima.end());
265 histo->GetZaxis()->SetRangeUser(globalMin, globalMax);
272 for (
int i = 1;
i <= 4;
i++) {
274 if (strcmp(
m_option,
"text") == 0) {
275 canvas.cd(
i)->SetRightMargin(0.02);
288 for (
int i = 1;
i <= 6;
i++) {
290 if (strcmp(
m_option,
"text") == 0) {
291 canvas.cd(
i)->SetRightMargin(0.02);