]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/AliComparisonRes.cxx
Adding new functionality to the ComaprisonComponent
[u/mrichter/AliRoot.git] / PWG1 / AliComparisonRes.cxx
1 //------------------------------------------------------------------------------
2 // Implementation of AliComparisonRes class. It keeps information from 
3 // comparison of reconstructed and MC particle tracks. In addtion, 
4 // it keeps selection cuts used during comparison. The comparison 
5 // information is stored in the ROOT histograms. Analysis of these 
6 // histograms can be done by using Analyse() class function. The result of 
7 // the analysis (histograms/graphs) are stored in the folder which is
8 // a data member of AliComparisonRes.
9 //
10 // Author: J.Otwinowski 04/02/2008 
11 //------------------------------------------------------------------------------
12
13 /*
14  
15   // after running comparison task, read the file, and get component
16   gSystem->Load("libPWG1.so");
17   TFile f("Output.root");
18   AliComparisonRes * compObj = (AliComparisonRes*)f.Get("AliComparisonRes");
19
20   // analyse comparison data
21   compObj->Analyse();
22
23   // the output histograms/graphs will be stored in the folder "folderRes" 
24   compObj->GetAnalysisFolder()->ls("*");
25
26   // user can save whole comparison object (or only folder with anlysed histograms) 
27   // in the seperate output file (e.g.)
28   TFile fout("Analysed_Res.root","recreate");
29   compObj->Write(); // compObj->GetAnalysisFolder()->Write();
30   fout.Close();
31
32 */
33
34 #include <iostream>
35
36 #include "TFile.h"
37 #include "TCint.h"
38 #include "TH3F.h"
39 #include "TH2F.h"
40 #include "TF1.h"
41 #include "TProfile.h"
42 #include "TProfile2D.h"
43 #include "TGraph2D.h"
44 #include "TCanvas.h"
45 #include "TGraph.h"
46
47 #include "AliESDEvent.h"   
48 #include "AliESD.h"
49 #include "AliESDfriend.h"
50 #include "AliESDfriendTrack.h"
51 #include "AliESDVertex.h"
52 #include "AliRecInfoCuts.h" 
53 #include "AliMCInfoCuts.h" 
54 #include "AliLog.h" 
55 #include "AliTracker.h" 
56
57 #include "AliMathBase.h"
58 #include "AliTreeDraw.h" 
59
60 #include "AliMCInfo.h" 
61 #include "AliESDRecInfo.h" 
62 #include "AliComparisonRes.h" 
63
64 using namespace std;
65
66 ClassImp(AliComparisonRes)
67
68 //_____________________________________________________________________________
69 AliComparisonRes::AliComparisonRes():
70   AliComparisonObject("AliComparisonRes"),
71
72   // Resolution 
73   fPtResolLPT(0),        // pt resolution - low pt
74   fPtResolHPT(0),        // pt resolution - high pt 
75   fPtPullLPT(0),         // pt resolution - low pt
76   fPtPullHPT(0),         // pt resolution - high pt 
77   //
78   // Resolution constrained param
79   //
80   fCPhiResolTan(0),  // angular resolution -  constrained
81   fCTanResolTan(0),  // angular resolution -  constrained
82   fCPtResolTan(0),   // pt resolution      -  constrained
83   fCPhiPullTan(0),   // angular resolution -  constrained
84   fCTanPullTan(0),   // angular resolution -  constrained
85   fCPtPullTan(0),    // pt resolution      -  constrained
86
87   //
88   // Parametrisation histograms
89   //
90
91   f1Pt2ResolS1PtTPC(0),
92   f1Pt2ResolS1PtTPCITS(0),
93   fYResolS1PtTPC(0),
94   fYResolS1PtTPCITS(0),
95   fZResolS1PtTPC(0),
96   fZResolS1PtTPCITS(0),
97   fPhiResolS1PtTPC(0),
98   fPhiResolS1PtTPCITS(0),
99   fThetaResolS1PtTPC(0),
100   fThetaResolS1PtTPCITS(0),
101
102   // constrained
103   fC1Pt2ResolS1PtTPC(0),
104   fC1Pt2ResolS1PtTPCITS(0),
105   fCYResolS1PtTPC(0),
106   fCYResolS1PtTPCITS(0),
107   fCZResolS1PtTPC(0),
108   fCZResolS1PtTPCITS(0),
109   fCPhiResolS1PtTPC(0),
110   fCPhiResolS1PtTPCITS(0),
111   fCThetaResolS1PtTPC(0),
112   fCThetaResolS1PtTPCITS(0),
113
114   // vertex
115   fVertex(0),
116  
117   // Cuts 
118   fCutsRC(0),  
119   fCutsMC(0),  
120
121   // histogram folder 
122   fAnalysisFolder(0)
123 {
124   Init();
125   
126   // vertex (0,0,0)
127   fVertex = new AliESDVertex();
128   fVertex->SetXv(0.0);
129   fVertex->SetYv(0.0);
130   fVertex->SetZv(0.0);
131 }
132
133 //_____________________________________________________________________________
134 AliComparisonRes::~AliComparisonRes(){
135   
136   // Resolution histograms
137   if(fPtResolLPT) delete  fPtResolLPT; fPtResolLPT=0;     
138   if(fPtResolHPT) delete  fPtResolHPT; fPtResolHPT=0;    
139   if(fPtPullLPT)  delete  fPtPullLPT;  fPtPullLPT=0;    
140   if(fPtPullHPT)  delete  fPtPullHPT;  fPtPullHPT=0;   
141
142   // Resolution histograms (constrained param)
143   if(fCPhiResolTan) delete fCPhiResolTan; fCPhiResolTan=0;
144   if(fCTanResolTan) delete fCTanResolTan; fCTanResolTan=0;
145   if(fCPtResolTan)  delete fCPtResolTan;  fCPtResolTan=0; 
146   if(fCPhiPullTan)  delete fCPhiPullTan;  fCPhiPullTan=0;
147   if(fCTanPullTan)  delete fCTanPullTan;  fCTanPullTan=0;
148   if(fCPtPullTan)   delete fCPtPullTan;   fCPtPullTan=0;
149
150   // Parametrisation histograms
151   // 
152   if(f1Pt2ResolS1PtTPC) delete f1Pt2ResolS1PtTPC; f1Pt2ResolS1PtTPC=0;
153   if(f1Pt2ResolS1PtTPCITS) delete f1Pt2ResolS1PtTPCITS; f1Pt2ResolS1PtTPCITS=0;
154   if(fYResolS1PtTPC) delete fYResolS1PtTPC; fYResolS1PtTPC=0;
155   if(fYResolS1PtTPCITS) delete fYResolS1PtTPCITS; fYResolS1PtTPCITS=0;
156   if(fZResolS1PtTPC) delete fZResolS1PtTPC; fZResolS1PtTPC=0;
157   if(fZResolS1PtTPCITS) delete fZResolS1PtTPCITS; fZResolS1PtTPCITS=0;
158   if(fPhiResolS1PtTPC) delete fPhiResolS1PtTPC; fPhiResolS1PtTPC=0;
159   if(fPhiResolS1PtTPCITS) delete fPhiResolS1PtTPCITS; fPhiResolS1PtTPCITS=0;
160   if(fThetaResolS1PtTPC) delete fThetaResolS1PtTPC; fThetaResolS1PtTPC=0;
161   if(fThetaResolS1PtTPCITS) delete fThetaResolS1PtTPCITS; fThetaResolS1PtTPCITS=0;
162
163   // constrained
164   if(fC1Pt2ResolS1PtTPC) delete fC1Pt2ResolS1PtTPC; fC1Pt2ResolS1PtTPC=0;
165   if(fC1Pt2ResolS1PtTPCITS) delete fC1Pt2ResolS1PtTPCITS; fC1Pt2ResolS1PtTPCITS=0;
166   if(fCYResolS1PtTPC) delete fCYResolS1PtTPC; fCYResolS1PtTPC=0;
167   if(fCYResolS1PtTPCITS) delete fCYResolS1PtTPCITS; fCYResolS1PtTPCITS=0;
168   if(fCZResolS1PtTPC) delete fCZResolS1PtTPC; fCZResolS1PtTPC=0;
169   if(fCZResolS1PtTPCITS) delete fCZResolS1PtTPCITS; fCZResolS1PtTPCITS=0;
170   if(fCPhiResolS1PtTPC) delete fCPhiResolS1PtTPC; fCPhiResolS1PtTPC=0;
171   if(fCPhiResolS1PtTPCITS) delete fCPhiResolS1PtTPCITS; fCPhiResolS1PtTPCITS=0;
172   if(fCThetaResolS1PtTPC) delete fCThetaResolS1PtTPC; fCThetaResolS1PtTPC=0;
173   if(fCThetaResolS1PtTPCITS) delete fCThetaResolS1PtTPCITS; fCThetaResolS1PtTPCITS=0;
174
175   if(fVertex) delete fVertex; fVertex=0;
176
177   if(fAnalysisFolder) delete fAnalysisFolder; fAnalysisFolder=0;
178 }
179
180 //_____________________________________________________________________________
181 void AliComparisonRes::Init(){
182
183   // Init histograms
184   fCPhiResolTan = new TH2F("CPhiResolTan","CPhiResolTan",50, -2,2,200,-0.025,0.025);   
185   fCPhiResolTan->SetXTitle("tan(#theta)");
186   fCPhiResolTan->SetYTitle("#Delta#phi");
187
188   fCTanResolTan = new TH2F("CTanResolTan","CTanResolTan",50, -2,2,200,-0.025,0.025);
189   fCTanResolTan->SetXTitle("tan(#theta)");
190   fCTanResolTan->SetYTitle("#Delta#theta");
191
192   fCPtResolTan=new TH2F("CPtResol","CPtResol",50, -2,2,200,-0.2,0.2);    
193   fCPtResolTan->SetXTitle("Tan(#theta)");
194   fCPtResolTan->SetYTitle("#Deltap_{t}/p_{t}");
195
196   fCPhiPullTan = new TH2F("CPhiPullTan","CPhiPullTan",50, -2,2,200,-5,5);   
197   fCPhiPullTan->SetXTitle("Tan(#theta)");
198   fCPhiPullTan->SetYTitle("#Delta#phi/#Sigma");
199
200   fCTanPullTan = new TH2F("CTanPullTan","CTanPullTan",50, -2,2,200,-5,5);
201   fCTanPullTan->SetXTitle("Tan(#theta)");
202   fCTanPullTan->SetYTitle("#Delta#theta/#Sigma");
203
204   fCPtPullTan=new TH2F("CPtPull","CPtPull",50, -2,2,200,-5,5);    
205   fCPtPullTan->SetXTitle("Tan(#theta)");
206   fCPtPullTan->SetYTitle("(1/mcp_{t}-1/p_{t})/#Sigma");
207
208   fPtResolLPT = new TH2F("Pt_resol_lpt","pt resol",10, 0.1,3,200,-0.2,0.2);
209   fPtResolLPT->SetXTitle("p_{t}");
210   fPtResolLPT->SetYTitle("#Deltap_{t}/p_{t}");
211
212   fPtResolHPT = new TH2F("Pt_resol_hpt","pt resol",10, 2,100,200,-0.3,0.3);  
213   fPtResolHPT->SetXTitle("p_{t}");
214   fPtResolHPT->SetYTitle("#Deltap_{t}/p_{t}");
215
216   fPtPullLPT = new TH2F("Pt_pull_lpt","pt pull",10, 0.1,3,200,-6,6);
217   fPtPullLPT->SetXTitle("p_{t}");
218   fPtPullLPT->SetYTitle("#Deltap_{t}/#Sigma");
219
220   fPtPullHPT = new TH2F("Pt_pull_hpt","pt pull",10,2,100,200,-6,6);  
221   fPtPullHPT->SetXTitle("p_{t}");
222   fPtPullHPT->SetYTitle("#Deltap_{t}/#Sigma");
223
224   //
225   // Parametrisation histograms
226   // 
227
228   f1Pt2ResolS1PtTPC = new TH2F("f1Pt2ResolS1PtTPC","(1/mcpt-1/pt)/(1+1/mcpt)^2 vs sqrt(1/pt))",100,0,3,200,-0.010,0.010);  
229   f1Pt2ResolS1PtTPC->SetXTitle("#sqrt{1/mcp_{t}}");
230   f1Pt2ResolS1PtTPC->SetYTitle("(1/mcp_{t}-1/p_{t})/(1+1/mcp_{t})^2)");
231
232   f1Pt2ResolS1PtTPCITS = new TH2F("f1Pt2ResolS1PtTPCITS","(1/mcpt-1/pt)/(1+1/mcpt)^2 vs sqrt(1/pt))",100,0,3,200,-0.010,0.010);  
233   f1Pt2ResolS1PtTPCITS->SetXTitle("#sqrt{1/mcp_{t}}");
234   f1Pt2ResolS1PtTPCITS->SetYTitle("(1/mcp_{t}-1/p_{t})/(1+1/mcp_{t})^2)");
235
236   fYResolS1PtTPC = new TH2F("fYResolS1PtTPC","fYResolS1PtTPC",100, 0,3,200,-1.0,1.0);   
237   fYResolS1PtTPC->SetXTitle("#sqrt{1/mcp_{t}}");
238   fYResolS1PtTPC->SetYTitle("#DeltaY");
239
240   fYResolS1PtTPCITS = new TH2F("fYResolS1PtTPCITS","fYResolS1PtTPCITS",100, 0,3,200,-0.05,0.05);   
241   fYResolS1PtTPCITS->SetXTitle("#sqrt{1/mcp_{t}}");
242   fYResolS1PtTPCITS->SetYTitle("#DeltaY");
243
244   fZResolS1PtTPC = new TH2F("fZResolS1PtTPC","fZResolS1PtTPC",100, 0,3,200,-1.0,1.0);   
245   fZResolS1PtTPC->SetXTitle("#sqrt{1/mcp_{t}}");
246   fZResolS1PtTPC->SetYTitle("#DeltaZ");
247
248   fZResolS1PtTPCITS = new TH2F("fZResolS1PtTPCITS","fZResolS1PtTPCITS",100, 0,3,200,-0.05,0.05);   
249   fZResolS1PtTPCITS->SetXTitle("#sqrt{1/mcp_{t}}");
250   fZResolS1PtTPCITS->SetYTitle("#DeltaZ");
251
252   fPhiResolS1PtTPC = new TH2F("fPhiResolS1PtTPC","fPhiResolS1PtTPC",100, 0,3,200,-0.025,0.025);   
253   fPhiResolS1PtTPC->SetXTitle("#sqrt{1/mcp_{t}}");
254   fPhiResolS1PtTPC->SetYTitle("#Delta#phi");
255
256   fPhiResolS1PtTPCITS = new TH2F("fPhiResolS1PtTPCITS","fPhiResolS1PtTPCITS",100, 0,3,200,-0.01,0.01);   
257   fPhiResolS1PtTPCITS->SetXTitle("#sqrt{1/mcp_{t}}");
258   fPhiResolS1PtTPCITS->SetYTitle("#Delta#phi");
259
260   fThetaResolS1PtTPC = new TH2F("fThetaResolS1PtTPC","fThetaResolS1PtTPC",100, 0,3,200,-0.025,0.025);   
261   fThetaResolS1PtTPC->SetXTitle("#sqrt{1/mcp_{t}}");
262   fThetaResolS1PtTPC->SetYTitle("#Delta#theta");
263
264   fThetaResolS1PtTPCITS = new TH2F("fThetaResolS1PtTPCITS","fThetaResolS1PtTPCITS",100, 0,3,200,-0.01,0.01);   
265   fThetaResolS1PtTPCITS->SetXTitle("#sqrt{1/mcp_{t}}");
266   fThetaResolS1PtTPCITS->SetYTitle("#Delta#theta");
267   
268   // constrained
269   fC1Pt2ResolS1PtTPC = new TH2F("fC1Pt2ResolS1PtTPC","(1/mcpt-1/pt)/(1+1/mcpt)^2 vs 1/pt)",100,0,3,200,-0.010,0.010);  
270   fC1Pt2ResolS1PtTPC->SetXTitle("#sqrt{1/mcp_{t}}");
271   fC1Pt2ResolS1PtTPC->SetYTitle("(1/mcp_{t}-1/p_{t})/(1+1/mcp_{t})^2)");
272
273   fC1Pt2ResolS1PtTPCITS = new TH2F("fC1Pt2ResolS1PtTPCITS","(1/mcpt-1/pt)/(1+1/mcpt)^2 vs 1/pt)",100,0,3,200,-0.010,0.010);  
274   fC1Pt2ResolS1PtTPCITS->SetXTitle("#sqrt{1/mcp_{t}}");
275   fC1Pt2ResolS1PtTPCITS->SetYTitle("(1/mcp_{t}-1/p_{t})/(1+1/mcp_{t})^2)");
276
277   fCYResolS1PtTPC = new TH2F("fCYResolS1PtTPC","fCYResolS1PtTPC",100, 0,3,200,-1.0,1.0);   
278   fCYResolS1PtTPC->SetXTitle("#sqrt{1/mcp_{t}}");
279   fCYResolS1PtTPC->SetYTitle("#DeltaY");
280
281   fCYResolS1PtTPCITS = new TH2F("fCYResolS1PtTPCITS","fCYResolS1PtTPCITS",100, 0,3,200,-0.01,0.01);   
282   fCYResolS1PtTPCITS->SetXTitle("#sqrt{1/mcp_{t}}");
283   fCYResolS1PtTPCITS->SetYTitle("#DeltaY");
284
285   fCZResolS1PtTPC = new TH2F("fCZResolS1PtTPC","fCZResolS1PtTPC",100, 0,3,200,-1.0,1.0);   
286   fCZResolS1PtTPC->SetXTitle("#sqrt{1/mcp_{t}}");
287   fCZResolS1PtTPC->SetYTitle("#DeltaZ");
288
289   fCZResolS1PtTPCITS = new TH2F("fCZResolS1PtTPCITS","fCZResolS1PtTPCITS",100, 0,3,200,-0.025,0.025);   
290   fCZResolS1PtTPCITS->SetXTitle("#sqrt{1/mcp_{t}}");
291   fCZResolS1PtTPCITS->SetYTitle("#DeltaZ");
292
293   fCPhiResolS1PtTPC = new TH2F("fCPhiResolS1PtTPC","fCPhiResolS1PtTPC",100, 0,3,200,-0.025,0.025);   
294   fCPhiResolS1PtTPC->SetXTitle("#sqrt{1/mcp_{t}}");
295   fCPhiResolS1PtTPC->SetYTitle("#Delta#phi");
296
297   fCPhiResolS1PtTPCITS = new TH2F("fCPhiResolS1PtTPCITS","fCPhiResolS1PtTPCITS",100, 0,3,200,-0.003,0.003);   
298   fCPhiResolS1PtTPCITS->SetXTitle("#sqrt{1/mcp_{t}}");
299   fCPhiResolS1PtTPCITS->SetYTitle("#Delta#phi");
300
301   fCThetaResolS1PtTPC = new TH2F("fCThetaResolS1PtTPC","fCThetaResolS1PtTPC",100, 0,3,200,-0.025,0.025);   
302   fCThetaResolS1PtTPC->SetXTitle("#sqrt{1/mcp_{t}}");
303   fCThetaResolS1PtTPC->SetYTitle("#Delta#theta");
304
305   fCThetaResolS1PtTPCITS = new TH2F("fCThetaResolS1PtTPCITS","fCThetaResolS1PtTPCITS",100, 0,3,200,-0.005,0.005);   
306   fCThetaResolS1PtTPCITS->SetXTitle("#sqrt{1/mcp_{t}}");
307   fCThetaResolS1PtTPCITS->SetYTitle("#Delta#theta");
308
309   // Init cuts 
310   if(!fCutsMC) 
311     AliDebug(AliLog::kError, "ERROR: Cannot find AliMCInfoCuts object");
312   if(!fCutsRC) 
313     AliDebug(AliLog::kError, "ERROR: Cannot find AliRecInfoCuts object");
314
315   // init folder
316   fAnalysisFolder = CreateFolder("folderRes","Analysis Resolution Folder");
317 }
318
319 //_____________________________________________________________________________
320 void AliComparisonRes::Process(AliMCInfo* infoMC, AliESDRecInfo *infoRC)
321 {
322   // Fill resolution comparison information 
323   AliExternalTrackParam *track = 0;
324   Double_t field      = AliTracker::GetBz(); // nominal Bz field [kG]
325   Double_t kMaxD      = 123456.0; // max distance
326
327   Int_t clusterITS[200];
328   Double_t dca[2], cov[3]; // dca_xy, dca_z, sigma_xy, sigma_xy_z, sigma_z
329
330   Float_t deltaPt, pullPt, deltaPhi, deltaTan, delta1Pt2, deltaY1Pt, deltaZ1Pt, deltaPhi1Pt, deltaTheta1Pt; 
331   Float_t deltaPtTPC, pullPtTPC, deltaPhiTPC, deltaTanTPC, delta1Pt2TPC, deltaY1PtTPC, deltaZ1PtTPC, deltaPhi1PtTPC, deltaTheta1PtTPC; 
332
333   Float_t mcpt = infoMC->GetParticle().Pt();
334   Float_t s1mcpt = TMath::Sqrt(1./infoMC->GetParticle().Pt());
335
336   // distance to Prim. vertex 
337   const Double_t* dv = infoMC->GetVDist(); 
338   Bool_t isPrim = TMath::Sqrt(dv[0]*dv[0] + dv[1]*dv[1])<fCutsMC->GetMaxR() && TMath::Abs(dv[2])<fCutsMC->GetMaxVz();
339
340   // Check selection cuts
341   if (fCutsMC->IsPdgParticle(TMath::Abs(infoMC->GetParticle().GetPdgCode())) == kFALSE) return; 
342   if (!isPrim) return;
343   if (infoRC->GetStatus(1)!=3) return; // TPC refit
344   if (!infoRC->GetESDtrack()) return;  
345   if (infoRC->GetESDtrack()->GetTPCNcls()<fCutsRC->GetMinNClustersTPC()) return;
346
347   // calculate and set prim. vertex
348   fVertex->SetXv( infoMC->GetParticle().Vx() - dv[0] );
349   fVertex->SetYv( infoMC->GetParticle().Vy() - dv[1] );
350   fVertex->SetZv( infoMC->GetParticle().Vz() - dv[2] );
351
352   deltaPt= (mcpt-infoRC->GetESDtrack()->Pt())/mcpt;  
353   pullPt= (1/mcpt-infoRC->GetESDtrack()->OneOverPt())/TMath::Sqrt(infoRC->GetESDtrack()->GetSigma1Pt2());  
354   deltaPhi = TMath::ATan2(infoRC->GetESDtrack()->Py(),infoRC->GetESDtrack()->Px())-
355                      TMath::ATan2(infoMC->GetParticle().Py(),infoMC->GetParticle().Px());
356
357   deltaTan = TMath::ATan2(infoRC->GetESDtrack()->Pz(),infoRC->GetESDtrack()->Pt())-
358                      TMath::ATan2(infoMC->GetParticle().Pz(),infoMC->GetParticle().Pt());
359
360   delta1Pt2 = (1/mcpt-infoRC->GetESDtrack()->OneOverPt())/TMath::Power(1+1/mcpt,2);       
361   deltaY1Pt = (infoMC->GetParticle().Vy()-infoRC->GetESDtrack()->GetY()) / (0.2+1/mcpt);
362   deltaZ1Pt = (infoMC->GetParticle().Vz()-infoRC->GetESDtrack()->GetZ()) / (0.2+1/mcpt);
363   deltaPhi1Pt = deltaPhi   / (0.1+1/mcpt);
364   deltaTheta1Pt = deltaTan / (0.1+1/mcpt);
365
366   // calculate track parameters at vertex
367   const AliExternalTrackParam *innerTPC =  0;
368   if ((innerTPC = infoRC->GetESDtrack()->GetTPCInnerParam()) != 0)
369   {
370     if ((track = new AliExternalTrackParam(*infoRC->GetESDtrack()->GetTPCInnerParam())) != 0 )
371     {
372       Bool_t bDCAStatus = track->PropagateToDCA(fVertex,field,kMaxD,dca,cov);
373
374       // Fill parametrisation histograms (only TPC track)
375       if(bDCAStatus) 
376           {
377                         deltaPtTPC= (mcpt-innerTPC->Pt())/mcpt;  
378                         pullPtTPC= (1/mcpt-innerTPC->OneOverPt())/TMath::Sqrt(innerTPC->GetSigma1Pt2());  
379                         deltaPhiTPC = TMath::ATan2(innerTPC->Py(),innerTPC->Px())-
380                                                                 TMath::ATan2(infoMC->GetParticle().Py(),infoMC->GetParticle().Px());
381
382                         deltaTanTPC = TMath::ATan2(innerTPC->Pz(),innerTPC->Pt())-
383                                                                 TMath::ATan2(infoMC->GetParticle().Pz(),infoMC->GetParticle().Pt());
384
385                         delta1Pt2TPC = (1/mcpt-innerTPC->OneOverPt())/TMath::Power(1+1/mcpt,2);       
386                         deltaY1PtTPC= (infoMC->GetParticle().Vy()-innerTPC->GetY()) / (0.2+1/mcpt);
387                         deltaZ1PtTPC = (infoMC->GetParticle().Vz()-innerTPC->GetZ()) / (0.2+1/mcpt);
388                         deltaPhi1PtTPC = deltaPhiTPC   / (0.1+1/mcpt);
389                         deltaTheta1PtTPC = deltaTanTPC / (0.1+1/mcpt);
390
391                         f1Pt2ResolS1PtTPC->Fill(s1mcpt,delta1Pt2TPC);
392                         fYResolS1PtTPC->Fill(s1mcpt,deltaY1PtTPC);
393                         fZResolS1PtTPC->Fill(s1mcpt,deltaZ1PtTPC);
394                         fPhiResolS1PtTPC->Fill(s1mcpt,deltaPhi1PtTPC);
395                         fThetaResolS1PtTPC->Fill(s1mcpt,deltaTheta1PtTPC);
396           }
397           delete track;
398     }
399   }
400
401   // TPC and ITS (nb. of clusters >2) in the system
402   if(infoRC->GetESDtrack()->GetITSclusters(clusterITS)>2) 
403   {
404       f1Pt2ResolS1PtTPCITS->Fill(s1mcpt,delta1Pt2);
405       fYResolS1PtTPCITS->Fill(s1mcpt,deltaY1Pt);
406       fZResolS1PtTPCITS->Fill(s1mcpt,deltaZ1Pt);
407       fPhiResolS1PtTPCITS->Fill(s1mcpt,deltaPhi1Pt);
408       fThetaResolS1PtTPCITS->Fill(s1mcpt,deltaTheta1Pt);
409   }
410
411   // Fill histograms
412   fPtResolLPT->Fill(mcpt,deltaPt);
413   fPtResolHPT->Fill(mcpt,deltaPt);
414   fPtPullLPT->Fill(mcpt,pullPt);
415   fPtPullHPT->Fill(mcpt,pullPt);  
416 }
417
418 //_____________________________________________________________________________
419 void AliComparisonRes::ProcessConstrained(AliMCInfo* infoMC, AliESDRecInfo *infoRC)
420 {
421   // Fill resolution comparison information (constarained parameters) 
422   //
423   AliExternalTrackParam *track = 0;
424   Double_t field      = AliTracker::GetBz(); // nominal Bz field [kG]
425   Double_t kMaxD      = 123456.0; // max distance
426
427   Int_t clusterITS[200];
428   Double_t dca[2], cov[3]; // dca_xy, dca_z, sigma_xy, sigma_xy_z, sigma_z
429  
430   Float_t deltaPt, pullPt, deltaPhi, pullPhi, deltaTan, pullTan, delta1Pt2, deltaY1Pt, deltaZ1Pt, deltaPhi1Pt, deltaTheta1Pt; 
431   Float_t deltaPtTPC, pullPtTPC, deltaPhiTPC, deltaTanTPC, delta1Pt2TPC, deltaY1PtTPC, deltaZ1PtTPC, deltaPhi1PtTPC, deltaTheta1PtTPC; 
432
433   Float_t mcpt = infoMC->GetParticle().Pt();
434   Float_t s1mcpt = TMath::Sqrt(1./infoMC->GetParticle().Pt());
435   Float_t tantheta = TMath::Tan(infoMC->GetParticle().Theta()-TMath::Pi()*0.5);
436
437   // distance to Prim. vertex 
438   const Double_t* dv = infoMC->GetVDist(); 
439   Bool_t isPrim = TMath::Sqrt(dv[0]*dv[0] + dv[1]*dv[1])<fCutsMC->GetMaxR() && TMath::Abs(dv[2])<fCutsMC->GetMaxVz();
440   
441   // Check selection cuts
442   if (fCutsMC->IsPdgParticle(TMath::Abs(infoMC->GetParticle().GetPdgCode())) == kFALSE) return; 
443   if (!isPrim) return;
444   if (infoRC->GetStatus(1)!=3) return;
445   if (!infoRC->GetESDtrack()) return;  
446   if (infoRC->GetESDtrack()->GetTPCNcls()<fCutsRC->GetMinNClustersTPC()) return;
447   if (!infoRC->GetESDtrack()->GetConstrainedParam()) return;
448
449 // calculate and set prim. vertex
450   fVertex->SetXv( infoMC->GetParticle().Vx() - dv[0] );
451   fVertex->SetYv( infoMC->GetParticle().Vy() - dv[1] );
452   fVertex->SetZv( infoMC->GetParticle().Vz() - dv[2] );
453
454   // constrained parameters resolution
455   const AliExternalTrackParam * cparam = infoRC->GetESDtrack()->GetConstrainedParam();
456   deltaPt= (mcpt-cparam->Pt())/mcpt;  
457   pullPt= (1/mcpt-cparam->OneOverPt())/TMath::Sqrt(cparam->GetSigma1Pt2());          
458   deltaPhi = TMath::ATan2(cparam->Py(),cparam->Px())-
459                      TMath::ATan2(infoMC->GetParticle().Py(),infoMC->GetParticle().Px());
460   pullPhi = deltaPhi/TMath::Sqrt(cparam->GetSigmaSnp2()); 
461   deltaTan = TMath::ATan2(cparam->Pz(),cparam->Pt())-TMath::ATan2(infoMC->GetParticle().Pz(),infoMC->GetParticle().Pt());
462   pullTan = deltaPhi/TMath::Sqrt(cparam->GetSigmaSnp2()); 
463
464
465   delta1Pt2 = (1/mcpt-cparam->OneOverPt())/TMath::Power(1+1/mcpt,2);       
466
467   deltaY1Pt = (infoMC->GetParticle().Vy()-cparam->GetY()) / (0.2+1/mcpt);
468   deltaZ1Pt = (infoMC->GetParticle().Vz()-cparam->GetZ()) / (0.2+1/mcpt);
469   deltaPhi1Pt = deltaPhi   / (0.1+1/mcpt);
470   deltaTheta1Pt = deltaTan / (0.1+1/mcpt);
471
472   // calculate track parameters at vertex
473   const AliExternalTrackParam *innerTPC =  0;
474   if ((innerTPC = infoRC->GetESDtrack()->GetTPCInnerParam()) != 0)
475   {
476     if ((track = new AliExternalTrackParam(*infoRC->GetESDtrack()->GetTPCInnerParam())) != 0 )
477     {
478       Bool_t bDCAStatus = track->PropagateToDCA(fVertex,field,kMaxD,dca,cov);
479
480       // Fill parametrisation histograms (only TPC track)
481       if(bDCAStatus) 
482           {
483                   deltaPtTPC= (mcpt-innerTPC->Pt())/mcpt;  
484                   pullPtTPC= (1/mcpt-innerTPC->OneOverPt())/TMath::Sqrt(innerTPC->GetSigma1Pt2());  
485                   deltaPhiTPC = TMath::ATan2(innerTPC->Py(),innerTPC->Px())-
486                                                                 TMath::ATan2(infoMC->GetParticle().Py(),infoMC->GetParticle().Px());
487
488                   deltaTanTPC = TMath::ATan2(innerTPC->Pz(),innerTPC->Pt())-
489                                                                 TMath::ATan2(infoMC->GetParticle().Pz(),infoMC->GetParticle().Pt());
490
491                   delta1Pt2TPC = (1/mcpt-innerTPC->OneOverPt())/TMath::Power(1+1/mcpt,2);       
492                   deltaY1PtTPC= (infoMC->GetParticle().Vy()-innerTPC->GetY()) / (0.2+1/mcpt);
493                   deltaZ1PtTPC = (infoMC->GetParticle().Vz()-innerTPC->GetZ()) / (0.2+1/mcpt);
494                   deltaPhi1PtTPC = deltaPhiTPC   / (0.1+1/mcpt);
495                   deltaTheta1PtTPC = deltaTanTPC / (0.1+1/mcpt);
496
497           fC1Pt2ResolS1PtTPC->Fill(s1mcpt,delta1Pt2TPC);
498           fCYResolS1PtTPC->Fill(s1mcpt,deltaY1PtTPC);
499           fCZResolS1PtTPC->Fill(s1mcpt,deltaZ1PtTPC);
500           fCPhiResolS1PtTPC->Fill(s1mcpt,deltaPhi1PtTPC);
501           fCThetaResolS1PtTPC->Fill(s1mcpt,deltaTheta1PtTPC);
502           }
503           delete track;
504     }
505   }
506
507  // TPC and ITS (nb. of clusters >2) in the system
508   if(infoRC->GetESDtrack()->GetITSclusters(clusterITS)>2) 
509   {
510       fC1Pt2ResolS1PtTPCITS->Fill(s1mcpt,delta1Pt2);
511       fCYResolS1PtTPCITS->Fill(s1mcpt,deltaY1Pt);
512       fCZResolS1PtTPCITS->Fill(s1mcpt,deltaZ1Pt);
513       fCPhiResolS1PtTPCITS->Fill(s1mcpt,deltaPhi1Pt);
514       fCThetaResolS1PtTPCITS->Fill(s1mcpt,deltaTheta1Pt);
515   }
516
517   // Fill histograms
518   fCPtResolTan->Fill(tantheta,deltaPt);
519   fCPtPullTan->Fill(tantheta,pullPt);
520   fCPhiResolTan->Fill(tantheta,deltaPhi);
521   fCPhiPullTan->Fill(tantheta,pullPhi);
522   fCTanResolTan->Fill(tantheta,deltaTan);
523   fCTanPullTan->Fill(tantheta,pullTan);
524 }
525  
526 //_____________________________________________________________________________
527 void AliComparisonRes::Exec(AliMCInfo* infoMC, AliESDRecInfo *infoRC){
528   
529   // Process comparison information 
530   Process(infoMC,infoRC);
531   ProcessConstrained(infoMC,infoRC);
532 }
533
534 //_____________________________________________________________________________
535 TH1F* AliComparisonRes::MakeResol(TH2F * his, Int_t integ, Bool_t type){
536   // Create resolution histograms
537  
538   TH1F *hisr, *hism;
539   if (!gPad) new TCanvas;
540   hisr = AliTreeDraw::CreateResHistoI(his,&hism,integ);
541   if (type) return hism;
542   else 
543     return hisr;
544 }
545
546 //_____________________________________________________________________________
547 void AliComparisonRes::Analyse(){
548   // Analyse comparison information and store output histograms
549   // in the folder "folderRes"
550   //
551  
552   TH1::AddDirectory(kFALSE);
553
554   AliComparisonRes * comp=this;
555   //TFolder *folder = comp->GetAnalysisFolder();
556   TH1F *hiss=0;
557   TObjArray *aFolderObj = new TObjArray;
558
559   // write results in the folder 
560
561   TCanvas * c = new TCanvas("Phi resol Tan","Phi resol Tan");
562   c->cd();
563   //
564   hiss = comp->MakeResol(comp->fCPtResolTan,1,0);
565   hiss->SetXTitle("Tan(#theta)");
566   hiss->SetYTitle("#sigmap_{t}/p_{t}");
567   hiss->Draw(); 
568   hiss->SetName("CptResolTan");
569   
570   aFolderObj->Add(hiss);
571
572   //
573   hiss = comp->MakeResol(comp->fCPhiResolTan,1,0);
574   hiss->SetXTitle("Tan(#theta)");
575   hiss->SetYTitle("#sigma#phi (rad)");
576   hiss->Draw();
577   hiss->SetName("PhiResolTan");
578   
579   aFolderObj->Add(hiss);
580   //
581   hiss = comp->MakeResol(comp->fCTanResolTan,1,0);
582   hiss->SetXTitle("Tan(#theta)");
583   hiss->SetYTitle("#sigma#theta (rad)");
584   hiss->Draw();
585   hiss->SetName("ThetaResolTan");
586   
587   aFolderObj->Add(hiss);
588   //
589   hiss = comp->MakeResol(comp->fCPtPullTan,1,0);
590   hiss->SetXTitle("Tan(#theta)");
591   hiss->SetYTitle("1/mcp_{t}-1/p_{t}/#Sigma(1/p_{t})");
592   hiss->Draw();
593   hiss->SetName("CptPullTan");
594   
595   aFolderObj->Add(hiss);
596   //
597   hiss = comp->MakeResol(comp->fC1Pt2ResolS1PtTPC,1,0);
598   hiss->SetXTitle("#sqrt(1/mcp_{t})");
599   hiss->SetYTitle("1/mcp_{t}-1/p_{t}/(1+1/p_{t})^2");
600   hiss->Draw();
601   hiss->SetName("C1Pt2ResolS1PtTPC");
602   
603   aFolderObj->Add(hiss);
604
605   hiss = comp->MakeResol(comp->fC1Pt2ResolS1PtTPCITS,1,0);
606   hiss->SetXTitle("#sqrt(1/mcp_{t})");
607   hiss->SetYTitle("1/mcp_{t}-1/p_{t}/(1+1/p_{t})^2");
608   hiss->Draw();
609   hiss->SetName("C1Pt2ResolS1PtTPCITS");
610   
611   aFolderObj->Add(hiss);
612   //
613   hiss = comp->MakeResol(comp->fCYResolS1PtTPC,1,0);
614   hiss->SetXTitle("#sqrt(1/mcp_{t})");
615   hiss->SetYTitle("(mcy-y)/(0.2+1/mcp_{t})");
616   hiss->Draw();
617   hiss->SetName("CYResolS1PtTPC");
618   
619   aFolderObj->Add(hiss);
620
621   hiss = comp->MakeResol(comp->fCYResolS1PtTPCITS,1,0);
622   hiss->SetXTitle("#sqrt(1/mcp_{t})");
623   hiss->SetYTitle("(mcy-y)/(0.2+1/mcp_{t})");
624   hiss->Draw();
625   hiss->SetName("CYResolS1PtTPCITS");
626   
627   aFolderObj->Add(hiss);
628   //
629   hiss = comp->MakeResol(comp->fCZResolS1PtTPC,1,0);
630   hiss->SetXTitle("#sqrt(1/mcp_{t})");
631   hiss->SetYTitle("(mcz-z)/(0.2+1/mcp_{t})");
632   hiss->Draw();
633   hiss->SetName("CZResolS1PtTPC");
634   
635   aFolderObj->Add(hiss);
636
637   hiss = comp->MakeResol(comp->fCZResolS1PtTPCITS,1,0);
638   hiss->SetXTitle("#sqrt(1/mcp_{t})");
639   hiss->SetYTitle("(mcz-z)/(0.2+1/mcp_{t})");
640   hiss->Draw();
641   hiss->SetName("CZResolS1PtTPCITS");
642   
643   aFolderObj->Add(hiss);
644   //
645   hiss = comp->MakeResol(comp->fCPhiResolS1PtTPC,1,0);
646   hiss->SetXTitle("#sqrt(1/mcp_{t})");
647   hiss->SetYTitle("(mc#phi-#phi)/(0.1+1/mcp_{t})");
648   hiss->Draw();
649   hiss->SetName("CPhiResolS1PtTPC");
650   
651   aFolderObj->Add(hiss);
652
653   hiss = comp->MakeResol(comp->fCPhiResolS1PtTPCITS,1,0);
654   hiss->SetXTitle("#sqrt(1/mcp_{t})");
655   hiss->SetYTitle("(mc#phi-#phi)/(0.1+1/mcp_{t})");
656   hiss->Draw();
657   hiss->SetName("CPhiResolS1PtTPCITS");
658   
659   aFolderObj->Add(hiss);
660   //
661   hiss = comp->MakeResol(comp->fCThetaResolS1PtTPC,1,0);
662   hiss->SetXTitle("#sqrt(1/mcp_{t})");
663   hiss->SetYTitle("(mc#theta-#theta)/(0.1+1/mcp_{t})");
664   hiss->Draw();
665   hiss->SetName("CThetaResolS1PtTPC");
666   
667   aFolderObj->Add(hiss);
668
669   hiss = comp->MakeResol(comp->fCThetaResolS1PtTPCITS,1,0);
670   hiss->SetXTitle("#sqrt(1/mcp_{t})");
671   hiss->SetYTitle("(mc#theta-#theta)/(0.1+1/mcp_{t})");
672   hiss->Draw();
673   hiss->SetName("CThetaResolS1PtTPCITS");
674   
675   aFolderObj->Add(hiss);
676
677   //
678   hiss = comp->MakeResol(comp->f1Pt2ResolS1PtTPC,1,0);
679   hiss->SetXTitle("#sqrt(1/mcp_{t})");
680   hiss->SetYTitle("1/mcp_{t}-1/p_{t}/(1+1/p_{t})^2");
681   hiss->Draw();
682   hiss->SetName("OnePt2ResolS1PtTPC");
683   
684   aFolderObj->Add(hiss);
685
686   hiss = comp->MakeResol(comp->f1Pt2ResolS1PtTPCITS,1,0);
687   hiss->SetXTitle("#sqrt(1/mcp_{t})");
688   hiss->SetYTitle("1/mcp_{t}-1/p_{t}/(1+1/p_{t})^2");
689   hiss->Draw();
690   hiss->SetName("OnePt2ResolS1PtTPCITS");
691   
692   aFolderObj->Add(hiss);
693   //
694   hiss = comp->MakeResol(comp->fYResolS1PtTPC,1,0);
695   hiss->SetXTitle("#sqrt(1/mcp_{t})");
696   hiss->SetYTitle("(mcy-y)/(0.2+1/mcp_{t})");
697   hiss->Draw();
698   hiss->SetName("YResolS1PtTPC");
699   
700   aFolderObj->Add(hiss);
701
702   hiss = comp->MakeResol(comp->fYResolS1PtTPCITS,1,0);
703   hiss->SetXTitle("#sqrt(1/mcp_{t})");
704   hiss->SetYTitle("(mcy-y)/(0.2+1/mcp_{t})");
705   hiss->Draw();
706   hiss->SetName("YResolS1PtTPCITS");
707   
708   aFolderObj->Add(hiss);
709   //
710   hiss = comp->MakeResol(comp->fZResolS1PtTPC,1,0);
711   hiss->SetXTitle("#sqrt(1/mcp_{t})");
712   hiss->SetYTitle("(mcz-z)/(0.2+1/mcp_{t})");
713   hiss->Draw();
714   hiss->SetName("ZResolS1PtTPC");
715   
716   aFolderObj->Add(hiss);
717
718   hiss = comp->MakeResol(comp->fZResolS1PtTPCITS,1,0);
719   hiss->SetXTitle("#sqrt(1/mcp_{t})");
720   hiss->SetYTitle("(mcz-z)/(0.2+1/mcp_{t})");
721   hiss->Draw();
722   hiss->SetName("ZResolS1PtTPCITS");
723   
724   aFolderObj->Add(hiss);
725   //
726   hiss = comp->MakeResol(comp->fPhiResolS1PtTPC,1,0);
727   hiss->SetXTitle("#sqrt(1/mcp_{t})");
728   hiss->SetYTitle("(mc#phi-#phi)/(0.1+1/mcp_{t})");
729   hiss->Draw();
730   hiss->SetName("PhiResolS1PtTPC");
731   
732   aFolderObj->Add(hiss);
733
734   hiss = comp->MakeResol(comp->fPhiResolS1PtTPCITS,1,0);
735   hiss->SetXTitle("#sqrt(1/mcp_{t})");
736   hiss->SetYTitle("(mc#phi-#phi)/(0.1+1/mcp_{t})");
737   hiss->Draw();
738   hiss->SetName("PhiResolS1PtTPCITS");
739   
740   aFolderObj->Add(hiss);
741   //
742   hiss = comp->MakeResol(comp->fThetaResolS1PtTPC,1,0);
743   hiss->SetXTitle("#sqrt(1/mcp_{t})");
744   hiss->SetYTitle("(mc#theta-#theta)/(0.1+1/mcp_{t})");
745   hiss->Draw();
746   hiss->SetName("ThetaResolS1PtTPC");
747   
748   aFolderObj->Add(hiss);
749
750   hiss = comp->MakeResol(comp->fThetaResolS1PtTPCITS,1,0);
751   hiss->SetXTitle("#sqrt(1/mcp_{t})");
752   hiss->SetYTitle("(mc#theta-#theta)/(0.1+1/mcp_{t})");
753   hiss->Draw();
754   hiss->SetName("ThetaResolS1PtTPCITS");
755   
756   aFolderObj->Add(hiss);
757
758   // export objects to analysis folder
759   fAnalysisFolder = ExportToFolder(aFolderObj);
760
761   // delete only TObjArray
762   if(aFolderObj) delete aFolderObj;
763 }
764
765 //_____________________________________________________________________________
766 TFolder* AliComparisonRes::ExportToFolder(TObjArray * array) 
767 {
768   // recreate folder avery time and export objects to new one
769   //
770   AliComparisonRes * comp=this;
771   TFolder *folder = comp->GetAnalysisFolder();
772
773   TString name, title;
774   TFolder *newFolder = 0;
775   Int_t i = 0;
776   Int_t size = array->GetSize();
777
778   if(folder) { 
779      // get name and title from old folder
780      name = folder->GetName();  
781      title = folder->GetTitle();  
782
783          // delete old one
784      delete folder;
785
786          // create new one
787      newFolder = CreateFolder(name.Data(),title.Data());
788      newFolder->SetOwner();
789
790          // add objects to folder
791      while(i < size) {
792            newFolder->Add(array->At(i));
793            i++;
794          }
795   }
796
797 return newFolder;
798 }
799
800 //_____________________________________________________________________________
801 Long64_t AliComparisonRes::Merge(TCollection* list) 
802 {
803   // Merge list of objects (needed by PROOF)
804
805   if (!list)
806   return 0;
807
808   if (list->IsEmpty())
809   return 1;
810
811   TIterator* iter = list->MakeIterator();
812   TObject* obj = 0;
813
814   // collection of generated histograms
815   Int_t count=0;
816   while((obj = iter->Next()) != 0) 
817   {
818   AliComparisonRes* entry = dynamic_cast<AliComparisonRes*>(obj);
819   if (entry == 0) continue; 
820
821   fPtResolLPT->Add(entry->fPtResolLPT);
822   fPtResolHPT->Add(entry->fPtResolHPT);
823   fPtPullLPT->Add(entry->fPtPullLPT);
824   fPtPullHPT->Add(entry->fPtPullHPT);
825
826   // Histograms for 1/pt parameterisation
827   f1Pt2ResolS1PtTPC->Add(entry->f1Pt2ResolS1PtTPC);
828   fYResolS1PtTPC->Add(entry->fYResolS1PtTPC);
829   fZResolS1PtTPC->Add(entry->fZResolS1PtTPC);
830   fPhiResolS1PtTPC->Add(entry->fPhiResolS1PtTPC);
831   fThetaResolS1PtTPC->Add(entry->fThetaResolS1PtTPC);
832
833   f1Pt2ResolS1PtTPCITS->Add(entry->f1Pt2ResolS1PtTPCITS);
834   fYResolS1PtTPCITS->Add(entry->fYResolS1PtTPCITS);
835   fZResolS1PtTPCITS->Add(entry->fZResolS1PtTPCITS);
836   fPhiResolS1PtTPCITS->Add(entry->fPhiResolS1PtTPCITS);
837   fThetaResolS1PtTPCITS->Add(entry->fThetaResolS1PtTPCITS);
838
839   // Resolution histograms (constrained param)
840   fCPhiResolTan->Add(entry->fCPhiResolTan);
841   fCTanResolTan->Add(entry->fCTanResolTan);
842   fCPtResolTan->Add(entry->fCPtResolTan);
843   fCPhiPullTan->Add(entry->fCPhiPullTan);
844   fCTanPullTan->Add(entry->fCTanPullTan);
845   fCPtPullTan->Add(entry->fCPtPullTan);
846
847   //  Histograms for 1/pt parameterisation (constrained)
848   fC1Pt2ResolS1PtTPC->Add(entry->fC1Pt2ResolS1PtTPC);
849   fCYResolS1PtTPC->Add(entry->fCYResolS1PtTPC);
850   fCZResolS1PtTPC->Add(entry->fCZResolS1PtTPC);
851   fCPhiResolS1PtTPC->Add(entry->fCPhiResolS1PtTPC);
852   fCThetaResolS1PtTPC->Add(entry->fCThetaResolS1PtTPC);
853
854   fC1Pt2ResolS1PtTPCITS->Add(entry->fC1Pt2ResolS1PtTPCITS);
855   fCYResolS1PtTPCITS->Add(entry->fCYResolS1PtTPCITS);
856   fCZResolS1PtTPCITS->Add(entry->fCZResolS1PtTPCITS);
857   fCPhiResolS1PtTPCITS->Add(entry->fCPhiResolS1PtTPCITS);
858   fCThetaResolS1PtTPCITS->Add(entry->fCThetaResolS1PtTPCITS);
859
860   count++;
861   }
862
863 return count;
864 }
865
866 //_____________________________________________________________________________
867 TFolder* AliComparisonRes::CreateFolder(TString name,TString title) { 
868 // create folder for analysed histograms
869 //
870 TFolder *folder = 0;
871   folder = new TFolder(name.Data(),title.Data());
872
873   return folder;
874 }