1 //------------------------------------------------------------------------------
\r
2 // Implementation of AliComparisonRes 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) are stored in the output picture_res.root file.
\r
9 // Author: J.Otwinowski 04/02/2008
\r
10 //------------------------------------------------------------------------------
\r
13 //after running analysis, read the file, and get component
\r
14 gSystem->Load("libPWG1.so");
\r
15 TFile f("Output.root");
\r
16 AliComparisonRes * comp = (AliComparisonRes*)f.Get("AliComparisonRes");
\r
18 // analyse comparison data (output stored in pictures_res.root)
\r
21 // paramtetrisation of the TPC track length (for information only)
\r
22 TF1 fl("fl","((min(250./(abs(x+0.000001)),250)-90))",0,2); // TPC track length function
\r
23 TF1 fl2("fl2","[0]/((min(250./(abs(x+0.000001)),250)-90))^[1]",0,2);
\r
24 fl2.SetParameter(1,1);
\r
25 fl2.SetParameter(0,1);
\r
35 #include "TProfile.h"
\r
36 #include "TProfile2D.h"
\r
37 #include "TGraph2D.h"
\r
38 #include "TCanvas.h"
\r
41 #include "AliESDEvent.h"
\r
43 #include "AliESDfriend.h"
\r
44 #include "AliESDfriendTrack.h"
\r
45 #include "AliESDVertex.h"
\r
46 #include "AliRecInfoCuts.h"
\r
47 #include "AliMCInfoCuts.h"
\r
48 #include "AliLog.h"
\r
49 #include "AliTracker.h"
\r
51 #include "AliMathBase.h"
\r
52 #include "AliTreeDraw.h"
\r
54 #include "AliMCInfo.h"
\r
55 #include "AliESDRecInfo.h"
\r
56 #include "AliComparisonRes.h"
\r
58 using namespace std;
\r
60 ClassImp(AliComparisonRes)
\r
62 //_____________________________________________________________________________
\r
63 AliComparisonRes::AliComparisonRes():
\r
64 TNamed("AliComparisonRes","AliComparisonRes"),
\r
67 fPtResolLPT(0), // pt resolution - low pt
\r
68 fPtResolHPT(0), // pt resolution - high pt
\r
69 fPtPullLPT(0), // pt resolution - low pt
\r
70 fPtPullHPT(0), // pt resolution - high pt
\r
72 // Resolution constrained param
\r
74 fCPhiResolTan(0), // angular resolution - constrained
\r
75 fCTanResolTan(0), // angular resolution - constrained
\r
76 fCPtResolTan(0), // pt resolution - constrained
\r
77 fCPhiPullTan(0), // angular resolution - constrained
\r
78 fCTanPullTan(0), // angular resolution - constrained
\r
79 fCPtPullTan(0), // pt resolution - constrained
\r
82 // Parametrisation histograms
\r
85 f1Pt2Resol1PtTPC(0),
\r
86 f1Pt2Resol1PtTPCITS(0),
\r
88 fYResol1PtTPCITS(0),
\r
90 fZResol1PtTPCITS(0),
\r
92 fPhiResol1PtTPCITS(0),
\r
93 fThetaResol1PtTPC(0),
\r
94 fThetaResol1PtTPCITS(0),
\r
97 fC1Pt2Resol1PtTPC(0),
\r
98 fC1Pt2Resol1PtTPCITS(0),
\r
100 fCYResol1PtTPCITS(0),
\r
102 fCZResol1PtTPCITS(0),
\r
103 fCPhiResol1PtTPC(0),
\r
104 fCPhiResol1PtTPCITS(0),
\r
105 fCThetaResol1PtTPC(0),
\r
106 fCThetaResol1PtTPCITS(0),
\r
119 fVertex = new AliESDVertex();
\r
120 fVertex->SetXv(0.0);
\r
121 fVertex->SetYv(0.0);
\r
122 fVertex->SetZv(0.0);
\r
125 //_____________________________________________________________________________
\r
126 AliComparisonRes::~AliComparisonRes(){
\r
128 // Resolution histograms
\r
129 if(fPtResolLPT) delete fPtResolLPT; fPtResolLPT=0;
\r
130 if(fPtResolHPT) delete fPtResolHPT; fPtResolHPT=0;
\r
131 if(fPtPullLPT) delete fPtPullLPT; fPtPullLPT=0;
\r
132 if(fPtPullHPT) delete fPtPullHPT; fPtPullHPT=0;
\r
134 // Resolution histograms (constrained param)
\r
135 if(fCPhiResolTan) delete fCPhiResolTan; fCPhiResolTan=0;
\r
136 if(fCTanResolTan) delete fCTanResolTan; fCTanResolTan=0;
\r
137 if(fCPtResolTan) delete fCPtResolTan; fCPtResolTan=0;
\r
138 if(fCPhiPullTan) delete fCPhiPullTan; fCPhiPullTan=0;
\r
139 if(fCTanPullTan) delete fCTanPullTan; fCTanPullTan=0;
\r
140 if(fCPtPullTan) delete fCPtPullTan; fCPtPullTan=0;
\r
142 // Parametrisation histograms
\r
144 if(f1Pt2Resol1PtTPC) delete f1Pt2Resol1PtTPC; f1Pt2Resol1PtTPC=0;
\r
145 if(f1Pt2Resol1PtTPCITS) delete f1Pt2Resol1PtTPCITS; f1Pt2Resol1PtTPCITS=0;
\r
146 if(fYResol1PtTPC) delete fYResol1PtTPC; fYResol1PtTPC=0;
\r
147 if(fYResol1PtTPCITS) delete fYResol1PtTPCITS; fYResol1PtTPCITS=0;
\r
148 if(fZResol1PtTPC) delete fZResol1PtTPC; fZResol1PtTPC=0;
\r
149 if(fZResol1PtTPCITS) delete fZResol1PtTPCITS; fZResol1PtTPCITS=0;
\r
150 if(fPhiResol1PtTPC) delete fPhiResol1PtTPC; fPhiResol1PtTPC=0;
\r
151 if(fPhiResol1PtTPCITS) delete fPhiResol1PtTPCITS; fPhiResol1PtTPCITS=0;
\r
152 if(fThetaResol1PtTPC) delete fThetaResol1PtTPC; fThetaResol1PtTPC=0;
\r
153 if(fThetaResol1PtTPCITS) delete fThetaResol1PtTPCITS; fThetaResol1PtTPCITS=0;
\r
156 if(fC1Pt2Resol1PtTPC) delete fC1Pt2Resol1PtTPC; fC1Pt2Resol1PtTPC=0;
\r
157 if(fC1Pt2Resol1PtTPCITS) delete fC1Pt2Resol1PtTPCITS; fC1Pt2Resol1PtTPCITS=0;
\r
158 if(fCYResol1PtTPC) delete fCYResol1PtTPC; fCYResol1PtTPC=0;
\r
159 if(fCYResol1PtTPCITS) delete fCYResol1PtTPCITS; fCYResol1PtTPCITS=0;
\r
160 if(fCZResol1PtTPC) delete fCZResol1PtTPC; fCZResol1PtTPC=0;
\r
161 if(fCZResol1PtTPCITS) delete fCZResol1PtTPCITS; fCZResol1PtTPCITS=0;
\r
162 if(fCPhiResol1PtTPC) delete fCPhiResol1PtTPC; fCPhiResol1PtTPC=0;
\r
163 if(fCPhiResol1PtTPCITS) delete fCPhiResol1PtTPCITS; fCPhiResol1PtTPCITS=0;
\r
164 if(fCThetaResol1PtTPC) delete fCThetaResol1PtTPC; fCThetaResol1PtTPC=0;
\r
165 if(fCThetaResol1PtTPCITS) delete fCThetaResol1PtTPCITS; fCThetaResol1PtTPCITS=0;
\r
167 if(fVertex) delete fVertex; fVertex=0;
\r
171 //_____________________________________________________________________________
\r
172 void AliComparisonRes::InitHisto(){
\r
175 fCPhiResolTan = new TH2F("CPhiResolTan","CPhiResolTan",50, -2,2,200,-0.025,0.025);
\r
176 fCPhiResolTan->SetXTitle("tan(#theta)");
\r
177 fCPhiResolTan->SetYTitle("#Delta#phi");
\r
179 fCTanResolTan = new TH2F("CTanResolTan","CTanResolTan",50, -2,2,200,-0.025,0.025);
\r
180 fCTanResolTan->SetXTitle("tan(#theta)");
\r
181 fCTanResolTan->SetYTitle("#Delta#theta");
\r
183 fCPtResolTan=new TH2F("CPtResol","CPtResol",50, -2,2,200,-0.2,0.2);
\r
184 fCPtResolTan->SetXTitle("Tan(#theta)");
\r
185 fCPtResolTan->SetYTitle("#Deltap_{t}/p_{t}");
\r
187 fCPhiPullTan = new TH2F("CPhiPullTan","CPhiPullTan",50, -2,2,200,-5,5);
\r
188 fCPhiPullTan->SetXTitle("Tan(#theta)");
\r
189 fCPhiPullTan->SetYTitle("#Delta#phi/#Sigma");
\r
191 fCTanPullTan = new TH2F("CTanPullTan","CTanPullTan",50, -2,2,200,-5,5);
\r
192 fCTanPullTan->SetXTitle("Tan(#theta)");
\r
193 fCTanPullTan->SetYTitle("#Delta#theta/#Sigma");
\r
195 fCPtPullTan=new TH2F("CPtPull","CPtPull",50, -2,2,200,-5,5);
\r
196 fCPtPullTan->SetXTitle("Tan(#theta)");
\r
197 fCPtPullTan->SetYTitle("(1/mcp_{t}-1/p_{t})/#Sigma");
\r
199 fPtResolLPT = new TH2F("Pt_resol_lpt","pt resol",10, 0.1,3,200,-0.2,0.2);
\r
200 fPtResolLPT->SetXTitle("p_{t}");
\r
201 fPtResolLPT->SetYTitle("#Deltap_{t}/p_{t}");
\r
203 fPtResolHPT = new TH2F("Pt_resol_hpt","pt resol",10, 2,100,200,-0.3,0.3);
\r
204 fPtResolHPT->SetXTitle("p_{t}");
\r
205 fPtResolHPT->SetYTitle("#Deltap_{t}/p_{t}");
\r
207 fPtPullLPT = new TH2F("Pt_pull_lpt","pt pull",10, 0.1,3,200,-6,6);
\r
208 fPtPullLPT->SetXTitle("p_{t}");
\r
209 fPtPullLPT->SetYTitle("#Deltap_{t}/#Sigma");
\r
211 fPtPullHPT = new TH2F("Pt_pull_hpt","pt pull",10,2,100,200,-6,6);
\r
212 fPtPullHPT->SetXTitle("p_{t}");
\r
213 fPtPullHPT->SetYTitle("#Deltap_{t}/#Sigma");
\r
216 // Parametrisation histograms
\r
219 f1Pt2Resol1PtTPC = new TH2F("f1Pt2Resol1PtTPC","(1/mcpt-1/pt)/(1+1/mcpt)^2 vs 1/pt)",100,0,10,200,-0.010,0.010);
\r
220 f1Pt2Resol1PtTPC->SetXTitle("1/mcp_{t}");
\r
221 f1Pt2Resol1PtTPC->SetYTitle("(1/mcp_{t}-1/p_{t})/(1+1/mcp_{t})^2)");
\r
223 f1Pt2Resol1PtTPCITS = new TH2F("f1Pt2Resol1PtTPCITS","(1/mcpt-1/pt)/(1+1/mcpt)^2 vs 1/pt)",100,0,10,200,-0.010,0.010);
\r
224 f1Pt2Resol1PtTPCITS->SetXTitle("1/mcp_{t}");
\r
225 f1Pt2Resol1PtTPCITS->SetYTitle("(1/mcp_{t}-1/p_{t})/(1+1/mcp_{t})^2)");
\r
227 fYResol1PtTPC = new TH2F("fYResol1PtTPC","fYResol1PtTPC",100, 0,10,200,-1.0,1.0);
\r
228 fYResol1PtTPC->SetXTitle("1/mcpt");
\r
229 fYResol1PtTPC->SetYTitle("#DeltaY");
\r
231 fYResol1PtTPCITS = new TH2F("fYResol1PtTPCITS","fYResol1PtTPCITS",100, 0,10,200,-0.05,0.05);
\r
232 fYResol1PtTPCITS->SetXTitle("1/mcpt");
\r
233 fYResol1PtTPCITS->SetYTitle("#DeltaY");
\r
235 fZResol1PtTPC = new TH2F("fZResol1PtTPC","fZResol1PtTPC",100, 0,10,200,-1.0,1.0);
\r
236 fZResol1PtTPC->SetXTitle("1/mcpt");
\r
237 fZResol1PtTPC->SetYTitle("#DeltaZ");
\r
239 fZResol1PtTPCITS = new TH2F("fZResol1PtTPCITS","fZResol1PtTPCITS",100, 0,10,200,-0.05,0.05);
\r
240 fZResol1PtTPCITS->SetXTitle("1/mcpt");
\r
241 fZResol1PtTPCITS->SetYTitle("#DeltaZ");
\r
243 fPhiResol1PtTPC = new TH2F("fPhiResol1PtTPC","fPhiResol1PtTPC",100, 0,10,200,-0.025,0.025);
\r
244 fPhiResol1PtTPC->SetXTitle("1/mcpt");
\r
245 fPhiResol1PtTPC->SetYTitle("#Delta#phi");
\r
247 fPhiResol1PtTPCITS = new TH2F("fPhiResol1PtTPCITS","fPhiResol1PtTPCITS",100, 0,10,200,-0.01,0.01);
\r
248 fPhiResol1PtTPCITS->SetXTitle("1/mcpt");
\r
249 fPhiResol1PtTPCITS->SetYTitle("#Delta#phi");
\r
251 fThetaResol1PtTPC = new TH2F("fThetaResol1PtTPC","fThetaResol1PtTPC",100, 0,10,200,-0.025,0.025);
\r
252 fThetaResol1PtTPC->SetXTitle("1/mcpt");
\r
253 fThetaResol1PtTPC->SetYTitle("#Delta#theta");
\r
255 fThetaResol1PtTPCITS = new TH2F("fThetaResol1PtTPCITS","fThetaResol1PtTPCITS",100, 0,10,200,-0.01,0.01);
\r
256 fThetaResol1PtTPCITS->SetXTitle("1/mcpt");
\r
257 fThetaResol1PtTPCITS->SetYTitle("#Delta#theta");
\r
260 fC1Pt2Resol1PtTPC = new TH2F("fC1Pt2Resol1PtTPC","(1/mcpt-1/pt)/(1+1/mcpt)^2 vs 1/pt)",100,0,10,200,-0.010,0.010);
\r
261 fC1Pt2Resol1PtTPC->SetXTitle("1/mcp_{t}");
\r
262 fC1Pt2Resol1PtTPC->SetYTitle("(1/mcp_{t}-1/p_{t})/(1+1/mcp_{t})^2)");
\r
264 fC1Pt2Resol1PtTPCITS = new TH2F("fC1Pt2Resol1PtTPCITS","(1/mcpt-1/pt)/(1+1/mcpt)^2 vs 1/pt)",100,0,10,200,-0.010,0.010);
\r
265 fC1Pt2Resol1PtTPCITS->SetXTitle("1/mcp_{t}");
\r
266 fC1Pt2Resol1PtTPCITS->SetYTitle("(1/mcp_{t}-1/p_{t})/(1+1/mcp_{t})^2)");
\r
268 fCYResol1PtTPC = new TH2F("fCYResol1PtTPC","fCYResol1PtTPC",100, 0,10,200,-1.0,1.0);
\r
269 fCYResol1PtTPC->SetXTitle("1/mcpt");
\r
270 fCYResol1PtTPC->SetYTitle("#DeltaY");
\r
272 fCYResol1PtTPCITS = new TH2F("fCYResol1PtTPCITS","fCYResol1PtTPCITS",100, 0,10,200,-0.05,0.05);
\r
273 fCYResol1PtTPCITS->SetXTitle("1/mcpt");
\r
274 fCYResol1PtTPCITS->SetYTitle("#DeltaY");
\r
276 fCZResol1PtTPC = new TH2F("fCZResol1PtTPC","fCZResol1PtTPC",100, 0,10,200,-1.0,1.0);
\r
277 fCZResol1PtTPC->SetXTitle("1/mcpt");
\r
278 fCZResol1PtTPC->SetYTitle("#DeltaZ");
\r
280 fCZResol1PtTPCITS = new TH2F("fCZResol1PtTPCITS","fCZResol1PtTPCITS",100, 0,10,200,-0.05,0.05);
\r
281 fCZResol1PtTPCITS->SetXTitle("1/mcpt");
\r
282 fCZResol1PtTPCITS->SetYTitle("#DeltaZ");
\r
284 fCPhiResol1PtTPC = new TH2F("fCPhiResol1PtTPC","fCPhiResol1PtTPC",100, 0,10,200,-0.025,0.025);
\r
285 fCPhiResol1PtTPC->SetXTitle("1/mcpt");
\r
286 fCPhiResol1PtTPC->SetYTitle("#Delta#phi");
\r
288 fCPhiResol1PtTPCITS = new TH2F("fCPhiResol1PtTPCITS","fCPhiResol1PtTPCITS",100, 0,10,200,-0.01,0.01);
\r
289 fCPhiResol1PtTPCITS->SetXTitle("1/mcpt");
\r
290 fCPhiResol1PtTPCITS->SetYTitle("#Delta#phi");
\r
292 fCThetaResol1PtTPC = new TH2F("fCThetaResol1PtTPC","fCThetaResol1PtTPC",100, 0,10,200,-0.025,0.025);
\r
293 fCThetaResol1PtTPC->SetXTitle("1/mcpt");
\r
294 fCThetaResol1PtTPC->SetYTitle("#Delta#theta");
\r
296 fCThetaResol1PtTPCITS = new TH2F("fCThetaResol1PtTPCITS","fCThetaResol1PtTPCITS",100, 0,10,200,-0.01,0.01);
\r
297 fCThetaResol1PtTPCITS->SetXTitle("1/mcpt");
\r
298 fCThetaResol1PtTPCITS->SetYTitle("#Delta#theta");
\r
301 //_____________________________________________________________________________
\r
302 void AliComparisonRes::InitCuts()
\r
306 AliDebug(AliLog::kError, "ERROR: Cannot find AliMCInfoCuts object");
\r
308 AliDebug(AliLog::kError, "ERROR: Cannot find AliRecInfoCuts object");
\r
311 //_____________________________________________________________________________
\r
312 void AliComparisonRes::Process(AliMCInfo* infoMC, AliESDRecInfo *infoRC)
\r
314 // Fill resolution comparison information
\r
315 AliExternalTrackParam *track = 0;
\r
316 Double_t kRadius = 3.0; // beam pipe radius
\r
317 Double_t kMaxStep = 5.0; // max step
\r
318 Double_t field = AliTracker::GetBz(); // nominal Bz field [kG]
\r
319 Double_t kMaxD = 123456.0; // max distance
\r
321 Int_t clusterITS[200];
\r
322 Double_t dca[2], cov[3]; // dca_xy, dca_z, sigma_xy, sigma_xy_z, sigma_z
\r
324 Float_t deltaPt, pullPt, deltaPhi, deltaTan, delta1Pt2, deltaY1Pt, deltaZ1Pt, deltaPhi1Pt, deltaTheta1Pt;
\r
325 Float_t deltaPtTPC, pullPtTPC, deltaPhiTPC, deltaTanTPC, delta1Pt2TPC, deltaY1PtTPC, deltaZ1PtTPC, deltaPhi1PtTPC, deltaTheta1PtTPC;
\r
327 Float_t mcpt = infoMC->GetParticle().Pt();
\r
329 // distance to Prim. vertex
\r
330 const Double_t* dv = infoMC->GetVDist();
\r
331 Bool_t isPrim = TMath::Sqrt(dv[0]*dv[0] + dv[1]*dv[1])<fCutsMC->GetMaxR() && TMath::Abs(dv[2])<fCutsMC->GetMaxVz();
\r
333 // Check selection cuts
\r
334 if (fCutsMC->IsPdgParticle(TMath::Abs(infoMC->GetParticle().GetPdgCode())) == kFALSE) return;
\r
335 if (!isPrim) return;
\r
336 //if (infoRC->GetStatus(1)==0) return;
\r
337 if (infoRC->GetStatus(1)!=3) return; // TPC refit
\r
338 if (!infoRC->GetESDtrack()) return;
\r
339 if (infoRC->GetESDtrack()->GetTPCNcls()<fCutsRC->GetMinNClustersTPC()) return;
\r
341 // calculate and set prim. vertex
\r
342 fVertex->SetXv( infoMC->GetParticle().Vx() - dv[0] );
\r
343 fVertex->SetYv( infoMC->GetParticle().Vy() - dv[1] );
\r
344 fVertex->SetZv( infoMC->GetParticle().Vz() - dv[2] );
\r
346 deltaPt= (mcpt-infoRC->GetESDtrack()->Pt())/mcpt;
\r
347 pullPt= (1/mcpt-infoRC->GetESDtrack()->OneOverPt())/TMath::Sqrt(infoRC->GetESDtrack()->GetSigma1Pt2());
\r
348 deltaPhi = TMath::ATan2(infoRC->GetESDtrack()->Py(),infoRC->GetESDtrack()->Px())-
\r
349 TMath::ATan2(infoMC->GetParticle().Py(),infoMC->GetParticle().Px());
\r
351 deltaTan = TMath::ATan2(infoRC->GetESDtrack()->Pz(),infoRC->GetESDtrack()->Pt())-
\r
352 TMath::ATan2(infoMC->GetParticle().Pz(),infoMC->GetParticle().Pt());
\r
354 delta1Pt2 = (1/mcpt-infoRC->GetESDtrack()->OneOverPt())/TMath::Power(1+1/mcpt,2);
\r
355 deltaY1Pt = (infoMC->GetParticle().Vy()-infoRC->GetESDtrack()->GetY()) / (0.2+1/mcpt);
\r
356 deltaZ1Pt = (infoMC->GetParticle().Vz()-infoRC->GetESDtrack()->GetZ()) / (0.2+1/mcpt);
\r
357 deltaPhi1Pt = deltaPhi / (0.1+1/mcpt);
\r
358 deltaTheta1Pt = deltaTan / (0.1+1/mcpt);
\r
360 //track parameters at the first measured point (TPC)
\r
361 //Double_t param[5],x,alpha; // [0]-Y [cm],[1]-Z [cm],[2]-sin(phi),[3]-tan(theta),[4]-1/pt [1/GeV]
\r
362 //infoRC->GetESDtrack()->GetInnerExternalParameters(alpha,x,param);
\r
363 //const AliExternalTrackParam *innerTPC = infoRC->GetESDtrack()->GetInnerParam();
\r
364 //const AliExternalTrackParam *innerTPC = infoRC->GetESDtrack()->GetTPCInnerParam();
\r
367 // calculate track parameters at vertex
\r
368 const AliExternalTrackParam *innerTPC = 0;
\r
369 if ((innerTPC = infoRC->GetESDtrack()->GetTPCInnerParam()) != 0)
\r
371 if ((track = new AliExternalTrackParam(*infoRC->GetESDtrack()->GetTPCInnerParam())) != 0 )
\r
373 Bool_t bStatus = AliTracker::PropagateTrackTo(track,kRadius,infoMC->GetMass(),kMaxStep,kTRUE);
\r
374 Bool_t bDCAStatus = track->PropagateToDCA(fVertex,field,kMaxD,dca,cov);
\r
376 // Fill parametrisation histograms (only TPC track)
\r
377 if(bStatus && bDCAStatus)
\r
379 deltaPtTPC= (mcpt-innerTPC->Pt())/mcpt;
\r
380 pullPtTPC= (1/mcpt-innerTPC->OneOverPt())/TMath::Sqrt(innerTPC->GetSigma1Pt2());
\r
381 deltaPhiTPC = TMath::ATan2(innerTPC->Py(),innerTPC->Px())-
\r
382 TMath::ATan2(infoMC->GetParticle().Py(),infoMC->GetParticle().Px());
\r
384 deltaTanTPC = TMath::ATan2(innerTPC->Pz(),innerTPC->Pt())-
\r
385 TMath::ATan2(infoMC->GetParticle().Pz(),infoMC->GetParticle().Pt());
\r
387 delta1Pt2TPC = (1/mcpt-innerTPC->OneOverPt())/TMath::Power(1+1/mcpt,2);
\r
388 deltaY1PtTPC= (infoMC->GetParticle().Vy()-innerTPC->GetY()) / (0.2+1/mcpt);
\r
389 deltaZ1PtTPC = (infoMC->GetParticle().Vz()-innerTPC->GetZ()) / (0.2+1/mcpt);
\r
390 deltaPhi1PtTPC = deltaPhiTPC / (0.1+1/mcpt);
\r
391 deltaTheta1PtTPC = deltaTanTPC / (0.1+1/mcpt);
\r
393 f1Pt2Resol1PtTPC->Fill(1/mcpt,delta1Pt2TPC);
\r
394 fYResol1PtTPC->Fill(1/mcpt,deltaY1PtTPC);
\r
395 fZResol1PtTPC->Fill(1/mcpt,deltaZ1PtTPC);
\r
396 fPhiResol1PtTPC->Fill(1/mcpt,deltaPhi1PtTPC);
\r
397 fThetaResol1PtTPC->Fill(1/mcpt,deltaTheta1PtTPC);
\r
403 // TPC and ITS (nb. of clusters >2) in the system
\r
404 if(infoRC->GetESDtrack()->GetITSclusters(clusterITS)>2)
\r
406 f1Pt2Resol1PtTPCITS->Fill(1/mcpt,delta1Pt2);
\r
407 fYResol1PtTPCITS->Fill(1/mcpt,deltaY1Pt);
\r
408 fZResol1PtTPCITS->Fill(1/mcpt,deltaZ1Pt);
\r
409 fPhiResol1PtTPCITS->Fill(1/mcpt,deltaPhi1Pt);
\r
410 fThetaResol1PtTPCITS->Fill(1/mcpt,deltaTheta1Pt);
\r
414 fPtResolLPT->Fill(mcpt,deltaPt);
\r
415 fPtResolHPT->Fill(mcpt,deltaPt);
\r
416 fPtPullLPT->Fill(mcpt,pullPt);
\r
417 fPtPullHPT->Fill(mcpt,pullPt);
\r
420 //_____________________________________________________________________________
\r
421 void AliComparisonRes::ProcessConstrained(AliMCInfo* infoMC, AliESDRecInfo *infoRC)
\r
423 // Fill resolution comparison information (constarained parameters)
\r
425 AliExternalTrackParam *track = 0;
\r
426 Double_t kRadius = 3.0; // beam pipe radius
\r
427 Double_t kMaxStep = 5.0; // max step
\r
428 Double_t field = AliTracker::GetBz(); // nominal Bz field [kG]
\r
429 Double_t kMaxD = 123456.0; // max distance
\r
431 Int_t clusterITS[200];
\r
432 Double_t dca[2], cov[3]; // dca_xy, dca_z, sigma_xy, sigma_xy_z, sigma_z
\r
434 Float_t deltaPt, pullPt, deltaPhi, pullPhi, deltaTan, pullTan, delta1Pt2, deltaY1Pt, deltaZ1Pt, deltaPhi1Pt, deltaTheta1Pt;
\r
435 Float_t deltaPtTPC, pullPtTPC, deltaPhiTPC, deltaTanTPC, delta1Pt2TPC, deltaY1PtTPC, deltaZ1PtTPC, deltaPhi1PtTPC, deltaTheta1PtTPC;
\r
437 Float_t mcpt = infoMC->GetParticle().Pt();
\r
438 Float_t tantheta = TMath::Tan(infoMC->GetParticle().Theta()-TMath::Pi()*0.5);
\r
440 // distance to Prim. vertex
\r
441 const Double_t* dv = infoMC->GetVDist();
\r
442 Bool_t isPrim = TMath::Sqrt(dv[0]*dv[0] + dv[1]*dv[1])<fCutsMC->GetMaxR() && TMath::Abs(dv[2])<fCutsMC->GetMaxVz();
\r
444 // Check selection cuts
\r
445 if (fCutsMC->IsPdgParticle(TMath::Abs(infoMC->GetParticle().GetPdgCode())) == kFALSE) return;
\r
446 if (!isPrim) return;
\r
447 if (infoRC->GetStatus(1)!=3) return;
\r
448 if (!infoRC->GetESDtrack()) return;
\r
449 if (infoRC->GetESDtrack()->GetTPCNcls()<fCutsRC->GetMinNClustersTPC()) return;
\r
450 if (!infoRC->GetESDtrack()->GetConstrainedParam()) return;
\r
452 // calculate and set prim. vertex
\r
453 fVertex->SetXv( infoMC->GetParticle().Vx() - dv[0] );
\r
454 fVertex->SetYv( infoMC->GetParticle().Vy() - dv[1] );
\r
455 fVertex->SetZv( infoMC->GetParticle().Vz() - dv[2] );
\r
457 // constrained parameters resolution
\r
458 const AliExternalTrackParam * cparam = infoRC->GetESDtrack()->GetConstrainedParam();
\r
459 deltaPt= (mcpt-cparam->Pt())/mcpt;
\r
460 pullPt= (1/mcpt-cparam->OneOverPt())/TMath::Sqrt(cparam->GetSigma1Pt2());
\r
461 deltaPhi = TMath::ATan2(cparam->Py(),cparam->Px())-
\r
462 TMath::ATan2(infoMC->GetParticle().Py(),infoMC->GetParticle().Px());
\r
463 pullPhi = deltaPhi/TMath::Sqrt(cparam->GetSigmaSnp2());
\r
464 deltaTan = TMath::ATan2(cparam->Pz(),cparam->Pt())-TMath::ATan2(infoMC->GetParticle().Pz(),infoMC->GetParticle().Pt());
\r
465 pullTan = deltaPhi/TMath::Sqrt(cparam->GetSigmaSnp2());
\r
468 delta1Pt2 = (1/mcpt-cparam->OneOverPt())/TMath::Power(1+1/mcpt,2);
\r
470 deltaY1Pt = (infoMC->GetParticle().Vy()-cparam->GetY()) / (0.2+1/mcpt);
\r
471 deltaZ1Pt = (infoMC->GetParticle().Vz()-cparam->GetZ()) / (0.2+1/mcpt);
\r
472 deltaPhi1Pt = deltaPhi / (0.1+1/mcpt);
\r
473 deltaTheta1Pt = deltaTan / (0.1+1/mcpt);
\r
475 // calculate track parameters at vertex
\r
476 const AliExternalTrackParam *innerTPC = 0;
\r
477 if ((innerTPC = infoRC->GetESDtrack()->GetTPCInnerParam()) != 0)
\r
479 if ((track = new AliExternalTrackParam(*infoRC->GetESDtrack()->GetTPCInnerParam())) != 0 )
\r
481 Bool_t bStatus = AliTracker::PropagateTrackTo(track,kRadius,infoMC->GetMass(),kMaxStep,kTRUE);
\r
482 Bool_t bDCAStatus = track->PropagateToDCA(fVertex,field,kMaxD,dca,cov);
\r
484 // Fill parametrisation histograms (only TPC track)
\r
485 if(bStatus && bDCAStatus)
\r
487 deltaPtTPC= (mcpt-innerTPC->Pt())/mcpt;
\r
488 pullPtTPC= (1/mcpt-innerTPC->OneOverPt())/TMath::Sqrt(innerTPC->GetSigma1Pt2());
\r
489 deltaPhiTPC = TMath::ATan2(innerTPC->Py(),innerTPC->Px())-
\r
490 TMath::ATan2(infoMC->GetParticle().Py(),infoMC->GetParticle().Px());
\r
492 deltaTanTPC = TMath::ATan2(innerTPC->Pz(),innerTPC->Pt())-
\r
493 TMath::ATan2(infoMC->GetParticle().Pz(),infoMC->GetParticle().Pt());
\r
495 delta1Pt2TPC = (1/mcpt-innerTPC->OneOverPt())/TMath::Power(1+1/mcpt,2);
\r
496 deltaY1PtTPC= (infoMC->GetParticle().Vy()-innerTPC->GetY()) / (0.2+1/mcpt);
\r
497 deltaZ1PtTPC = (infoMC->GetParticle().Vz()-innerTPC->GetZ()) / (0.2+1/mcpt);
\r
498 deltaPhi1PtTPC = deltaPhiTPC / (0.1+1/mcpt);
\r
499 deltaTheta1PtTPC = deltaTanTPC / (0.1+1/mcpt);
\r
501 fC1Pt2Resol1PtTPC->Fill(1/mcpt,delta1Pt2TPC);
\r
502 fCYResol1PtTPC->Fill(1/mcpt,deltaY1PtTPC);
\r
503 fCZResol1PtTPC->Fill(1/mcpt,deltaZ1PtTPC);
\r
504 fCPhiResol1PtTPC->Fill(1/mcpt,deltaPhi1PtTPC);
\r
505 fCThetaResol1PtTPC->Fill(1/mcpt,deltaTheta1PtTPC);
\r
511 // TPC and ITS (nb. of clusters >2) in the system
\r
512 if(infoRC->GetESDtrack()->GetITSclusters(clusterITS)>2)
\r
514 fC1Pt2Resol1PtTPCITS->Fill(1/mcpt,delta1Pt2);
\r
515 fCYResol1PtTPCITS->Fill(1/mcpt,deltaY1Pt);
\r
516 fCZResol1PtTPCITS->Fill(1/mcpt,deltaZ1Pt);
\r
517 fCPhiResol1PtTPCITS->Fill(1/mcpt,deltaPhi1Pt);
\r
518 fCThetaResol1PtTPCITS->Fill(1/mcpt,deltaTheta1Pt);
\r
522 fCPtResolTan->Fill(tantheta,deltaPt);
\r
523 fCPtPullTan->Fill(tantheta,pullPt);
\r
524 fCPhiResolTan->Fill(tantheta,deltaPhi);
\r
525 fCPhiPullTan->Fill(tantheta,pullPhi);
\r
526 fCTanResolTan->Fill(tantheta,deltaTan);
\r
527 fCTanPullTan->Fill(tantheta,pullTan);
\r
530 //_____________________________________________________________________________
\r
531 void AliComparisonRes::Exec(AliMCInfo* infoMC, AliESDRecInfo *infoRC){
\r
533 // Process comparison information
\r
534 Process(infoMC,infoRC);
\r
535 ProcessConstrained(infoMC,infoRC);
\r
538 //_____________________________________________________________________________
\r
539 TH1F* AliComparisonRes::MakeResol(TH2F * his, Int_t integ, Bool_t type){
\r
540 // Create resolution histograms
\r
543 if (!gPad) new TCanvas;
\r
544 hisr = AliTreeDraw::CreateResHistoI(his,&hism,integ);
\r
545 if (type) return hism;
\r
550 //_____________________________________________________________________________
\r
551 void AliComparisonRes::Analyse(){
\r
552 // Analyse comparison information and store output histograms
\r
553 // in the "pictures_res.root" file
\r
555 AliComparisonRes * comp=this;
\r
558 TFile *fp = new TFile("pictures_res.root","recreate");
\r
561 TCanvas * c = new TCanvas("Phi resol Tan","Phi resol Tan");
\r
564 hiss = comp->MakeResol(comp->fCPtResolTan,1,0);
\r
565 hiss->SetXTitle("Tan(#theta)");
\r
566 hiss->SetYTitle("#sigmap_{t}/p_{t}");
\r
568 hiss->Write("CptResolTan");
\r
570 hiss = comp->MakeResol(comp->fCPhiResolTan,1,0);
\r
571 hiss->SetXTitle("Tan(#theta)");
\r
572 hiss->SetYTitle("#sigma#phi (rad)");
\r
574 hiss->Write("PhiResolTan");
\r
576 hiss = comp->MakeResol(comp->fCTanResolTan,1,0);
\r
577 hiss->SetXTitle("Tan(#theta)");
\r
578 hiss->SetYTitle("#sigma#theta (rad)");
\r
580 hiss->Write("ThetaResolTan");
\r
582 hiss = comp->MakeResol(comp->fCPtPullTan,1,0);
\r
583 hiss->SetXTitle("Tan(#theta)");
\r
584 hiss->SetYTitle("1/mcp_{t}-1/p_{t}/#Sigma(1/p_{t})");
\r
586 hiss->Write("CptPullTan");
\r
588 hiss = comp->MakeResol(comp->fC1Pt2Resol1PtTPC,1,0);
\r
589 hiss->SetXTitle("1/mcp_{t}");
\r
590 hiss->SetYTitle("1/mcp_{t}-1/p_{t}/(1+1/p_{t})^2");
\r
592 hiss->Write("C1Pt2Resol1PtTPC");
\r
593 fC1Pt2Resol1PtTPC->Write();
\r
595 hiss = comp->MakeResol(comp->fC1Pt2Resol1PtTPCITS,1,0);
\r
596 hiss->SetXTitle("1/mcp_{t}");
\r
597 hiss->SetYTitle("1/mcp_{t}-1/p_{t}/(1+1/p_{t})^2");
\r
599 hiss->Write("C1Pt2Resol1PtTPCITS");
\r
600 fC1Pt2Resol1PtTPCITS->Write();
\r
602 hiss = comp->MakeResol(comp->fCYResol1PtTPC,1,0);
\r
603 hiss->SetXTitle("1/mcp_{t}");
\r
604 hiss->SetYTitle("(mcy-y)/(0.2+1/mcp_{t})");
\r
606 hiss->Write("CYResol1PtTPC");
\r
607 fCYResol1PtTPC->Write();
\r
609 hiss = comp->MakeResol(comp->fCYResol1PtTPCITS,1,0);
\r
610 hiss->SetXTitle("1/mcp_{t}");
\r
611 hiss->SetYTitle("(mcy-y)/(0.2+1/mcp_{t})");
\r
613 hiss->Write("CYResol1PtTPCITS");
\r
614 fCYResol1PtTPCITS->Write();
\r
616 hiss = comp->MakeResol(comp->fCZResol1PtTPC,1,0);
\r
617 hiss->SetXTitle("1/mcp_{t}");
\r
618 hiss->SetYTitle("(mcz-z)/(0.2+1/mcp_{t})");
\r
620 hiss->Write("CZResol1PtTPC");
\r
621 fCZResol1PtTPC->Write();
\r
623 hiss = comp->MakeResol(comp->fCZResol1PtTPCITS,1,0);
\r
624 hiss->SetXTitle("1/mcp_{t}");
\r
625 hiss->SetYTitle("(mcz-z)/(0.2+1/mcp_{t})");
\r
627 hiss->Write("CZResol1PtTPCITS");
\r
628 fCZResol1PtTPCITS->Write();
\r
630 hiss = comp->MakeResol(comp->fCPhiResol1PtTPC,1,0);
\r
631 hiss->SetXTitle("1/mcp_{t}");
\r
632 hiss->SetYTitle("(mc#phi-#phi)/(0.1+1/mcp_{t})");
\r
634 hiss->Write("CPhiResol1PtTPC");
\r
635 fCPhiResol1PtTPC->Write();
\r
637 hiss = comp->MakeResol(comp->fCPhiResol1PtTPCITS,1,0);
\r
638 hiss->SetXTitle("1/mcp_{t}");
\r
639 hiss->SetYTitle("(mc#phi-#phi)/(0.1+1/mcp_{t})");
\r
641 hiss->Write("CPhiResol1PtTPCITS");
\r
642 fCPhiResol1PtTPCITS->Write();
\r
644 hiss = comp->MakeResol(comp->fCThetaResol1PtTPC,1,0);
\r
645 hiss->SetXTitle("1/mcp_{t}");
\r
646 hiss->SetYTitle("(mc#theta-#theta)/(0.1+1/mcp_{t})");
\r
648 hiss->Write("CThetaResol1PtTPC");
\r
649 fCThetaResol1PtTPC->Write();
\r
651 hiss = comp->MakeResol(comp->fCThetaResol1PtTPCITS,1,0);
\r
652 hiss->SetXTitle("1/mcp_{t}");
\r
653 hiss->SetYTitle("(mc#theta-#theta)/(0.1+1/mcp_{t})");
\r
655 hiss->Write("CThetaResol1PtTPCITS");
\r
656 fCThetaResol1PtTPCITS->Write();
\r
659 hiss = comp->MakeResol(comp->f1Pt2Resol1PtTPC,1,0);
\r
660 hiss->SetXTitle("1/mcp_{t}");
\r
661 hiss->SetYTitle("1/mcp_{t}-1/p_{t}/(1+1/p_{t})^2");
\r
663 hiss->Write("OnePt2Resol1PtTPC");
\r
664 f1Pt2Resol1PtTPC->Write();
\r
666 hiss = comp->MakeResol(comp->f1Pt2Resol1PtTPCITS,1,0);
\r
667 hiss->SetXTitle("1/mcp_{t}");
\r
668 hiss->SetYTitle("1/mcp_{t}-1/p_{t}/(1+1/p_{t})^2");
\r
670 hiss->Write("OnePt2Resol1PtTPCITS");
\r
671 f1Pt2Resol1PtTPCITS->Write();
\r
673 hiss = comp->MakeResol(comp->fYResol1PtTPC,1,0);
\r
674 hiss->SetXTitle("1/mcp_{t}");
\r
675 hiss->SetYTitle("(mcy-y)/(0.2+1/mcp_{t})");
\r
677 hiss->Write("YResol1PtTPC");
\r
678 fYResol1PtTPC->Write();
\r
680 hiss = comp->MakeResol(comp->fYResol1PtTPCITS,1,0);
\r
681 hiss->SetXTitle("1/mcp_{t}");
\r
682 hiss->SetYTitle("(mcy-y)/(0.2+1/mcp_{t})");
\r
684 hiss->Write("YResol1PtTPCITS");
\r
685 fYResol1PtTPCITS->Write();
\r
687 hiss = comp->MakeResol(comp->fZResol1PtTPC,1,0);
\r
688 hiss->SetXTitle("1/mcp_{t}");
\r
689 hiss->SetYTitle("(mcz-z)/(0.2+1/mcp_{t})");
\r
691 hiss->Write("ZResol1PtTPC");
\r
692 fZResol1PtTPC->Write();
\r
694 hiss = comp->MakeResol(comp->fZResol1PtTPCITS,1,0);
\r
695 hiss->SetXTitle("1/mcp_{t}");
\r
696 hiss->SetYTitle("(mcz-z)/(0.2+1/mcp_{t})");
\r
698 hiss->Write("ZResol1PtTPCITS");
\r
699 fZResol1PtTPCITS->Write();
\r
701 hiss = comp->MakeResol(comp->fPhiResol1PtTPC,1,0);
\r
702 hiss->SetXTitle("1/mcp_{t}");
\r
703 hiss->SetYTitle("(mc#phi-#phi)/(0.1+1/mcp_{t})");
\r
705 hiss->Write("PhiResol1PtTPC");
\r
706 fPhiResol1PtTPC->Write();
\r
708 hiss = comp->MakeResol(comp->fPhiResol1PtTPCITS,1,0);
\r
709 hiss->SetXTitle("1/mcp_{t}");
\r
710 hiss->SetYTitle("(mc#phi-#phi)/(0.1+1/mcp_{t})");
\r
712 hiss->Write("PhiResol1PtTPCITS");
\r
713 fPhiResol1PtTPCITS->Write();
\r
715 hiss = comp->MakeResol(comp->fThetaResol1PtTPC,1,0);
\r
716 hiss->SetXTitle("1/mcp_{t}");
\r
717 hiss->SetYTitle("(mc#theta-#theta)/(0.1+1/mcp_{t})");
\r
719 hiss->Write("ThetaResol1PtTPC");
\r
720 fThetaResol1PtTPC->Write();
\r
722 hiss = comp->MakeResol(comp->fThetaResol1PtTPCITS,1,0);
\r
723 hiss->SetXTitle("1/mcp_{t}");
\r
724 hiss->SetYTitle("(mc#theta-#theta)/(0.1+1/mcp_{t})");
\r
726 hiss->Write("ThetaResol1PtTPCITS");
\r
727 fThetaResol1PtTPCITS->Write();
\r
732 //_____________________________________________________________________________
\r
733 Long64_t AliComparisonRes::Merge(TCollection* list)
\r
735 // Merge list of objects (needed by PROOF)
\r
740 if (list->IsEmpty())
\r
743 TIterator* iter = list->MakeIterator();
\r
746 // collection of generated histograms
\r
748 while((obj = iter->Next()) != 0)
\r
750 AliComparisonRes* entry = dynamic_cast<AliComparisonRes*>(obj);
\r
751 if (entry == 0) continue;
\r
753 fPtResolLPT->Add(entry->fPtResolLPT);
\r
754 fPtResolHPT->Add(entry->fPtResolHPT);
\r
755 fPtPullLPT->Add(entry->fPtPullLPT);
\r
756 fPtPullHPT->Add(entry->fPtPullHPT);
\r
758 // Histograms for 1/pt parameterisation
\r
759 f1Pt2Resol1PtTPC->Add(entry->f1Pt2Resol1PtTPC);
\r
760 fYResol1PtTPC->Add(entry->fYResol1PtTPC);
\r
761 fZResol1PtTPC->Add(entry->fZResol1PtTPC);
\r
762 fPhiResol1PtTPC->Add(entry->fPhiResol1PtTPC);
\r
763 fThetaResol1PtTPC->Add(entry->fThetaResol1PtTPC);
\r
765 f1Pt2Resol1PtTPCITS->Add(entry->f1Pt2Resol1PtTPCITS);
\r
766 fYResol1PtTPCITS->Add(entry->fYResol1PtTPCITS);
\r
767 fZResol1PtTPCITS->Add(entry->fZResol1PtTPCITS);
\r
768 fPhiResol1PtTPCITS->Add(entry->fPhiResol1PtTPCITS);
\r
769 fThetaResol1PtTPCITS->Add(entry->fThetaResol1PtTPCITS);
\r
771 // Resolution histograms (constrained param)
\r
772 fCPhiResolTan->Add(entry->fCPhiResolTan);
\r
773 fCTanResolTan->Add(entry->fCTanResolTan);
\r
774 fCPtResolTan->Add(entry->fCPtResolTan);
\r
775 fCPhiPullTan->Add(entry->fCPhiPullTan);
\r
776 fCTanPullTan->Add(entry->fCTanPullTan);
\r
777 fCPtPullTan->Add(entry->fCPtPullTan);
\r
779 // Histograms for 1/pt parameterisation (constrained)
\r
780 fC1Pt2Resol1PtTPC->Add(entry->fC1Pt2Resol1PtTPC);
\r
781 fCYResol1PtTPC->Add(entry->fCYResol1PtTPC);
\r
782 fCZResol1PtTPC->Add(entry->fCZResol1PtTPC);
\r
783 fCPhiResol1PtTPC->Add(entry->fCPhiResol1PtTPC);
\r
784 fCThetaResol1PtTPC->Add(entry->fCThetaResol1PtTPC);
\r
786 fC1Pt2Resol1PtTPCITS->Add(entry->fC1Pt2Resol1PtTPCITS);
\r
787 fCYResol1PtTPCITS->Add(entry->fCYResol1PtTPCITS);
\r
788 fCZResol1PtTPCITS->Add(entry->fCZResol1PtTPCITS);
\r
789 fCPhiResol1PtTPCITS->Add(entry->fCPhiResol1PtTPCITS);
\r
790 fCThetaResol1PtTPCITS->Add(entry->fCThetaResol1PtTPCITS);
\r