24 gROOT->SetStyle(
"Plain");
28 const Int_t NRGBs = 5;
29 const Int_t NCont = 255;
30 Double_t stops[NRGBs] = { 0.00, 0.25, 0.50, 0.75, 1.00 };
31 Double_t
red[NRGBs] = { 0.00, 0.00, 0.40, 1.00, 1.00 };
32 Double_t
green[NRGBs] = { 0.00, 0.40, 0.70, 0.60, 1.00 };
33 Double_t blue[NRGBs] = { 0.30, 0.60, 0.00, 0.00, 0.20 };
34 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
35 gStyle->SetNumberContours(NCont);
39 const Int_t NRGBs = 3;
40 const Int_t NCont = 255;
41 Double_t stops[NRGBs] = { 0.00, 0.50, 1.00 };
42 Double_t red[NRGBs] = { 0.90, 0.50, 0.00};
43 Double_t green[NRGBs] = { 0.90, 0.50, 0.00};
44 Double_t blue[NRGBs] = { 0.90, 0.50, 0.00};
45 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
46 gStyle->SetNumberContours(NCont);
50 const Int_t NRGBs = 7;
51 const Int_t NCont = 255;
52 Double_t stops[NRGBs] = { 0.00, 0.15, 0.30, 0.45, 0.65, 0.85, 1.00 };
53 Double_t red[NRGBs] = { 0.60, 0.30, 0.00, 0.00, 0.60, 0.40, 0.00 };
54 Double_t green[NRGBs] = { 1.00, 0.90, 0.80, 0.75, 0.20, 0.00, 0.00 };
55 Double_t blue[NRGBs] = { 1.00, 1.00, 1.00, 0.30, 0.00, 0.00, 0.00 };
56 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
57 gStyle->SetNumberContours(NCont);
60 int ncol = gStyle->GetNumberOfColors();
61 std::cout <<
"Number of colors " << ncol << std::endl;
65 TProfile* aveoccu= (TProfile*)gDirectory->Get(
"aveoccu");
66 TProfile* avemult= (TProfile*)gDirectory->Get(
"avemult");
67 TH1F* nchannels = (TH1F*)gDirectory->Get(
"nchannels_real");
69 TProfile* averadius = (TProfile*)gDirectory->Get(
"averadius");
70 TProfile* avez = (TProfile*)gDirectory->Get(
"avez");
72 std::cout <<
"pointers " << aveoccu <<
" " << avemult <<
" " << nchannels <<
" " << averadius <<
" " << avez << std::endl;
74 if(aveoccu && avemult && nchannels && averadius && avez) {
77 for(
int i=1;
i<nchannels->GetNbinsX()+1;++
i) {
78 nchannels->SetBinError(
i,0.);
81 TH1D* haveoccu = aveoccu->ProjectionX(
"haveoccu");
82 haveoccu->SetDirectory(0);
83 haveoccu->Divide(nchannels);
84 TH1D* havemult = avemult->ProjectionX(
"havemult");
85 havemult->SetDirectory(0);
86 havemult->Divide(nchannels);
88 TH1D* havewidth = (TH1D*)haveoccu->Clone(
"havewidth");
89 havewidth->SetDirectory(0);
90 havewidth->SetTitle(
"Average Cluster Size");
91 havewidth->Divide(havemult);
94 new TCanvas(
"occupancy",
"occupancy",1200,500);
96 haveoccu->SetStats(0);
98 TLine* l1 =
new TLine(1000,0,1000,haveoccu->GetMaximum()); l1->DrawClone();
99 TLine* l2 =
new TLine(2000,0,2000,haveoccu->GetMaximum()); l2->DrawClone();
100 TLine* l3 =
new TLine(3000,0,3000,haveoccu->GetMaximum()); l3->DrawClone();
101 TLine* l4 =
new TLine(4000,0,4000,haveoccu->GetMaximum()); l4->DrawClone();
102 TLine* l5 =
new TLine(5000,0,5000,haveoccu->GetMaximum()); l5->DrawClone();
103 TText* tpix =
new TText(500,haveoccu->GetMaximum(),
"BPIX+FPIX"); tpix->SetTextAlign(22); tpix->DrawClone();
104 TText* ttib =
new TText(1500,haveoccu->GetMaximum(),
"TIB"); ttib->SetTextAlign(22); ttib->DrawClone();
105 TText* ttid =
new TText(2500,haveoccu->GetMaximum(),
"TID"); ttid->SetTextAlign(22); ttid->DrawClone();
106 TText* ttob =
new TText(3500,haveoccu->GetMaximum(),
"TOB"); ttob->SetTextAlign(22); ttob->DrawClone();
107 TText* ttecm =
new TText(4500,haveoccu->GetMaximum(),
"TEC-"); ttecm->SetTextAlign(22); ttecm->DrawClone();
108 TText* ttecp =
new TText(5500,haveoccu->GetMaximum(),
"TEC+"); ttecp->SetTextAlign(22); ttecp->DrawClone();
110 new TCanvas(
"multiplicity",
"multiplicity",1200,500);
112 havemult->SetStats(0);
113 havemult->DrawCopy();
114 tpix->SetY(havemult->GetMaximum()); tpix->DrawClone();
115 ttib->SetY(havemult->GetMaximum()); ttib->DrawClone();
116 ttid->SetY(havemult->GetMaximum()); ttid->DrawClone();
117 ttob->SetY(havemult->GetMaximum()); ttob->DrawClone();
118 ttecm->SetY(havemult->GetMaximum()); ttecm->DrawClone();
119 ttecp->SetY(havemult->GetMaximum()); ttecp->DrawClone();
120 l1->SetY2(havemult->GetMaximum()); l1->DrawClone();
121 l2->SetY2(havemult->GetMaximum()); l2->DrawClone();
122 l3->SetY2(havemult->GetMaximum()); l3->DrawClone();
123 l4->SetY2(havemult->GetMaximum()); l4->DrawClone();
124 l5->SetY2(havemult->GetMaximum()); l5->DrawClone();
126 new TCanvas(
"width",
"width",1200,500);
127 havewidth->SetStats(0);
128 havewidth->DrawCopy();
129 tpix->SetY(havewidth->GetMaximum()); tpix->DrawClone();
130 ttib->SetY(havewidth->GetMaximum()); ttib->DrawClone();
131 ttid->SetY(havewidth->GetMaximum()); ttid->DrawClone();
132 ttob->SetY(havewidth->GetMaximum()); ttob->DrawClone();
133 ttecm->SetY(havewidth->GetMaximum()); ttecm->DrawClone();
134 ttecp->SetY(havewidth->GetMaximum()); ttecp->DrawClone();
135 l1->SetY2(havewidth->GetMaximum()); l1->DrawClone();
136 l2->SetY2(havewidth->GetMaximum()); l2->DrawClone();
137 l3->SetY2(havewidth->GetMaximum()); l3->DrawClone();
138 l4->SetY2(havewidth->GetMaximum()); l4->DrawClone();
139 l5->SetY2(havewidth->GetMaximum()); l5->DrawClone();
141 TCanvas * o2 =
new TCanvas(
"occupancy2",
"occupancy2",1200,800);
144 haveoccu->SetAxisRange(100,270);
145 haveoccu->DrawCopy();
146 tpix->SetY(haveoccu->GetMaximum()); tpix->SetX(185); tpix->DrawClone();
148 haveoccu->SetAxisRange(1050,1450);
149 haveoccu->DrawCopy();
150 ttib->SetY(haveoccu->GetMaximum()); ttib->SetX(1250); ttib->DrawClone();
152 haveoccu->SetAxisRange(2070,2400);
153 haveoccu->DrawCopy();
154 ttid->SetY(haveoccu->GetMaximum()); ttid->SetX(2235); ttid->DrawClone();
156 haveoccu->SetAxisRange(3000,3700);
157 haveoccu->DrawCopy();
158 ttob->SetY(haveoccu->GetMaximum()); ttob->SetX(3350); ttob->DrawClone();
160 haveoccu->SetAxisRange(4000,4850);
161 haveoccu->DrawCopy();
162 ttecm->SetY(haveoccu->GetMaximum()); ttecm->SetX(4425); ttecm->DrawClone();
164 haveoccu->SetAxisRange(5000,5850);
165 haveoccu->DrawCopy();
166 ttecp->SetY(haveoccu->GetMaximum()); ttecp->SetX(5425); ttecp->DrawClone();
168 TCanvas * m2 =
new TCanvas(
"multiplicity2",
"multiplicity2",1200,800);
171 havemult->SetAxisRange(100,270);
172 havemult->DrawCopy();
173 tpix->SetY(havemult->GetMaximum()); tpix->SetX(185); tpix->DrawClone();
175 havemult->SetAxisRange(1050,1450);
176 havemult->DrawCopy();
177 ttib->SetY(havemult->GetMaximum()); ttib->SetX(1250); ttib->DrawClone();
179 havemult->SetAxisRange(2070,2400);
180 havemult->DrawCopy();
181 ttid->SetY(havemult->GetMaximum()); ttid->SetX(2235); ttid->DrawClone();
183 havemult->SetAxisRange(3000,3700);
184 havemult->DrawCopy();
185 ttob->SetY(havemult->GetMaximum()); ttob->SetX(3350); ttob->DrawClone();
187 havemult->SetAxisRange(4000,4850);
188 havemult->DrawCopy();
189 ttecm->SetY(havemult->GetMaximum()); ttecm->SetX(4425); ttecm->DrawClone();
191 havemult->SetAxisRange(5000,5850);
192 havemult->DrawCopy();
193 ttecp->SetY(havemult->GetMaximum()); ttecp->SetX(5425); ttecp->DrawClone();
195 TCanvas *
w2 =
new TCanvas(
"width2",
"width2",1200,800);
198 havewidth->SetAxisRange(100,270);
199 havewidth->DrawCopy();
200 tpix->SetY(havewidth->GetMaximum()); tpix->SetX(185); tpix->DrawClone();
202 havewidth->SetAxisRange(1050,1450);
203 havewidth->DrawCopy();
204 ttib->SetY(havewidth->GetMaximum()); ttib->SetX(1250); ttib->DrawClone();
206 havewidth->SetAxisRange(2070,2400);
207 havewidth->DrawCopy();
208 ttid->SetY(havewidth->GetMaximum()); ttid->SetX(2235); ttid->DrawClone();
210 havewidth->SetAxisRange(3000,3700);
211 havewidth->DrawCopy();
212 ttob->SetY(havewidth->GetMaximum()); ttob->SetX(3350); ttob->DrawClone();
214 havewidth->SetAxisRange(4000,4850);
215 havewidth->DrawCopy();
216 ttecm->SetY(havewidth->GetMaximum()); ttecm->SetX(4425); ttecm->DrawClone();
218 havewidth->SetAxisRange(5000,5850);
219 havewidth->DrawCopy();
220 ttecp->SetY(havewidth->GetMaximum()); ttecp->SetX(5425); ttecp->DrawClone();
227 for(
int i=1;
i<haveoccu->GetNbinsX();++
i) {
229 if(averadius->GetBinEntries(
i)*avez->GetBinEntries(
i)) {
235 if(
i > 100 &&
i < 200) { dz=3.33;dr=0.4;}
237 if(
i > 200 &&
i < 1000 && (
i%10 == 1 ||
i%10 == 7)) { dz=0.8;dr=0.4;}
238 if(
i > 200 &&
i < 1000 && !(
i%10 == 1 ||
i%10 == 7)) { dz=0.8;dr=0.8;}
240 if(
i > 1000 &&
i < 2000) { dz=5.948;dr=0.4;}
242 if(
i > 3000 &&
i < 4000) { dz=9.440;dr=0.4;}
244 if(
i > 2000 &&
i < 3000 && (
i%1000)/100 == 1) { dz=0.8;dr=5.647;}
245 if(
i > 2000 &&
i < 3000 && (
i%1000)/100 == 2) { dz=0.8;dr=4.512;}
246 if(
i > 2000 &&
i < 3000 && (
i%1000)/100 == 3) { dz=0.8;dr=5.637;}
248 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 1) { dz=0.8;dr=4.362;}
249 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 2) { dz=0.8;dr=4.512;}
250 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 3) { dz=0.8;dr=5.637;}
251 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 4) { dz=0.8;dr=5.862;}
252 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 5) { dz=0.8;dr=7.501;}
253 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 6) { dz=0.8;dr=9.336;}
254 if(
i > 4000 &&
i < 6000 && (
i%1000)/100 == 7) { dz=0.8;dr=10.373;}
257 TBox* modoccu =
new TBox(avez->GetBinContent(
i)-dz,averadius->GetBinContent(
i)-dr,avez->GetBinContent(
i)+dz,averadius->GetBinContent(
i)+dr);
258 modoccu->SetFillStyle(1001);
261 if(icol > (ncol-1)) icol=(ncol-1);
262 std::cout <<
i <<
" " << icol <<
" " << haveoccu->GetBinContent(
i) << std::endl;
263 modoccu->SetFillColor(gStyle->GetColorPalette(icol));
264 modulesoccu.Add(modoccu);
267 TBox* modmult =
new TBox(avez->GetBinContent(
i)-dz,averadius->GetBinContent(
i)-dr,avez->GetBinContent(
i)+dz,averadius->GetBinContent(
i)+dr);
268 modmult->SetFillStyle(1001);
269 int icol=int(ncol*(
log(havemult->GetBinContent(
i))-
log(mmin))/(
log(mmax)-
log(mmin)));
271 if(icol > (ncol-1)) icol=(ncol-1);
272 std::cout <<
i <<
" " << icol <<
" " << havemult->GetBinContent(
i) << std::endl;
273 modmult->SetFillColor(gStyle->GetColorPalette(icol));
274 modulesmult.Add(modmult);
284 for(
int i=0;
i<8;++
i) {
285 double eta = 3.0-
i*0.2;
286 TLine* lin =
new TLine(295,2*295/(
exp(eta)-
exp(-eta)),305,2*305/(
exp(eta)-
exp(-eta)));
289 sprintf(lab,
"%3.1f",eta);
290 TText*
label =
new TText(285,2*285/(
exp(eta)-
exp(-eta)),lab);
291 label->SetTextSize(.03);
292 label->SetTextAlign(22);
293 etalabels.Add(label);
295 for(
int i=0;
i<8;++
i) {
296 double eta = -3.0+
i*0.2;
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<15;++
i) {
307 double eta = -1.4+
i*0.2;
308 TLine* lin =
new TLine(130.*(
exp(eta)-
exp(-eta))/2.,130,138.*(
exp(eta)-
exp(-eta))/2.,138);
311 sprintf(lab,
"%3.1f",eta);
312 TText* label =
new TText(125.*(
exp(eta)-
exp(-eta))/2.,125,lab);
313 label->SetTextSize(.03);
314 label->SetTextAlign(22);
315 etalabels.Add(label);
317 TLatex* etalab =
new TLatex(0,115,
"#eta");
318 etalab->SetTextSize(.03);
319 etalab->SetTextAlign(22);
320 etalabels.Add(etalab);
323 TLatex *cmslab =
new TLatex(0.15,0.965,
"CMS");
325 cmslab->SetTextSize(0.04);
326 cmslab->SetTextAlign(31);
327 paperlabels.Add(cmslab);
328 TLatex *enelab =
new TLatex(0.92,0.965,
"#sqrt{s} = 7 TeV");
330 enelab->SetTextSize(0.04);
331 enelab->SetTextAlign(31);
332 paperlabels.Add(enelab);
341 TGaxis *raxis =
new TGaxis(-310,0,-310,140,0,140,10,
"S");
342 TGaxis *zaxis =
new TGaxis(-310,0,310,0,-310,310,10,
"S");
343 raxis->SetTickSize(.01); zaxis->SetTickSize(.01);
344 raxis->SetTitle(
"r (cm)"); zaxis->SetTitle(
"z (cm)");
349 for(
int i = 0;
i< ncol ; ++
i) {
350 TBox* box=
new TBox(315,0+140./ncol*
i,330,0+140./ncol*(i+1));
351 box->SetFillStyle(1001);
352 box->SetFillColor(gStyle->GetColorPalette(i));
358 TGaxis *paxis =
new TGaxis(330,0,330,140,
min,
max,510,
"SLG+");
359 paxis->SetTickSize(.02);
360 paxis->SetLabelOffset(paxis->GetLabelOffset()*0.5);
361 paxis->SetTitle(
"channel occupancy");
364 TGaxis *mpaxis =
new TGaxis(330,0,330,140,mmin,mmax,510,
"SLG+");
365 mpaxis->SetTickSize(.02);
366 mpaxis->SetLabelOffset(paxis->GetLabelOffset()*0.5);
367 mpalette.Add(mpaxis);
369 TCanvas* cc1 =
new TCanvas(
"occumap",
"occumap",1000,500);
370 cc1->Range(-370.,-20.,390.,150.);
371 TFrame* fr1 =
new TFrame(-310,0,310,140);
372 fr1->UseCurrentStyle();
374 raxis->Draw(); zaxis->Draw();
375 std::cout << modulesoccu.GetSize() << std::endl;
382 TCanvas* cc2 =
new TCanvas(
"multmap",
"multmap",1000,500);
383 cc2->Range(-370.,-20.,390.,150.);
384 TFrame* fr2 =
new TFrame(-310,0,310,140);
385 fr2->UseCurrentStyle();
387 raxis->Draw(); zaxis->Draw();
388 std::cout << modulesmult.GetSize() << std::endl;
common ppss p3p6s2 common epss epspn46 common const1 w2
const T & max(const T &a, const T &b)