Adding abstract class for comparison components
[u/mrichter/AliRoot.git] / PWG1 / AliComparisonEff.cxx
1 //------------------------------------------------------------------------------\r
2 // Implementation of AliComparisonEff class. It keeps information from \r
3 // comparison of reconstructed and MC particle tracks. In addtion, \r
4 // it keeps selection cuts used during comparison. The comparison \r
5 // information is stored in the ROOT histograms. Analysis of these \r
6 // histograms can be done by using Analyse() class function. The result of \r
7 // the analysis (histograms/graphs) are stored in the folder which is \r
8 // a data member of AliComparisonEff.\r
9 // \r
10 // Author: J.Otwinowski 04/02/2008 \r
11 //------------------------------------------------------------------------------\r
12 \r
13 /*\r
14  \r
15   // after running comparison task, read the file, and get component\r
16   gSystem->Load("libPWG1.so");\r
17   TFile f("Output.root");\r
18   AliComparisonEff * compObj = (AliComparisonEff*)f.Get("AliComparisonEff");\r
19 \r
20   // analyse comparison data\r
21   compObj->Analyse();\r
22 \r
23   // the output histograms/graphs will be stored in the folder "folderEff" \r
24   compObj->GetAnalysisFolder()->ls("*");\r
25 \r
26   // user can save whole comparison object (or only folder with anlysed histograms) \r
27   // in the seperate output file (e.g.)\r
28   TFile fout("Analysed_Eff.root","recreate");\r
29   compObj->Write(); // compObj->GetAnalysisFolder()->Write();\r
30   fout.Close();\r
31 \r
32 */\r
33 \r
34 \r
35 #include <iostream>\r
36 \r
37 #include "TFile.h"\r
38 #include "TCint.h"\r
39 #include "TH3F.h"\r
40 #include "TH2F.h"\r
41 #include "TF1.h"\r
42 #include "TProfile.h"\r
43 #include "TProfile2D.h"\r
44 #include "TGraph2D.h"\r
45 #include "TCanvas.h"\r
46 #include "TGraph.h"\r
47 // \r
48 #include "AliESDEvent.h"  \r
49 #include "AliESD.h"\r
50 #include "AliESDfriend.h"\r
51 #include "AliESDfriendTrack.h"\r
52 #include "AliRecInfoCuts.h" \r
53 #include "AliMCInfoCuts.h" \r
54 #include "AliLog.h" \r
55 //\r
56 #include "AliMathBase.h"\r
57 #include "AliTreeDraw.h" \r
58 #include "AliMagFMaps.h" \r
59 #include "AliESDVertex.h" \r
60 #include "AliExternalTrackParam.h" \r
61 #include "AliTracker.h" \r
62 \r
63 #include "AliMCInfo.h" \r
64 #include "AliESDRecInfo.h" \r
65 #include "AliComparisonEff.h" \r
66 \r
67 using namespace std;\r
68 \r
69 \r
70 ClassImp(AliComparisonEff)\r
71 \r
72 //_____________________________________________________________________________\r
73 AliComparisonEff::AliComparisonEff():\r
74   AliComparisonObject("AliComparisonEff"),\r
75 \r
76   // histograms\r
77  \r
78   fMCPt(0),\r
79   fMCRecPt(0),\r
80   fMCRecPrimPt(0),\r
81   fMCRecSecPt(0),\r
82 \r
83   fEffTPCPt(0),\r
84   fEffTPCPtMC(0),\r
85   fEffTPCPtF(0),\r
86   //\r
87   fEffTPCPt_P(0),\r
88   fEffTPCPtMC_P(0),\r
89   fEffTPCPtF_P(0),\r
90   //\r
91   fEffTPCPt_Pi(0),\r
92   fEffTPCPtMC_Pi(0),\r
93   fEffTPCPtF_Pi(0),\r
94   //\r
95   fEffTPCPt_K(0),\r
96   fEffTPCPtMC_K(0),\r
97   fEffTPCPtF_K(0),\r
98  \r
99   fEffTPCTan(0),\r
100   fEffTPCTanMC(0),\r
101   fEffTPCTanF(0),\r
102   //\r
103   fEffTPCPtTan(0),\r
104   fEffTPCPtTanMC(0),\r
105   fEffTPCPtTanF(0),\r
106 \r
107   // Cuts \r
108   fCutsRC(0), \r
109   fCutsMC(0),\r
110 \r
111   fVertex(0),\r
112 \r
113   // histogram folder \r
114   fAnalysisFolder(0)\r
115 {\r
116   // init vertex\r
117   fVertex = new AliESDVertex();\r
118   fVertex->SetXv(0.0); fVertex->SetYv(0.0); fVertex->SetZv(0.0); \r
119 \r
120   for(Int_t i=0; i<4; ++i)\r
121   {\r
122     fTPCPtDCASigmaIdeal[i]=0;\r
123     fTPCPtDCASigmaFull[i]=0;\r
124     fTPCPtDCASigmaDay0[i]=0;\r
125 \r
126     fTPCPtDCAXY[i]=0;\r
127     fTPCPtDCAZ[i]=0;\r
128 \r
129         fTPCPtDCASigmaIdealPid[i]=0;\r
130         fTPCPtDCASigmaFullPid[i]=0;\r
131         fTPCPtDCASigmaDay0Pid[i]=0;\r
132 \r
133         fTPCPtDCAXYPid[i]=0;   \r
134         fTPCPtDCAZPid[i]=0; \r
135   }\r
136   Init();\r
137 }\r
138 \r
139 //_____________________________________________________________________________\r
140 AliComparisonEff::~AliComparisonEff(){\r
141 \r
142   // \r
143   if(fMCPt)  delete  fMCPt; fMCPt=0;\r
144   if(fMCRecPt)  delete  fMCRecPt; fMCRecPt=0;\r
145   if(fMCRecPrimPt)  delete  fMCRecPrimPt; fMCRecPrimPt=0;\r
146   if(fMCRecSecPt)  delete  fMCRecSecPt; fMCRecSecPt=0;\r
147 \r
148   // \r
149   if(fEffTPCPt)   delete  fEffTPCPt;   fEffTPCPt=0;\r
150   if(fEffTPCPtMC) delete  fEffTPCPtMC; fEffTPCPtMC=0;\r
151   if(fEffTPCPtF)  delete  fEffTPCPtF;  fEffTPCPtF=0;\r
152 \r
153   // \r
154   if(fEffTPCPt_P)   delete  fEffTPCPt_P;   fEffTPCPt_P=0;\r
155   if(fEffTPCPtMC_P) delete  fEffTPCPtMC_P; fEffTPCPtMC_P=0;\r
156   if(fEffTPCPtF_P)  delete  fEffTPCPtF_P;  fEffTPCPtF_P=0;\r
157 \r
158   // \r
159   if(fEffTPCPt_Pi)   delete  fEffTPCPt_Pi;   fEffTPCPt_Pi=0;\r
160   if(fEffTPCPtMC_Pi) delete  fEffTPCPtMC_Pi; fEffTPCPtMC_Pi=0;\r
161   if(fEffTPCPtF_Pi)  delete  fEffTPCPtF_Pi;  fEffTPCPtF_Pi=0;\r
162 \r
163   // \r
164   if(fEffTPCPt_K)   delete  fEffTPCPt_K;   fEffTPCPt_K=0;\r
165   if(fEffTPCPtMC_K) delete  fEffTPCPtMC_K; fEffTPCPtMC_K=0;\r
166   if(fEffTPCPtF_K)  delete  fEffTPCPtF_K;  fEffTPCPtF_K=0;\r
167 \r
168   // \r
169   if(fEffTPCTan)   delete  fEffTPCTan;   fEffTPCTan=0;\r
170   if(fEffTPCTanMC) delete  fEffTPCTanMC; fEffTPCTanMC=0;\r
171   if(fEffTPCTanF)  delete  fEffTPCTanF;  fEffTPCTanF=0;\r
172 \r
173   //\r
174   if(fEffTPCPtTan)   delete  fEffTPCPtTan;   fEffTPCPtTan=0;\r
175   if(fEffTPCPtTanMC) delete  fEffTPCPtTanMC; fEffTPCPtTanMC=0;\r
176   if(fEffTPCPtTanF)  delete  fEffTPCPtTanF;  fEffTPCPtTanF=0;\r
177 \r
178   for(Int_t i=0; i<4; ++i)\r
179   {\r
180     if(fTPCPtDCASigmaIdeal[i]) delete  fTPCPtDCASigmaIdeal[i];  fTPCPtDCASigmaIdeal[i]=0;\r
181     if(fTPCPtDCASigmaFull[i]) delete  fTPCPtDCASigmaFull[i];  fTPCPtDCASigmaFull[i]=0;\r
182     if(fTPCPtDCASigmaDay0[i]) delete  fTPCPtDCASigmaDay0[i];  fTPCPtDCASigmaDay0[i]=0;\r
183 \r
184     if(fTPCPtDCAXY[i]) delete  fTPCPtDCAXY[i];  fTPCPtDCAXY[i]=0;\r
185     if(fTPCPtDCAZ[i]) delete  fTPCPtDCAZ[i];  fTPCPtDCAZ[i]=0;\r
186 \r
187         if(fTPCPtDCASigmaIdealPid[i]) delete  fTPCPtDCASigmaIdealPid[i];  fTPCPtDCASigmaIdealPid[i]=0;\r
188         if(fTPCPtDCASigmaFullPid[i]) delete  fTPCPtDCASigmaFullPid[i];  fTPCPtDCASigmaFullPid[i]=0;\r
189         if(fTPCPtDCASigmaDay0Pid[i]) delete  fTPCPtDCASigmaDay0Pid[i];  fTPCPtDCASigmaDay0Pid[i]=0;\r
190 \r
191         if(fTPCPtDCAXYPid[i]) delete  fTPCPtDCAXYPid[i]; fTPCPtDCAXYPid[i]=0;\r
192         if(fTPCPtDCAZPid[i]) delete   fTPCPtDCAZPid[i];  fTPCPtDCAZPid[i]=0;\r
193   }\r
194 \r
195   if(fAnalysisFolder) delete fAnalysisFolder; fAnalysisFolder=0;\r
196 }\r
197 \r
198 //_____________________________________________________________________________\r
199 void AliComparisonEff::Init(){\r
200 \r
201   // Init histograms\r
202   //\r
203   fMCPt = new TH1F("fMCPt","fMCPt",50,0.1,3);           \r
204   fMCPt->SetXTitle("p_{t}");\r
205   fMCPt->SetYTitle("yield");\r
206 \r
207   fMCRecPt = new TH1F("fMCRecPt","fMCRecPt",50,0.1,3);           \r
208   fMCRecPt->SetXTitle("p_{t}");\r
209   fMCRecPt->SetYTitle("yield");\r
210 \r
211   fMCRecPrimPt = new TH1F("fMCRecPrimPt","fMCRecPrimPt",50,0.1,3);           \r
212   fMCRecPrimPt->SetXTitle("p_{t}");\r
213   fMCRecPrimPt->SetYTitle("yield");\r
214 \r
215   fMCRecSecPt = new TH1F("fMCRecSecPt","fMCRecSecPt",50,0.1,3);           \r
216   fMCRecSecPt->SetXTitle("p_{t}");\r
217   fMCRecSecPt->SetYTitle("yield");\r
218 \r
219   // Efficiency as function of pt\r
220   fEffTPCPt = new TProfile("Eff_pt","Eff_Pt",50,0.1,3);           \r
221   fEffTPCPt->SetXTitle("p_{t}");\r
222   fEffTPCPt->SetYTitle("TPC Efficiency");\r
223 \r
224   fEffTPCPtMC = new TProfile("MC_Eff_pt","MC_Eff_Pt",50,0.1,3);   \r
225   fEffTPCPtMC->SetXTitle("p_{t}");\r
226   fEffTPCPtMC->SetYTitle("MC TPC Efficiency");\r
227 \r
228   fEffTPCPtF = new TProfile("F_Eff_pt","F_Eff_Pt",50,0.1,3);     \r
229   fEffTPCPtF->SetXTitle("p_{t}");\r
230   fEffTPCPtF->SetYTitle("TPC Findable Efficiency");\r
231 \r
232   // Efficiency as function of pt protons\r
233   fEffTPCPt_P = new TProfile("Eff_pt_P","Eff_Pt_P",50,0.1,3);           \r
234   fEffTPCPt_P->SetXTitle("p_{t}");\r
235   fEffTPCPt_P->SetYTitle("TPC Efficiency");\r
236 \r
237   fEffTPCPtMC_P = new TProfile("MC_Eff_pt_P","MC_Eff_Pt_P",50,0.1,3);   \r
238   fEffTPCPtMC_P->SetXTitle("p_{t}");\r
239   fEffTPCPtMC_P->SetYTitle("MC TPC Efficiency");\r
240 \r
241   fEffTPCPtF_P = new TProfile("F_Eff_pt_P","F_Eff_Pt_P",50,0.1,3);     \r
242   fEffTPCPtF_P->SetXTitle("p_{t}");\r
243   fEffTPCPtF_P->SetYTitle("TPC Findable Efficiency");\r
244 \r
245   // Efficiency as function of pt pions\r
246   fEffTPCPt_Pi = new TProfile("Eff_pt_Pi","Eff_Pit_Pi",50,0.1,3);           \r
247   fEffTPCPt_Pi->SetXTitle("p_{t}");\r
248   fEffTPCPt_Pi->SetYTitle("TPC Efficiency");\r
249 \r
250   fEffTPCPtMC_Pi = new TProfile("MC_Eff_pt_Pi","MC_Eff_Pit_Pi",50,0.1,3);   \r
251   fEffTPCPtMC_Pi->SetXTitle("p_{t}");\r
252   fEffTPCPtMC_Pi->SetYTitle("MC TPC Efficiency");\r
253 \r
254   fEffTPCPtF_Pi = new TProfile("F_Eff_pt_Pi","F_Eff_Pit_Pi",50,0.1,3);     \r
255   fEffTPCPtF_Pi->SetXTitle("p_{t}");\r
256   fEffTPCPtF_Pi->SetYTitle("TPC Findable Efficiency");\r
257 \r
258   // Efficiency as function of pt kaons\r
259   fEffTPCPt_K = new TProfile("Eff_pt_K","Eff_Kt_K",50,0.1,3);           \r
260   fEffTPCPt_K->SetXTitle("p_{t}");\r
261   fEffTPCPt_K->SetYTitle("TPC Efficiency");\r
262 \r
263   fEffTPCPtMC_K = new TProfile("MC_Eff_pt_K","MC_Eff_Kt_K",50,0.1,3);   \r
264   fEffTPCPtMC_K->SetXTitle("p_{t}");\r
265   fEffTPCPtMC_K->SetYTitle("MC TPC Efficiency");\r
266 \r
267   fEffTPCPtF_K = new TProfile("F_Eff_pt_K","F_Eff_Kt_K",50,0.1,3);     \r
268   fEffTPCPtF_K->SetXTitle("p_{t}");\r
269   fEffTPCPtF_K->SetYTitle("TPC Findable Efficiency");\r
270 \r
271   // Efficiency as function of tan(theta) \r
272   fEffTPCTan = new TProfile("Eff_tan","Eff_tan",50,-2.5,2.5);         \r
273   fEffTPCTan->SetXTitle("tan(#theta)");\r
274   fEffTPCTan->SetYTitle("TPC Efficiency");\r
275 \r
276   fEffTPCTanMC = new TProfile("MC_Eff_tan","MC_Eff_tan",50,-2.5,2.5); \r
277   fEffTPCTanMC->SetXTitle("tan(#theta)");\r
278   fEffTPCTanMC->SetYTitle("MC TPC Efficiency");\r
279 \r
280   fEffTPCTanF = new TProfile("F_Eff_tan","F_Eff_tan",50,-2.5,2.5);   \r
281   fEffTPCPtF->SetXTitle("tan(#theta)");\r
282   fEffTPCPtF->SetYTitle("TPC Findable Efficiency");\r
283 \r
284   // Efficiency as function of pt and tan(theta) \r
285   fEffTPCPtTan = new TProfile2D("Eff_pt_tan","Eff_Pt_tan",10,0.1,3,20,-2.,2.);\r
286   fEffTPCPtTan->SetXTitle("tan(#theta)");\r
287   fEffTPCPtTan->SetYTitle("p_{t}");\r
288 \r
289   fEffTPCPtTanMC = new TProfile2D("MC_Eff_pt_tan_MC","MC Eff Pt",10,0.1,3,20,-2.,2.);\r
290   fEffTPCPtTanMC->SetXTitle("tan(#theta)");\r
291   fEffTPCPtTanMC->SetYTitle("p_{t}");\r
292 \r
293   fEffTPCPtTanF = new TProfile2D("MC_Eff_pt_tan_F","MC Eff Pt",10,0.1,3,20,-2.,2.);\r
294   fEffTPCPtTanF->SetXTitle("tan(#theta)");\r
295   fEffTPCPtTanF->SetYTitle("p_{t}");\r
296 \r
297   char name[256];\r
298   for(Int_t i=0; i<4; ++i)\r
299   {\r
300     sprintf(name, "fTPCPtDCASigmaIdeal_%d",i);\r
301     fTPCPtDCASigmaIdeal[i] = new TH2F(name,name,50,0.1,3,100,0,100);\r
302 \r
303     sprintf(name, "fTPCPtDCASigmaFull_%d",i);\r
304     fTPCPtDCASigmaFull[i] = new TH2F(name,name,50,0.1,3,100,0,100);\r
305 \r
306     sprintf(name, "fTPCPtDCASigmaDay0_%d",i);\r
307     fTPCPtDCASigmaDay0[i] = new TH2F(name,name,50,0.1,3,100,0,100);\r
308 \r
309     sprintf(name, "fTPCPtDCAXY_%d",i);\r
310     fTPCPtDCAXY[i]= new TH2F(name,name,50,0.1,3,100,0,100);\r
311     sprintf(name, "fTPCPtDCAZ_%d",i);\r
312     fTPCPtDCAZ[i]= new TH2F(name,name,50,0.1,3,100,0,100);\r
313 \r
314     sprintf(name, "fTPCPtDCASigmaIdealPid_%d",i);\r
315         fTPCPtDCASigmaIdealPid[i] = new TH3F(name,name,50,0.1,3,100,0,100,5,0,5);\r
316 \r
317     sprintf(name, "fTPCPtDCASigmaFullPid_%d",i);\r
318         fTPCPtDCASigmaFullPid[i]= new TH3F(name,name,50,0.1,3,100,0,100,5,0,5);\r
319 \r
320     sprintf(name, "fTPCPtDCASigmaDay0Pid_%d",i);\r
321         fTPCPtDCASigmaDay0Pid[i]= new TH3F(name,name,50,0.1,3,100,0,100,5,0,5);\r
322 \r
323     sprintf(name, "fTPCPtDCAXYPid_%d",i);\r
324         fTPCPtDCAXYPid[i]= new TH3F(name,name,50,0.1,3,100,0,100,5,0,5);\r
325 \r
326     sprintf(name, "fTPCPtDCAZPid_%d",i);\r
327         fTPCPtDCAZPid[i]= new TH3F(name,name,50,0.1,3,100,0,100,5,0,5);\r
328   }\r
329 \r
330   // init cuts\r
331   if(!fCutsMC) \r
332     AliDebug(AliLog::kError, "ERROR: Cannot find AliMCInfoCuts object");\r
333   if(!fCutsRC) \r
334     AliDebug(AliLog::kError, "ERROR: Cannot find AliRecInfoCuts object");\r
335 \r
336   // init folder\r
337   fAnalysisFolder = CreateFolder("folderEff","Analysis Efficiency Folder");\r
338 }\r
339 \r
340 //_____________________________________________________________________________\r
341 void AliComparisonEff::Process(AliMCInfo* infoMC, AliESDRecInfo *infoRC)\r
342 {\r
343   // Fill efficiency comparison information\r
344   \r
345   AliExternalTrackParam *track = 0;\r
346   Double_t field      = AliTracker::GetBz(); // nominal Bz field [kG]\r
347   Double_t kMaxD      = 123456.0; // max distance\r
348 \r
349   // systematics\r
350   const Double_t kSigma2Full_xy  = 0.25; // ExB full systematics  [cm]\r
351   const Double_t kSigma2Full_z  =  5.0;  // [cm] \r
352 \r
353   const Double_t kSigma2Day0_xy  = 0.02; //  ExB  [cm]\r
354   const Double_t kSigma2Day0_z  =  0.1; //  [cm] goofie  \r
355 \r
356   //  \r
357   Double_t      DCASigmaIdeal=0;\r
358   Double_t  DCASigmaFull=0;\r
359   Double_t  DCASigmaDay0=0;\r
360 \r
361   Double_t dca[2], cov[3]; // dca_xy, dca_z, sigma_xy, sigma_xy_z, sigma_z\r
362 \r
363   // distance to Prim. vertex \r
364   const Double_t* dv = infoMC->GetVDist(); \r
365 \r
366   Float_t mcpt = infoMC->GetParticle().Pt();\r
367   Float_t tantheta = TMath::Tan(infoMC->GetParticle().Theta()-TMath::Pi()*0.5);\r
368   Bool_t isPrim = TMath::Sqrt(dv[0]*dv[0] + dv[1]*dv[1])<fCutsMC->GetMaxR() && TMath::Abs(dv[2])<fCutsMC->GetMaxVz();\r
369  \r
370   // calculate and set prim. vertex\r
371   fVertex->SetXv( infoMC->GetParticle().Vx() - dv[0] );\r
372   fVertex->SetYv( infoMC->GetParticle().Vy() - dv[1] );\r
373   fVertex->SetZv( infoMC->GetParticle().Vz() - dv[2] );\r
374   \r
375   // Check selection cuts\r
376   if (fCutsMC->IsPdgParticle(TMath::Abs(infoMC->GetParticle().GetPdgCode())) == kFALSE) return; \r
377 \r
378   // transform Pdg to Pid\r
379   // Pdg convension is different for hadrons and leptons \r
380   // (e.g. K+/K- = 321/-321; e+/e- = -11/11 ) \r
381   Double_t pid = -1;\r
382   if( TMath::Abs(infoMC->GetParticle().GetPdgCode())==fCutsMC->GetEM() ) pid = 0; \r
383   if( TMath::Abs(infoMC->GetParticle().GetPdgCode())==fCutsMC->GetMuM() ) pid = 1; \r
384   if( TMath::Abs(infoMC->GetParticle().GetPdgCode())==fCutsMC->GetPiP() ) pid = 2; \r
385   if( TMath::Abs(infoMC->GetParticle().GetPdgCode())==fCutsMC->GetKP() ) pid = 3; \r
386   if( TMath::Abs(infoMC->GetParticle().GetPdgCode())==fCutsMC->GetProt() ) pid = 4; \r
387 \r
388   //cout << "dv[0] " << dv[0] << " dv[1] " << dv[1]  <<  " dv[2] " << dv[2] << endl; \r
389   //cout << "v[0] " << fVertex->GetXv()  << " v[1] " << fVertex->GetYv()  <<  " v[2] " << fVertex->GetZv()<< endl; \r
390   if (TMath::Abs(tantheta)<fCutsRC->GetMaxAbsTanTheta())\r
391   {\r
392     if (infoRC->GetESDtrack()->GetTPCInnerParam()) \r
393     {\r
394       if ((track = new AliExternalTrackParam(*infoRC->GetESDtrack()->GetTPCInnerParam())) != 0 )\r
395       {\r
396         Bool_t bDCAStatus = track->PropagateToDCA(fVertex,field,kMaxD,dca,cov);\r
397                 if(bDCAStatus) {\r
398                 //\r
399                 cov[2] = track->GetCovariance()[2];\r
400 \r
401             // Eff = infoRC->GetStatus(1)==3 && isPrim / isPrim;\r
402         // Pt vs ( dca[0]^2/cov[0]^2 + dca[1]^2/cov[2]^2 ) \r
403         // Pt vs ( dca[0]^2/(cov[0]^2 + kSigma2Full_xy)  + dca[1]^2/( cov[2]^2 + kSigma2Full_z ) \r
404         // Pt vs ( dca[0]^2/(cov[0]^2 + kSigma2_xy)  + dca[1]^2/( cov[2]^2 + kSigma2_z ) \r
405 \r
406          if(cov[0]>0.0 && cov[2]>0.0)\r
407                  {\r
408                          DCASigmaIdeal = TMath::Power(dca[0],2)/cov[0] \r
409                                                                           + TMath::Power(dca[1],2)/cov[2]; \r
410 \r
411                          DCASigmaFull = TMath::Power(dca[0],2)/(cov[0]+kSigma2Full_xy) \r
412                                                                          + TMath::Power(dca[1],2)/(cov[2]+kSigma2Full_z); \r
413 \r
414                          DCASigmaDay0 = TMath::Power(dca[0],2)/(cov[0]+kSigma2Day0_xy) \r
415                                                                          + TMath::Power(dca[1],2)/(cov[2]+kSigma2Day0_z); \r
416 \r
417               //cout << "dca[0] " << dca[0]  << " dca[1] " << dca[1]  << endl; \r
418               //cout << "cov[0] " << cov[0]  << " cov[2] " << cov[2]  << endl; \r
419               //cout << "DCASigmaIdeal " << DCASigmaIdeal  << " DCASigmaFull " << DCASigmaFull  << " DCASigmaDay0 "  <<DCASigmaDay0 <<  endl; \r
420             //cout << " -------------------------------------------------------- "<<  endl; \r
421                  }\r
422 \r
423          // MC pt\r
424          fMCPt->Fill(mcpt); \r
425          if(infoRC->GetStatus(1)==3) fMCRecPt->Fill(mcpt); \r
426          if(infoRC->GetStatus(1)==3 && isPrim) fMCRecPrimPt->Fill(mcpt); \r
427          if(infoRC->GetStatus(1)==3 && !isPrim) fMCRecSecPt->Fill(mcpt); \r
428 \r
429          if(isPrim)\r
430                  {\r
431            fTPCPtDCASigmaIdeal[0]->Fill(mcpt,DCASigmaIdeal);\r
432            fTPCPtDCASigmaFull[0]->Fill(mcpt,DCASigmaFull);\r
433            fTPCPtDCASigmaDay0[0]->Fill(mcpt,DCASigmaDay0);\r
434 \r
435            fTPCPtDCAXY[0]->Fill(mcpt,dca[0]);\r
436            fTPCPtDCAZ[0]->Fill(mcpt,dca[1]);\r
437 \r
438            fTPCPtDCASigmaIdealPid[0]->Fill(mcpt,DCASigmaIdeal,pid);\r
439            fTPCPtDCASigmaFullPid[0]->Fill(mcpt,DCASigmaFull,pid);\r
440            fTPCPtDCASigmaDay0Pid[0]->Fill(mcpt,DCASigmaDay0,pid);\r
441 \r
442            fTPCPtDCAXYPid[0]->Fill(mcpt,dca[0],pid);\r
443            fTPCPtDCAZPid[0]->Fill(mcpt,dca[1],pid);\r
444                            \r
445                    if(infoRC->GetStatus(1)==3)\r
446                    {\r
447              fTPCPtDCASigmaIdeal[1]->Fill(mcpt,DCASigmaIdeal);\r
448              fTPCPtDCASigmaFull[1]->Fill(mcpt,DCASigmaFull);\r
449              fTPCPtDCASigmaDay0[1]->Fill(mcpt,DCASigmaDay0);\r
450 \r
451              fTPCPtDCAXY[1]->Fill(mcpt,dca[0]);\r
452              fTPCPtDCAZ[1]->Fill(mcpt,dca[1]);\r
453 \r
454              fTPCPtDCASigmaIdealPid[1]->Fill(mcpt,DCASigmaIdeal,pid);\r
455              fTPCPtDCASigmaFullPid[1]->Fill(mcpt,DCASigmaFull,pid);\r
456              fTPCPtDCASigmaDay0Pid[1]->Fill(mcpt,DCASigmaDay0,pid);\r
457 \r
458              fTPCPtDCAXYPid[1]->Fill(mcpt,dca[0],pid);\r
459              fTPCPtDCAZPid[1]->Fill(mcpt,dca[1],pid);\r
460            }\r
461                  }\r
462 \r
463         // Cont = infoRC->GetStatus(1)==3 && !isPrim / infoRC->GetStatus(1)==3   \r
464         // Pt vs ( dz[0]^2/cov[0]^2 + dz[1]^2/cov[2]^2 ) \r
465         // Pt vs ( dz[0]^2/(cov[0]^2 + kSigma2Full_xy)  + dz[1]^2/( cov[2]^2 + kSigma2Full_z ) \r
466         // Pt vs ( dz[0]^2/(cov[0]^2 + kSigma2_xy)  + dz[1]^2/( cov[2]^2 + kSigma2_z ) \r
467 \r
468                  if(infoRC->GetStatus(1)==3) \r
469                  {\r
470                    fTPCPtDCASigmaIdeal[2]->Fill(mcpt,DCASigmaIdeal);\r
471            fTPCPtDCASigmaFull[2]->Fill(mcpt,DCASigmaFull);\r
472            fTPCPtDCASigmaDay0[2]->Fill(mcpt,DCASigmaDay0);\r
473 \r
474            fTPCPtDCAXY[2]->Fill(mcpt,dca[0]);\r
475            fTPCPtDCAZ[2]->Fill(mcpt,dca[1]);\r
476 \r
477            fTPCPtDCASigmaIdealPid[2]->Fill(mcpt,DCASigmaIdeal,pid);\r
478            fTPCPtDCASigmaFullPid[2]->Fill(mcpt,DCASigmaFull,pid);\r
479            fTPCPtDCASigmaDay0Pid[2]->Fill(mcpt,DCASigmaDay0,pid);\r
480 \r
481            fTPCPtDCAXYPid[2]->Fill(mcpt,dca[0],pid);\r
482            fTPCPtDCAZPid[2]->Fill(mcpt,dca[1],pid);\r
483  \r
484                    if(isPrim==0)\r
485                    {\r
486              fTPCPtDCASigmaIdeal[3]->Fill(mcpt,DCASigmaIdeal);\r
487              fTPCPtDCASigmaFull[3]->Fill(mcpt,DCASigmaFull);\r
488              fTPCPtDCASigmaDay0[3]->Fill(mcpt,DCASigmaDay0);\r
489 \r
490              fTPCPtDCAXY[3]->Fill(mcpt,dca[0]);\r
491              fTPCPtDCAZ[3]->Fill(mcpt,dca[1]);\r
492 \r
493              fTPCPtDCASigmaIdealPid[3]->Fill(mcpt,DCASigmaIdeal,pid);\r
494              fTPCPtDCASigmaFullPid[3]->Fill(mcpt,DCASigmaFull,pid);\r
495              fTPCPtDCASigmaDay0Pid[3]->Fill(mcpt,DCASigmaDay0,pid);\r
496 \r
497              fTPCPtDCAXYPid[3]->Fill(mcpt,dca[0],pid);\r
498              fTPCPtDCAZPid[3]->Fill(mcpt,dca[1],pid);\r
499            }\r
500              }\r
501            delete track;\r
502        }\r
503        }\r
504      } \r
505          else \r
506          {\r
507        if(isPrim)\r
508            {\r
509              fTPCPtDCASigmaIdeal[0]->Fill(mcpt,0.0);\r
510          fTPCPtDCASigmaFull[0]->Fill(mcpt,0.0);\r
511          fTPCPtDCASigmaDay0[0]->Fill(mcpt,0.0);\r
512 \r
513          fTPCPtDCAXY[0]->Fill(mcpt,0.0);\r
514          fTPCPtDCAZ[0]->Fill(mcpt,0.0);\r
515 \r
516          fTPCPtDCASigmaIdealPid[0]->Fill(mcpt,0.0,pid);\r
517          fTPCPtDCASigmaFullPid[0]->Fill(mcpt,0.0,pid);\r
518          fTPCPtDCASigmaDay0Pid[0]->Fill(mcpt,0.0,pid);\r
519 \r
520          fTPCPtDCAXYPid[0]->Fill(mcpt,0.0,pid);\r
521          fTPCPtDCAZPid[0]->Fill(mcpt,0.0,pid);\r
522            }\r
523      }\r
524   }\r
525 \r
526   // only primary particles\r
527   if (!isPrim) return;\r
528 \r
529   // pt\r
530   if (TMath::Abs(tantheta)<fCutsRC->GetMaxAbsTanTheta()){\r
531 \r
532     fEffTPCPt->Fill(mcpt, infoRC->GetStatus(1)==3);\r
533     fEffTPCPtMC->Fill(mcpt, infoMC->GetRowsWithDigits()>fCutsMC->GetMinRowsWithDigits());\r
534     if (infoMC->GetRowsWithDigits()>fCutsMC->GetMinRowsWithDigits()){\r
535       fEffTPCPtF->Fill(mcpt, infoRC->GetStatus(1)==3);\r
536     }\r
537 \r
538     // protons\r
539     if(TMath::Abs(infoMC->GetParticle().GetPdgCode())==fCutsMC->GetProt()) { \r
540            fEffTPCPt_P->Fill(mcpt, infoRC->GetStatus(1)==3);\r
541        fEffTPCPtMC_P->Fill(mcpt, infoMC->GetRowsWithDigits()>fCutsMC->GetMinRowsWithDigits());\r
542 \r
543        if(infoMC->GetRowsWithDigits()>fCutsMC->GetMinRowsWithDigits()) {\r
544          fEffTPCPtF_P->Fill(mcpt, infoRC->GetStatus(1)==3);\r
545        }\r
546         }\r
547 \r
548     // pions\r
549     if(TMath::Abs(infoMC->GetParticle().GetPdgCode())==fCutsMC->GetPiP()) {\r
550           fEffTPCPt_Pi->Fill(mcpt, infoRC->GetStatus(1)==3);\r
551       fEffTPCPtMC_Pi->Fill(mcpt, infoMC->GetRowsWithDigits()>fCutsMC->GetMinRowsWithDigits());\r
552 \r
553        if(infoMC->GetRowsWithDigits()>fCutsMC->GetMinRowsWithDigits()) {\r
554          fEffTPCPtF_Pi->Fill(mcpt, infoRC->GetStatus(1)==3);\r
555        }\r
556         }\r
557 \r
558         // kaons\r
559     if(TMath::Abs(infoMC->GetParticle().GetPdgCode())==fCutsMC->GetKP()) {\r
560           fEffTPCPt_K->Fill(mcpt, infoRC->GetStatus(1)==3);\r
561       fEffTPCPtMC_K->Fill(mcpt, infoMC->GetRowsWithDigits()>fCutsMC->GetMinRowsWithDigits());\r
562 \r
563        if(infoMC->GetRowsWithDigits()>fCutsMC->GetMinRowsWithDigits()) {\r
564          fEffTPCPtF_K->Fill(mcpt, infoRC->GetStatus(1)==3);\r
565        }\r
566         }\r
567   }\r
568 \r
569   // theta\r
570   if (TMath::Abs(mcpt)>fCutsRC->GetPtMin()){\r
571     fEffTPCTan->Fill(tantheta, infoRC->GetStatus(1)==3);\r
572     fEffTPCTanMC->Fill(tantheta, infoMC->GetRowsWithDigits()>fCutsMC->GetMinRowsWithDigits());\r
573     if (infoMC->GetRowsWithDigits()>fCutsMC->GetMinRowsWithDigits()){\r
574       fEffTPCTanF->Fill(tantheta, infoRC->GetStatus(1)==3);\r
575     }\r
576   }\r
577 \r
578   // pt-theta\r
579   fEffTPCPtTan->Fill(mcpt,tantheta,infoRC->GetStatus(1)==3);\r
580   fEffTPCPtTanMC->Fill(mcpt,tantheta,infoMC->GetRowsWithDigits()>fCutsMC->GetMinRowsWithDigits()); \r
581   if (infoMC->GetRowsWithDigits()>fCutsMC->GetMinRowsWithDigits()){\r
582     fEffTPCPtTanF->Fill(mcpt,tantheta,infoRC->GetStatus(1)==3); \r
583   }\r
584 }\r
585 \r
586 //_____________________________________________________________________________\r
587 void AliComparisonEff::Exec(AliMCInfo* infoMC, AliESDRecInfo *infoRC)\r
588 {\r
589   // Process comparison information\r
590   Process(infoMC,infoRC);\r
591 }\r
592 \r
593 //_____________________________________________________________________________\r
594 Long64_t AliComparisonEff::Merge(TCollection* list) \r
595 {\r
596   // Merge list of objects (needed by PROOF)\r
597 \r
598   if (!list)\r
599   return 0;\r
600 \r
601   if (list->IsEmpty())\r
602   return 1;\r
603 \r
604   TIterator* iter = list->MakeIterator();\r
605   TObject* obj = 0;\r
606 \r
607   // collection of generated histograms\r
608 \r
609   Int_t count=0;\r
610   while((obj = iter->Next()) != 0) \r
611   {\r
612     AliComparisonEff* entry = dynamic_cast<AliComparisonEff*>(obj);\r
613     if (entry == 0) continue; \r
614   \r
615     fMCPt->Add(entry->fMCPt);\r
616     fMCRecPt->Add(entry->fMCRecPt);\r
617     fMCRecPrimPt->Add(entry->fMCRecPrimPt);\r
618     fMCRecSecPt->Add(entry->fMCRecSecPt);\r
619 \r
620     fEffTPCPt->Add(entry->fEffTPCPt);\r
621         fEffTPCPtMC->Add(entry->fEffTPCPtMC);\r
622         fEffTPCPtF->Add(entry->fEffTPCPtF);\r
623 \r
624     fEffTPCPt_P->Add(entry->fEffTPCPt_P);\r
625         fEffTPCPtMC_P->Add(entry->fEffTPCPtMC_P);\r
626         fEffTPCPtF_P->Add(entry->fEffTPCPtF_P);\r
627 \r
628     fEffTPCPt_Pi->Add(entry->fEffTPCPt_Pi);\r
629         fEffTPCPtMC_Pi->Add(entry->fEffTPCPtMC_Pi);\r
630         fEffTPCPtF_Pi->Add(entry->fEffTPCPtF_Pi);\r
631 \r
632     fEffTPCPt_K->Add(entry->fEffTPCPt_K);\r
633         fEffTPCPtMC_K->Add(entry->fEffTPCPtMC_K);\r
634         fEffTPCPtF_K->Add(entry->fEffTPCPtF_K);\r
635 \r
636         fEffTPCTan->Add(entry->fEffTPCTan);\r
637         fEffTPCTanMC->Add(entry->fEffTPCTanMC);\r
638         fEffTPCTanF->Add(entry->fEffTPCTanF);\r
639           \r
640         fEffTPCPtTan->Add(entry->fEffTPCPtTan);\r
641         fEffTPCPtTanMC->Add(entry->fEffTPCPtTanMC);\r
642         fEffTPCPtTanF->Add(entry->fEffTPCPtTanF);\r
643     \r
644     for(Int_t i=0; i<4; ++i)\r
645     {\r
646       fTPCPtDCASigmaIdeal[i]->Add(entry->fTPCPtDCASigmaIdeal[i]);\r
647       fTPCPtDCASigmaFull[i]->Add(entry->fTPCPtDCASigmaFull[i]);\r
648       fTPCPtDCASigmaDay0[i]->Add(entry->fTPCPtDCASigmaDay0[i]);\r
649 \r
650       fTPCPtDCAXY[i]->Add(entry->fTPCPtDCAXY[i]);\r
651       fTPCPtDCAZ[i]->Add(entry->fTPCPtDCAXY[i]);\r
652 \r
653       fTPCPtDCASigmaIdealPid[i]->Add(entry->fTPCPtDCASigmaIdealPid[i]);\r
654       fTPCPtDCASigmaFullPid[i]->Add(entry->fTPCPtDCASigmaFullPid[i]);\r
655       fTPCPtDCASigmaDay0Pid[i]->Add(entry->fTPCPtDCASigmaDay0Pid[i]);\r
656 \r
657       fTPCPtDCAXYPid[i]->Add(entry->fTPCPtDCAXYPid[i]);\r
658       fTPCPtDCAZPid[i]->Add(entry->fTPCPtDCAXYPid[i]);\r
659     }\r
660 \r
661   count++;\r
662   }\r
663 \r
664 return count;\r
665 }\r
666  \r
667 //_____________________________________________________________________________\r
668 void AliComparisonEff::Analyse() \r
669 {\r
670   // Analyse comparison information and store output histograms\r
671   // in the folder "folderEff" \r
672   //\r
673   \r
674   TH1::AddDirectory(kFALSE);\r
675 \r
676   AliComparisonEff * comp=this;\r
677   TFolder *folder = comp->GetAnalysisFolder();\r
678 \r
679   // recreate folder every time\r
680   if(folder) delete folder;\r
681   folder = CreateFolder("folderEff","Analysis Eff Folder");\r
682   folder->SetOwner();\r
683 \r
684   // calculate efficiency and contamination (4 sigma) \r
685   TH1 *h_sigmaidealpid[20];\r
686   TH1 *h_sigmafullpid[20];\r
687   TH1 *h_sigmaday0pid[20];\r
688 \r
689   TH1 *h_sigmaidealpidtot[4];\r
690   TH1 *h_sigmafullpidtot[4];\r
691   TH1 *h_sigmaday0pidtot[4];\r
692 \r
693   char name[256];\r
694   char name1[256];\r
695   Int_t idx;\r
696 \r
697   for(Int_t i=0; i<4; ++i)\r
698   {\r
699      //total\r
700      comp->fTPCPtDCASigmaIdealPid[i]->GetYaxis()->SetRange(1,4);\r
701      sprintf(name,"h_sigmaidealpidtot_%d",i);\r
702      h_sigmaidealpidtot[i] = comp->fTPCPtDCASigmaIdealPid[i]->Project3D();\r
703      h_sigmaidealpidtot[i]->SetName(name);\r
704 \r
705      comp->fTPCPtDCASigmaFullPid[i]->GetYaxis()->SetRange(1,4);\r
706      sprintf(name,"h_sigmafullpidtot_%d",i);\r
707      h_sigmafullpidtot[i] = comp->fTPCPtDCASigmaFullPid[i]->Project3D();\r
708      h_sigmafullpidtot[i]->SetName(name);\r
709 \r
710      comp->fTPCPtDCASigmaDay0Pid[i]->GetYaxis()->SetRange(1,4);\r
711      sprintf(name,"h_sigmaday0pidtot_%d",i);\r
712      h_sigmaday0pidtot[i] = comp->fTPCPtDCASigmaDay0Pid[i]->Project3D();\r
713      h_sigmaday0pidtot[i]->SetName(name);\r
714 \r
715      // pid wise\r
716      for(Int_t j=0; j<5; ++j)\r
717          {\r
718        idx = i*5 + j;\r
719 \r
720        comp->fTPCPtDCASigmaIdealPid[i]->GetYaxis()->SetRange(1,4);\r
721        comp->fTPCPtDCASigmaIdealPid[i]->GetZaxis()->SetRange(j+1,j+1);\r
722 \r
723        sprintf(name,"h_sigmaidealpid_%d",idx);\r
724        h_sigmaidealpid[idx] = comp->fTPCPtDCASigmaIdealPid[i]->Project3D();\r
725        h_sigmaidealpid[idx]->SetName(name);\r
726            \r
727 \r
728        comp->fTPCPtDCASigmaFullPid[i]->GetYaxis()->SetRange(1,4);\r
729        comp->fTPCPtDCASigmaFullPid[i]->GetZaxis()->SetRange(j+1,j+1);\r
730 \r
731        sprintf(name,"h_sigmafullpid_%d",idx);\r
732        h_sigmafullpid[idx] = comp->fTPCPtDCASigmaFullPid[i]->Project3D();\r
733        h_sigmafullpid[idx]->SetName(name);\r
734        \r
735        comp->fTPCPtDCASigmaDay0Pid[i]->GetYaxis()->SetRange(1,4);\r
736        comp->fTPCPtDCASigmaDay0Pid[i]->GetZaxis()->SetRange(j+1,j+1);\r
737 \r
738        sprintf(name,"h_sigmaday0pid_%d",idx);\r
739        h_sigmaday0pid[idx] = comp->fTPCPtDCASigmaDay0Pid[i]->Project3D();\r
740        h_sigmaday0pid[idx]->SetName(name);\r
741         } \r
742   }\r
743 \r
744   // calculate efficiency and contamination (all pids)\r
745   h_sigmaidealpidtot[0]->Sumw2();\r
746   h_sigmaidealpidtot[1]->Divide(h_sigmaidealpidtot[0]);\r
747   h_sigmaidealpidtot[2]->Sumw2();\r
748   h_sigmaidealpidtot[3]->Divide(h_sigmaidealpidtot[2]);\r
749 \r
750   h_sigmafullpidtot[0]->Sumw2();\r
751   h_sigmafullpidtot[1]->Divide(h_sigmafullpidtot[0]);\r
752   h_sigmafullpidtot[2]->Sumw2();\r
753   h_sigmafullpidtot[3]->Divide(h_sigmafullpidtot[2]);\r
754 \r
755   h_sigmaday0pidtot[0]->Sumw2();\r
756   h_sigmaday0pidtot[1]->Divide(h_sigmaday0pidtot[0]);\r
757   h_sigmaday0pidtot[2]->Sumw2();\r
758   h_sigmaday0pidtot[3]->Divide(h_sigmaday0pidtot[2]);\r
759 \r
760   // calculate efficiency pid wise\r
761   for(Int_t idx = 0; idx<5; idx++)\r
762   {\r
763     h_sigmaidealpid[idx]->Sumw2();\r
764     h_sigmaidealpid[idx+5]->Divide(h_sigmaidealpid[idx]);\r
765 \r
766     h_sigmafullpid[idx]->Sumw2();\r
767     h_sigmafullpid[idx+5]->Divide(h_sigmafullpid[idx]);\r
768 \r
769     h_sigmaday0pid[idx]->Sumw2();\r
770     h_sigmaday0pid[idx+5]->Divide(h_sigmaday0pid[idx]);\r
771   }\r
772 \r
773   // calculate cont. pid wise\r
774   for(Int_t idx = 0; idx<5; idx++)\r
775   {\r
776     h_sigmaidealpid[idx+15]->Divide(h_sigmaidealpidtot[2]);\r
777     h_sigmafullpid[idx+15]->Divide(h_sigmafullpidtot[2]);\r
778     h_sigmaday0pid[idx+15]->Divide(h_sigmaday0pidtot[2]);\r
779   }\r
780 \r
781   TCanvas * c = new TCanvas("Efficiency","Track efficiency");\r
782   c->cd();\r
783 \r
784   //\r
785   comp->fEffTPCTanF->SetXTitle("Tan(#theta)");\r
786   comp->fEffTPCTanF->SetYTitle("eff_{findable}");\r
787   comp->fEffTPCTanF->SetName("EffTanFindable");\r
788   //\r
789   comp->fEffTPCTan->SetXTitle("Tan(#theta)");\r
790   comp->fEffTPCTan->SetYTitle("eff_{all}");\r
791   comp->fEffTPCTan->SetName("EffTanAll");\r
792 \r
793   if(folder) folder->Add(comp->fEffTPCTanF);\r
794   if(folder) folder->Add(comp->fEffTPCTan);\r
795 \r
796   h_sigmaidealpidtot[1]->SetName("Eff_SigmaIdeal");\r
797   h_sigmaidealpidtot[3]->SetName("Cont_SigmaIdeal");\r
798 \r
799   if(folder) folder->Add(h_sigmaidealpidtot[1]);\r
800   if(folder) folder->Add(h_sigmaidealpidtot[3]);\r
801 \r
802   h_sigmafullpidtot[1]->SetName("Eff_SigmaFull");\r
803   h_sigmafullpidtot[3]->SetName("Cont_SigmaFull");\r
804 \r
805   if(folder) folder->Add(h_sigmafullpidtot[1]);\r
806   if(folder) folder->Add(h_sigmafullpidtot[3]);\r
807 \r
808   h_sigmaday0pidtot[1]->SetName("Eff_SigmaDay0");\r
809   h_sigmaday0pidtot[3]->SetName("Cont_SigmaDay0");\r
810 \r
811   if(folder) folder->Add(h_sigmaday0pidtot[1]);\r
812   if(folder) folder->Add(h_sigmaday0pidtot[3]);\r
813 \r
814   for(Int_t idx = 0; idx<5; idx++)\r
815   {\r
816     sprintf(name,"Eff_SigmaIdeal_%d",idx);\r
817     sprintf(name1,"Cont_SigmaIdeal_%d",idx);\r
818 \r
819     h_sigmaidealpid[idx+5]->SetName(name);\r
820     h_sigmaidealpid[idx+15]->SetName(name1);\r
821 \r
822         if(folder) folder->Add(h_sigmaidealpid[idx+5]);\r
823         if(folder) folder->Add(h_sigmaidealpid[idx+15]);\r
824 \r
825     sprintf(name,"Eff_SigmaFull_%d",idx);\r
826     sprintf(name1,"Cont_SigmaFull_%d",idx);\r
827 \r
828     h_sigmafullpid[idx+5]->SetName(name);\r
829     h_sigmafullpid[idx+15]->SetName(name1);\r
830 \r
831         if(folder) folder->Add(h_sigmafullpid[idx+5]);\r
832         if(folder) folder->Add(h_sigmafullpid[idx+15]);\r
833 \r
834     sprintf(name,"Eff_SigmaDay0_%d",idx);\r
835     sprintf(name1,"Cont_SigmaDay0_%d",idx);\r
836 \r
837     h_sigmaday0pid[idx+5]->SetName(name);\r
838     h_sigmaday0pid[idx+15]->SetName(name1);\r
839 \r
840         if(folder) folder->Add(h_sigmaday0pid[idx+5]);\r
841         if(folder) folder->Add(h_sigmaday0pid[idx+15]);\r
842   }\r
843 \r
844   // set pointer to fAnalysisFolder\r
845   fAnalysisFolder = folder;\r
846 \r
847 }\r
848 \r
849 //_____________________________________________________________________________\r
850 TFolder* AliComparisonEff::CreateFolder(TString name,TString title) { \r
851 // create folder for analysed histograms\r
852 //\r
853 TFolder *folder = 0;\r
854   folder = new TFolder(name.Data(),title.Data());\r
855 \r
856   return folder;\r
857 }\r