6 #include "TDirectory.h"
30 float dz=-1;
float dr=-1;
32 if(i > 100 && i < 200) { dz=3.33;dr=0.4;}
34 if(i > 200 && i < 1000 && ( i%10 == 1 || i%10 == 7)) { dz=0.8;dr=0.4;}
35 if(i > 200 && i < 1000 && !( i%10 == 1 || i%10 == 7)) { dz=0.8;dr=0.8;}
37 if(i > 1000 && i < 2000) { dz=5.948;dr=0.4;}
39 if(i > 3000 && i < 4000) { dz=9.440;dr=0.4;}
41 if(i > 2000 && i < 3000 && (i%1000)/100 == 1) { dz=0.8;dr=5.647;}
42 if(i > 2000 && i < 3000 && (i%1000)/100 == 2) { dz=0.8;dr=4.512;}
43 if(i > 2000 && i < 3000 && (i%1000)/100 == 3) { dz=0.8;dr=5.637;}
45 if(i > 4000 && i < 6000 && (i%1000)/100 == 1) { dz=0.8;dr=4.362;}
46 if(i > 4000 && i < 6000 && (i%1000)/100 == 2) { dz=0.8;dr=4.512;}
47 if(i > 4000 && i < 6000 && (i%1000)/100 == 3) { dz=0.8;dr=5.637;}
48 if(i > 4000 && i < 6000 && (i%1000)/100 == 4) { dz=0.8;dr=5.862;}
49 if(i > 4000 && i < 6000 && (i%1000)/100 == 5) { dz=0.8;dr=7.501;}
50 if(i > 4000 && i < 6000 && (i%1000)/100 == 6) { dz=0.8;dr=9.336;}
51 if(i > 4000 && i < 6000 && (i%1000)/100 == 7) { dz=0.8;dr=10.373;}
53 std::pair<float,float> res(dz,dr);
59 float dz=-1;
float dr=-1;
61 if(i > 1000 && i < 1040) { dz=3.33;dr=0.4;}
62 if(i > 1040 && i < 1130) { dr=3.33;dz=0.4;}
64 if(i > 2000 && i < 2550) { dz=2.5;dr=0.1;}
65 if(i > 2550 && i < 3000) { dz=5.0;dr=0.1;}
67 if(i > 3000 && i < 5000) { dz=0.2;dr=5.0;}
69 if(i > 3100 && i < 3119) { dz=0.2;dr=2.5;}
70 if(i > 3140 && i < 3159) { dz=0.2;dr=2.5;}
71 if(i > 3180 && i < 3199) { dz=0.2;dr=2.5;}
72 if(i > 3220 && i < 3239) { dz=0.2;dr=2.5;}
73 if(i > 3260 && i < 3279) { dz=0.2;dr=2.5;}
75 if(i > 4100 && i < 4119) { dz=0.2;dr=2.5;}
76 if(i > 4140 && i < 4159) { dz=0.2;dr=2.5;}
77 if(i > 4180 && i < 4199) { dz=0.2;dr=2.5;}
78 if(i > 4220 && i < 4239) { dz=0.2;dr=2.5;}
79 if(i > 4260 && i < 4279) { dz=0.2;dr=2.5;}
81 std::pair<float,float> res(dz,dr);
87 float dz=-1;
float dr=-1;
89 if(i > 1000 && i < 1040) { dz=3.33;dr=0.4;}
90 if(i > 1040 && i < 1080) { dr=3.33;dz=0.4;}
92 if(i > 1100 && i < 2000) { dz=5.948;dr=0.4;}
94 if(i > 3000 && i < 4000) { dz=9.440;dr=0.4;}
96 if(i > 2000 && i < 3000 && (i%1000)/100 == 1) { dz=0.8;dr=5.647;}
97 if(i > 2000 && i < 3000 && (i%1000)/100 == 2) { dz=0.8;dr=4.512;}
98 if(i > 2000 && i < 3000 && (i%1000)/100 == 3) { dz=0.8;dr=5.637;}
100 if(i > 4000 && i < 6000 && (i%1000)/100 == 1) { dz=0.8;dr=4.362;}
101 if(i > 4000 && i < 6000 && (i%1000)/100 == 2) { dz=0.8;dr=4.512;}
102 if(i > 4000 && i < 6000 && (i%1000)/100 == 3) { dz=0.8;dr=5.637;}
103 if(i > 4000 && i < 6000 && (i%1000)/100 == 4) { dz=0.8;dr=5.862;}
104 if(i > 4000 && i < 6000 && (i%1000)/100 == 5) { dz=0.8;dr=7.501;}
105 if(i > 4000 && i < 6000 && (i%1000)/100 == 6) { dz=0.8;dr=9.336;}
106 if(i > 4000 && i < 6000 && (i%1000)/100 == 7) { dz=0.8;dr=10.373;}
108 std::pair<float,float> res(dz,dr);
114 h->SetAxisRange(min,max);
119 TText*
t =
new TText((max+min)/2,h->GetMaximum(),
label); t->SetTextAlign(22);
125 std::pair<float,float>(*
size)(
int), std::vector<SubDetParams>& vsub) {
127 gROOT->SetStyle(
"Plain");
131 TProfile* aveoccu= (TProfile*)gDirectory->Get(
"aveoccu");
132 TProfile* avemult= (TProfile*)gDirectory->Get(
"avemult");
133 TH1F* nchannels = (TH1F*)gDirectory->Get(
"nchannels_real");
135 TProfile* averadius = (TProfile*)gDirectory->Get(
"averadius");
136 TProfile* avez = (TProfile*)gDirectory->Get(
"avez");
138 std::cout <<
"pointers " << aveoccu <<
" " << avemult <<
" " << nchannels <<
" " << averadius <<
" " << avez << std::endl;
140 if(aveoccu && avemult && nchannels && averadius && avez) {
143 for(
int i=1;
i<nchannels->GetNbinsX()+1;++
i) {
144 nchannels->SetBinError(
i,0.);
147 TH1D* haveoccu = aveoccu->ProjectionX(
"haveoccu");
148 haveoccu->SetDirectory(0);
149 haveoccu->Divide(nchannels);
151 TH1D* havemult = avemult->ProjectionX(
"havemult");
152 havemult->SetDirectory(0);
153 havemult->Divide(nchannels);
155 TH1D* havewidth = (TH1D*)haveoccu->Clone(
"havewidth");
156 havewidth->SetDirectory(0);
157 havewidth->SetTitle(
"Average Cluster Size");
158 havewidth->Divide(havemult);
161 new TCanvas(
"occupancy",
"occupancy",1200,500);
163 haveoccu->SetStats(0);
164 haveoccu->SetLineColor(kRed);
165 haveoccu->SetMarkerColor(kRed);
166 haveoccu->DrawCopy();
168 new TCanvas(
"multiplicity",
"multiplicity",1200,500);
170 havemult->SetStats(0);
171 havemult->SetLineColor(kRed);
172 havemult->SetMarkerColor(kRed);
173 havemult->DrawCopy();
175 new TCanvas(
"width",
"width",1200,500);
176 havewidth->SetStats(0);
177 havewidth->SetLineColor(kRed);
178 havewidth->SetMarkerColor(kRed);
179 havewidth->DrawCopy();
182 TCanvas* o2 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject(
"occupancy2");
185 haveoccu->SetLineColor(kBlue);
186 haveoccu->SetMarkerColor(kBlue);
189 o2 =
new TCanvas(
"occupancy2",
"occupancy2",1200,800);
192 for(
unsigned int isub=0;isub<vsub.size();++isub) {
193 printFrame(o2,haveoccu,vsub[isub].
label.c_str(),isub+1,vsub[isub].min,vsub[isub].max,same);
197 TCanvas* m2 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject(
"multiplicity2");
200 havemult->SetLineColor(kBlue);
201 havemult->SetMarkerColor(kBlue);
204 m2 =
new TCanvas(
"multiplicity2",
"multiplicity2",1200,800);
207 for(
unsigned int isub=0;isub<vsub.size();++isub) {
208 printFrame(m2,havemult,vsub[isub].
label.c_str(),isub+1,vsub[isub].min,vsub[isub].max,same);
212 TCanvas*
w2 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject(
"width2");
215 havewidth->SetLineColor(kBlue);
216 havewidth->SetMarkerColor(kBlue);
219 w2 =
new TCanvas(
"width2",
"width2",1200,800);
222 for(
unsigned int isub=0;isub<vsub.size();++isub) {
223 printFrame(w2,havewidth,vsub[isub].
label.c_str(),isub+1,vsub[isub].min,vsub[isub].max,same);
226 float (*
scale)(float);
231 drawMap(
"occumap",haveoccu,averadius,avez,min,max,
size,
scale,color,
"channel occupancy");
239 float combinedOccupancy(TFile* ff,
const char* module,
const int lowerbin,
const int upperbin) {
246 TProfile* aveoccu= (TProfile*)gDirectory->Get(
"aveoccu");
248 TH1F* nchannels = (TH1F*)gDirectory->Get(
"nchannels_real");
251 float sumnchannels=0;
254 for(
int i=lowerbin;
i<upperbin+1; ++
i) {
255 std::cout <<
"processing bin " <<
i <<
" " << aveoccu->GetBinContent(
i) <<
"+/-" << aveoccu->GetBinError(
i) << std::endl;
256 sumoccu += aveoccu->GetBinContent(
i);
257 sumnchannels += nchannels->GetBinContent(
i);
258 sumerrsq += aveoccu->GetBinError(
i)*aveoccu->GetBinError(
i);
260 cumoccu = sumnchannels!=0 ? sumoccu/sumnchannels : -1;
261 cumerr = sumnchannels!=0 ?
sqrt(sumerrsq)/sumnchannels : -1;
262 std::cout <<
"Cumulative occupancy: " << sumoccu <<
" " << sumnchannels <<
" " << cumoccu <<
"+/-" << cumerr;
269 void PlotOccupancyMap(TFile* ff,
const char* module,
const float min,
const float max,
const float mmin,
const float mmax,
const int color) {
271 std::pair<float,float> (*size)(int);
274 std::vector<SubDetParams> vsub;
275 SubDetParams ppix={
"BPIX+FPIX",100,270}; vsub.push_back(ppix);
276 SubDetParams ptib={
"TIB",1050,1450}; vsub.push_back(ptib);
277 SubDetParams ptid={
"TID",2070,2400}; vsub.push_back(ptid);
278 SubDetParams ptob={
"TOB",3000,3700}; vsub.push_back(ptob);
279 SubDetParams ptecm={
"TEC-",4000,4850}; vsub.push_back(ptecm);
280 SubDetParams ptecp={
"TEC+",5000,5850}; vsub.push_back(ptecp);
285 void PlotOccupancyMapPhase1(TFile* ff,
const char* module,
const float min,
const float max,
const float mmin,
const float mmax,
const int color) {
287 std::pair<float,float> (*size)(int);
290 std::vector<SubDetParams> vsub;
291 SubDetParams ppix={
"BPIX+FPIX",1000,1080}; vsub.push_back(ppix);
292 SubDetParams ptib={
"TIB",1090,1450}; vsub.push_back(ptib);
293 SubDetParams ptid={
"TID",2070,2400}; vsub.push_back(ptid);
294 SubDetParams ptob={
"TOB",3000,3700}; vsub.push_back(ptob);
295 SubDetParams ptecm={
"TEC-",4000,4850}; vsub.push_back(ptecm);
296 SubDetParams ptecp={
"TEC+",5000,5850}; vsub.push_back(ptecp);
301 void PlotOccupancyMapPhase2(TFile* ff,
const char* module,
const float min,
const float max,
const float mmin,
const float mmax,
const int color) {
303 std::pair<float,float> (*size)(int);
306 std::vector<SubDetParams> vsub;
307 SubDetParams ppix={
"BPIX+FPIX",1000,1090}; vsub.push_back(ppix);
308 SubDetParams ptob={
"TOB",2000,2900}; vsub.push_back(ptob);
309 SubDetParams ptecm={
"TEC-",3100,3300}; vsub.push_back(ptecm);
310 SubDetParams ptecp={
"TEC+",4100,4300}; vsub.push_back(ptecp);
315 void PlotOnTrackOccupancy(TFile* ff,
const char* module,
const char* ontrkmod,
const float mmin,
const float mmax,
const int color) {
317 std::pair<float,float> (*size)(int);
320 std::vector<SubDetParams> vsub;
321 SubDetParams ppix={
"BPIX+FPIX",100,270}; vsub.push_back(ppix);
322 SubDetParams ptib={
"TIB",1050,1450}; vsub.push_back(ptib);
323 SubDetParams ptid={
"TID",2070,2400}; vsub.push_back(ptid);
324 SubDetParams ptob={
"TOB",3000,3700}; vsub.push_back(ptob);
325 SubDetParams ptecm={
"TEC-",4000,4850}; vsub.push_back(ptecm);
326 SubDetParams ptecp={
"TEC+",5000,5850}; vsub.push_back(ptecp);
333 std::pair<float,float> (*size)(int);
336 std::vector<SubDetParams> vsub;
337 SubDetParams ppix={
"BPIX+FPIX",1000,1080}; vsub.push_back(ppix);
338 SubDetParams ptib={
"TIB",1090,1450}; vsub.push_back(ptib);
339 SubDetParams ptid={
"TID",2070,2400}; vsub.push_back(ptid);
340 SubDetParams ptob={
"TOB",3000,3700}; vsub.push_back(ptob);
341 SubDetParams ptecm={
"TEC-",4000,4850}; vsub.push_back(ptecm);
342 SubDetParams ptecp={
"TEC+",5000,5850}; vsub.push_back(ptecp);
349 std::pair<float,float> (*size)(int);
352 std::vector<SubDetParams> vsub;
353 SubDetParams ppix={
"BPIX+FPIX",1000,1090}; vsub.push_back(ppix);
354 SubDetParams ptob={
"TOB",2000,2900}; vsub.push_back(ptob);
355 SubDetParams ptecm={
"TEC-",3100,3300}; vsub.push_back(ptecm);
356 SubDetParams ptecp={
"TEC+",4100,4300}; vsub.push_back(ptecp);
362 std::pair<float,float>(*
size)(
int),
const std::vector<SubDetParams>& vsub) {
365 gROOT->SetStyle(
"Plain");
368 TProfile* aveontrkmult=0;
369 TProfile* averadius =0;
373 avemult= (TProfile*)gDirectory->Get(
"avemult");
374 averadius = (TProfile*)gDirectory->Get(
"averadius");
375 avez = (TProfile*)gDirectory->Get(
"avez");
377 if(ff->cd(ontrkmod)) aveontrkmult= (TProfile*)gDirectory->Get(
"avemult");
379 std::cout <<
"pointers " << avemult <<
" " << aveontrkmult <<
" " << averadius <<
" " << avez << std::endl;
381 if( averadius && avez && avemult && aveontrkmult) {
383 TH1D* havemult = avemult->ProjectionX(
"havemult");
384 TH1D* haveontrkmult = aveontrkmult->ProjectionX(
"haveontrkmult");
385 havemult->SetDirectory(0);
386 haveontrkmult->SetDirectory(0);
387 haveontrkmult->Divide(havemult);
389 new TCanvas(
"ontrkmult",
"ontrkmult",1200,500);
391 haveontrkmult->SetStats(0);
392 haveontrkmult->SetLineColor(kRed);
393 haveontrkmult->SetMarkerColor(kRed);
394 haveontrkmult->SetMarkerSize(.5);
395 haveontrkmult->SetMarkerStyle(20);
396 haveontrkmult->DrawCopy();
399 TCanvas* o2 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject(
"ontrkmult2");
402 haveontrkmult->SetLineColor(kBlue);
403 haveontrkmult->SetMarkerColor(kBlue);
406 o2 =
new TCanvas(
"ontrkmult2",
"ontrkmult2",1200,800);
409 for(
unsigned int isub=0;isub<vsub.size();++isub) {
410 printFrame(o2,haveontrkmult,vsub[isub].
label.c_str(),isub+1,vsub[isub].min,vsub[isub].max,same);
413 float (*
scale)(float);
416 drawMap(
"ontrkmultmap",haveontrkmult,averadius,avez,mmin,mmax,
size,
scale,color);
420 TCanvas*
drawMap(
const char* cname,
const TH1* hval,
const TProfile* averadius,
const TProfile* avez,
const float mmin,
const float mmax,
421 std::pair<float,float>(*
size)(
int),
float(*
scale)(
float),
const int color,
const char* ptitle) {
425 const Int_t NRGBs = 5;
426 const Int_t NCont = 255;
427 Double_t stops[NRGBs] = { 0.00, 0.25, 0.50, 0.75, 1.00 };
428 Double_t
red[NRGBs] = { 0.00, 0.00, 0.40, 1.00, 1.00 };
429 Double_t
green[NRGBs] = { 0.00, 0.40, 0.70, 0.60, 1.00 };
430 Double_t blue[NRGBs] = { 0.30, 0.60, 0.00, 0.00, 0.20 };
431 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
432 gStyle->SetNumberContours(NCont);
436 const Int_t NRGBs = 3;
437 const Int_t NCont = 255;
438 Double_t stops[NRGBs] = { 0.00, 0.50, 1.00 };
439 Double_t
red[NRGBs] = { 0.90, 0.50, 0.00};
440 Double_t
green[NRGBs] = { 0.90, 0.50, 0.00};
441 Double_t blue[NRGBs] = { 0.90, 0.50, 0.00};
442 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
443 gStyle->SetNumberContours(NCont);
447 const Int_t NRGBs = 7;
448 const Int_t NCont = 255;
449 Double_t stops[NRGBs] = { 0.00, 0.15, 0.30, 0.45, 0.65, 0.85, 1.00 };
450 Double_t
red[NRGBs] = { 0.60, 0.30, 0.00, 0.00, 0.60, 0.40, 0.00 };
451 Double_t
green[NRGBs] = { 1.00, 0.90, 0.80, 0.75, 0.20, 0.00, 0.00 };
452 Double_t blue[NRGBs] = { 1.00, 1.00, 1.00, 0.30, 0.00, 0.00, 0.00 };
453 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
454 gStyle->SetNumberContours(NCont);
457 int ncol = gStyle->GetNumberOfColors();
458 std::cout <<
"Number of colors " << ncol << std::endl;
463 for(
int i=1;
i<hval->GetNbinsX();++
i) {
465 if(averadius->GetBinEntries(
i)*avez->GetBinEntries(
i)) {
474 if(dz<0 && dr<0)
continue;
477 TBox* modmult =
new TBox(avez->GetBinContent(
i)-dz,averadius->GetBinContent(
i)-dr,avez->GetBinContent(
i)+dz,averadius->GetBinContent(
i)+dr);
478 modmult->SetFillStyle(1001);
480 modmult->SetFillColor(kBlack);
485 if(icol > (ncol-1)) icol=(ncol-1);
486 std::cout <<
i <<
" " << icol <<
" " << hval->GetBinContent(
i) << std::endl;
487 modmult->SetFillColor(gStyle->GetColorPalette(icol));
489 modulesmult.Add(modmult);
496 double etavalext[] = {4.,3.5,3.,2.8,2.6,2.4,2.2,2.0,1.8,1.6};
497 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};
501 for(
int i=0;
i<10;++
i) {
503 double eta = etavalext[
i];
504 TLine* lin =
new TLine(295,2*295/(
exp(eta)-
exp(-eta)),305,2*305/(
exp(eta)-
exp(-eta)));
507 sprintf(lab,
"%3.1f",eta);
508 TText*
label =
new TText(285,2*285/(
exp(eta)-
exp(-eta)),lab);
509 label->SetTextSize(.03);
510 label->SetTextAlign(22);
511 etalabels.Add(label);
513 for(
int i=0;
i<10;++
i) {
515 double eta = -1*etavalext[
i];
516 TLine* lin =
new TLine(-295,-2*295/(
exp(eta)-
exp(-eta)),-305,-2*305/(
exp(eta)-
exp(-eta)));
519 sprintf(lab,
"%3.1f",eta);
520 TText*
label =
new TText(-285,-2*285/(
exp(eta)-
exp(-eta)),lab);
521 label->SetTextSize(.03);
522 label->SetTextAlign(22);
523 etalabels.Add(label);
525 for(
int i=0;
i<15;++
i) {
527 double eta = etavalint[
i];
528 TLine* lin =
new TLine(130.*(
exp(eta)-
exp(-eta))/2.,130,138.*(
exp(eta)-
exp(-eta))/2.,138);
531 sprintf(lab,
"%3.1f",eta);
532 TText*
label =
new TText(125.*(
exp(eta)-
exp(-eta))/2.,125,lab);
533 label->SetTextSize(.03);
534 label->SetTextAlign(22);
535 etalabels.Add(label);
537 TLatex* etalab =
new TLatex(0,115,
"#eta");
538 etalab->SetTextSize(.03);
539 etalab->SetTextAlign(22);
540 etalabels.Add(etalab);
543 TLatex *cmslab =
new TLatex(0.15,0.965,
"CMS");
545 cmslab->SetTextSize(0.04);
546 cmslab->SetTextAlign(31);
547 paperlabels.Add(cmslab);
548 TLatex *enelab =
new TLatex(0.92,0.965,
"#sqrt{s} = 7 TeV");
550 enelab->SetTextSize(0.04);
551 enelab->SetTextAlign(31);
552 paperlabels.Add(enelab);
562 TGaxis *raxis =
new TGaxis(-310,0,-310,140,0,140,10,
"S");
563 TGaxis *zaxis =
new TGaxis(-310,0,310,0,-310,310,10,
"S");
564 raxis->SetTickSize(.01); zaxis->SetTickSize(.01);
565 raxis->SetTitle(
"r (cm)"); zaxis->SetTitle(
"z (cm)");
569 for(
int i = 0;
i< ncol ; ++
i) {
570 TBox* box=
new TBox(315,0+140./ncol*
i,330,0+140./ncol*(i+1));
571 box->SetFillStyle(1001);
572 box->SetFillColor(gStyle->GetColorPalette(i));
579 mpaxis =
new TGaxis(330,0,330,140,mmin,mmax,510,
"SLG+");
582 mpaxis =
new TGaxis(330,0,330,140,mmin,mmax,510,
"SL+");
584 mpaxis->SetTickSize(.02);
585 mpaxis->SetLabelOffset(mpaxis->GetLabelOffset()*0.5);
586 mpaxis->SetTitle(ptitle);
587 mpalette.Add(mpaxis);
589 TCanvas* cc2 =
new TCanvas(cname,cname,1000,500);
590 cc2->Range(-370.,-20.,390.,150.);
591 TFrame* fr2 =
new TFrame(-310,0,310,140);
592 fr2->UseCurrentStyle();
594 raxis->Draw(); zaxis->Draw();
595 std::cout << modulesmult.GetSize() << std::endl;
598 if(color>=0) mpalette.Draw();
608 gROOT->SetStyle(
"Plain");
610 TCanvas* cc =
new TCanvas(name,name,750,750);
611 cc->Range(-25,-25,25,25);
612 TFrame* fr1 =
new TFrame(-20,-20,20,20);
613 fr1->UseCurrentStyle();
617 TProfile* avex = (TProfile*)gDirectory->Get(
"avex");
618 TProfile* avey = (TProfile*)gDirectory->Get(
"avey");
619 TProfile* avez = (TProfile*)gDirectory->Get(
"avez");
621 if(avex && avey && avez) {
622 TText* tittext =
new TText(0,0,name);
623 tittext->SetTextSize(.04); tittext->SetTextAlign(22);
625 for(
unsigned int mod=ioffset+1;
mod<ioffset+57;++
mod) {
626 double x = avex->GetBinContent(
mod);
627 double y = avey->GetBinContent(
mod);
630 sprintf(modstring,
"%d",
mod%100);
631 TText* modtext =
new TText(x,y,modstring);
632 modtext->SetTextAngle(atan(y/x)*180/3.14159);
633 modtext->SetTextSize(.02); modtext->SetTextAlign(22); modtext->SetTextColor(kRed);
638 for(
unsigned int mod=ioffset+101;
mod<ioffset+157;++
mod) {
639 double x = avex->GetBinContent(
mod);
640 double y = avey->GetBinContent(
mod);
643 sprintf(modstring,
"%d",
mod%100);
644 TText* modtext =
new TText(x,y,modstring);
645 modtext->SetTextAngle(atan(y/x)*180/3.14159);
646 modtext->SetTextSize(.02); modtext->SetTextAlign(22); modtext->SetTextColor(kBlue);
647 std::cout <<
mod <<
" " << x <<
" " << y <<
" " << atan(y/x) << std::endl;
657 gROOT->SetStyle(
"Plain");
661 TProfile* averadius = (TProfile*)gDirectory->Get(
"averadius");
662 TProfile* avez = (TProfile*)gDirectory->Get(
"avez");
664 std::cout <<
"pointers " << averadius <<
" " << avez << std::endl;
666 if(averadius && avez) {
668 std::pair<float,float> (*size)(int);
670 float (*
scale)(float);
674 drawMap(
"trackermap",averadius,averadius,avez,0,0,size,
scale,-1);
686 TH1D* occutrend =
new TH1D(
"occutrend",
"Average number of clusters vs run",10,0.,10.);
687 occutrend->SetCanExtend(TH1::kXaxis);
691 std::sort(runs.begin(),runs.end());
694 for(
unsigned int i=0;
i<runs.size();++
i) {
697 sprintf(runlabel,
"%d",runs[
i]);
699 sprintf(runpath,
"run_%d",runs[i]);
704 if(occu==0) occu = (TProfile*)caoccu.
getObject(hname);
707 const int ibin=occu->FindBin(bin);
708 std::cout << runlabel <<
" " <<
" " << ibin <<
" " << occu->GetBinContent(ibin) <<
" " << occu->GetBinError(ibin) << std::endl;
709 const int jbin=occutrend->Fill(runlabel,occu->GetBinContent(ibin));
710 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)