5 #include "TDirectory.h"
23 gROOT->SetStyle(
"Plain");
27 const Int_t NRGBs = 5;
28 const Int_t NCont = 255;
29 Double_t stops[NRGBs] = { 0.00, 0.25, 0.50, 0.75, 1.00 };
30 Double_t
red[NRGBs] = { 0.00, 0.00, 0.40, 1.00, 1.00 };
31 Double_t
green[NRGBs] = { 0.00, 0.40, 0.70, 0.60, 1.00 };
32 Double_t blue[NRGBs] = { 0.30, 0.60, 0.00, 0.00, 0.20 };
33 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
34 gStyle->SetNumberContours(NCont);
38 const Int_t NRGBs = 3;
39 const Int_t NCont = 255;
40 Double_t stops[NRGBs] = { 0.00, 0.50, 1.00 };
41 Double_t
red[NRGBs] = { 0.90, 0.50, 0.00};
42 Double_t
green[NRGBs] = { 0.90, 0.50, 0.00};
43 Double_t blue[NRGBs] = { 0.90, 0.50, 0.00};
44 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
45 gStyle->SetNumberContours(NCont);
49 const Int_t NRGBs = 7;
50 const Int_t NCont = 255;
51 Double_t stops[NRGBs] = { 0.00, 0.15, 0.30, 0.45, 0.65, 0.85, 1.00 };
52 Double_t
red[NRGBs] = { 0.60, 0.30, 0.00, 0.00, 0.60, 0.40, 0.00 };
53 Double_t
green[NRGBs] = { 1.00, 0.90, 0.80, 0.75, 0.20, 0.00, 0.00 };
54 Double_t blue[NRGBs] = { 1.00, 1.00, 1.00, 0.30, 0.00, 0.00, 0.00 };
55 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
56 gStyle->SetNumberContours(NCont);
59 int ncol = gStyle->GetNumberOfColors();
60 std::cout <<
"Number of colors " << ncol << std::endl;
64 TProfile* aveoccu= (TProfile*)gDirectory->Get(
"aveoccu");
65 TProfile* avemult= (TProfile*)gDirectory->Get(
"avemult");
66 TH1F* nchannels = (TH1F*)gDirectory->Get(
"nchannels_real");
68 TProfile* averadius = (TProfile*)gDirectory->Get(
"averadius");
69 TProfile* avez = (TProfile*)gDirectory->Get(
"avez");
71 std::cout <<
"pointers " << aveoccu <<
" " << avemult <<
" " << nchannels <<
" " << averadius <<
" " << avez << std::endl;
73 if(aveoccu && avemult && nchannels && averadius && avez) {
76 for(
int i=1;
i<nchannels->GetNbinsX()+1;++
i) {
77 nchannels->SetBinError(
i,0.);
80 TH1D* haveoccu = aveoccu->ProjectionX(
"haveoccu");
81 haveoccu->SetDirectory(0);
82 haveoccu->Divide(nchannels);
83 TH1D* havemult = avemult->ProjectionX(
"havemult");
84 havemult->SetDirectory(0);
85 havemult->Divide(nchannels);
87 TH1D* havewidth = (TH1D*)haveoccu->Clone(
"havewidth");
88 havewidth->SetDirectory(0);
89 havewidth->SetTitle(
"Average Cluster Size");
90 havewidth->Divide(havemult);
93 new TCanvas(
"occupancy",
"occupancy",1200,500);
95 haveoccu->SetStats(0);
97 TLine* l1 =
new TLine(1000,0,1000,haveoccu->GetMaximum()); l1->DrawClone();
98 TLine* l2 =
new TLine(2000,0,2000,haveoccu->GetMaximum()); l2->DrawClone();
99 TLine* l3 =
new TLine(3000,0,3000,haveoccu->GetMaximum()); l3->DrawClone();
100 TLine* l4 =
new TLine(4000,0,4000,haveoccu->GetMaximum()); l4->DrawClone();
101 TLine* l5 =
new TLine(5000,0,5000,haveoccu->GetMaximum()); l5->DrawClone();
102 TText* tpix =
new TText(500,haveoccu->GetMaximum(),
"BPIX+FPIX"); tpix->SetTextAlign(22); tpix->DrawClone();
103 TText* ttib =
new TText(1500,haveoccu->GetMaximum(),
"TIB"); ttib->SetTextAlign(22); ttib->DrawClone();
104 TText* ttid =
new TText(2500,haveoccu->GetMaximum(),
"TID"); ttid->SetTextAlign(22); ttid->DrawClone();
105 TText* ttob =
new TText(3500,haveoccu->GetMaximum(),
"TOB"); ttob->SetTextAlign(22); ttob->DrawClone();
106 TText* ttecm =
new TText(4500,haveoccu->GetMaximum(),
"TEC-"); ttecm->SetTextAlign(22); ttecm->DrawClone();
107 TText* ttecp =
new TText(5500,haveoccu->GetMaximum(),
"TEC+"); ttecp->SetTextAlign(22); ttecp->DrawClone();
109 new TCanvas(
"multiplicity",
"multiplicity",1200,500);
111 havemult->SetStats(0);
112 havemult->DrawCopy();
113 tpix->SetY(havemult->GetMaximum()); tpix->DrawClone();
114 ttib->SetY(havemult->GetMaximum()); ttib->DrawClone();
115 ttid->SetY(havemult->GetMaximum()); ttid->DrawClone();
116 ttob->SetY(havemult->GetMaximum()); ttob->DrawClone();
117 ttecm->SetY(havemult->GetMaximum()); ttecm->DrawClone();
118 ttecp->SetY(havemult->GetMaximum()); ttecp->DrawClone();
119 l1->SetY2(havemult->GetMaximum()); l1->DrawClone();
120 l2->SetY2(havemult->GetMaximum()); l2->DrawClone();
121 l3->SetY2(havemult->GetMaximum()); l3->DrawClone();
122 l4->SetY2(havemult->GetMaximum()); l4->DrawClone();
123 l5->SetY2(havemult->GetMaximum()); l5->DrawClone();
125 new TCanvas(
"width",
"width",1200,500);
126 havewidth->SetStats(0);
127 havewidth->DrawCopy();
128 tpix->SetY(havewidth->GetMaximum()); tpix->DrawClone();
129 ttib->SetY(havewidth->GetMaximum()); ttib->DrawClone();
130 ttid->SetY(havewidth->GetMaximum()); ttid->DrawClone();
131 ttob->SetY(havewidth->GetMaximum()); ttob->DrawClone();
132 ttecm->SetY(havewidth->GetMaximum()); ttecm->DrawClone();
133 ttecp->SetY(havewidth->GetMaximum()); ttecp->DrawClone();
134 l1->SetY2(havewidth->GetMaximum()); l1->DrawClone();
135 l2->SetY2(havewidth->GetMaximum()); l2->DrawClone();
136 l3->SetY2(havewidth->GetMaximum()); l3->DrawClone();
137 l4->SetY2(havewidth->GetMaximum()); l4->DrawClone();
138 l5->SetY2(havewidth->GetMaximum()); l5->DrawClone();
140 TCanvas * o2 =
new TCanvas(
"occupancy2",
"occupancy2",1200,800);
143 haveoccu->SetAxisRange(100,270);
144 haveoccu->DrawCopy();
145 tpix->SetY(haveoccu->GetMaximum()); tpix->SetX(185); tpix->DrawClone();
147 haveoccu->SetAxisRange(1050,1450);
148 haveoccu->DrawCopy();
149 ttib->SetY(haveoccu->GetMaximum()); ttib->SetX(1250); ttib->DrawClone();
151 haveoccu->SetAxisRange(2070,2400);
152 haveoccu->DrawCopy();
153 ttid->SetY(haveoccu->GetMaximum()); ttid->SetX(2235); ttid->DrawClone();
155 haveoccu->SetAxisRange(3000,3700);
156 haveoccu->DrawCopy();
157 ttob->SetY(haveoccu->GetMaximum()); ttob->SetX(3350); ttob->DrawClone();
159 haveoccu->SetAxisRange(4000,4850);
160 haveoccu->DrawCopy();
161 ttecm->SetY(haveoccu->GetMaximum()); ttecm->SetX(4425); ttecm->DrawClone();
163 haveoccu->SetAxisRange(5000,5850);
164 haveoccu->DrawCopy();
165 ttecp->SetY(haveoccu->GetMaximum()); ttecp->SetX(5425); ttecp->DrawClone();
167 TCanvas * m2 =
new TCanvas(
"multiplicity2",
"multiplicity2",1200,800);
170 havemult->SetAxisRange(100,270);
171 havemult->DrawCopy();
172 tpix->SetY(havemult->GetMaximum()); tpix->SetX(185); tpix->DrawClone();
174 havemult->SetAxisRange(1050,1450);
175 havemult->DrawCopy();
176 ttib->SetY(havemult->GetMaximum()); ttib->SetX(1250); ttib->DrawClone();
178 havemult->SetAxisRange(2070,2400);
179 havemult->DrawCopy();
180 ttid->SetY(havemult->GetMaximum()); ttid->SetX(2235); ttid->DrawClone();
182 havemult->SetAxisRange(3000,3700);
183 havemult->DrawCopy();
184 ttob->SetY(havemult->GetMaximum()); ttob->SetX(3350); ttob->DrawClone();
186 havemult->SetAxisRange(4000,4850);
187 havemult->DrawCopy();
188 ttecm->SetY(havemult->GetMaximum()); ttecm->SetX(4425); ttecm->DrawClone();
190 havemult->SetAxisRange(5000,5850);
191 havemult->DrawCopy();
192 ttecp->SetY(havemult->GetMaximum()); ttecp->SetX(5425); ttecp->DrawClone();
194 TCanvas *
w2 =
new TCanvas(
"width2",
"width2",1200,800);
197 havewidth->SetAxisRange(100,270);
198 havewidth->DrawCopy();
199 tpix->SetY(havewidth->GetMaximum()); tpix->SetX(185); tpix->DrawClone();
201 havewidth->SetAxisRange(1050,1450);
202 havewidth->DrawCopy();
203 ttib->SetY(havewidth->GetMaximum()); ttib->SetX(1250); ttib->DrawClone();
205 havewidth->SetAxisRange(2070,2400);
206 havewidth->DrawCopy();
207 ttid->SetY(havewidth->GetMaximum()); ttid->SetX(2235); ttid->DrawClone();
209 havewidth->SetAxisRange(3000,3700);
210 havewidth->DrawCopy();
211 ttob->SetY(havewidth->GetMaximum()); ttob->SetX(3350); ttob->DrawClone();
213 havewidth->SetAxisRange(4000,4850);
214 havewidth->DrawCopy();
215 ttecm->SetY(havewidth->GetMaximum()); ttecm->SetX(4425); ttecm->DrawClone();
217 havewidth->SetAxisRange(5000,5850);
218 havewidth->DrawCopy();
219 ttecp->SetY(havewidth->GetMaximum()); ttecp->SetX(5425); ttecp->DrawClone();
226 for(
int i=1;
i<haveoccu->GetNbinsX();++
i) {
228 if(averadius->GetBinEntries(
i)*avez->GetBinEntries(
i)) {
234 if(
i > 100 &&
i < 200) { dz=3.33;dr=0.4;}
236 if(
i > 200 &&
i < 1000 && (
i%10 == 1 ||
i%10 == 7)) { dz=0.8;dr=0.4;}
237 if(
i > 200 &&
i < 1000 && !(
i%10 == 1 ||
i%10 == 7)) { dz=0.8;dr=0.8;}
239 if(
i > 1000 &&
i < 2000) { dz=5.948;dr=0.4;}
241 if(
i > 3000 &&
i < 4000) { dz=9.440;dr=0.4;}
243 if(
i > 2000 &&
i < 3000 && (
i%1000)/100 == 1) { dz=0.8;dr=5.647;}
244 if(
i > 2000 &&
i < 3000 && (
i%1000)/100 == 2) { dz=0.8;dr=4.512;}
245 if(
i > 2000 &&
i < 3000 && (
i%1000)/100 == 3) { dz=0.8;dr=5.637;}
247 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 1) { dz=0.8;dr=4.362;}
248 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 2) { dz=0.8;dr=4.512;}
249 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 3) { dz=0.8;dr=5.637;}
250 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 4) { dz=0.8;dr=5.862;}
251 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 5) { dz=0.8;dr=7.501;}
252 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 6) { dz=0.8;dr=9.336;}
253 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 7) { dz=0.8;dr=10.373;}
256 TBox* modoccu =
new TBox(avez->GetBinContent(
i)-dz,averadius->GetBinContent(
i)-dr,avez->GetBinContent(
i)+dz,averadius->GetBinContent(
i)+dr);
257 modoccu->SetFillStyle(1001);
258 int icol=int(ncol*(
log(haveoccu->GetBinContent(
i))-
log(min))/(
log(max)-
log(min)));
260 if(icol > (ncol-1)) icol=(ncol-1);
261 std::cout <<
i <<
" " << icol <<
" " << haveoccu->GetBinContent(
i) << std::endl;
262 modoccu->SetFillColor(gStyle->GetColorPalette(icol));
263 modulesoccu.Add(modoccu);
266 TBox* modmult =
new TBox(avez->GetBinContent(
i)-dz,averadius->GetBinContent(
i)-dr,avez->GetBinContent(
i)+dz,averadius->GetBinContent(
i)+dr);
267 modmult->SetFillStyle(1001);
268 int icol=int(ncol*(
log(havemult->GetBinContent(
i))-
log(mmin))/(
log(mmax)-
log(mmin)));
270 if(icol > (ncol-1)) icol=(ncol-1);
271 std::cout <<
i <<
" " << icol <<
" " << havemult->GetBinContent(
i) << std::endl;
272 modmult->SetFillColor(gStyle->GetColorPalette(icol));
273 modulesmult.Add(modmult);
282 for(
int i=0;
i<8;++
i) {
283 double eta = 3.0-
i*0.2;
284 TLine* lin =
new TLine(295,2*295/(
exp(eta)-
exp(-eta)),305,2*305/(
exp(eta)-
exp(-eta)));
287 sprintf(lab,
"%3.1f",eta);
288 TText*
label =
new TText(285,2*285/(
exp(eta)-
exp(-eta)),lab);
289 label->SetTextSize(.03);
290 label->SetTextAlign(22);
291 etalabels.Add(label);
293 for(
int i=0;
i<8;++
i) {
294 double eta = -3.0+
i*0.2;
295 TLine* lin =
new TLine(-295,-2*295/(
exp(eta)-
exp(-eta)),-305,-2*305/(
exp(eta)-
exp(-eta)));
298 sprintf(lab,
"%3.1f",eta);
299 TText*
label =
new TText(-285,-2*285/(
exp(eta)-
exp(-eta)),lab);
300 label->SetTextSize(.03);
301 label->SetTextAlign(22);
302 etalabels.Add(label);
304 for(
int i=0;
i<15;++
i) {
305 double eta = -1.4+
i*0.2;
306 TLine* lin =
new TLine(130.*(
exp(eta)-
exp(-eta))/2.,130,138.*(
exp(eta)-
exp(-eta))/2.,138);
309 sprintf(lab,
"%3.1f",eta);
310 TText*
label =
new TText(125.*(
exp(eta)-
exp(-eta))/2.,125,lab);
311 label->SetTextSize(.03);
312 label->SetTextAlign(22);
313 etalabels.Add(label);
317 TGaxis *raxis =
new TGaxis(-310,0,-310,140,0,140,10,
"S");
318 TGaxis *zaxis =
new TGaxis(-310,0,310,0,-310,310,10,
"S");
319 raxis->SetTickSize(.01); zaxis->SetTickSize(.01);
320 raxis->SetTitle(
"R (cm)"); zaxis->SetTitle(
"Z (cm)");
325 for(
int i = 0;
i< ncol ; ++
i) {
326 TBox* box=
new TBox(315,0+140./ncol*
i,330,0+140./ncol*(i+1));
327 box->SetFillStyle(1001);
328 box->SetFillColor(gStyle->GetColorPalette(i));
334 TGaxis *paxis =
new TGaxis(330,0,330,140,min,max,510,
"SLG+");
335 paxis->SetTickSize(.02);
336 paxis->SetLabelOffset(paxis->GetLabelOffset()*0.5);
339 TGaxis *mpaxis =
new TGaxis(330,0,330,140,mmin,mmax,510,
"SLG+");
340 mpaxis->SetTickSize(.02);
341 mpaxis->SetLabelOffset(paxis->GetLabelOffset()*0.5);
342 mpalette.Add(mpaxis);
344 TCanvas* cc1 =
new TCanvas(
"occumap",
"occumap",1000,500);
345 cc1->Range(-370.,-20.,390.,150.);
346 TFrame* fr1 =
new TFrame(-310,0,310,140);
347 fr1->UseCurrentStyle();
349 raxis->Draw(); zaxis->Draw();
350 std::cout << modulesoccu.GetSize() << std::endl;
356 TCanvas* cc2 =
new TCanvas(
"multmap",
"multmap",1000,500);
357 cc2->Range(-370.,-20.,390.,150.);
358 TFrame* fr2 =
new TFrame(-310,0,310,140);
359 fr2->UseCurrentStyle();
361 raxis->Draw(); zaxis->Draw();
362 std::cout << modulesmult.GetSize() << std::endl;
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)
const T & max(const T &a, const T &b)