6 #include "TDirectory.h"
25 h->SetAxisRange(min,max);
27 t->SetY(h->GetMaximum()); t->SetX((max+min)/2); t->DrawClone();
32 gROOT->SetStyle(
"Plain");
36 const Int_t NRGBs = 5;
37 const Int_t NCont = 255;
38 Double_t stops[NRGBs] = { 0.00, 0.25, 0.50, 0.75, 1.00 };
39 Double_t
red[NRGBs] = { 0.00, 0.00, 0.40, 1.00, 1.00 };
40 Double_t
green[NRGBs] = { 0.00, 0.40, 0.70, 0.60, 1.00 };
41 Double_t blue[NRGBs] = { 0.30, 0.60, 0.00, 0.00, 0.20 };
42 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
43 gStyle->SetNumberContours(NCont);
47 const Int_t NRGBs = 3;
48 const Int_t NCont = 255;
49 Double_t stops[NRGBs] = { 0.00, 0.50, 1.00 };
50 Double_t
red[NRGBs] = { 0.90, 0.50, 0.00};
51 Double_t
green[NRGBs] = { 0.90, 0.50, 0.00};
52 Double_t blue[NRGBs] = { 0.90, 0.50, 0.00};
53 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
54 gStyle->SetNumberContours(NCont);
58 const Int_t NRGBs = 7;
59 const Int_t NCont = 255;
60 Double_t stops[NRGBs] = { 0.00, 0.15, 0.30, 0.45, 0.65, 0.85, 1.00 };
61 Double_t
red[NRGBs] = { 0.60, 0.30, 0.00, 0.00, 0.60, 0.40, 0.00 };
62 Double_t
green[NRGBs] = { 1.00, 0.90, 0.80, 0.75, 0.20, 0.00, 0.00 };
63 Double_t blue[NRGBs] = { 1.00, 1.00, 1.00, 0.30, 0.00, 0.00, 0.00 };
64 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
65 gStyle->SetNumberContours(NCont);
68 int ncol = gStyle->GetNumberOfColors();
69 std::cout <<
"Number of colors " << ncol << std::endl;
73 TProfile* aveoccu= (TProfile*)gDirectory->Get(
"aveoccu");
74 TProfile* avemult= (TProfile*)gDirectory->Get(
"avemult");
75 TH1F* nchannels = (TH1F*)gDirectory->Get(
"nchannels_real");
77 TProfile* averadius = (TProfile*)gDirectory->Get(
"averadius");
78 TProfile* avez = (TProfile*)gDirectory->Get(
"avez");
80 std::cout <<
"pointers " << aveoccu <<
" " << avemult <<
" " << nchannels <<
" " << averadius <<
" " << avez << std::endl;
82 if(aveoccu && avemult && nchannels && averadius && avez) {
85 for(
int i=1;
i<nchannels->GetNbinsX()+1;++
i) {
86 nchannels->SetBinError(
i,0.);
89 TH1D* haveoccu = aveoccu->ProjectionX(
"haveoccu");
90 haveoccu->SetDirectory(0);
91 haveoccu->Divide(nchannels);
92 TH1D* havemult = avemult->ProjectionX(
"havemult");
93 havemult->SetDirectory(0);
94 havemult->Divide(nchannels);
96 TH1D* havewidth = (TH1D*)haveoccu->Clone(
"havewidth");
97 havewidth->SetDirectory(0);
98 havewidth->SetTitle(
"Average Cluster Size");
99 havewidth->Divide(havemult);
102 new TCanvas(
"occupancy",
"occupancy",1200,500);
104 haveoccu->SetStats(0);
105 haveoccu->DrawCopy();
106 TLine* l1 =
new TLine(1000,0,1000,haveoccu->GetMaximum()); l1->DrawClone();
107 TLine* l2 =
new TLine(2000,0,2000,haveoccu->GetMaximum()); l2->DrawClone();
108 TLine* l3 =
new TLine(3000,0,3000,haveoccu->GetMaximum()); l3->DrawClone();
109 TLine* l4 =
new TLine(4000,0,4000,haveoccu->GetMaximum()); l4->DrawClone();
110 TLine* l5 =
new TLine(5000,0,5000,haveoccu->GetMaximum()); l5->DrawClone();
111 TText* tpix =
new TText(500,haveoccu->GetMaximum(),
"BPIX+FPIX"); tpix->SetTextAlign(22); tpix->DrawClone();
112 TText* ttib =
new TText(1500,haveoccu->GetMaximum(),
"TIB"); ttib->SetTextAlign(22); ttib->DrawClone();
113 TText* ttid =
new TText(2500,haveoccu->GetMaximum(),
"TID"); ttid->SetTextAlign(22); ttid->DrawClone();
114 TText* ttob =
new TText(3500,haveoccu->GetMaximum(),
"TOB"); ttob->SetTextAlign(22); ttob->DrawClone();
115 TText* ttecm =
new TText(4500,haveoccu->GetMaximum(),
"TEC-"); ttecm->SetTextAlign(22); ttecm->DrawClone();
116 TText* ttecp =
new TText(5500,haveoccu->GetMaximum(),
"TEC+"); ttecp->SetTextAlign(22); ttecp->DrawClone();
118 new TCanvas(
"multiplicity",
"multiplicity",1200,500);
120 havemult->SetStats(0);
121 havemult->DrawCopy();
122 tpix->SetY(havemult->GetMaximum()); tpix->DrawClone();
123 ttib->SetY(havemult->GetMaximum()); ttib->DrawClone();
124 ttid->SetY(havemult->GetMaximum()); ttid->DrawClone();
125 ttob->SetY(havemult->GetMaximum()); ttob->DrawClone();
126 ttecm->SetY(havemult->GetMaximum()); ttecm->DrawClone();
127 ttecp->SetY(havemult->GetMaximum()); ttecp->DrawClone();
128 l1->SetY2(havemult->GetMaximum()); l1->DrawClone();
129 l2->SetY2(havemult->GetMaximum()); l2->DrawClone();
130 l3->SetY2(havemult->GetMaximum()); l3->DrawClone();
131 l4->SetY2(havemult->GetMaximum()); l4->DrawClone();
132 l5->SetY2(havemult->GetMaximum()); l5->DrawClone();
134 new TCanvas(
"width",
"width",1200,500);
135 havewidth->SetStats(0);
136 havewidth->DrawCopy();
137 tpix->SetY(havewidth->GetMaximum()); tpix->DrawClone();
138 ttib->SetY(havewidth->GetMaximum()); ttib->DrawClone();
139 ttid->SetY(havewidth->GetMaximum()); ttid->DrawClone();
140 ttob->SetY(havewidth->GetMaximum()); ttob->DrawClone();
141 ttecm->SetY(havewidth->GetMaximum()); ttecm->DrawClone();
142 ttecp->SetY(havewidth->GetMaximum()); ttecp->DrawClone();
143 l1->SetY2(havewidth->GetMaximum()); l1->DrawClone();
144 l2->SetY2(havewidth->GetMaximum()); l2->DrawClone();
145 l3->SetY2(havewidth->GetMaximum()); l3->DrawClone();
146 l4->SetY2(havewidth->GetMaximum()); l4->DrawClone();
147 l5->SetY2(havewidth->GetMaximum()); l5->DrawClone();
149 TCanvas * o2 =
new TCanvas(
"occupancy2",
"occupancy2",1200,800);
152 haveoccu->SetAxisRange(100,270);
153 haveoccu->DrawCopy();
154 tpix->SetY(haveoccu->GetMaximum()); tpix->SetX(185); tpix->DrawClone();
156 haveoccu->SetAxisRange(1050,1450);
157 haveoccu->DrawCopy();
158 ttib->SetY(haveoccu->GetMaximum()); ttib->SetX(1250); ttib->DrawClone();
160 haveoccu->SetAxisRange(2070,2400);
161 haveoccu->DrawCopy();
162 ttid->SetY(haveoccu->GetMaximum()); ttid->SetX(2235); ttid->DrawClone();
164 haveoccu->SetAxisRange(3000,3700);
165 haveoccu->DrawCopy();
166 ttob->SetY(haveoccu->GetMaximum()); ttob->SetX(3350); ttob->DrawClone();
168 haveoccu->SetAxisRange(4000,4850);
169 haveoccu->DrawCopy();
170 ttecm->SetY(haveoccu->GetMaximum()); ttecm->SetX(4425); ttecm->DrawClone();
172 haveoccu->SetAxisRange(5000,5850);
173 haveoccu->DrawCopy();
174 ttecp->SetY(haveoccu->GetMaximum()); ttecp->SetX(5425); ttecp->DrawClone();
176 TCanvas * m2 =
new TCanvas(
"multiplicity2",
"multiplicity2",1200,800);
179 havemult->SetAxisRange(100,270);
180 havemult->DrawCopy();
181 tpix->SetY(havemult->GetMaximum()); tpix->SetX(185); tpix->DrawClone();
183 havemult->SetAxisRange(1050,1450);
184 havemult->DrawCopy();
185 ttib->SetY(havemult->GetMaximum()); ttib->SetX(1250); ttib->DrawClone();
187 havemult->SetAxisRange(2070,2400);
188 havemult->DrawCopy();
189 ttid->SetY(havemult->GetMaximum()); ttid->SetX(2235); ttid->DrawClone();
191 havemult->SetAxisRange(3000,3700);
192 havemult->DrawCopy();
193 ttob->SetY(havemult->GetMaximum()); ttob->SetX(3350); ttob->DrawClone();
195 havemult->SetAxisRange(4000,4850);
196 havemult->DrawCopy();
197 ttecm->SetY(havemult->GetMaximum()); ttecm->SetX(4425); ttecm->DrawClone();
199 havemult->SetAxisRange(5000,5850);
200 havemult->DrawCopy();
201 ttecp->SetY(havemult->GetMaximum()); ttecp->SetX(5425); ttecp->DrawClone();
203 TCanvas *
w2 =
new TCanvas(
"width2",
"width2",1200,800);
206 havewidth->SetAxisRange(100,270);
207 havewidth->DrawCopy();
208 tpix->SetY(havewidth->GetMaximum()); tpix->SetX(185); tpix->DrawClone();
210 havewidth->SetAxisRange(1050,1450);
211 havewidth->DrawCopy();
212 ttib->SetY(havewidth->GetMaximum()); ttib->SetX(1250); ttib->DrawClone();
214 havewidth->SetAxisRange(2070,2400);
215 havewidth->DrawCopy();
216 ttid->SetY(havewidth->GetMaximum()); ttid->SetX(2235); ttid->DrawClone();
218 havewidth->SetAxisRange(3000,3700);
219 havewidth->DrawCopy();
220 ttob->SetY(havewidth->GetMaximum()); ttob->SetX(3350); ttob->DrawClone();
222 havewidth->SetAxisRange(4000,4850);
223 havewidth->DrawCopy();
224 ttecm->SetY(havewidth->GetMaximum()); ttecm->SetX(4425); ttecm->DrawClone();
226 havewidth->SetAxisRange(5000,5850);
227 havewidth->DrawCopy();
228 ttecp->SetY(havewidth->GetMaximum()); ttecp->SetX(5425); ttecp->DrawClone();
235 for(
int i=1;
i<haveoccu->GetNbinsX();++
i) {
237 if(averadius->GetBinEntries(
i)*avez->GetBinEntries(
i)) {
243 if(
i > 100 &&
i < 200) { dz=3.33;dr=0.4;}
245 if(
i > 200 &&
i < 1000 && (
i%10 == 1 ||
i%10 == 7)) { dz=0.8;dr=0.4;}
246 if(
i > 200 &&
i < 1000 && !(
i%10 == 1 ||
i%10 == 7)) { dz=0.8;dr=0.8;}
248 if(
i > 1000 &&
i < 2000) { dz=5.948;dr=0.4;}
250 if(
i > 3000 &&
i < 4000) { dz=9.440;dr=0.4;}
252 if(
i > 2000 &&
i < 3000 && (
i%1000)/100 == 1) { dz=0.8;dr=5.647;}
253 if(
i > 2000 &&
i < 3000 && (
i%1000)/100 == 2) { dz=0.8;dr=4.512;}
254 if(
i > 2000 &&
i < 3000 && (
i%1000)/100 == 3) { dz=0.8;dr=5.637;}
256 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 1) { dz=0.8;dr=4.362;}
257 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 2) { dz=0.8;dr=4.512;}
258 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 3) { dz=0.8;dr=5.637;}
259 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 4) { dz=0.8;dr=5.862;}
260 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 5) { dz=0.8;dr=7.501;}
261 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 6) { dz=0.8;dr=9.336;}
262 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 7) { dz=0.8;dr=10.373;}
265 TBox* modoccu =
new TBox(avez->GetBinContent(
i)-dz,averadius->GetBinContent(
i)-dr,avez->GetBinContent(
i)+dz,averadius->GetBinContent(
i)+dr);
266 modoccu->SetFillStyle(1001);
267 int icol=int(ncol*(
log(haveoccu->GetBinContent(
i))-
log(min))/(
log(max)-
log(min)));
269 if(icol > (ncol-1)) icol=(ncol-1);
270 std::cout <<
i <<
" " << icol <<
" " << haveoccu->GetBinContent(
i) << std::endl;
271 modoccu->SetFillColor(gStyle->GetColorPalette(icol));
272 modulesoccu.Add(modoccu);
275 TBox* modmult =
new TBox(avez->GetBinContent(
i)-dz,averadius->GetBinContent(
i)-dr,avez->GetBinContent(
i)+dz,averadius->GetBinContent(
i)+dr);
276 modmult->SetFillStyle(1001);
277 int icol=int(ncol*(
log(havemult->GetBinContent(
i))-
log(mmin))/(
log(mmax)-
log(mmin)));
279 if(icol > (ncol-1)) icol=(ncol-1);
280 std::cout <<
i <<
" " << icol <<
" " << havemult->GetBinContent(
i) << std::endl;
281 modmult->SetFillColor(gStyle->GetColorPalette(icol));
282 modulesmult.Add(modmult);
289 double etavalext[] = {3.,2.8,2.6,2.4,2.2,2.0,1.8,1.6};
290 double etavalint[] = {-1.4,-1.2,-1.0,-0.8,-0.6,-0.4,-0.2,0.,0.2,0.4,0.6,0.8,1.0,1.2,1.4};
294 for(
int i=0;
i<8;++
i) {
296 double eta = etavalext[
i];
297 TLine* lin =
new TLine(295,2*295/(
exp(eta)-
exp(-eta)),305,2*305/(
exp(eta)-
exp(-eta)));
300 sprintf(lab,
"%3.1f",eta);
301 TText*
label =
new TText(285,2*285/(
exp(eta)-
exp(-eta)),lab);
302 label->SetTextSize(.03);
303 label->SetTextAlign(22);
304 etalabels.Add(label);
306 for(
int i=0;
i<8;++
i) {
308 double eta = -1*etavalext[
i];
309 TLine* lin =
new TLine(-295,-2*295/(
exp(eta)-
exp(-eta)),-305,-2*305/(
exp(eta)-
exp(-eta)));
312 sprintf(lab,
"%3.1f",eta);
313 TText*
label =
new TText(-285,-2*285/(
exp(eta)-
exp(-eta)),lab);
314 label->SetTextSize(.03);
315 label->SetTextAlign(22);
316 etalabels.Add(label);
318 for(
int i=0;
i<15;++
i) {
320 double eta = etavalint[
i];
321 TLine* lin =
new TLine(130.*(
exp(eta)-
exp(-eta))/2.,130,138.*(
exp(eta)-
exp(-eta))/2.,138);
324 sprintf(lab,
"%3.1f",eta);
325 TText*
label =
new TText(125.*(
exp(eta)-
exp(-eta))/2.,125,lab);
326 label->SetTextSize(.03);
327 label->SetTextAlign(22);
328 etalabels.Add(label);
330 TLatex* etalab =
new TLatex(0,115,
"#eta");
331 etalab->SetTextSize(.03);
332 etalab->SetTextAlign(22);
333 etalabels.Add(etalab);
336 TLatex *cmslab =
new TLatex(0.15,0.965,
"CMS");
338 cmslab->SetTextSize(0.04);
339 cmslab->SetTextAlign(31);
340 paperlabels.Add(cmslab);
341 TLatex *enelab =
new TLatex(0.92,0.965,
"#sqrt{s} = 7 TeV");
343 enelab->SetTextSize(0.04);
344 enelab->SetTextAlign(31);
345 paperlabels.Add(enelab);
354 TGaxis *raxis =
new TGaxis(-310,0,-310,140,0,140,10,
"S");
355 TGaxis *zaxis =
new TGaxis(-310,0,310,0,-310,310,10,
"S");
356 raxis->SetTickSize(.01); zaxis->SetTickSize(.01);
357 raxis->SetTitle(
"r (cm)"); zaxis->SetTitle(
"z (cm)");
362 for(
int i = 0;
i< ncol ; ++
i) {
363 TBox* box=
new TBox(315,0+140./ncol*
i,330,0+140./ncol*(i+1));
364 box->SetFillStyle(1001);
365 box->SetFillColor(gStyle->GetColorPalette(i));
371 TGaxis *paxis =
new TGaxis(330,0,330,140,min,max,510,
"SLG+");
372 paxis->SetTickSize(.02);
373 paxis->SetLabelOffset(paxis->GetLabelOffset()*0.5);
374 paxis->SetTitle(
"channel occupancy");
377 TGaxis *mpaxis =
new TGaxis(330,0,330,140,mmin,mmax,510,
"SLG+");
378 mpaxis->SetTickSize(.02);
379 mpaxis->SetLabelOffset(paxis->GetLabelOffset()*0.5);
380 mpalette.Add(mpaxis);
382 TCanvas* cc1 =
new TCanvas(
"occumap",
"occumap",1000,500);
383 cc1->Range(-370.,-20.,390.,150.);
384 TFrame* fr1 =
new TFrame(-310,0,310,140);
385 fr1->UseCurrentStyle();
387 raxis->Draw(); zaxis->Draw();
388 std::cout << modulesoccu.GetSize() << std::endl;
395 TCanvas* cc2 =
new TCanvas(
"multmap",
"multmap",1000,500);
396 cc2->Range(-370.,-20.,390.,150.);
397 TFrame* fr2 =
new TFrame(-310,0,310,140);
398 fr2->UseCurrentStyle();
400 raxis->Draw(); zaxis->Draw();
401 std::cout << modulesmult.GetSize() << std::endl;
415 gROOT->SetStyle(
"Plain");
419 const Int_t NRGBs = 5;
420 const Int_t NCont = 255;
421 Double_t stops[NRGBs] = { 0.00, 0.25, 0.50, 0.75, 1.00 };
422 Double_t
red[NRGBs] = { 0.00, 0.00, 0.40, 1.00, 1.00 };
423 Double_t
green[NRGBs] = { 0.00, 0.40, 0.70, 0.60, 1.00 };
424 Double_t blue[NRGBs] = { 0.30, 0.60, 0.00, 0.00, 0.20 };
425 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
426 gStyle->SetNumberContours(NCont);
430 const Int_t NRGBs = 3;
431 const Int_t NCont = 255;
432 Double_t stops[NRGBs] = { 0.00, 0.50, 1.00 };
433 Double_t
red[NRGBs] = { 0.90, 0.50, 0.00};
434 Double_t
green[NRGBs] = { 0.90, 0.50, 0.00};
435 Double_t blue[NRGBs] = { 0.90, 0.50, 0.00};
436 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
437 gStyle->SetNumberContours(NCont);
441 const Int_t NRGBs = 7;
442 const Int_t NCont = 255;
443 Double_t stops[NRGBs] = { 0.00, 0.15, 0.30, 0.45, 0.65, 0.85, 1.00 };
444 Double_t
red[NRGBs] = { 0.60, 0.30, 0.00, 0.00, 0.60, 0.40, 0.00 };
445 Double_t
green[NRGBs] = { 1.00, 0.90, 0.80, 0.75, 0.20, 0.00, 0.00 };
446 Double_t blue[NRGBs] = { 1.00, 1.00, 1.00, 0.30, 0.00, 0.00, 0.00 };
447 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
448 gStyle->SetNumberContours(NCont);
451 int ncol = gStyle->GetNumberOfColors();
452 std::cout <<
"Number of colors " << ncol << std::endl;
456 TProfile* aveoccu= (TProfile*)gDirectory->Get(
"aveoccu");
457 TProfile* avemult= (TProfile*)gDirectory->Get(
"avemult");
458 TH1F* nchannels = (TH1F*)gDirectory->Get(
"nchannels_real");
460 TProfile* averadius = (TProfile*)gDirectory->Get(
"averadius");
461 TProfile* avez = (TProfile*)gDirectory->Get(
"avez");
463 std::cout <<
"pointers " << aveoccu <<
" " << avemult <<
" " << nchannels <<
" " << averadius <<
" " << avez << std::endl;
465 if(aveoccu && avemult && nchannels && averadius && avez) {
468 for(
int i=1;
i<nchannels->GetNbinsX()+1;++
i) {
469 nchannels->SetBinError(
i,0.);
472 TH1D* haveoccu = aveoccu->ProjectionX(
"haveoccu");
473 haveoccu->SetDirectory(0);
474 haveoccu->Divide(nchannels);
475 TH1D* havemult = avemult->ProjectionX(
"havemult");
476 havemult->SetDirectory(0);
477 havemult->Divide(nchannels);
479 TH1D* havewidth = (TH1D*)haveoccu->Clone(
"havewidth");
480 havewidth->SetDirectory(0);
481 havewidth->SetTitle(
"Average Cluster Size");
482 havewidth->Divide(havemult);
485 new TCanvas(
"occupancy",
"occupancy",1200,500);
487 haveoccu->SetStats(0);
488 haveoccu->DrawCopy();
489 TLine* l1 =
new TLine(1000,0,1000,haveoccu->GetMaximum()); l1->DrawClone();
490 TLine* l2 =
new TLine(2000,0,2000,haveoccu->GetMaximum()); l2->DrawClone();
491 TLine* l3 =
new TLine(3000,0,3000,haveoccu->GetMaximum()); l3->DrawClone();
492 TLine* l4 =
new TLine(4000,0,4000,haveoccu->GetMaximum()); l4->DrawClone();
493 TLine* l5 =
new TLine(5000,0,5000,haveoccu->GetMaximum()); l5->DrawClone();
494 TText* tpix =
new TText(1500,haveoccu->GetMaximum(),
"BPIX+FPIX"); tpix->SetTextAlign(22); tpix->DrawClone();
497 TText* ttob =
new TText(2500,haveoccu->GetMaximum(),
"TOB"); ttob->SetTextAlign(22); ttob->DrawClone();
498 TText* ttecm =
new TText(3500,haveoccu->GetMaximum(),
"TEC-"); ttecm->SetTextAlign(22); ttecm->DrawClone();
499 TText* ttecp =
new TText(4500,haveoccu->GetMaximum(),
"TEC+"); ttecp->SetTextAlign(22); ttecp->DrawClone();
501 new TCanvas(
"multiplicity",
"multiplicity",1200,500);
503 havemult->SetStats(0);
504 havemult->DrawCopy();
505 tpix->SetY(havemult->GetMaximum()); tpix->DrawClone();
508 ttob->SetY(havemult->GetMaximum()); ttob->DrawClone();
509 ttecm->SetY(havemult->GetMaximum()); ttecm->DrawClone();
510 ttecp->SetY(havemult->GetMaximum()); ttecp->DrawClone();
511 l1->SetY2(havemult->GetMaximum()); l1->DrawClone();
512 l2->SetY2(havemult->GetMaximum()); l2->DrawClone();
513 l3->SetY2(havemult->GetMaximum()); l3->DrawClone();
514 l4->SetY2(havemult->GetMaximum()); l4->DrawClone();
515 l5->SetY2(havemult->GetMaximum()); l5->DrawClone();
517 new TCanvas(
"width",
"width",1200,500);
518 havewidth->SetStats(0);
519 havewidth->DrawCopy();
520 tpix->SetY(havewidth->GetMaximum()); tpix->DrawClone();
523 ttob->SetY(havewidth->GetMaximum()); ttob->DrawClone();
524 ttecm->SetY(havewidth->GetMaximum()); ttecm->DrawClone();
525 ttecp->SetY(havewidth->GetMaximum()); ttecp->DrawClone();
526 l1->SetY2(havewidth->GetMaximum()); l1->DrawClone();
527 l2->SetY2(havewidth->GetMaximum()); l2->DrawClone();
528 l3->SetY2(havewidth->GetMaximum()); l3->DrawClone();
529 l4->SetY2(havewidth->GetMaximum()); l4->DrawClone();
530 l5->SetY2(havewidth->GetMaximum()); l5->DrawClone();
532 TCanvas * o2 =
new TCanvas(
"occupancy2",
"occupancy2",1200,800);
539 TCanvas * m2 =
new TCanvas(
"multiplicity2",
"multiplicity2",1200,800);
546 TCanvas *
w2 =
new TCanvas(
"width2",
"width2",1200,800);
558 for(
int i=1;
i<haveoccu->GetNbinsX();++
i) {
562 if(averadius->GetBinEntries(
i)*avez->GetBinEntries(
i)) {
568 if(
i > 1000 &&
i < 1040) { dz=3.33;dr=0.4;}
569 if(
i > 1040 &&
i < 1130) { dr=3.33;dz=0.4;}
571 if(
i > 2000 &&
i < 2550) { dz=2.5;dr=0.1;}
572 if(
i > 2550 &&
i < 3000) { dz=5.0;dr=0.1;}
574 if(
i > 3000 &&
i < 5000) { dz=0.2;dr=5.0;}
576 if(
i > 3100 &&
i < 3119) { dz=0.2;dr=2.5;}
577 if(
i > 3140 &&
i < 3159) { dz=0.2;dr=2.5;}
578 if(
i > 3180 &&
i < 3199) { dz=0.2;dr=2.5;}
579 if(
i > 3220 &&
i < 3239) { dz=0.2;dr=2.5;}
580 if(
i > 3260 &&
i < 3279) { dz=0.2;dr=2.5;}
582 if(
i > 4100 &&
i < 4119) { dz=0.2;dr=2.5;}
583 if(
i > 4140 &&
i < 4159) { dz=0.2;dr=2.5;}
584 if(
i > 4180 &&
i < 4199) { dz=0.2;dr=2.5;}
585 if(
i > 4220 &&
i < 4239) { dz=0.2;dr=2.5;}
586 if(
i > 4260 &&
i < 4279) { dz=0.2;dr=2.5;}
605 TBox* modoccu =
new TBox(avez->GetBinContent(
i)-dz,averadius->GetBinContent(
i)-dr,avez->GetBinContent(
i)+dz,averadius->GetBinContent(
i)+dr);
606 modoccu->SetFillStyle(1001);
607 int icol=int(ncol*(
log(haveoccu->GetBinContent(
i))-
log(min))/(
log(max)-
log(min)));
609 if(icol > (ncol-1)) icol=(ncol-1);
610 std::cout <<
i <<
" " << icol <<
" " << haveoccu->GetBinContent(
i) << std::endl;
611 modoccu->SetFillColor(gStyle->GetColorPalette(icol));
612 modulesoccu.Add(modoccu);
615 TBox* modmult =
new TBox(avez->GetBinContent(
i)-dz,averadius->GetBinContent(
i)-dr,avez->GetBinContent(
i)+dz,averadius->GetBinContent(
i)+dr);
616 modmult->SetFillStyle(1001);
617 int icol=int(ncol*(
log(havemult->GetBinContent(
i))-
log(mmin))/(
log(mmax)-
log(mmin)));
619 if(icol > (ncol-1)) icol=(ncol-1);
620 std::cout <<
i <<
" " << icol <<
" " << havemult->GetBinContent(
i) << std::endl;
621 modmult->SetFillColor(gStyle->GetColorPalette(icol));
622 modulesmult.Add(modmult);
629 double etavalext[] = {4.,3.5,3.,2.8,2.6,2.4,2.2,2.0,1.8,1.6};
630 double etavalint[] = {-1.4,-1.2,-1.0,-0.8,-0.6,-0.4,-0.2,0.,0.2,0.4,0.6,0.8,1.0,1.2,1.4};
633 for(
int i=0;
i<10;++
i) {
635 double eta = etavalext[
i];
636 TLine* lin =
new TLine(295,2*295/(
exp(eta)-
exp(-eta)),305,2*305/(
exp(eta)-
exp(-eta)));
639 sprintf(lab,
"%3.1f",eta);
640 TText*
label =
new TText(285,2*285/(
exp(eta)-
exp(-eta)),lab);
641 label->SetTextSize(.03);
642 label->SetTextAlign(22);
643 etalabels.Add(label);
645 for(
int i=0;
i<10;++
i) {
647 double eta = -1*etavalext[
i];
648 TLine* lin =
new TLine(-295,-2*295/(
exp(eta)-
exp(-eta)),-305,-2*305/(
exp(eta)-
exp(-eta)));
651 sprintf(lab,
"%3.1f",eta);
652 TText*
label =
new TText(-285,-2*285/(
exp(eta)-
exp(-eta)),lab);
653 label->SetTextSize(.03);
654 label->SetTextAlign(22);
655 etalabels.Add(label);
657 for(
int i=0;
i<15;++
i) {
659 double eta = etavalint[
i];
660 TLine* lin =
new TLine(130.*(
exp(eta)-
exp(-eta))/2.,130,138.*(
exp(eta)-
exp(-eta))/2.,138);
663 sprintf(lab,
"%3.1f",eta);
664 TText*
label =
new TText(125.*(
exp(eta)-
exp(-eta))/2.,125,lab);
665 label->SetTextSize(.03);
666 label->SetTextAlign(22);
667 etalabels.Add(label);
671 TGaxis *raxis =
new TGaxis(-310,0,-310,140,0,140,10,
"S");
672 TGaxis *zaxis =
new TGaxis(-310,0,310,0,-310,310,10,
"S");
673 raxis->SetTickSize(.01); zaxis->SetTickSize(.01);
674 raxis->SetTitle(
"R (cm)"); zaxis->SetTitle(
"Z (cm)");
679 for(
int i = 0;
i< ncol ; ++
i) {
680 TBox* box=
new TBox(315,0+140./ncol*
i,330,0+140./ncol*(i+1));
681 box->SetFillStyle(1001);
682 box->SetFillColor(gStyle->GetColorPalette(i));
688 TGaxis *paxis =
new TGaxis(330,0,330,140,min,max,510,
"SLG+");
689 paxis->SetTickSize(.02);
690 paxis->SetLabelOffset(paxis->GetLabelOffset()*0.5);
693 TGaxis *mpaxis =
new TGaxis(330,0,330,140,mmin,mmax,510,
"SLG+");
694 mpaxis->SetTickSize(.02);
695 mpaxis->SetLabelOffset(paxis->GetLabelOffset()*0.5);
696 mpalette.Add(mpaxis);
698 TCanvas* cc1 =
new TCanvas(
"occumap",
"occumap",1000,500);
699 cc1->Range(-370.,-20.,390.,150.);
700 TFrame* fr1 =
new TFrame(-310,0,310,140);
701 fr1->UseCurrentStyle();
703 raxis->Draw(); zaxis->Draw();
704 std::cout << modulesoccu.GetSize() << std::endl;
710 TCanvas* cc2 =
new TCanvas(
"multmap",
"multmap",1000,500);
711 cc2->Range(-370.,-20.,390.,150.);
712 TFrame* fr2 =
new TFrame(-310,0,310,140);
713 fr2->UseCurrentStyle();
715 raxis->Draw(); zaxis->Draw();
716 std::cout << modulesmult.GetSize() << std::endl;
735 TProfile* aveoccu= (TProfile*)gDirectory->Get(
"aveoccu");
737 TH1F* nchannels = (TH1F*)gDirectory->Get(
"nchannels_real");
740 float sumnchannels=0;
743 for(
int i=lowerbin;
i<upperbin+1; ++
i) {
744 std::cout <<
"processing bin " <<
i <<
" " << aveoccu->GetBinContent(
i) <<
"+/-" << aveoccu->GetBinError(
i) << std::endl;
745 sumoccu += aveoccu->GetBinContent(
i);
746 sumnchannels += nchannels->GetBinContent(
i);
747 sumerrsq += aveoccu->GetBinError(
i)*aveoccu->GetBinError(
i);
749 cumoccu = sumnchannels!=0 ? sumoccu/sumnchannels : -1;
750 cumerr = sumnchannels!=0 ?
sqrt(sumerrsq)/sumnchannels : -1;
751 std::cout <<
"Cumulative occupancy: " << sumoccu <<
" " << sumnchannels <<
" " << cumoccu <<
"+/-" << cumerr;
762 const Int_t NRGBs = 5;
763 const Int_t NCont = 255;
764 Double_t stops[NRGBs] = { 0.00, 0.25, 0.50, 0.75, 1.00 };
765 Double_t
red[NRGBs] = { 0.00, 0.00, 0.40, 1.00, 1.00 };
766 Double_t
green[NRGBs] = { 0.00, 0.40, 0.70, 0.60, 1.00 };
767 Double_t blue[NRGBs] = { 0.30, 0.60, 0.00, 0.00, 0.20 };
768 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
769 gStyle->SetNumberContours(NCont);
773 const Int_t NRGBs = 3;
774 const Int_t NCont = 255;
775 Double_t stops[NRGBs] = { 0.00, 0.50, 1.00 };
776 Double_t
red[NRGBs] = { 0.90, 0.50, 0.00};
777 Double_t
green[NRGBs] = { 0.90, 0.50, 0.00};
778 Double_t blue[NRGBs] = { 0.90, 0.50, 0.00};
779 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
780 gStyle->SetNumberContours(NCont);
784 const Int_t NRGBs = 7;
785 const Int_t NCont = 255;
786 Double_t stops[NRGBs] = { 0.00, 0.15, 0.30, 0.45, 0.65, 0.85, 1.00 };
787 Double_t
red[NRGBs] = { 0.60, 0.30, 0.00, 0.00, 0.60, 0.40, 0.00 };
788 Double_t
green[NRGBs] = { 1.00, 0.90, 0.80, 0.75, 0.20, 0.00, 0.00 };
789 Double_t blue[NRGBs] = { 1.00, 1.00, 1.00, 0.30, 0.00, 0.00, 0.00 };
790 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
791 gStyle->SetNumberContours(NCont);
794 int ncol = gStyle->GetNumberOfColors();
795 std::cout <<
"Number of colors " << ncol << std::endl;
797 gROOT->SetStyle(
"Plain");
800 TProfile* aveontrkmult=0;
801 TProfile* averadius =0;
805 avemult= (TProfile*)gDirectory->Get(
"avemult");
806 averadius = (TProfile*)gDirectory->Get(
"averadius");
807 avez = (TProfile*)gDirectory->Get(
"avez");
809 if(ff->cd(ontrkmod)) aveontrkmult= (TProfile*)gDirectory->Get(
"avemult");
811 std::cout <<
"pointers " << avemult <<
" " << aveontrkmult <<
" " << averadius <<
" " << avez << std::endl;
813 if( averadius && avez && avemult && aveontrkmult) {
815 TH1D* havemult = avemult->ProjectionX(
"havemult");
816 TH1D* haveontrkmult = aveontrkmult->ProjectionX(
"haveontrkmult");
817 havemult->SetDirectory(0);
818 haveontrkmult->SetDirectory(0);
819 haveontrkmult->Divide(havemult);
821 new TCanvas(
"ontrkmult",
"ontrkmult",1200,500);
823 haveontrkmult->SetStats(0);
824 haveontrkmult->SetLineColor(kRed);
825 haveontrkmult->SetMarkerColor(kRed);
826 haveontrkmult->SetMarkerSize(.5);
827 haveontrkmult->SetMarkerStyle(20);
828 haveontrkmult->DrawCopy();
829 TLine* l1 =
new TLine(1000,0,1000,haveontrkmult->GetMaximum()); l1->DrawClone();
830 TLine* l2 =
new TLine(2000,0,2000,haveontrkmult->GetMaximum()); l2->DrawClone();
831 TLine* l3 =
new TLine(3000,0,3000,haveontrkmult->GetMaximum()); l3->DrawClone();
832 TLine* l4 =
new TLine(4000,0,4000,haveontrkmult->GetMaximum()); l4->DrawClone();
833 TLine* l5 =
new TLine(5000,0,5000,haveontrkmult->GetMaximum()); l5->DrawClone();
834 TText* tpix =
new TText(1500,haveontrkmult->GetMaximum(),
"BPIX+FPIX"); tpix->SetTextAlign(22); tpix->DrawClone();
837 TText* ttob =
new TText(2500,haveontrkmult->GetMaximum(),
"TOB"); ttob->SetTextAlign(22); ttob->DrawClone();
838 TText* ttecm =
new TText(3500,haveontrkmult->GetMaximum(),
"TEC-"); ttecm->SetTextAlign(22); ttecm->DrawClone();
839 TText* ttecp =
new TText(4500,haveontrkmult->GetMaximum(),
"TEC+"); ttecp->SetTextAlign(22); ttecp->DrawClone();
841 TCanvas * o2 =
new TCanvas(
"ontrkmult2",
"ontrkmult2",1200,800);
843 printFrame(o2,haveontrkmult,tpix,1,1000,1090);
844 printFrame(o2,haveontrkmult,ttob,2,2000,2900);
845 printFrame(o2,haveontrkmult,ttecm,3,3100,3300);
846 printFrame(o2,haveontrkmult,ttecp,4,4100,4300);
852 for(
int i=1;
i<haveontrkmult->GetNbinsX();++
i) {
856 if(averadius->GetBinEntries(
i)*avez->GetBinEntries(
i)) {
862 if(
i > 1000 &&
i < 1040) { dz=3.33;dr=0.4;}
863 if(
i > 1040 &&
i < 1130) { dr=3.33;dz=0.4;}
865 if(
i > 2000 &&
i < 2550) { dz=2.5;dr=0.1;}
866 if(
i > 2550 &&
i < 3000) { dz=5.0;dr=0.1;}
868 if(
i > 3000 &&
i < 5000) { dz=0.2;dr=5.0;}
870 if(
i > 3100 &&
i < 3119) { dz=0.2;dr=2.5;}
871 if(
i > 3140 &&
i < 3159) { dz=0.2;dr=2.5;}
872 if(
i > 3180 &&
i < 3199) { dz=0.2;dr=2.5;}
873 if(
i > 3220 &&
i < 3239) { dz=0.2;dr=2.5;}
874 if(
i > 3260 &&
i < 3279) { dz=0.2;dr=2.5;}
876 if(
i > 4100 &&
i < 4119) { dz=0.2;dr=2.5;}
877 if(
i > 4140 &&
i < 4159) { dz=0.2;dr=2.5;}
878 if(
i > 4180 &&
i < 4199) { dz=0.2;dr=2.5;}
879 if(
i > 4220 &&
i < 4239) { dz=0.2;dr=2.5;}
880 if(
i > 4260 &&
i < 4279) { dz=0.2;dr=2.5;}
883 TBox* modmult =
new TBox(avez->GetBinContent(
i)-dz,averadius->GetBinContent(
i)-dr,avez->GetBinContent(
i)+dz,averadius->GetBinContent(
i)+dr);
884 modmult->SetFillStyle(1001);
885 int icol=int(ncol*(haveontrkmult->GetBinContent(
i)-mmin)/(mmax-mmin));
887 if(icol > (ncol-1)) icol=(ncol-1);
888 std::cout <<
i <<
" " << icol <<
" " << haveontrkmult->GetBinContent(
i) << std::endl;
889 modmult->SetFillColor(gStyle->GetColorPalette(icol));
890 modulesmult.Add(modmult);
897 double etavalext[] = {4.,3.5,3.,2.8,2.6,2.4,2.2,2.0,1.8,1.6};
898 double etavalint[] = {-1.4,-1.2,-1.0,-0.8,-0.6,-0.4,-0.2,0.,0.2,0.4,0.6,0.8,1.0,1.2,1.4};
901 for(
int i=0;
i<10;++
i) {
903 double eta = etavalext[
i];
904 TLine* lin =
new TLine(295,2*295/(
exp(eta)-
exp(-eta)),305,2*305/(
exp(eta)-
exp(-eta)));
907 sprintf(lab,
"%3.1f",eta);
908 TText*
label =
new TText(285,2*285/(
exp(eta)-
exp(-eta)),lab);
909 label->SetTextSize(.03);
910 label->SetTextAlign(22);
911 etalabels.Add(label);
913 for(
int i=0;
i<10;++
i) {
915 double eta = -1*etavalext[
i];
916 TLine* lin =
new TLine(-295,-2*295/(
exp(eta)-
exp(-eta)),-305,-2*305/(
exp(eta)-
exp(-eta)));
919 sprintf(lab,
"%3.1f",eta);
920 TText*
label =
new TText(-285,-2*285/(
exp(eta)-
exp(-eta)),lab);
921 label->SetTextSize(.03);
922 label->SetTextAlign(22);
923 etalabels.Add(label);
925 for(
int i=0;
i<15;++
i) {
927 double eta = etavalint[
i];
928 TLine* lin =
new TLine(130.*(
exp(eta)-
exp(-eta))/2.,130,138.*(
exp(eta)-
exp(-eta))/2.,138);
931 sprintf(lab,
"%3.1f",eta);
932 TText*
label =
new TText(125.*(
exp(eta)-
exp(-eta))/2.,125,lab);
933 label->SetTextSize(.03);
934 label->SetTextAlign(22);
935 etalabels.Add(label);
939 TGaxis *raxis =
new TGaxis(-310,0,-310,140,0,140,10,
"S");
940 TGaxis *zaxis =
new TGaxis(-310,0,310,0,-310,310,10,
"S");
941 raxis->SetTickSize(.01); zaxis->SetTickSize(.01);
942 raxis->SetTitle(
"R (cm)"); zaxis->SetTitle(
"Z (cm)");
946 for(
int i = 0;
i< ncol ; ++
i) {
947 TBox* box=
new TBox(315,0+140./ncol*
i,330,0+140./ncol*(i+1));
948 box->SetFillStyle(1001);
949 box->SetFillColor(gStyle->GetColorPalette(i));
954 TGaxis *mpaxis =
new TGaxis(330,0,330,140,mmin,mmax,510,
"SL+");
955 mpaxis->SetTickSize(.02);
956 mpaxis->SetLabelOffset(mpaxis->GetLabelOffset()*0.5);
957 mpalette.Add(mpaxis);
959 TCanvas* cc2 =
new TCanvas(
"multmap",
"multmap",1000,500);
960 cc2->Range(-370.,-20.,390.,150.);
961 TFrame* fr2 =
new TFrame(-310,0,310,140);
962 fr2->UseCurrentStyle();
964 raxis->Draw(); zaxis->Draw();
965 std::cout << modulesmult.GetSize() << std::endl;
977 gROOT->SetStyle(
"Plain");
979 TCanvas* cc =
new TCanvas(name,name,750,750);
980 cc->Range(-25,-25,25,25);
981 TFrame* fr1 =
new TFrame(-20,-20,20,20);
982 fr1->UseCurrentStyle();
986 TProfile* avex = (TProfile*)gDirectory->Get(
"avex");
987 TProfile* avey = (TProfile*)gDirectory->Get(
"avey");
988 TProfile* avez = (TProfile*)gDirectory->Get(
"avez");
990 if(avex && avey && avez) {
991 TText* tittext =
new TText(0,0,name);
992 tittext->SetTextSize(.04); tittext->SetTextAlign(22);
994 for(
unsigned int mod=ioffset+1;
mod<ioffset+57;++
mod) {
995 double x = avex->GetBinContent(
mod);
996 double y = avey->GetBinContent(
mod);
999 sprintf(modstring,
"%d",
mod%100);
1000 TText* modtext =
new TText(x,y,modstring);
1001 modtext->SetTextAngle(atan(y/x)*180/3.14159);
1002 modtext->SetTextSize(.02); modtext->SetTextAlign(22); modtext->SetTextColor(kRed);
1007 for(
unsigned int mod=ioffset+101;
mod<ioffset+157;++
mod) {
1008 double x = avex->GetBinContent(
mod);
1009 double y = avey->GetBinContent(
mod);
1012 sprintf(modstring,
"%d",
mod%100);
1013 TText* modtext =
new TText(x,y,modstring);
1014 modtext->SetTextAngle(atan(y/x)*180/3.14159);
1015 modtext->SetTextSize(.02); modtext->SetTextAlign(22); modtext->SetTextColor(kBlue);
1016 std::cout <<
mod <<
" " << x <<
" " << y <<
" " << atan(y/x) << std::endl;
void PlotDebugFPIX_XYMap(TFile *ff, const char *module, const unsigned int ioffset, const char *name)
common ppss p3p6s2 common epss epspn46 common const1 w2
void PlotOccupancyMap(TFile *ff, const char *module, const float min, const float max, const float mmin, const float mmax, const int color)
void printFrame(TCanvas *c, TH1D *h, TText *t, const int frame, const int min, const int max)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
float combinedOccupancy(TFile *ff, const char *module, const int lowerbin, const int upperbin)
void PlotOnTrackOccupancyPhase2(TFile *ff, const char *module, const char *ontrkmod, const float mmin, const float mmax, const int color)
void PlotOccupancyMapPhase2(TFile *ff, const char *module, const float min, const float max, const float mmin, const float mmax, const int color)
T mod(const T &a, const T &b)