6 #include "TDirectory.h"
31 float dz=-1;
float dr=-1;
33 if(i > 100 && i < 200) { dz=3.33;dr=0.4;}
35 if(i > 200 && i < 1000 && ( i%10 == 1 || i%10 == 7)) { dz=0.8;dr=0.4;}
36 if(i > 200 && i < 1000 && !( i%10 == 1 || i%10 == 7)) { dz=0.8;dr=0.8;}
38 if(i > 1000 && i < 2000) { dz=5.948;dr=0.4;}
40 if(i > 3000 && i < 4000) { dz=9.440;dr=0.4;}
42 if(i > 2000 && i < 3000 && (i%1000)/100 == 1) { dz=0.8;dr=5.647;}
43 if(i > 2000 && i < 3000 && (i%1000)/100 == 2) { dz=0.8;dr=4.512;}
44 if(i > 2000 && i < 3000 && (i%1000)/100 == 3) { dz=0.8;dr=5.637;}
46 if(i > 4000 && i < 6000 && (i%1000)/100 == 1) { dz=0.8;dr=4.362;}
47 if(i > 4000 && i < 6000 && (i%1000)/100 == 2) { dz=0.8;dr=4.512;}
48 if(i > 4000 && i < 6000 && (i%1000)/100 == 3) { dz=0.8;dr=5.637;}
49 if(i > 4000 && i < 6000 && (i%1000)/100 == 4) { dz=0.8;dr=5.862;}
50 if(i > 4000 && i < 6000 && (i%1000)/100 == 5) { dz=0.8;dr=7.501;}
51 if(i > 4000 && i < 6000 && (i%1000)/100 == 6) { dz=0.8;dr=9.336;}
52 if(i > 4000 && i < 6000 && (i%1000)/100 == 7) { dz=0.8;dr=10.373;}
54 std::pair<float,float> res(dz,dr);
60 float dz=-1;
float dr=-1;
62 if(i > 1000 && i < 1040) { dz=3.33;dr=0.4;}
63 if(i > 1040 && i < 1130) { dr=3.33;dz=0.4;}
65 if(i > 2000 && i < 2550) { dz=2.5;dr=0.1;}
66 if(i > 2550 && i < 3000) { dz=5.0;dr=0.1;}
68 if(i > 3000 && i < 5000) { dz=0.2;dr=5.0;}
70 if(i > 3100 && i < 3119) { dz=0.2;dr=2.5;}
71 if(i > 3140 && i < 3159) { dz=0.2;dr=2.5;}
72 if(i > 3180 && i < 3199) { dz=0.2;dr=2.5;}
73 if(i > 3220 && i < 3239) { dz=0.2;dr=2.5;}
74 if(i > 3260 && i < 3279) { dz=0.2;dr=2.5;}
76 if(i > 4100 && i < 4119) { dz=0.2;dr=2.5;}
77 if(i > 4140 && i < 4159) { dz=0.2;dr=2.5;}
78 if(i > 4180 && i < 4199) { dz=0.2;dr=2.5;}
79 if(i > 4220 && i < 4239) { dz=0.2;dr=2.5;}
80 if(i > 4260 && i < 4279) { dz=0.2;dr=2.5;}
82 std::pair<float,float> res(dz,dr);
88 float dz=-1;
float dr=-1;
90 if(i > 1000 && i < 1040) { dz=3.33;dr=0.4;}
91 if(i > 1040 && i < 1080) { dr=3.33;dz=0.4;}
93 if(i > 1100 && i < 2000) { dz=5.948;dr=0.4;}
95 if(i > 3000 && i < 4000) { dz=9.440;dr=0.4;}
97 if(i > 2000 && i < 3000 && (i%1000)/100 == 1) { dz=0.8;dr=5.647;}
98 if(i > 2000 && i < 3000 && (i%1000)/100 == 2) { dz=0.8;dr=4.512;}
99 if(i > 2000 && i < 3000 && (i%1000)/100 == 3) { dz=0.8;dr=5.637;}
101 if(i > 4000 && i < 6000 && (i%1000)/100 == 1) { dz=0.8;dr=4.362;}
102 if(i > 4000 && i < 6000 && (i%1000)/100 == 2) { dz=0.8;dr=4.512;}
103 if(i > 4000 && i < 6000 && (i%1000)/100 == 3) { dz=0.8;dr=5.637;}
104 if(i > 4000 && i < 6000 && (i%1000)/100 == 4) { dz=0.8;dr=5.862;}
105 if(i > 4000 && i < 6000 && (i%1000)/100 == 5) { dz=0.8;dr=7.501;}
106 if(i > 4000 && i < 6000 && (i%1000)/100 == 6) { dz=0.8;dr=9.336;}
107 if(i > 4000 && i < 6000 && (i%1000)/100 == 7) { dz=0.8;dr=10.373;}
109 std::pair<float,float> res(dz,dr);
115 h->SetAxisRange(min,max);
120 TText*
t =
new TText((max+min)/2,h->GetMaximum(),
label); t->SetTextAlign(22);
126 std::pair<float,float>(*
size)(
int), std::vector<SubDetParams>& vsub) {
128 gROOT->SetStyle(
"Plain");
132 TProfile* aveoccu= (TProfile*)gDirectory->Get(
"aveoccu");
133 TProfile* avemult= (TProfile*)gDirectory->Get(
"avemult");
134 TH1F* nchannels = (TH1F*)gDirectory->Get(
"nchannels_real");
136 TProfile* averadius = (TProfile*)gDirectory->Get(
"averadius");
137 TProfile* avez = (TProfile*)gDirectory->Get(
"avez");
139 std::cout <<
"pointers " << aveoccu <<
" " << avemult <<
" " << nchannels <<
" " << averadius <<
" " << avez << std::endl;
141 if(aveoccu && avemult && nchannels && averadius && avez) {
144 for(
int i=1;
i<nchannels->GetNbinsX()+1;++
i) {
145 nchannels->SetBinError(
i,0.);
148 TH1D* haveoccu = aveoccu->ProjectionX(
"haveoccu");
149 haveoccu->SetDirectory(0);
150 haveoccu->Divide(nchannels);
152 TH1D* havemult = avemult->ProjectionX(
"havemult");
153 havemult->SetDirectory(0);
154 havemult->Divide(nchannels);
156 TH1D* havewidth = (TH1D*)haveoccu->Clone(
"havewidth");
157 havewidth->SetDirectory(0);
158 havewidth->SetTitle(
"Average Cluster Size");
159 havewidth->Divide(havemult);
162 new TCanvas(
"occupancy",
"occupancy",1200,500);
164 haveoccu->SetStats(0);
165 haveoccu->SetLineColor(kRed);
166 haveoccu->SetMarkerColor(kRed);
167 haveoccu->DrawCopy();
169 new TCanvas(
"multiplicity",
"multiplicity",1200,500);
171 havemult->SetStats(0);
172 havemult->SetLineColor(kRed);
173 havemult->SetMarkerColor(kRed);
174 havemult->DrawCopy();
176 new TCanvas(
"width",
"width",1200,500);
177 havewidth->SetStats(0);
178 havewidth->SetLineColor(kRed);
179 havewidth->SetMarkerColor(kRed);
180 havewidth->DrawCopy();
183 TCanvas* o2 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject(
"occupancy2");
186 haveoccu->SetLineColor(kBlue);
187 haveoccu->SetMarkerColor(kBlue);
190 o2 =
new TCanvas(
"occupancy2",
"occupancy2",1200,800);
193 for(
unsigned int isub=0;isub<vsub.size();++isub) {
194 printFrame(o2,haveoccu,vsub[isub].
label.c_str(),isub+1,vsub[isub].min,vsub[isub].max,same);
198 TCanvas* m2 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject(
"multiplicity2");
201 havemult->SetLineColor(kBlue);
202 havemult->SetMarkerColor(kBlue);
205 m2 =
new TCanvas(
"multiplicity2",
"multiplicity2",1200,800);
208 for(
unsigned int isub=0;isub<vsub.size();++isub) {
209 printFrame(m2,havemult,vsub[isub].
label.c_str(),isub+1,vsub[isub].min,vsub[isub].max,same);
213 TCanvas*
w2 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject(
"width2");
216 havewidth->SetLineColor(kBlue);
217 havewidth->SetMarkerColor(kBlue);
220 w2 =
new TCanvas(
"width2",
"width2",1200,800);
223 for(
unsigned int isub=0;isub<vsub.size();++isub) {
224 printFrame(w2,havewidth,vsub[isub].
label.c_str(),isub+1,vsub[isub].min,vsub[isub].max,same);
227 float (*
scale)(float);
232 drawMap(
"occumap",haveoccu,averadius,avez,min,max,
size,
scale,color,
"channel occupancy");
240 float combinedOccupancy(TFile* ff,
const char* module,
const int lowerbin,
const int upperbin) {
247 TProfile* aveoccu= (TProfile*)gDirectory->Get(
"aveoccu");
249 TH1F* nchannels = (TH1F*)gDirectory->Get(
"nchannels_real");
252 float sumnchannels=0;
255 for(
int i=lowerbin;
i<upperbin+1; ++
i) {
256 std::cout <<
"processing bin " <<
i <<
" " << aveoccu->GetBinContent(
i) <<
"+/-" << aveoccu->GetBinError(
i) << std::endl;
257 sumoccu += aveoccu->GetBinContent(
i);
258 sumnchannels += nchannels->GetBinContent(
i);
259 sumerrsq += aveoccu->GetBinError(
i)*aveoccu->GetBinError(
i);
261 cumoccu = sumnchannels!=0 ? sumoccu/sumnchannels : -1;
262 cumerr = sumnchannels!=0 ?
sqrt(sumerrsq)/sumnchannels : -1;
263 std::cout <<
"Cumulative occupancy: " << sumoccu <<
" " << sumnchannels <<
" " << cumoccu <<
"+/-" << cumerr;
270 void PlotOccupancyMap(TFile* ff,
const char* module,
const float min,
const float max,
const float mmin,
const float mmax,
const int color) {
272 std::pair<float,float> (*size)(int);
275 std::vector<SubDetParams> vsub;
276 SubDetParams ppix={
"BPIX+FPIX",100,270}; vsub.push_back(ppix);
277 SubDetParams ptib={
"TIB",1050,1450}; vsub.push_back(ptib);
278 SubDetParams ptid={
"TID",2070,2400}; vsub.push_back(ptid);
279 SubDetParams ptob={
"TOB",3000,3700}; vsub.push_back(ptob);
280 SubDetParams ptecm={
"TEC-",4000,4850}; vsub.push_back(ptecm);
281 SubDetParams ptecp={
"TEC+",5000,5850}; vsub.push_back(ptecp);
286 void PlotOccupancyMapPhase1(TFile* ff,
const char* module,
const float min,
const float max,
const float mmin,
const float mmax,
const int color) {
288 std::pair<float,float> (*size)(int);
291 std::vector<SubDetParams> vsub;
292 SubDetParams ppix={
"BPIX+FPIX",1000,1080}; vsub.push_back(ppix);
293 SubDetParams ptib={
"TIB",1090,1450}; vsub.push_back(ptib);
294 SubDetParams ptid={
"TID",2070,2400}; vsub.push_back(ptid);
295 SubDetParams ptob={
"TOB",3000,3700}; vsub.push_back(ptob);
296 SubDetParams ptecm={
"TEC-",4000,4850}; vsub.push_back(ptecm);
297 SubDetParams ptecp={
"TEC+",5000,5850}; vsub.push_back(ptecp);
302 void PlotOccupancyMapPhase2(TFile* ff,
const char* module,
const float min,
const float max,
const float mmin,
const float mmax,
const int color) {
304 std::pair<float,float> (*size)(int);
307 std::vector<SubDetParams> vsub;
308 SubDetParams ppix={
"BPIX+FPIX",1000,1090}; vsub.push_back(ppix);
309 SubDetParams ptob={
"TOB",2000,2900}; vsub.push_back(ptob);
310 SubDetParams ptecm={
"TEC-",3100,3300}; vsub.push_back(ptecm);
311 SubDetParams ptecp={
"TEC+",4100,4300}; vsub.push_back(ptecp);
316 void PlotOnTrackOccupancy(TFile* ff,
const char* module,
const char* ontrkmod,
const float mmin,
const float mmax,
const int color) {
318 std::pair<float,float> (*size)(int);
321 std::vector<SubDetParams> vsub;
322 SubDetParams ppix={
"BPIX+FPIX",100,270}; vsub.push_back(ppix);
323 SubDetParams ptib={
"TIB",1050,1450}; vsub.push_back(ptib);
324 SubDetParams ptid={
"TID",2070,2400}; vsub.push_back(ptid);
325 SubDetParams ptob={
"TOB",3000,3700}; vsub.push_back(ptob);
326 SubDetParams ptecm={
"TEC-",4000,4850}; vsub.push_back(ptecm);
327 SubDetParams ptecp={
"TEC+",5000,5850}; vsub.push_back(ptecp);
334 std::pair<float,float> (*size)(int);
337 std::vector<SubDetParams> vsub;
338 SubDetParams ppix={
"BPIX+FPIX",1000,1080}; vsub.push_back(ppix);
339 SubDetParams ptib={
"TIB",1090,1450}; vsub.push_back(ptib);
340 SubDetParams ptid={
"TID",2070,2400}; vsub.push_back(ptid);
341 SubDetParams ptob={
"TOB",3000,3700}; vsub.push_back(ptob);
342 SubDetParams ptecm={
"TEC-",4000,4850}; vsub.push_back(ptecm);
343 SubDetParams ptecp={
"TEC+",5000,5850}; vsub.push_back(ptecp);
350 std::pair<float,float> (*size)(int);
353 std::vector<SubDetParams> vsub;
354 SubDetParams ppix={
"BPIX+FPIX",1000,1090}; vsub.push_back(ppix);
355 SubDetParams ptob={
"TOB",2000,2900}; vsub.push_back(ptob);
356 SubDetParams ptecm={
"TEC-",3100,3300}; vsub.push_back(ptecm);
357 SubDetParams ptecp={
"TEC+",4100,4300}; vsub.push_back(ptecp);
363 std::pair<float,float>(*
size)(
int),
const std::vector<SubDetParams>& vsub) {
366 gROOT->SetStyle(
"Plain");
369 TProfile* aveontrkmult=0;
370 TProfile* averadius =0;
374 avemult= (TProfile*)gDirectory->Get(
"avemult");
375 averadius = (TProfile*)gDirectory->Get(
"averadius");
376 avez = (TProfile*)gDirectory->Get(
"avez");
378 if(ff->cd(ontrkmod)) aveontrkmult= (TProfile*)gDirectory->Get(
"avemult");
380 std::cout <<
"pointers " << avemult <<
" " << aveontrkmult <<
" " << averadius <<
" " << avez << std::endl;
382 if( averadius && avez && avemult && aveontrkmult) {
384 TH1D* havemult = avemult->ProjectionX(
"havemult");
385 TH1D* haveontrkmult = aveontrkmult->ProjectionX(
"haveontrkmult");
386 havemult->SetDirectory(0);
387 haveontrkmult->SetDirectory(0);
388 haveontrkmult->Divide(havemult);
390 new TCanvas(
"ontrkmult",
"ontrkmult",1200,500);
392 haveontrkmult->SetStats(0);
393 haveontrkmult->SetLineColor(kRed);
394 haveontrkmult->SetMarkerColor(kRed);
395 haveontrkmult->SetMarkerSize(.5);
396 haveontrkmult->SetMarkerStyle(20);
397 haveontrkmult->DrawCopy();
400 TCanvas* o2 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject(
"ontrkmult2");
403 haveontrkmult->SetLineColor(kBlue);
404 haveontrkmult->SetMarkerColor(kBlue);
407 o2 =
new TCanvas(
"ontrkmult2",
"ontrkmult2",1200,800);
410 for(
unsigned int isub=0;isub<vsub.size();++isub) {
411 printFrame(o2,haveontrkmult,vsub[isub].
label.c_str(),isub+1,vsub[isub].min,vsub[isub].max,same);
414 float (*
scale)(float);
417 drawMap(
"ontrkmultmap",haveontrkmult,averadius,avez,mmin,mmax,
size,
scale,color);
421 TCanvas*
drawMap(
const char* cname,
const TH1* hval,
const TProfile* averadius,
const TProfile* avez,
const float mmin,
const float mmax,
422 std::pair<float,float>(*
size)(
int),
float(*
scale)(
float),
const int color,
const char* ptitle) {
426 const Int_t NRGBs = 5;
427 const Int_t NCont = 255;
428 Double_t stops[NRGBs] = { 0.00, 0.25, 0.50, 0.75, 1.00 };
429 Double_t
red[NRGBs] = { 0.00, 0.00, 0.40, 1.00, 1.00 };
430 Double_t
green[NRGBs] = { 0.00, 0.40, 0.70, 0.60, 1.00 };
431 Double_t blue[NRGBs] = { 0.30, 0.60, 0.00, 0.00, 0.20 };
432 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
433 gStyle->SetNumberContours(NCont);
437 const Int_t NRGBs = 3;
438 const Int_t NCont = 255;
439 Double_t stops[NRGBs] = { 0.00, 0.50, 1.00 };
440 Double_t
red[NRGBs] = { 0.90, 0.50, 0.00};
441 Double_t
green[NRGBs] = { 0.90, 0.50, 0.00};
442 Double_t blue[NRGBs] = { 0.90, 0.50, 0.00};
443 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
444 gStyle->SetNumberContours(NCont);
448 const Int_t NRGBs = 7;
449 const Int_t NCont = 255;
450 Double_t stops[NRGBs] = { 0.00, 0.15, 0.30, 0.45, 0.65, 0.85, 1.00 };
451 Double_t
red[NRGBs] = { 0.60, 0.30, 0.00, 0.00, 0.60, 0.40, 0.00 };
452 Double_t
green[NRGBs] = { 1.00, 0.90, 0.80, 0.75, 0.20, 0.00, 0.00 };
453 Double_t blue[NRGBs] = { 1.00, 1.00, 1.00, 0.30, 0.00, 0.00, 0.00 };
454 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
455 gStyle->SetNumberContours(NCont);
458 int ncol = gStyle->GetNumberOfColors();
459 std::cout <<
"Number of colors " << ncol << std::endl;
464 for(
int i=1;
i<hval->GetNbinsX();++
i) {
466 if(averadius->GetBinEntries(
i)*avez->GetBinEntries(
i)) {
475 if(dz<0 && dr<0)
continue;
478 TBox* modmult =
new TBox(avez->GetBinContent(
i)-dz,averadius->GetBinContent(
i)-
dr,avez->GetBinContent(
i)+dz,averadius->GetBinContent(
i)+
dr);
479 modmult->SetFillStyle(1001);
481 modmult->SetFillColor(kBlack);
486 if(icol > (ncol-1)) icol=(ncol-1);
487 std::cout <<
i <<
" " << icol <<
" " << hval->GetBinContent(
i) << std::endl;
488 modmult->SetFillColor(gStyle->GetColorPalette(icol));
490 modulesmult.Add(modmult);
497 double etavalext[] = {4.,3.5,3.,2.8,2.6,2.4,2.2,2.0,1.8,1.6};
498 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};
502 for(
int i=0;
i<10;++
i) {
504 double eta = etavalext[
i];
505 TLine* lin =
new TLine(295,2*295/(
exp(eta)-
exp(-eta)),305,2*305/(
exp(eta)-
exp(-eta)));
508 sprintf(lab,
"%3.1f",eta);
509 TText*
label =
new TText(285,2*285/(
exp(eta)-
exp(-eta)),lab);
510 label->SetTextSize(.03);
511 label->SetTextAlign(22);
512 etalabels.Add(label);
514 for(
int i=0;
i<10;++
i) {
516 double eta = -1*etavalext[
i];
517 TLine* lin =
new TLine(-295,-2*295/(
exp(eta)-
exp(-eta)),-305,-2*305/(
exp(eta)-
exp(-eta)));
520 sprintf(lab,
"%3.1f",eta);
521 TText*
label =
new TText(-285,-2*285/(
exp(eta)-
exp(-eta)),lab);
522 label->SetTextSize(.03);
523 label->SetTextAlign(22);
524 etalabels.Add(label);
526 for(
int i=0;
i<15;++
i) {
528 double eta = etavalint[
i];
529 TLine* lin =
new TLine(130.*(
exp(eta)-
exp(-eta))/2.,130,138.*(
exp(eta)-
exp(-eta))/2.,138);
532 sprintf(lab,
"%3.1f",eta);
533 TText*
label =
new TText(125.*(
exp(eta)-
exp(-eta))/2.,125,lab);
534 label->SetTextSize(.03);
535 label->SetTextAlign(22);
536 etalabels.Add(label);
538 TLatex* etalab =
new TLatex(0,115,
"#eta");
539 etalab->SetTextSize(.03);
540 etalab->SetTextAlign(22);
541 etalabels.Add(etalab);
544 TLatex *cmslab =
new TLatex(0.15,0.965,
"CMS");
546 cmslab->SetTextSize(0.04);
547 cmslab->SetTextAlign(31);
548 paperlabels.Add(cmslab);
549 TLatex *enelab =
new TLatex(0.92,0.965,
"#sqrt{s} = 7 TeV");
551 enelab->SetTextSize(0.04);
552 enelab->SetTextAlign(31);
553 paperlabels.Add(enelab);
563 TGaxis *raxis =
new TGaxis(-310,0,-310,140,0,140,10,
"S");
564 TGaxis *zaxis =
new TGaxis(-310,0,310,0,-310,310,10,
"S");
565 raxis->SetTickSize(.01); zaxis->SetTickSize(.01);
566 raxis->SetTitle(
"r (cm)"); zaxis->SetTitle(
"z (cm)");
570 for(
int i = 0;
i< ncol ; ++
i) {
571 TBox* box=
new TBox(315,0+140./ncol*
i,330,0+140./ncol*(i+1));
572 box->SetFillStyle(1001);
573 box->SetFillColor(gStyle->GetColorPalette(i));
580 mpaxis =
new TGaxis(330,0,330,140,mmin,mmax,510,
"SLG+");
583 mpaxis =
new TGaxis(330,0,330,140,mmin,mmax,510,
"SL+");
585 mpaxis->SetTickSize(.02);
586 mpaxis->SetLabelOffset(mpaxis->GetLabelOffset()*0.5);
587 mpaxis->SetTitle(ptitle);
588 mpalette.Add(mpaxis);
590 TCanvas* cc2 =
new TCanvas(cname,cname,1000,500);
591 cc2->Range(-370.,-20.,390.,150.);
592 TFrame* fr2 =
new TFrame(-310,0,310,140);
593 fr2->UseCurrentStyle();
595 raxis->Draw(); zaxis->Draw();
596 std::cout << modulesmult.GetSize() << std::endl;
599 if(color>=0) mpalette.Draw();
609 gROOT->SetStyle(
"Plain");
611 TCanvas* cc =
new TCanvas(name,name,750,750);
612 cc->Range(-25,-25,25,25);
613 TFrame* fr1 =
new TFrame(-20,-20,20,20);
614 fr1->UseCurrentStyle();
618 TProfile* avex = (TProfile*)gDirectory->Get(
"avex");
619 TProfile* avey = (TProfile*)gDirectory->Get(
"avey");
620 TProfile* avez = (TProfile*)gDirectory->Get(
"avez");
622 if(avex && avey && avez) {
623 TText* tittext =
new TText(0,0,name);
624 tittext->SetTextSize(.04); tittext->SetTextAlign(22);
626 for(
unsigned int mod=ioffset+1;
mod<ioffset+57;++
mod) {
627 double x = avex->GetBinContent(
mod);
628 double y = avey->GetBinContent(
mod);
631 sprintf(modstring,
"%d",
mod%100);
632 TText* modtext =
new TText(x,y,modstring);
633 modtext->SetTextAngle(atan(y/x)*180/3.14159);
634 modtext->SetTextSize(.02); modtext->SetTextAlign(22); modtext->SetTextColor(kRed);
639 for(
unsigned int mod=ioffset+101;
mod<ioffset+157;++
mod) {
640 double x = avex->GetBinContent(
mod);
641 double y = avey->GetBinContent(
mod);
644 sprintf(modstring,
"%d",
mod%100);
645 TText* modtext =
new TText(x,y,modstring);
646 modtext->SetTextAngle(atan(y/x)*180/3.14159);
647 modtext->SetTextSize(.02); modtext->SetTextAlign(22); modtext->SetTextColor(kBlue);
648 std::cout <<
mod <<
" " << x <<
" " << y <<
" " << atan(y/x) << std::endl;
658 gROOT->SetStyle(
"Plain");
662 TProfile* averadius = (TProfile*)gDirectory->Get(
"averadius");
663 TProfile* avez = (TProfile*)gDirectory->Get(
"avez");
665 std::cout <<
"pointers " << averadius <<
" " << avez << std::endl;
667 if(averadius && avez) {
669 std::pair<float,float> (*size)(int);
671 float (*
scale)(float);
675 drawMap(
"trackermap",averadius,averadius,avez,0,0,size,
scale,-1);
687 TH1D* occutrend =
new TH1D(
"occutrend",
"Average number of clusters vs run",10,0.,10.);
688 occutrend->SetCanExtend(TH1::kXaxis);
692 std::sort(runs.begin(),runs.end());
695 for(
unsigned int i=0;
i<runs.size();++
i) {
698 sprintf(runlabel,
"%d",runs[
i]);
700 sprintf(runpath,
"run_%d",runs[i]);
705 if(occu==0) occu = (TProfile*)caoccu.
getObject(hname);
708 const int ibin=occu->FindBin(bin);
709 std::cout << runlabel <<
" " <<
" " << ibin <<
" " << occu->GetBinContent(ibin) <<
" " << occu->GetBinError(ibin) << std::endl;
710 const int jbin=occutrend->Fill(runlabel,occu->GetBinContent(ibin));
711 occutrend->SetBinError(jbin,occu->GetBinError(ibin));
void PlotDebugFPIX_XYMap(TFile *ff, const char *module, const unsigned int ioffset, const char *name)
void PlotOnTrackOccupancy(TFile *ff, const char *module, const char *ontrkmod, const float mmin, const float mmax, const int color)
void PlotOccupancyMapPhase1(TFile *ff, const char *module, const float min, const float max, const float mmin, const float mmax, const int color)
common ppss p3p6s2 common epss epspn46 common const1 w2
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
TObject * getObject(const char *name) const
std::pair< float, float > phase2bin(int i)
void PlotOccupancyMap(TFile *ff, const char *module, const float min, const float max, const float mmin, const float mmax, const int color)
TH1D * TrendPlotSingleBin(TFile *ff, const char *module, const char *hname, const int bin)
std::pair< float, float > presentbin(int i)
void PlotOccupancyMapGeneric(TFile *ff, const char *module, const float min, const float max, const float mmin, const float mmax, const int color, std::pair< float, float >(*size)(int), std::vector< SubDetParams > &vsub)
void printFrame(TCanvas *c, TH1D *h, const char *label, const int frame, const int min, const int max, const bool same)
U second(std::pair< T, U > const &p)
void PlotTrackerXsect(TFile *ff, const char *module)
T x() const
Cartesian x coordinate.
std::pair< float, float > phase1bin(int i)
float combinedOccupancy(TFile *ff, const char *module, const int lowerbin, const int upperbin)
void setPath(const char *path)
const std::vector< unsigned int > getRunList() const
TCanvas * drawMap(const char *cname, const TH1 *hval, const TProfile *averadius, const TProfile *avez, const float mmin, const float mmax, std::pair< float, float >(*size)(int), float(*scale)(float), const int color, const char *ptitle)
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)
void PlotOnTrackOccupancyPhase1(TFile *ff, const char *module, const char *ontrkmod, const float mmin, const float mmax, const int color)
T mod(const T &a, const T &b)
tuple size
Write out results.
void PlotOnTrackOccupancyGeneric(TFile *ff, const char *module, const char *ontrkmod, const float mmin, const float mmax, const int color, std::pair< float, float >(*size)(int), const std::vector< SubDetParams > &vsub)