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