1 #if !defined(__CINT__) || defined(__MAKECINT__)
3 #include <TFileMerger.h>
4 #include <TAlienFile.h>
7 #include <TGridResult.h>
13 #include <TFileMerger.h>
14 #include <TAlienFile.h>
18 #include <TGridResult.h>
19 #include <Riostream.h>
20 #include <TObjArray.h>
31 #include "AliRecoParam.h"
34 enum rawexpert_t{pattern,patternnorm,layer3norm,layer4norm,layer3occ,layer4occ,rawcheck,rawtot};
35 enum nonrawexpert_t{layer3,layer4,calibl3,calibl4,nonrawtot};
37 enum rpexpert_t{rlocaldistro,rlayer3norm,rlayer4norm,rmodpattern,rmodpatternnorm,rphilayer3,rphilayer4,rrlayer3,rrlayer4,occlayer3,occlayer4,recraw2dlayer3,recraw2dlayer4,recrawlayer3,recrawlayer4,dedxlayer3,dedxlayer4,rlayer3,rlayer4,recpointcheck,rtot};
38 enum rnonexpert_t{rphizlayer3,rphizlayer4,rglobalrz,rglobalxy,rchargelayer3,rchargelayer4,rtimelayer3,rtimelayer4,nrtot};
40 enum canvsname_t{canvname0,canvname1,canvname2,canvname3,canvname4,canvname5,canvname6,canvname7,canvname8,canvname9,canvname10,canvname11,canvname12,canvname13,canvname14,canvname15,canvname16,canvname17,canvname18,canvname19,canvname20,canvname21,canvname22,canvname23,canvasname24,canvasname25,canvasname26};//27
44 void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Bool_t kDoEps=kFALSE,Char_t eventspecie[25]="LowMultiplicity")
46 const TString Rawsexpertname[]={"SDDModPattern",//0 1
47 "SDDModPatternNORM",//1 //1
48 "SDDphizL3NORM", //2 //0
49 "SDDphizL4NORM", //3 //0
50 "SDDL3_RelativeOccupancy", //4 4 5
51 "SDDL4_RelativeOccupancy",//5 4 5
52 "SDDRawDataCheck"//6 6
54 const TString Rawsnonexpertname[]={"SDDphizL3",//0 2
56 "SDDphizCalibL3",//2 // 3
60 const TString RecPointsexpertname[]={"SDDLocalCoordDistrib",//0 //11
61 "SDDModPatternL3RP",//1 //12
62 "SDDModPatternL4RP",//2 //12
63 "SDDModPatternL3RPNORM",//3 //13
64 "SDDModPatternL4RPNORM",//4 //13
65 "SDDModPatternRP",//5 //14
66 "SDDModPatternRPNORM",//6 //14
67 "SDDphidistrib_Layer3",//7 //15
68 "SDDphidistrib_Layer4",//8 //15
69 "SDDrdistrib_Layer3",//9 //16
70 "SDDrdistrib_Layer4",//10 //16
71 "SDDL3_RelativeOccupancy",//11 //19 20
72 "SDDL4_RelativeOccupancy",//12 //19 20
73 "SDDL3_Rec2Raw_2D", //13 //21
74 "SDDL4_Rec2Raw_2D", //14 //21
75 "SDDL3_Rec2Raw", //15 //22 23
76 "SDDL4_Rec2Raw", //16 //22 23
77 "SDDL3_dedx", //17 //24 25
78 "SDDL4_dedx", //18 24 25
79 "SDDRecPointCheck"//19 26
82 const TString RecPointsnonexpertname[]={"SDDGlobalCoordDistribL3PHIZ",//0 7
83 "SDDGlobalCoordDistribL4PHIZ",//1 7
84 "SDDGlobalCoordDistribRZ",//2 8
85 "SDDGlobalCoordDistribYX",//3 8
86 "SDDLay3TotCh", //4 9 17
87 "SDDLay4TotCh", //5 9 17
88 "SDDdrifttime_Layer3", //6 10 18
89 "SDDdrifttime_Layer4"//7 10 18
92 const TString canvassavedname[]={"RawLayersNORM", //0
95 "CalibConfiguration", //3
96 "RawLayersRelOcc", //4
97 "RawLayersRelOccBoth", //5
100 "RecPointsGlobalDistributions", //8
101 "RecPointsCharge", //9
102 "RecPointsDriftTime", //10
103 "RecPointsLocalDistribution", //11
104 "RecPointsLayers", //12
105 "RecPointsLayersNORM", //13
106 "RecPointsLayersPatterns", //14
107 "RecPointsPhiDistribution", //15
108 "RecPointsRDistribution", //16
109 "RecPointsChargeBothLayers", //17
110 "RecPointsDriftTimeBothLayers", //18
111 "RecPointsRelLayersOcc", //19
112 "RecPointsLayersRelOccBoth", //20
113 "RecPointsLayersRecRaw2D", //21
114 "RecPointsLayersRecRaw", //22
115 "RecPointsLayersRecRawBoth", //23
116 "RecPointsLayersdedx", //24
117 "RecPointsLayersdedxBoth", //25
118 "CheckRecPoints" //26
121 Char_t trendfile[25]="FileQAtrend.root";
123 TString psfilestart=Form("SDDQAPlot.ps[");
124 TString psfile =Form("SDDQAPlot.ps");
125 TString psfileend =Form("SDDQAPlot.ps]");
128 gStyle->SetTitleFont(62,"");
129 gStyle->SetTitleFontSize(0.025);
130 gStyle->SetPalette(1);
131 // gStyle->SetOptStat("ne");
132 if(gSystem->Exec(Form("ls %s >/dev/null 2>&1", fileName))!=0)
134 printf(" No file created --- Exit");
137 TFile mergedfile(fileName);
138 if(mergedfile.GetKey("ITS")==0x0){
139 printf("In this run ITS QA has not been executed.\n\nExit macro \n\n");
142 Char_t filepath[100];
143 Char_t namecanvas[50];
144 TDirectory *directory=NULL;
145 TDirectory *directory2=NULL;
146 Char_t histoname[200];
148 TH1F *historaw2=NULL;
149 TH2F *histodraw=NULL;
151 // TH1F *histo2save[9];
152 //for(Int_t i=0;i<9;i++){histo2save[i]=NULL;}
154 TF1 *f1 = new TF1("f1","1",-100000,100000); // this is the function defined to multiply histograms
161 //Int_t histo2savenumber[9]={4,5,6,7,7,8,3,5,1};
162 TCanvas *canvas1 = new TCanvas("canvas1","SDD QA Plot",1000,600);
163 // TLegend *legend=new TLegend(0.83,0.8,0.97,0.7);
164 TLegend *legend=new TLegend(0.81,0.895,0.95,0.995);
165 Bool_t updatecanvas[2];
166 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
168 // -------------This part is to read the number of chunks that were merged
169 Float_t fChnknmbr=0.;
170 FILE * pChunkNumber = fopen ("ChunkNumber.txt","r");
172 Int_t rv=fscanf(pChunkNumber, "%f", &fChnknmbr);
173 fclose (pChunkNumber);
177 gStyle->SetPalette(1);
178 float fCNinv=1./fChnknmbr;
179 // printf("\n====================>%f\n\n", fCNinv);
182 if(!mergedfile.IsOpen()){return;}else{printf("file is open\n");}
184 for(Int_t ispecie=0;ispecie<AliRecoParam::kNSpecies;ispecie++){
185 //__________________________________________________________________
187 sprintf(filepath,"ITS/Raws/%s",AliRecoParam::GetEventSpecieName(ispecie));
188 printf("%s",filepath);
189 TString especie(filepath);
190 if(!especie.Contains(eventspecie)){printf("...Found and Skipped\n");continue;}
191 canvas1->Print(psfilestart.Data());
192 directory=(TDirectory*)mergedfile.Get(filepath);
193 if(!directory){printf("...Not Found\n ");}//faccio l'istogramma
196 printf("...Found: The histograms of this EventSpecie will be displayed\n");
199 canvas1->Divide(2,1);
201 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
202 for(Int_t iraws=2;iraws<4;iraws++){//non expert raws
203 canvas1->cd(iraws-1);
205 sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[iraws].Data());
206 printf("histo name %s ",Rawsexpertname[iraws].Data());
207 historaw=(TH2D*)mergedfile.Get(histoname);
208 if(historaw){printf("...Found\n"); historaw->Multiply(f1,fCNinv); historaw->DrawCopy("colz");}
211 sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[iraws].Data());
212 printf("...Not found\nSecond try for histo name %s ",Rawsexpertname[iraws].Data());
213 historaw=(TH2D*)mergedfile.Get(histoname);
214 if(historaw){printf("...Found\n"); historaw->Multiply(f1,fCNinv);historaw->DrawCopy("colz");}
217 updatecanvas[iraws-2]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");
223 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
227 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
228 canvas1->SaveAs(namecanvas);
230 canvas1->Print(psfile.Data());
232 //else{delete canvas1; canvas1=NULL;}
233 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
235 canvas1->Divide(1,2);
238 for(Int_t inraws=0;inraws<2;inraws++){//non expert raws
239 canvas1->cd(inraws+1);
240 sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[inraws].Data());
241 printf("histo name %s ",Rawsexpertname[inraws].Data());
242 historaw2=(TH1F*)mergedfile.Get(histoname);
243 // -----------------This is the part were I divide between the number of chunks to normalize the histogram----------------
248 printf("...Found\n");
251 historaw2->Multiply(f1,fCNinv);
254 historaw2->DrawCopy();
256 else {updatecanvas[inraws]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
259 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
263 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
264 canvas1->SaveAs(namecanvas);
266 canvas1->Print(psfile.Data());
268 //else{delete canvas2; canvas2=NULL;}
270 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
274 canvas1->Divide(2,1);
275 for(Int_t iraws=0;iraws<2;iraws++){//non expert raws
276 canvas1->cd(iraws+1);
278 sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsnonexpertname[iraws].Data());
279 printf("histo name %s",Rawsnonexpertname[iraws].Data());
280 historaw=(TH2D*)mergedfile.Get(histoname);
282 printf("...Found\n");
283 // historaw->SetTitleSize(0.02);
285 historaw->DrawCopy("colz");
289 sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsnonexpertname[iraws].Data());
290 printf("...Not Found.\n Second Try for histo name %s",Rawsnonexpertname[iraws].Data());
291 historaw=(TH2D*)mergedfile.Get(histoname);
293 printf("...Found\n");
294 // historaw->SetTitleSize(0.02);
295 historaw->Multiply(f1,fCNinv);
296 historaw->DrawCopy("colz");
300 updatecanvas[iraws]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");
305 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
309 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
310 canvas1->SaveAs(namecanvas);
312 canvas1->Print(psfile.Data());
314 //else{delete canvas3; canvas3=NULL;}
316 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
320 canvas1->Divide(2,1);
321 for(Int_t iraws=2;iraws<4;iraws++){//non expert raws
322 canvas1->cd(iraws-1);
324 sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsnonexpertname[iraws].Data());
325 printf("histo name %s",Rawsnonexpertname[iraws].Data());
326 historaw=(TH2D*)mergedfile.Get(histoname);
328 printf("...Found\n");
329 // historaw->SetTitleSize(0.02);
330 // historaw->Multiply(f1,fCNinv);
331 historaw->DrawCopy("colz");
335 updatecanvas[iraws]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");
339 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
343 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
344 canvas1->SaveAs(namecanvas);
346 canvas1->Print(psfile.Data());
349 //--------------------- new plots
350 printf("================= 4\n");
351 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
354 canvas1->Divide(2,1);
355 for(Int_t iraws=4;iraws<rawtot-1;iraws++){//non expert raws
356 canvas1->cd(iraws-3);
357 sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[iraws].Data());
358 printf("histo name %s",Rawsexpertname[iraws].Data());
359 historaw2=(TH1F*)mergedfile.Get(histoname);
362 printf("...Found\n");
363 historaw2->DrawCopy();
366 updatecanvas[iraws-4]=kFALSE;
367 printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");
371 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
375 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
376 canvas1->SaveAs(namecanvas);
378 canvas1->Print(psfile.Data());
380 //else{delete canvas3; canvas3=NULL;}
383 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
388 for (Int_t i=4;i<rawtot-1;i++){
389 sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[i].Data());
390 historaw2=(TH1F*)mergedfile.Get(histoname);
392 fmax=historaw2->GetMaximum();
403 fmaxmargin=1.1*fmaxold;
404 for(Int_t irrpp=4;irrpp<rawtot-1;irrpp++){//non expert raws
406 sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[irrpp].Data());
407 printf("histo name %s",Rawsexpertname[irrpp].Data());
408 sprintf(layer, "layer %d",irrpp-1);
409 historaw2=(TH1F*)mergedfile.Get(histoname);
410 gStyle->SetOptStat(0);
414 printf("...Found\n");
415 historaw2->GetYaxis()->SetRangeUser(0,fmaxmargin);
416 historaw2->SetTitle("Raw Relative Occupancy");
417 if (irrpp==4) {historaw2->SetStats(0);historaw2->SetLineColor(2);historaw2->DrawCopy();}
418 if (irrpp!=4) {historaw2->SetStats(0);historaw2->SetLineColor(4);historaw2->DrawCopy("same");}
419 legend->AddEntry(historaw2,layer,"l");
423 else{updatecanvas[irrpp-4]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
426 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
430 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
431 canvas1->SaveAs(namecanvas);
433 canvas1->Print(psfile.Data());
435 //---------------------------- summary plot ------------------------//
438 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
439 sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[rawtot-1].Data());
440 printf("histo name %s",Rawsexpertname[rawtot-1].Data());
442 historaw2=(TH1F*)mergedfile.Get(histoname);
445 printf("...Found\n");
446 historaw2->SetStats(0);
447 historaw2->DrawCopy();
450 else{updatecanvas[0]=kFALSE;updatecanvas[1]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
452 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
456 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
457 canvas1->SaveAs(namecanvas);
459 canvas1->Print(psfile.Data());
466 //_______________________________________________________________________________
468 sprintf(filepath,"ITS/RecPoints/%s",AliRecoParam::GetEventSpecieName(ispecie));
469 printf("%s\n",filepath);
470 directory2=(TDirectory*)mergedfile.Get(filepath);
473 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
475 canvas1->Divide(2,1);
478 for(Int_t irp=0;irp<2;irp++){//non expert rec point
481 sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsnonexpertname[irp].Data());
482 printf("histo name %s ",RecPointsnonexpertname[irp].Data());
483 histodraw=(TH2F*)mergedfile.Get(histoname);
484 if(histodraw){printf("...Found\n");histodraw->DrawCopy("colz");}else{updatecanvas[irp]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
487 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
491 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
492 canvas1->SaveAs(namecanvas);
494 canvas1->Print(psfile.Data());
496 // else{delete canvas4; canvas4=NULL;}
499 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
501 canvas1->Divide(2,1);
504 for(Int_t irrp=2;irrp<4;irrp++){//non expert raws
507 sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsnonexpertname[irrp].Data());
508 printf("histo name %s",RecPointsnonexpertname[irrp].Data() );
509 histodraw=(TH2F*)mergedfile.Get(histoname);
510 if(histodraw){printf("...Found\n");histodraw->DrawCopy("colz");}else{updatecanvas[irrp-2]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
513 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
517 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
518 canvas1->SaveAs(namecanvas);
520 canvas1->Print(psfile.Data());
522 //else{delete canvas5; canvas5=NULL;}
525 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
527 canvas1->Divide(1,2);
530 for(Int_t irrpp=4;irrpp<6;irrpp++){//non expert raws
531 canvas1->cd(irrpp-3);
533 sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsnonexpertname[irrpp].Data());
534 printf("histo name %s",RecPointsnonexpertname[irrpp].Data());
535 historaw2=(TH1F*)mergedfile.Get(histoname);
537 if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[irrpp-4]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
540 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
544 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
545 canvas1->SaveAs(namecanvas);
547 canvas1->Print(psfile.Data());
549 //else{delete canvas6; canvas6=NULL;}
551 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
553 canvas1->Divide(1,2);
556 for(Int_t irrpp=6;irrpp<8;irrpp++){//non expert raws
557 canvas1->cd(irrpp-5);
558 // printf("histo name\n");
559 sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsnonexpertname[irrpp].Data());
560 printf("histo name %s",RecPointsnonexpertname[irrpp].Data());
561 historaw2=(TH1F*)mergedfile.Get(histoname);
562 if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[irrpp-6]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
565 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
569 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
570 canvas1->SaveAs(namecanvas);
572 canvas1->Print(psfile.Data());
574 //else{delete canvas7; canvas7=NULL;}
576 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
580 //canvas1->Divide(2,1);
581 sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[rlocaldistro].Data());
582 printf("histo name %s",RecPointsexpertname[rlocaldistro].Data());
583 histodraw=(TH2F*)mergedfile.Get(histoname);
585 if(histodraw){printf("...Found\n");histodraw->DrawCopy("colz");}else{updatecanvas[0]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
587 if(updatecanvas[0]==kTRUE){
590 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
591 canvas1->SaveAs(namecanvas);
593 canvas1->Print(psfile.Data());
595 //else{delete canvas8; canvas8=NULL;}
597 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
599 canvas1->Divide(2,1);
602 for(Int_t i=1;i<3;i++)
606 sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
607 printf("histo name %s",RecPointsexpertname[i].Data());
608 histodraw=(TH2F*)mergedfile.Get(histoname);
610 if(histodraw){printf("...Found\n");histodraw->DrawCopy("colz");}else{updatecanvas[i-1]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
613 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
617 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
618 canvas1->SaveAs(namecanvas);
620 canvas1->Print(psfile.Data());
623 //else{delete canvas9; canvas9=NULL;}
624 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
626 canvas1->Divide(2,1);
629 for(Int_t i=3;i<5;i++)
633 sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
634 histodraw=(TH2F*)mergedfile.Get(histoname);
635 printf("histo name %s",RecPointsexpertname[i].Data());
638 printf("...Found\n");histodraw->Multiply(f1,fCNinv);
639 histodraw->DrawCopy("colz");
640 }else{updatecanvas[i-3]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
643 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
647 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
648 canvas1->SaveAs(namecanvas);
650 canvas1->Print(psfile.Data());
654 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
656 canvas1->Divide(1,2);
660 for(Int_t i=5;i<7;i++)
664 sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
665 printf("histo name %s",RecPointsexpertname[i].Data());
666 historaw2=(TH1F*)mergedfile.Get(histoname);
670 printf("...Found\n");
671 if (i==4){historaw2->Multiply(f1,fCNinv);}
672 historaw2->DrawCopy();
674 else{updatecanvas[i-5]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
677 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
681 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
682 canvas1->SaveAs(namecanvas);
684 canvas1->Print(psfile.Data());
688 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
690 canvas1->Divide(2,1);
693 for(Int_t i=7;i<9;i++)
697 sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
698 printf("histo name %s",RecPointsexpertname[i].Data());
699 historaw2=(TH1F*)mergedfile.Get(histoname);
701 if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[i-7]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
704 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
708 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
709 canvas1->SaveAs(namecanvas);
711 canvas1->Print(psfile.Data());
714 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
716 canvas1->Divide(2,1);
719 for(Int_t i=9;i<11;i++)
722 sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
723 printf("histo name %s",RecPointsexpertname[i].Data());
724 historaw2=(TH1F*)mergedfile.Get(histoname);
726 if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[i-9]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
729 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
733 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
734 canvas1->SaveAs(namecanvas);
736 canvas1->Print(psfile.Data());
741 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
746 for (Int_t i=4;i<6;i++){
747 sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsnonexpertname[i].Data());
748 historaw2=(TH1F*)mergedfile.Get(histoname);
750 fmax=historaw2->GetMaximum();
761 fmaxmargin=1.1*fmaxold;
762 for(Int_t irrpp=4;irrpp<6;irrpp++){//non expert raws
764 sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsnonexpertname[irrpp].Data());
765 printf("histo name %s",RecPointsnonexpertname[irrpp].Data());
766 sprintf(layer, "layer %d",irrpp-1);
767 historaw2=(TH1F*)mergedfile.Get(histoname);
768 gStyle->SetOptStat(0);
772 printf("...Found\n");
773 historaw2->GetYaxis()->SetRangeUser(0,fmaxmargin);
774 historaw2->SetTitle("Charge");
775 historaw2->SetFillColor(0);
776 if (irrpp==4) {historaw2->SetStats(0);historaw2->SetLineColor(2);historaw2->DrawCopy();}
777 if (irrpp!=4) {historaw2->SetStats(0);historaw2->SetLineColor(4);historaw2->DrawCopy("same");}
778 legend->AddEntry(historaw2,layer,"l");
782 else{updatecanvas[irrpp-4]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
785 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
789 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
790 canvas1->SaveAs(namecanvas);
792 canvas1->Print(psfile.Data());
795 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
800 for (Int_t i=6;i<8;i++){
801 sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsnonexpertname[i].Data());
802 historaw2=(TH1F*)mergedfile.Get(histoname);
804 fmax=historaw2->GetMaximum();
810 fmaxmargin=1.1*fmaxold;
812 for(Int_t irrpp=6;irrpp<8;irrpp++){//non expert raws
814 sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsnonexpertname[irrpp].Data());
815 printf("histo name %s",RecPointsnonexpertname[irrpp].Data());
816 sprintf(layer, "layer %d",irrpp-3);
817 historaw2=(TH1F*)mergedfile.Get(histoname);
818 gStyle->SetOptStat(0);
822 printf("...Found\n");
823 historaw2->GetYaxis()->SetRangeUser(0,fmaxmargin);
824 historaw2->SetTitle("Drift Time");
825 historaw2->SetFillColor(0);
826 if (irrpp==6) {historaw2->SetStats(0); historaw2->SetLineColor(2);historaw2->DrawCopy();}
827 if (irrpp!=6) {historaw2->SetStats(0); historaw2->SetLineColor(4);historaw2->DrawCopy("same");}
828 legend->AddEntry(historaw2,layer,"l");
832 else{updatecanvas[irrpp-6]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
833 printf("%s\n%s\n",historaw2->GetName(),historaw2->GetTitle());
836 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
840 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
841 canvas1->SaveAs(namecanvas);
843 canvas1->Print(psfile.Data());
846 //------------------------------------------- new plot
848 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
850 canvas1->Divide(2,1);
853 for(Int_t i=11;i<13;i++)
856 sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
857 printf("histo name %s",RecPointsexpertname[i].Data());
858 historaw2=(TH1F*)mergedfile.Get(histoname);
860 if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[i-11]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
863 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
867 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
868 canvas1->SaveAs(namecanvas);
870 canvas1->Print(psfile.Data());
873 //------------------------------------
874 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
879 for (Int_t i=11;i<13;i++){
880 sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
881 historaw2=(TH1F*)mergedfile.Get(histoname);
883 fmax=historaw2->GetMaximum();
894 fmaxmargin=1.1*fmaxold;
895 for(Int_t irrpp=11;irrpp<13;irrpp++){//non expert raws
897 sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[irrpp].Data());
898 printf("histo name %s",RecPointsexpertname[irrpp].Data());
899 sprintf(layer, "layer %d",irrpp-8);
900 historaw2=(TH1F*)mergedfile.Get(histoname);
901 gStyle->SetOptStat(0);
905 printf("...Found\n");
906 historaw2->GetYaxis()->SetRangeUser(0,fmaxmargin);
907 historaw2->SetTitle("RecPoint Relative Occupancy");
908 if (irrpp==11) {historaw2->SetStats(0);historaw2->SetLineColor(2);historaw2->DrawCopy();}
909 if (irrpp!=11) {historaw2->SetStats(0);historaw2->SetLineColor(4);historaw2->DrawCopy("same");}
910 legend->AddEntry(historaw2,layer,"l");
914 else{updatecanvas[irrpp-11]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
917 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
921 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
922 canvas1->SaveAs(namecanvas);
924 canvas1->Print(psfile.Data());
928 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
930 canvas1->Divide(2,1);
933 for(Int_t i=13;i<15;i++)
936 sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
937 printf("histo name %s",RecPointsexpertname[i].Data());
938 historaw=(TH2D*)mergedfile.Get(histoname);
940 if(historaw){printf("...Found\n"); historaw->DrawCopy("colz");}else{updatecanvas[i-13]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
943 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
947 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
948 canvas1->SaveAs(namecanvas);
950 canvas1->Print(psfile.Data());
956 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
958 canvas1->Divide(2,1);
961 for(Int_t i=15;i<17;i++)
964 sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
965 printf("histo name %s",RecPointsexpertname[i].Data());
966 historaw2=(TH1F*)mergedfile.Get(histoname);
968 if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[i-15]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
971 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
975 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
976 canvas1->SaveAs(namecanvas);
978 canvas1->Print(psfile.Data());
980 //--------------------------------------------
982 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
987 for (Int_t i=15;i<17;i++){
988 sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
989 historaw2=(TH1F*)mergedfile.Get(histoname);
991 fmax=historaw2->GetMaximum();
1002 fmaxmargin=1.1*fmaxold;
1003 for(Int_t irrpp=15;irrpp<17;irrpp++){//non expert raws
1005 sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[irrpp].Data());
1006 printf("histo name %s",RecPointsexpertname[irrpp].Data());
1007 sprintf(layer, "layer %d",irrpp-12);
1008 historaw2=(TH1F*)mergedfile.Get(histoname);
1009 gStyle->SetOptStat(0);
1013 printf("...Found\n");
1014 historaw2->GetYaxis()->SetRangeUser(0,fmaxmargin);
1015 historaw2->SetTitle("Rec2Raw Ratio");
1016 if (irrpp==15) {historaw2->SetStats(0);historaw2->SetLineColor(2);historaw2->DrawCopy();}
1017 if (irrpp!=15) {historaw2->SetStats(0);historaw2->SetLineColor(4);historaw2->DrawCopy("same");}
1018 legend->AddEntry(historaw2,layer,"l");
1022 else{updatecanvas[irrpp-15]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
1025 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
1029 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
1030 canvas1->SaveAs(namecanvas);
1032 canvas1->Print(psfile.Data());
1036 //--------------------------------------
1038 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
1040 canvas1->Divide(2,1);
1043 for(Int_t i=17;i<19;i++)
1046 sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
1047 printf("histo name %s",RecPointsexpertname[i].Data());
1048 historaw2=(TH1F*)mergedfile.Get(histoname);
1050 if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[i-17]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
1053 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
1057 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
1058 canvas1->SaveAs(namecanvas);
1060 canvas1->Print(psfile.Data());
1064 //--------------------------------------------
1066 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
1071 for (Int_t i=17;i<19;i++){
1072 sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
1073 historaw2=(TH1F*)mergedfile.Get(histoname);
1075 fmax=historaw2->GetMaximum();
1079 if(fmaxold<fmax){fmaxold=fmax;}
1084 fmaxmargin=1.1*fmaxold;
1085 for(Int_t irrpp=17;irrpp<19;irrpp++){//non expert raws
1087 sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[irrpp].Data());
1088 printf("histo name %s",RecPointsexpertname[irrpp].Data());
1089 sprintf(layer, "layer %d",irrpp-14);
1090 historaw2=(TH1F*)mergedfile.Get(histoname);
1091 gStyle->SetOptStat(0);
1095 printf("...Found\n");
1096 historaw2->GetYaxis()->SetRangeUser(0,fmaxmargin);
1097 historaw2->SetTitle("RecPoint dEdx");
1098 if (irrpp==17) {historaw2->SetStats(0);historaw2->SetLineColor(2);historaw2->DrawCopy();}
1099 if (irrpp!=17) {historaw2->SetStats(0);historaw2->SetLineColor(4);historaw2->DrawCopy("same");}
1100 legend->AddEntry(historaw2,layer,"l");
1104 else{updatecanvas[irrpp-15]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
1107 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
1111 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
1112 canvas1->SaveAs(namecanvas);
1114 canvas1->Print(psfile.Data());
1116 //------------------------summary plot ---------------//
1118 for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
1125 sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[rtot-1].Data());
1126 printf("histo name %s",RecPointsexpertname[rtot-1].Data());
1127 historaw2=(TH1F*)mergedfile.Get(histoname);
1131 printf("...Found\n");
1133 historaw2->DrawCopy();
1135 else{updatecanvas[0]=kFALSE;updatecanvas[1]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
1138 if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
1142 sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
1143 canvas1->SaveAs(namecanvas);
1145 canvas1->Print(psfile.Data());
1152 canvas1->Print(psfileend.Data());
1154 TFile file2savefortrend(trendfile,"recreate");
1155 file2savefortrend.cd();
1157 for(Int_t isave=0;isave<nonrawtot;isave++)
1159 sprintf(histoname,"ITS/Raws/%s/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),Rawsnonexpertname[isave].Data());
1160 historaw=(TH2D*)mergedfile.Get(histoname);
1162 printf("Saved %s\n",histoname);
1166 for(Int_t isave1=0;isave1<rawtot;isave1++)
1168 sprintf(histoname,"ITS/Raws/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[isave1].Data());
1169 if(isave1==2||isave1==3)
1171 historaw=(TH2D*)mergedfile.Get(histoname);
1177 historaw2=(TH1F*)mergedfile.Get(histoname);
1181 printf("Saved %s\n",histoname);
1184 for(Int_t isave2=0;isave2<nrtot;isave2++)
1186 sprintf(histoname,"ITS/RecPoints/%s/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsnonexpertname[isave2].Data());
1187 if(isave2<4||isave2==17||isave2==18)
1189 historaw=(TH2D*)mergedfile.Get(histoname);
1195 historaw2=(TH1F*)mergedfile.Get(histoname);
1199 printf("Saved %s\n",histoname);
1201 for(Int_t isave3=0;isave3<rtot;isave3++)
1203 sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[isave3].Data());
1204 //printf(histoname,"ITS/RecPoints/%s/Expert/%s_%s \n",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[isave3].Data());
1205 if(isave3<3||isave3==11||isave3==12||isave3==17||isave3==18)
1207 histodraw=(TH2F*)mergedfile.Get(histoname);
1213 historaw2=(TH1F*)mergedfile.Get(histoname);
1217 printf("Saved %s\n",histoname);
1220 //for(Int_t iss=0;iss<9;iss++){printf("Saved %d\n",iss); histo2save[iss]->Write();}
1221 file2savefortrend.Close();
1223 //else{delete canvas13; canvas13=NULL;}