5 // Compare the MC information with the reconstructed
9 after running analysis, read the file, and get component
10 gSystem->Load("libPWGPP.so");
11 TFile f("Output.root");
12 AliComparisonDraw * comp = (AliComparisonDraw*)f.Get("AliComparisonDraw");
13 TF1 fl("fl","((min(250./(abs(x+0.000001)),250)-90))",0,2); // length function
14 TF1 fl2("fl2","[0]/((min(250./(abs(x+0.000001)),250)-90))^[1]",0,2);
15 fl2.SetParameter(1,1);
16 fl2.SetParameter(0,1);
28 #include "TProfile2D.h"
34 #include "AliESDEvent.h" // new container
36 #include "AliESDfriend.h"
37 #include "AliESDfriendTrack.h"
39 #include "AliMathBase.h"
40 #include "AliTreeDraw.h"
42 #include "AliMCInfo.h"
43 #include "AliESDRecInfo.h"
44 #include "AliComparisonDraw.h"
47 ClassImp(AliComparisonDraw)
49 Bool_t AliComparisonDraw::fgBDraw=kFALSE; //option draw temporary results
51 AliComparisonDraw::AliComparisonDraw():
52 TNamed("ComparisonDraw","ComparisonDraw"),
53 fEffTPCPt(0), // TPC efficiency as function of Pt (tan+-1)
54 fEffTPCPtMC(0), // MC -TPC efficiency as function of Pt (tan+-1)
55 fEffTPCPtF(0), // efficiency for findable tracks
57 fEffTPCTan(0), // TPC efficiency as function of Tan (pt>0.15
58 fEffTPCTanMC(0), // MC -TPC efficiency as function of Tan (pt>0.15)
59 fEffTPCTanF(0), // efficiency for findable tracks Tan (pt>0.15)
61 fEffTPCPtTan(0), // TPC efficiency as function of Pt and tan
62 fEffTPCPtTanMC(0), // MC -TPC efficiency as function of Pt and tan
63 fEffTPCPtTanF(0), // TPC efficiency as function of Pt and tan
67 fTPCSignalNormTan(0), // tpc signal normalized to the mean signal - MC
68 fTPCSignalNormSPhi(0), // tpc signal normalized to the mean signal - MC
69 fTPCSignalNormTPhi(0), // tpc signal normalized to the mean signal - MC
71 fTPCSignalNormTanSPhi(0), // tpc signal normalized to the mean signal - MC
72 fTPCSignalNormTanTPhi(0), // tpc signal normalized to the mean signal - MC
73 fTPCSignalNormTanSPt(0), // tpc signal normalized to the mean signal - MC
76 fPtResolLPT(0), // pt resolution - low pt
77 fPtResolHPT(0), // pt resolution - high pt
78 fPtPullLPT(0), // pt resolution - low pt
79 fPtPullHPT(0), // pt resolution - high pt
81 // Resolution constrained param
83 fCPhiResolTan(0), // angular resolution - constrained
84 fCTanResolTan(0), // angular resolution - constrained
85 fCPtResolTan(0), // pt resolution - constrained
86 fCPhiPullTan(0), // angular resolution - constrained
87 fCTanPullTan(0), // angular resolution - constrained
88 fCPtPullTan(0), // pt resolution - constrained
92 fD0TanSPtB1(0), // distance to vertex y
93 fD1TanSPtB1(0), // distance to vertex z
94 fD0TanSPtL1(0), // distance to vertex y
95 fD1TanSPtL1(0) // distance to vertex z
100 AliComparisonDraw::AliComparisonDraw(const AliComparisonDraw& draw):
101 TNamed(draw.GetName(),draw.GetTitle()),
102 fEffTPCPt(draw.fEffTPCPt), // TPC efficiency as function of Pt (tan+-1)
103 fEffTPCPtMC(draw.fEffTPCPtMC), // MC -TPC efficiency as function of Pt (tan+-1)
104 fEffTPCPtF(draw.fEffTPCPtF), // efficiency for findable tracks
106 fEffTPCTan(draw.fEffTPCTan), // TPC efficiency as function of Tan (pt>0.15
107 fEffTPCTanMC(draw.fEffTPCTanMC), // MC -TPC efficiency as function of Tan (pt>0.15)
108 fEffTPCTanF(draw.fEffTPCTanF), // efficiency for findable tracks Tan (pt>0.15)
110 fEffTPCPtTan(draw.fEffTPCPtTan), // TPC efficiency as function of Pt and tan
111 fEffTPCPtTanMC(draw.fEffTPCPtTanMC), // MC -TPC efficiency as function of Pt and tan
112 fEffTPCPtTanF(draw.fEffTPCPtTanF), // TPC efficiency as function of Pt and tan
116 fTPCSignalNormTan(draw.fTPCSignalNormTan), // tpc signal normalized to the mean signal - MC
117 fTPCSignalNormSPhi(draw.fTPCSignalNormSPhi), // tpc signal normalized to the mean signal - MC
118 fTPCSignalNormTPhi(draw.fTPCSignalNormTPhi), // tpc signal normalized to the mean signal - MC
120 fTPCSignalNormTanSPhi(draw.fTPCSignalNormTanSPhi), // tpc signal normalized to the mean signal - MC
121 fTPCSignalNormTanTPhi(draw.fTPCSignalNormTanTPhi), // tpc signal normalized to the mean signal - MC
122 fTPCSignalNormTanSPt(draw.fTPCSignalNormTanSPt), // tpc signal normalized to the mean signal - MC
125 fPtResolLPT(draw.fPtResolLPT), // pt resolution - low pt
126 fPtResolHPT(draw.fPtResolHPT), // pt resolution - high pt
127 fPtPullLPT(draw.fPtPullLPT), // pt resolution - low pt
128 fPtPullHPT(draw.fPtPullHPT), // pt resolution - high pt
130 // Resolution constrained param
132 fCPhiResolTan(draw.fCPhiResolTan), // angular resolution - constrained
133 fCTanResolTan(draw.fCTanResolTan), // angular resolution - constrained
134 fCPtResolTan(draw.fCPtResolTan), // pt resolution - constrained
135 fCPhiPullTan(draw.fCPhiPullTan), // angular resolution - constrained
136 fCTanPullTan(draw.fCTanPullTan), // angular resolution - constrained
137 fCPtPullTan(draw.fCPtPullTan), // pt resolution - constrained
141 fD0TanSPtB1(draw.fD0TanSPtB1), // distance to vertex y
142 fD1TanSPtB1(draw.fD1TanSPtB1), // distance to vertex z
143 fD0TanSPtL1(draw.fD0TanSPtL1), // distance to vertex y
144 fD1TanSPtL1(draw.fD1TanSPtL1) // distance to vertex z
151 AliComparisonDraw& AliComparisonDraw::operator=(const AliComparisonDraw& info){
153 // assignment operator
156 new (this) AliComparisonDraw(info);
163 AliComparisonDraw::~AliComparisonDraw(){
167 delete fEffTPCPt; // TPC efficiency as function of Pt (tan+-1)
168 delete fEffTPCPtMC; // MC -TPC efficiency as function of Pt (tan+-1)
169 delete fEffTPCPtF; // efficiency for findable tracks
171 delete fEffTPCTan; // TPC efficiency as function of Tan (pt>0.15
172 delete fEffTPCTanMC; // MC -TPC efficiency as function of Tan (pt>0.15)
173 delete fEffTPCTanF; // efficiency for findable tracks Tan (pt>0.15)
175 delete fEffTPCPtTan; // TPC efficiency as function of Pt and tan
176 delete fEffTPCPtTanMC; // MC -TPC efficiency as function of Pt and tan
177 delete fEffTPCPtTanF; // TPC efficiency as function of Pt and tan
181 delete fTPCSignalNormTan; // tpc signal normalized to the mean signal - MC
182 delete fTPCSignalNormSPhi; // tpc signal normalized to the mean signal - MC
183 delete fTPCSignalNormTPhi; // tpc signal normalized to the mean signal - MC
185 delete fTPCSignalNormTanSPhi; // tpc signal normalized to the mean signal - MC
186 delete fTPCSignalNormTanTPhi; // tpc signal normalized to the mean signal - MC
187 delete fTPCSignalNormTanSPt; // tpc signal normalized to the mean signal - MC
190 delete fPtResolLPT; // pt resolution - low pt
191 delete fPtResolHPT; // pt resolution - high pt
192 delete fPtPullLPT; // pt resolution - low pt
193 delete fPtPullHPT; // pt resolution - high pt
195 // Resolution constrained param
197 delete fCPhiResolTan; // angular resolution - constrained
198 delete fCTanResolTan; // angular resolution - constrained
199 delete fCPtResolTan; // pt resolution - constrained
200 delete fCPhiPullTan; // angular resolution - constrained
201 delete fCTanPullTan; // angular resolution - constrained
202 delete fCPtPullTan; // pt resolution - constrained
206 delete fD0TanSPtB1; // distance to vertex y
207 delete fD1TanSPtB1; // distance to vertex z
208 delete fD0TanSPtL1; // distance to vertex y
209 delete fD1TanSPtL1; // distance to vertex z
216 void AliComparisonDraw::InitHisto(){
221 // Efficiency as function of pt
222 fEffTPCPt = new TProfile("Eff_pt","Eff_Pt",50,0.1,3); // physical
223 fEffTPCPtMC = new TProfile("MC_Eff_pt","MC_Eff_Pt",50,0.1,3); // MC - particles make more than 50 rowdigits
224 fEffTPCPtF = new TProfile("F_Eff_pt","F_Eff_Pt",50,0.1,3); // tracking - under condition more than 50 rdigits
226 // Efficiency as function of pt
227 fEffTPCTan = new TProfile("Eff_tan","Eff_tan",50,-2.5,2.5); // physical
228 fEffTPCTanMC = new TProfile("MC_Eff_tan","MC_Eff_tan",50,-2.5,2.5); // MC - particles make more than 50 rowdigits
229 fEffTPCTanF = new TProfile("F_Eff_tan","F_Eff_tan",50,-2.5,2.5); // tracking - under condition more than 50 rdigits
231 fEffTPCPtTan = new TProfile2D("Eff_pt","Eff_Pt",10,0.1,3,20,-2.,2.);
232 fEffTPCPtTanMC = new TProfile2D("MC_Eff_pt","MC Eff Pt",10,0.1,3,20, -2.,2.);
233 fEffTPCPtTanF = new TProfile2D("MC_Eff_pt","MC Eff Pt",10,0.1,3,20, -2.,2.);
238 fTPCSignalNormTan = new TH2F("CdEdxTan","CdEdxTan",50, -2,2, 40,30,70); // tpc signal normalized to the MC
239 fTPCSignalNormSPhi = new TH2F("CdEdxSPhi","CdEdxSPhi",10,0.0,1,40,30,70); // tpc signal normalized to the MC
240 fTPCSignalNormTPhi = new TH2F("CdEdxTPhi","CdEdxTPhi",10,0.0,2,40,30,70); // tpc signal normalized to the MC
242 fTPCSignalNormTanSPhi= new TH3F("CdEdxTanSPhi","CdEdxTanSPhi",20, -2,2, 10,0.0 ,1, 40,30,70); // tpc signal normalized to the mean signal - MC
243 fTPCSignalNormTanTPhi= new TH3F("CdEdxTanTPhi","CdEdxTanTPhi",20, -2,2, 10,0.0 ,1, 40,30,70); // tpc signal normalized to the mean signal - MC
244 fTPCSignalNormTanSPt= new TH3F("CdEdxTanSPt","CdEdxTanSPt",20, -2,2, 10,0.3 ,3, 40,30,70); // tpc signal normalized to the mean signal - MC
251 fCPtResolTan = new TH2F("C Pt resol","C pt resol",50, -2,2,200,-0.2,0.2);
252 fCPtPullTan = new TH2F("C Pt pull","C pt pull",50, -2,2,200,-5,5);
254 fCPhiResolTan = new TH2F("CPhiResolTan","CPhiResolTan",50, -2,2,200,-0.025,0.025);
255 // angular resolution - constrained
256 fCTanResolTan = new TH2F("CTanResolTan","CTanResolTan",50, -2,2,200,-0.025,0.025);
257 // angular resolution - constrained
258 fCPtResolTan=new TH2F("CPtResol","CPtResol",50, -2,2,200,-0.2,0.2);;
259 // pt resolution - constrained
260 fCPhiPullTan = new TH2F("CPhiPullTan","CPhiPullTan",50, -2,2,200,-5,5);
261 // angular resolution - constrained
262 fCTanPullTan = new TH2F("CTanPullTan","CTanPullTan",50, -2,2,200,-5,5);
263 // angular resolution - constrained
264 fCPtPullTan=new TH2F("CPtPull","CPtPull",50, -2,2,200,-5,5);
265 // pt resolution - constrained
267 fPtResolLPT = new TH2F("Pt resol","pt resol",10, 0.1,3,200,-0.2,0.2);
268 fPtResolHPT = new TH2F("Pt resol","pt resol",10, 2,100,200,-0.3,0.3);
269 fPtPullLPT = new TH2F("Pt pool","pt pool",10, 0.1,3,200,-6,6);
270 fPtPullHPT = new TH2F("Pt pool","pt pool",10, 2,100,200,-6,6);
272 fD0TanSPtB1 = new TH3F("DCAyTanSPt","DCAyTanSPt",20,1,2, 10,0.3,2, 100,-4,4);
273 fD1TanSPtB1 = new TH3F("DCAzTanSPt","DCAzTanSPt",20,1,2, 10,0.3,2, 100,-4,4);
274 fD0TanSPtL1 = new TH3F("DCAyTanSPt","DCAyTanSPt",20,0,1, 10,0.3,2, 100,-0.1,0.1);
275 fD1TanSPtL1 = new TH3F("DCAzTanSPt","DCAzTanSPt",20,0,1, 10,0.3,2, 100, -0.1,0.1);
281 void AliComparisonDraw::ProcessEff(AliMCInfo* infoMC, AliESDRecInfo *infoRC){
283 // make efficiencies histograms
285 Float_t kptcut = 0.15;
288 Float_t mcpt = infoMC->GetParticle().Pt();
289 Float_t tantheta = TMath::Tan(infoMC->GetParticle().Theta()-TMath::Pi()*0.5);
290 Bool_t isPrim = infoMC->GetParticle().R()<0.1 && TMath::Abs(infoMC->GetParticle().Vz())<10;
296 if (TMath::Abs(tantheta)<ktancut){
297 fEffTPCPt->Fill(mcpt, infoRC->GetStatus(1)==3);
298 fEffTPCPtMC->Fill(mcpt, infoMC->GetRowsWithDigits()>kmincl);
299 if (infoMC->GetRowsWithDigits()>kmincl){
300 fEffTPCPtF->Fill(mcpt, infoRC->GetStatus(1)==3);
305 if (TMath::Abs(mcpt)>kptcut){
306 fEffTPCTan->Fill(tantheta, infoRC->GetStatus(1)==3);
307 fEffTPCTanMC->Fill(tantheta, infoMC->GetRowsWithDigits()>kmincl);
308 if (infoMC->GetRowsWithDigits()>kmincl){
309 fEffTPCTanF->Fill(tantheta, infoRC->GetStatus(1)==3);
315 fEffTPCPtTan->Fill(mcpt,tantheta,infoRC->GetStatus(1)==3);
316 fEffTPCPtTanMC->Fill(mcpt,tantheta,infoMC->GetRowsWithDigits()>50);
317 if (infoMC->GetRowsWithDigits()>kmincl){
318 fEffTPCPtTanF->Fill(mcpt,tantheta,infoRC->GetStatus(1)==3);
323 void AliComparisonDraw::ProcessResolConstrained(AliMCInfo* infoMC, AliESDRecInfo *infoRC){
327 Float_t mcpt = infoMC->GetParticle().Pt();
328 Float_t tantheta = TMath::Tan(infoMC->GetParticle().Theta()-TMath::Pi()*0.5);
329 Bool_t isPrim = infoMC->GetParticle().R()<0.1 && TMath::Abs(infoMC->GetParticle().Vz())<10;
333 if (infoRC->GetStatus(1)!=3) return;
334 if (!infoRC->GetESDtrack()) return;
335 if (infoRC->GetESDtrack()->GetTPCNcls()<10) return;
336 if (!infoRC->GetESDtrack()->GetConstrainedParam()) return;
339 // constrained parameters resolution
341 const AliExternalTrackParam * cparam = infoRC->GetESDtrack()->GetConstrainedParam();
342 Float_t deltaCPt= (mcpt-cparam->Pt())/mcpt;
343 Float_t pullCPt= (1/mcpt-cparam->OneOverPt())/
344 TMath::Sqrt(cparam->GetSigma1Pt2());
345 Float_t deltaPhi = TMath::ATan2(cparam->Py(),cparam->Px())-
346 TMath::ATan2(infoMC->GetParticle().Py(),infoMC->GetParticle().Px());
347 Float_t pullPhi = deltaPhi/TMath::Sqrt(cparam->GetSigmaSnp2());
349 Float_t deltaTan = TMath::ATan2(cparam->Pz(),cparam->Pt())-
350 TMath::ATan2(infoMC->GetParticle().Pz(),infoMC->GetParticle().Pt());
351 Float_t pullTan = deltaPhi/TMath::Sqrt(cparam->GetSigmaSnp2());
353 fCPtResolTan->Fill(tantheta,deltaCPt);
354 fCPtPullTan->Fill(tantheta,pullCPt);
355 fCPhiResolTan->Fill(tantheta,deltaPhi);
356 fCPhiPullTan->Fill(tantheta,pullPhi);
357 fCTanResolTan->Fill(tantheta,deltaTan);
358 fCTanPullTan->Fill(tantheta,pullTan);
364 void AliComparisonDraw::ProcessTPCdedx(AliMCInfo* infoMC, AliESDRecInfo *infoRC){
368 Float_t mcpt = infoMC->GetParticle().Pt();
369 Float_t tantheta = TMath::Tan(infoMC->GetParticle().Theta()-TMath::Pi()*0.5);
370 Bool_t isPrim = infoMC->GetParticle().R()<0.1 && TMath::Abs(infoMC->GetParticle().Vz())<10;
374 if (infoRC->GetStatus(1)!=3) return;
375 if (!infoRC->GetESDtrack()) return;
376 if (infoRC->GetESDtrack()->GetTPCNcls()<10) return;
377 if (!infoRC->GetESDtrack()->GetConstrainedParam()) return;
378 Float_t mprim = infoMC->GetPrim();
379 if (mprim>1.4) return;
380 if (mprim<0.5) return;
381 if (infoRC->GetESDtrack()->GetTPCsignalN()<50) return;
383 Float_t ratio = infoRC->GetESDtrack()->GetTPCsignal()/infoMC->GetPrim();
384 Float_t sphi = infoRC->GetESDtrack()->GetInnerParam()->GetSnp();
385 Float_t tphi = sphi/TMath::Sqrt((1.-sphi)*(1.+sphi));
388 if (TMath::Abs(infoMC->GetParticle().GetPdgCode())!=211) return;
390 fTPCSignalNormTan->Fill(tantheta,ratio); //only subset
392 if (TMath::Abs(tantheta)<0.5){
393 fTPCSignalNormSPhi->Fill(sphi,ratio); // only subset
394 fTPCSignalNormTPhi->Fill(tphi,ratio); // only subset
396 fTPCSignalNormTanSPhi->Fill(tantheta,sphi,ratio);
397 fTPCSignalNormTanTPhi->Fill(tantheta,tphi,ratio);
398 fTPCSignalNormTanSPt->Fill(tantheta,TMath::Sqrt(mcpt),ratio);
401 void AliComparisonDraw::ProcessDCA(AliMCInfo* infoMC, AliESDRecInfo *infoRC){
405 Float_t mcpt = infoMC->GetParticle().Pt();
406 Float_t tantheta = TMath::Tan(infoMC->GetParticle().Theta()-TMath::Pi()*0.5);
407 Bool_t isPrim = infoMC->GetParticle().R()<0.1 && TMath::Abs(infoMC->GetParticle().Vz())<10;
410 if (infoRC->GetStatus(1)!=3) return;
411 if (!infoRC->GetESDtrack()) return;
412 if (infoRC->GetESDtrack()->GetTPCNcls()<10) return;
413 if (!infoRC->GetESDtrack()->GetConstrainedParam()) return;
414 Float_t spt = TMath::Sqrt(mcpt);
415 Float_t dca[2],cov[3];
416 infoRC->GetESDtrack()->GetImpactParameters(dca,cov);
417 Int_t clusterITS[100];
418 if (infoRC->GetESDtrack()->GetITSclusters(clusterITS)==0){
419 fD0TanSPtB1->Fill(tantheta,spt,dca[0]);
420 fD1TanSPtB1->Fill(tantheta,spt,dca[1]);
422 fD0TanSPtL1->Fill(tantheta,spt,dca[0]);
423 fD1TanSPtL1->Fill(tantheta,spt,dca[1]);
429 void AliComparisonDraw::Process(AliMCInfo* infoMC, AliESDRecInfo *infoRC){
433 ProcessEff(infoMC,infoRC);
434 ProcessResolConstrained(infoMC,infoRC);
435 ProcessTPCdedx(infoMC, infoRC);
436 ProcessDCA(infoMC, infoRC);
438 Float_t mcpt = infoMC->GetParticle().Pt();
439 Bool_t isPrim = infoMC->GetParticle().R()<0.1 && TMath::Abs(infoMC->GetParticle().Vz())<10;
445 if (infoRC->GetStatus(1)==0) return;
446 if (!infoRC->GetESDtrack()) return;
447 if (infoRC->GetESDtrack()->GetTPCNcls()<10) return;
448 // printf("Pt\t%f\t%f\n",mcpt, infoRC->GetESDtrack()->Pt());
450 Float_t deltaPt= (mcpt-infoRC->GetESDtrack()->Pt())/mcpt;
451 Float_t poolPt= (1/mcpt-infoRC->GetESDtrack()->OneOverPt())/
452 TMath::Sqrt(infoRC->GetESDtrack()->GetSigma1Pt2());
454 fPtResolLPT->Fill(mcpt,deltaPt);
455 fPtResolHPT->Fill(mcpt,deltaPt);
456 fPtPullLPT->Fill(mcpt,poolPt);
457 fPtPullHPT->Fill(mcpt,poolPt);
462 TH1F* AliComparisonDraw::MakeResol(TH2F * his, Int_t integ, Bool_t type){
464 if (!gPad) new TCanvas;
465 hisr = AliTreeDraw::CreateResHistoI(his,&hism,integ);
466 if (type) return hism;
472 TGraph2D * AliComparisonDraw::MakeStat2D(TH3 * his, Int_t delta0, Int_t delta1, Int_t type){
476 // delta - number of bins to integrate
477 // type - 0 - mean value
479 TAxis * xaxis = his->GetXaxis();
480 TAxis * yaxis = his->GetYaxis();
481 // TAxis * zaxis = his->GetZaxis();
482 Int_t nbinx = xaxis->GetNbins();
483 Int_t nbiny = yaxis->GetNbins();
486 TGraph2D *graph = new TGraph2D(nbinx*nbiny);
488 for (Int_t ix=0; ix<nbinx;ix++)
489 for (Int_t iy=0; iy<nbiny;iy++){
490 Float_t xcenter = xaxis->GetBinCenter(ix);
491 Float_t ycenter = yaxis->GetBinCenter(iy);
492 snprintf(name,1000,"%s_%d_%d",his->GetName(), ix,iy);
493 TH1 *projection = his->ProjectionZ(name,ix-delta0,ix+delta0,iy-delta1,iy+delta1);
495 if (type==0) stat = projection->GetMean();
496 if (type==1) stat = projection->GetRMS();
497 if (type==2 || type==3){
499 AliMathBase::LTM((TH1F*)projection,&vec,0.7);
500 if (type==2) stat= vec[1];
501 if (type==3) stat= vec[0];
503 if (type==4|| type==5){
504 projection->Fit(&f1);
505 if (type==4) stat= f1.GetParameter(1);
506 if (type==5) stat= f1.GetParameter(2);
508 //printf("%d\t%f\t%f\t%f\n", icount,xcenter, ycenter, stat);
509 graph->SetPoint(icount,xcenter, ycenter, stat);
515 TGraph * AliComparisonDraw::MakeStat1D(TH3 * his, Int_t delta1, Int_t type){
519 // delta - number of bins to integrate
520 // type - 0 - mean value
522 TAxis * xaxis = his->GetXaxis();
523 TAxis * yaxis = his->GetYaxis();
524 // TAxis * zaxis = his->GetZaxis();
525 Int_t nbinx = xaxis->GetNbins();
526 Int_t nbiny = yaxis->GetNbins();
529 TGraph *graph = new TGraph(nbinx);
531 for (Int_t ix=0; ix<nbinx;ix++){
532 Float_t xcenter = xaxis->GetBinCenter(ix);
533 // Float_t ycenter = yaxis->GetBinCenter(iy);
534 snprintf(name,1000,"%s_%d",his->GetName(), ix);
535 TH1 *projection = his->ProjectionZ(name,ix-delta1,ix+delta1,0,nbiny);
537 if (type==0) stat = projection->GetMean();
538 if (type==1) stat = projection->GetRMS();
539 if (type==2 || type==3){
541 AliMathBase::LTM((TH1F*)projection,&vec,0.7);
542 if (type==2) stat= vec[1];
543 if (type==3) stat= vec[0];
545 if (type==4|| type==5){
546 projection->Fit(&f1);
547 if (type==4) stat= f1.GetParameter(1);
548 if (type==5) stat= f1.GetParameter(2);
550 //printf("%d\t%f\t%f\t%f\n", icount,xcenter, ycenter, stat);
551 graph->SetPoint(icount,xcenter, stat);
558 // Make derived plots
561 void AliComparisonDraw::MakePlots(){
565 AliComparisonDraw * comp=this;
567 TFile *fp = new TFile("picutures.root","recreate");
570 TGraph2D * gr=0, gr2=0;
572 TCanvas * c = new TCanvas("Phi resol Tan","Phi resol Tan");
576 hiss = comp->MakeResol(comp->fCPtResolTan,1,0);
577 hiss->SetXTitle("Tan(#theta)");
578 hiss->SetYTitle("#sigmap_{t}/p_{t}");
580 hiss->Write("CptResolTan");
583 hiss = comp->MakeResol(comp->fCPhiResolTan,1,0);
585 hiss->SetXTitle("Tan(#theta)");
586 hiss->SetYTitle("#sigma#phi (rad)");
589 hiss->Write("PhiResolTan");
591 hiss = comp->MakeResol(comp->fCTanResolTan,1,0);
593 hiss->SetXTitle("Tan(#theta)");
594 hiss->SetYTitle("#sigma#theta (rad)");
597 hiss->Write("ThetaResolTan");
600 hiss = comp->MakeResol(comp->fCTanResolTan,1,0);
602 hiss->SetXTitle("Tan(#theta)");
603 hiss->SetYTitle("#sigmap_{t}/p_{t} ");
609 hiss = comp->MakeResol(comp->fTPCSignalNormTan,4,0);
610 hiss->SetXTitle("Tan(#theta)");
611 hiss->SetYTitle("#sigma_{dEdx}");
614 hiss->Write("TPCdEdxResolTan");
618 hiss = comp->MakeResol(comp->fTPCSignalNormTan,4,1);
619 hiss->SetXTitle("Tan(#theta)");
620 hiss->SetYTitle("<dEdx>");
622 hiss->Write("TPCdEdxMeanTan");
625 gr = comp->MakeStat2D(comp->fTPCSignalNormTanSPt,3,1,4);
626 gr->GetXaxis()->SetTitle("Tan(#theta)");
627 gr->GetYaxis()->SetTitle("#sqrt{p_{t}(GeV)}");
628 gr->GetZaxis()->SetTitle("<dEdx>");
630 gr->GetHistogram()->Write("TPCdEdxMeanTanPt");
633 gr = comp->MakeStat2D(comp->fTPCSignalNormTanSPt,3,1,5);
634 gr->GetXaxis()->SetTitle("Tan(#theta)");
635 gr->GetYaxis()->SetTitle("#sqrt{p_{t}(GeV)}");
636 gr->GetZaxis()->SetTitle("#sigma_{dEdx}");
638 gr->GetHistogram()->Write("TPCdEdxMeanTanPt");
642 comp->fEffTPCTanF->SetXTitle("Tan(#theta)");
643 comp->fEffTPCTanF->SetYTitle("eff_{findable}");
644 comp->fEffTPCTanF->Draw();
645 comp->fEffTPCTanF->Write("EffTanFindable");
648 comp->fEffTPCTan->SetXTitle("Tan(#theta)");
649 comp->fEffTPCTan->SetYTitle("eff_{all}");
650 comp->fEffTPCTan->Draw();
651 comp->fEffTPCTan->Write("EffTanAll");
655 gr0 = comp->MakeStat1D(comp->fD0TanSPtB1,2,5);
656 gr0->GetXaxis()->SetTitle("Tan(#theta)");
657 gr0->GetYaxis()->SetTitle("#sigmaDCA (cm)");
660 gr->GetHistogram()->Write("DCAResolTan");
664 gr = comp->MakeStat2D(comp->fD0TanSPtB1,4,2,5);
665 gr0->GetXaxis()->SetTitle("Tan(#theta)");
666 gr0->GetYaxis()->SetTitle("#sigmaDCA (cm)");
669 gr->GetHistogram()->Write("DCAResolSPTTan");