]>
Commit | Line | Data |
---|---|---|
9ea746fc | 1 | |
2 | /************************************************************************** | |
3 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * * | |
5 | * Author: The ALICE Off-line Project. * | |
6 | * Contributors are mentioned in the code where appropriate. * | |
7 | * * | |
8 | * Permission to use, copy, modify and distribute this software and its * | |
9 | * documentation strictly for non-commercial purposes is hereby granted * | |
10 | * without fee, provided that the above copyright notice appears in all * | |
11 | * copies and that both the copyright notice and this permission notice * | |
12 | * appear in the supporting documentation. The authors make no claims * | |
13 | * about the suitability of this software for any purpose. It is * | |
14 | * provided "as is" without express or implied warranty. * | |
15 | **************************************************************************/ | |
16 | ||
17 | //----------------------------------------------------------------- | |
18 | // AliAnalysisTaskStrange class | |
19 | // This task is for single strange study from ESD/AOD | |
20 | // Origin: H.Ricaud, Helene.Ricaud@IReS.in2p3.fr | |
21 | //----------------------------------------------------------------- | |
22 | #include "TList.h" | |
23 | #include "TH1F.h" | |
24 | #include "TH2F.h" | |
25 | #include "TCanvas.h" | |
26 | #include "TMath.h" | |
27 | ||
28 | #include "AliAnalysisTaskSE.h" | |
29 | ||
30 | #include "AliESDVertex.h" | |
31 | #include "AliESDEvent.h" | |
32 | #include "AliAODEvent.h" | |
9ea746fc | 33 | |
34 | #include "AliESDv0.h" | |
35 | #include "AliESDtrack.h" | |
36 | #include "AliAODv0.h" | |
37 | #include "AliAODTrack.h" | |
38 | ||
39 | #include "AliLog.h" | |
40 | ||
41 | #include "AliAnalysisTaskStrange.h" | |
42 | ||
43 | ClassImp(AliAnalysisTaskStrange) | |
44 | ||
45 | //________________________________________________________________________ | |
46 | AliAnalysisTaskStrange::AliAnalysisTaskStrange() | |
043d4727 | 47 | : AliAnalysisTaskSE(), fAnalysisType("ESD"), fCollidingSystems(0), fUseCut("infoCut"), fListHist(), |
9ea746fc | 48 | fHistPrimaryVertexPosX(0), fHistPrimaryVertexPosY(0), fHistPrimaryVertexPosZ(0), |
49 | fHistTrackMultiplicity(0), fHistV0Multiplicity(0), | |
50 | fHistDcaPosToPrimVertex(0), fHistDcaNegToPrimVertex(0), | |
51 | fHistDcaPosToPrimVertexZoom(0), fHistDcaNegToPrimVertexZoom(0), | |
52 | fHistRadiusV0(0), fHistDecayLengthV0(0), fHistDcaV0Daughters(0), fHistChi2(0), | |
53 | fHistCosPointAngle(0), fHistCosPointAngleZoom(0), | |
54 | fHistV0MultiplicityOff(0), | |
55 | fHistPtVsYK0sOff(0), fHistPtVsYLambdaOff(0), fHistPtVsYAntiLambdaOff(0), | |
56 | fHistMassK0sOff(0), fHistMassLambdaOff(0), fHistMassAntiLambdaOff(0), | |
57 | fHistMassVsRadiusK0sOff(0), fHistMassVsRadiusLambdaOff(0), fHistMassVsRadiusAntiLambdaOff(0), | |
58 | fHistPtVsMassK0sOff(0), fHistPtVsMassLambdaOff(0), fHistPtVsMassAntiLambdaOff(0), | |
59 | fHistArmenterosPodolanskiOff(0), | |
60 | fHistV0MultiplicityOn(0), | |
61 | fHistPtVsYK0sOn(0), fHistPtVsYLambdaOn(0), fHistPtVsYAntiLambdaOn(0), | |
62 | fHistMassK0sOn(0), fHistMassLambdaOn(0), fHistMassAntiLambdaOn(0), | |
63 | fHistMassVsRadiusK0sOn(0), fHistMassVsRadiusLambdaOn(0), fHistMassVsRadiusAntiLambdaOn(0), | |
64 | fHistPtVsMassK0sOn(0), fHistPtVsMassLambdaOn(0), fHistPtVsMassAntiLambdaOn(0), | |
65 | fHistArmenterosPodolanskiOn(0) | |
66 | { | |
67 | // Dummy constructor | |
68 | } | |
69 | //________________________________________________________________________ | |
043d4727 | 70 | AliAnalysisTaskStrange::AliAnalysisTaskStrange(const char *name) |
71 | : AliAnalysisTaskSE(name), fAnalysisType("ESD"), fCollidingSystems(0), fUseCut("infocut"), fListHist(), | |
9ea746fc | 72 | fHistPrimaryVertexPosX(0), fHistPrimaryVertexPosY(0), fHistPrimaryVertexPosZ(0), |
73 | fHistTrackMultiplicity(0), fHistV0Multiplicity(0), | |
74 | fHistDcaPosToPrimVertex(0), fHistDcaNegToPrimVertex(0), | |
75 | fHistDcaPosToPrimVertexZoom(0), fHistDcaNegToPrimVertexZoom(0), | |
76 | fHistRadiusV0(0), fHistDecayLengthV0(0), fHistDcaV0Daughters(0), fHistChi2(0), | |
77 | fHistCosPointAngle(0), fHistCosPointAngleZoom(0), | |
78 | fHistV0MultiplicityOff(0), | |
79 | fHistPtVsYK0sOff(0), fHistPtVsYLambdaOff(0), fHistPtVsYAntiLambdaOff(0), | |
80 | fHistMassK0sOff(0), fHistMassLambdaOff(0), fHistMassAntiLambdaOff(0), | |
81 | fHistMassVsRadiusK0sOff(0), fHistMassVsRadiusLambdaOff(0), fHistMassVsRadiusAntiLambdaOff(0), | |
82 | fHistPtVsMassK0sOff(0), fHistPtVsMassLambdaOff(0), fHistPtVsMassAntiLambdaOff(0), | |
83 | fHistArmenterosPodolanskiOff(0), | |
84 | fHistV0MultiplicityOn(0), | |
85 | fHistPtVsYK0sOn(0), fHistPtVsYLambdaOn(0), fHistPtVsYAntiLambdaOn(0), | |
86 | fHistMassK0sOn(0), fHistMassLambdaOn(0), fHistMassAntiLambdaOn(0), | |
87 | fHistMassVsRadiusK0sOn(0), fHistMassVsRadiusLambdaOn(0), fHistMassVsRadiusAntiLambdaOn(0), | |
88 | fHistPtVsMassK0sOn(0), fHistPtVsMassLambdaOn(0), fHistPtVsMassAntiLambdaOn(0), | |
89 | fHistArmenterosPodolanskiOn(0) | |
90 | { | |
91 | // Constructor | |
92 | // Define output slots only here | |
93 | // Output slot #1 writes into a TList container | |
94 | DefineOutput(1, TList::Class()); | |
95 | } | |
dd1940c8 | 96 | //________________________________________________________________________ |
97 | AliAnalysisTaskStrange::~AliAnalysisTaskStrange(){ | |
98 | // Destructor | |
99 | if (fListHist) { delete fListHist; fListHist = 0x0; } | |
100 | } | |
9ea746fc | 101 | //________________________________________________________________________ |
102 | void AliAnalysisTaskStrange::UserCreateOutputObjects() | |
103 | { | |
104 | // Create histograms | |
105 | // Called once | |
106 | ||
107 | fListHist = new TList(); | |
787055d3 | 108 | fListHist->SetOwner(); |
9ea746fc | 109 | |
110 | // Primary Vertex: | |
111 | fHistPrimaryVertexPosX = new TH1F("h1PrimaryVertexPosX", "Primary Vertex Position X;Primary Vertex Position X (cm);Events",100,-0.5,0.5); | |
112 | fListHist->Add(fHistPrimaryVertexPosX); | |
113 | fHistPrimaryVertexPosY = new TH1F("h1PrimaryVertexPosY", "Primary Vertex Position Y;Primary Vertex Position Y (cm);Events",100,-0.5,0.5); | |
114 | fListHist->Add(fHistPrimaryVertexPosY); | |
115 | fHistPrimaryVertexPosZ = new TH1F("h1PrimaryVertexPosZ", "Primary Vertex Position Z;Primary Vertex Position Z (cm);Events",200,-2.0,2.0); | |
116 | fListHist->Add(fHistPrimaryVertexPosZ); | |
117 | ||
118 | // Multiplicity: | |
119 | if (!fHistTrackMultiplicity) { | |
120 | if (fCollidingSystems) | |
121 | fHistTrackMultiplicity = new TH1F("fHistTrackMultiplicity", "Multiplicity distribution;Number of tracks;Events", 200, 0, 40000); | |
122 | else | |
123 | fHistTrackMultiplicity = new TH1F("fHistTrackMultiplicity", "Multiplicity distribution;Number of tracks;Events", 250, 0, 250); | |
124 | fListHist->Add(fHistTrackMultiplicity); | |
125 | } | |
126 | if (!fHistV0Multiplicity) { | |
127 | if (fCollidingSystems) | |
128 | fHistV0Multiplicity = new TH1F("fHistV0Multiplicity", "Multiplicity distribution;Number of V0s;Events", 200, 0, 40000); | |
129 | else | |
130 | fHistV0Multiplicity = new TH1F("fHistV0Multiplicity", "Multiplicity distribution;Number of V0s;Events", 50, 0, 50); | |
131 | fListHist->Add(fHistV0Multiplicity); | |
132 | } | |
133 | ||
134 | // Selection checks: | |
135 | fHistDcaPosToPrimVertex = new TH2F("h2DcaPosToPrimVertex", "Positive V0 daughter;dca(cm);Status",500,0,5,2,-0.5,1.5); | |
136 | fListHist->Add(fHistDcaPosToPrimVertex); | |
137 | fHistDcaNegToPrimVertex = new TH2F("h2DcaNegToPrimVertex", "Negative V0 daughter;dca(cm);Status",500,0,5,2,-0.5,1.5); | |
138 | fListHist->Add(fHistDcaNegToPrimVertex); | |
139 | fHistDcaPosToPrimVertexZoom = new TH2F("h2DcaPosToPrimVertexZoom", "Positive V0 daughter;dca(cm);Status",100,0,0.1,2,-0.5,1.5); | |
140 | fListHist->Add(fHistDcaPosToPrimVertexZoom); | |
141 | fHistDcaNegToPrimVertexZoom = new TH2F("h2DcaNegToPrimVertexZoom", "Negative V0 daughter;dca(cm);Status",100,0,0.1,2,-0.5,1.5); | |
142 | fListHist->Add(fHistDcaNegToPrimVertexZoom); | |
143 | fHistRadiusV0 = new TH2F("h2RadiusV0", "Radius;Radius(cm);Status",1000,0,100,2,-0.5,1.5); | |
144 | fListHist->Add(fHistRadiusV0); | |
145 | fHistDecayLengthV0 = new TH2F("h2DecayLengthV0", "V0s decay Length;decay length(cm);Status", 200, 0, 100,2,-0.5,1.5); | |
146 | fListHist->Add(fHistDecayLengthV0); | |
147 | fHistDcaV0Daughters = new TH2F("h2DcaV0Daughters", "DCA between daughters;dca(cm);Status", 160, 0, 4,2,-0.5,1.5); | |
148 | fListHist->Add(fHistDcaV0Daughters); | |
149 | fHistChi2 = new TH2F("h2Chi2", "V0s chi2;chi2;Status", 33, 0, 33,2,-0.5,1.5); | |
150 | fListHist->Add(fHistChi2); | |
151 | fHistCosPointAngle = new TH2F("h2CosPointAngle", "Cosine of V0's pointing angle", 100,0,1,2,-0.5,1.5); | |
152 | fListHist->Add(fHistCosPointAngle); | |
153 | fHistCosPointAngleZoom = new TH2F("h2CosPointAngleZoom", "Cosine of V0's pointing angle", 100,0.9,1,2,-0.5,1.5); | |
154 | fListHist->Add(fHistCosPointAngleZoom); | |
155 | ||
156 | // bounds of histograms: | |
157 | // Radius | |
158 | const Double_t radius[10] = {0.0,2.5,2.9,3.9,7.6,15.0,23.9,37.8,42.8,100.0}; | |
c2c631b3 | 159 | Int_t nBinRadius = 9; |
9ea746fc | 160 | |
161 | // V0 offline distributions | |
162 | if (!fHistV0MultiplicityOff) { | |
163 | if (fCollidingSystems) | |
164 | fHistV0MultiplicityOff = new TH1F("fHistV0MultiplicityOff", "Multiplicity distribution;Number of V0s;Events", 200, 0, 40000); | |
165 | else | |
166 | fHistV0MultiplicityOff = new TH1F("fHistV0MultiplicityOff", "Multiplicity distribution;Number of V0s;Events", 50, 0, 50); | |
167 | fListHist->Add(fHistV0MultiplicityOff); | |
168 | } | |
169 | // Pt vs rapidity: | |
170 | fHistPtVsYK0sOff = new TH2F("h2PtVsYK0sOff", "K^{0} Offline candidates;p_{t} (GeV/c);rapidity",30,0,15,30,-1.5,1.5); | |
171 | fListHist->Add(fHistPtVsYK0sOff); | |
172 | fHistPtVsYLambdaOff = new TH2F("h2PtVsYLambdaOff", "#Lambda^{0} Offline candidates;p_{t} (GeV/c);rapidity",30,0,15,30,-1.5,1.5); | |
173 | fListHist->Add(fHistPtVsYLambdaOff); | |
174 | fHistPtVsYAntiLambdaOff = new TH2F("h2PtVsYAntiLambdaOff", "#bar{#Lambda}^{0} Offline candidates;p_{t} (GeV/c);rapidity",30,0,15,30,-1.5,1.5); | |
175 | fListHist->Add(fHistPtVsYAntiLambdaOff); | |
176 | // Mass: | |
177 | fHistMassK0sOff = new TH1F("h1MassK0sOff", "K^{0} Offline candidates;M(#pi^{+}#pi^{-}) (GeV/c^{2});Counts", 100, 0.4, 0.6); | |
178 | fListHist->Add(fHistMassK0sOff); | |
179 | fHistMassLambdaOff = new TH1F("h1MassLambdaOff", "#Lambda^{0} Offline candidates;M(p#pi^{-}) (GeV/c^{2});Counts", 75, 1.05, 1.2); | |
180 | fListHist->Add(fHistMassLambdaOff); | |
181 | fHistMassAntiLambdaOff = new TH1F("h1MassAntiLambdaOff", "#bar{#Lambda}^{0} Offline candidates;M(#bar{p}#pi^{+}) (GeV/c^{2});Counts", 75, 1.05, 1.2); | |
182 | fListHist->Add(fHistMassAntiLambdaOff); | |
183 | // Mass vs radius: | |
c2c631b3 | 184 | fHistMassVsRadiusK0sOff = new TH2F("h2MassVsRadiusK0sOff", "K^{0} Offline candidates;radius (cm);M(#pi^{+}#pi^{-}) (GeV/c^{2})",nBinRadius,radius, 200, 0.4, 0.6); |
9ea746fc | 185 | fListHist->Add(fHistMassVsRadiusK0sOff); |
c2c631b3 | 186 | fHistMassVsRadiusLambdaOff = new TH2F("h2MassVsRadiusLambdaOff", "#Lambda Offline candidates;radius (cm);M(p#pi^{-}) (GeV/c^{2})",nBinRadius,radius, 140, 1.06, 1.2); |
9ea746fc | 187 | fListHist->Add(fHistMassVsRadiusLambdaOff); |
c2c631b3 | 188 | fHistMassVsRadiusAntiLambdaOff = new TH2F("h2MassVsRadiusAntiLambdaOff", "#bar{#Lambda} Offline candidates;radius (cm);M(#bar{p}#pi^{+}) (GeV/c^{2})",nBinRadius,radius, 140, 1.06, 1.2); |
9ea746fc | 189 | fListHist->Add(fHistMassVsRadiusAntiLambdaOff); |
190 | // Pt Vs Mass: | |
191 | fHistPtVsMassK0sOff = new TH2F("h2PtVsMassK0sOff","K^{0} Offline candidates;M(#pi^{+}#pi^{-}) (GeV/c^{2});p_{t} (GeV/c)",200, 0.4, 0.6,100,0,10); | |
192 | fListHist->Add(fHistPtVsMassK0sOff); | |
193 | fHistPtVsMassLambdaOff = new TH2F("h2PtVsMassLambdaOff","#Lambda^{0} Offline candidates;M(p#pi^{-}) (GeV/c^{2});p_{t} (GeV/c)",140, 1.06, 1.2,100,0,10); | |
194 | fListHist->Add(fHistPtVsMassLambdaOff); | |
195 | fHistPtVsMassAntiLambdaOff = new TH2F("h2PtVsMassAntiLambdaOff","#bar{#Lambda}^{0} Offline candidates;M(#bar{p}#pi^{+}) (GeV/c^{2});p_{t} (GeV/c)",140, 1.06, 1.2,100,0,10); | |
196 | fListHist->Add(fHistPtVsMassAntiLambdaOff); | |
197 | //ArmenterosPodolanski: | |
198 | fHistArmenterosPodolanskiOff = new TH2F("h2ArmenterosPodolanskiOff","Armenteros-Podolanski Offline phase space;#alpha;p_{t} arm",100,-1.0,1.0,50,0,0.5); | |
199 | fListHist->Add(fHistArmenterosPodolanskiOff); | |
200 | ||
201 | // V0 on-the-fly distributions | |
202 | if (!fHistV0MultiplicityOn) { | |
203 | if (fCollidingSystems) | |
204 | fHistV0MultiplicityOn = new TH1F("fHistV0MultiplicityOn", "Multiplicity distribution;Number of V0s;Events", 200, 0, 40000); | |
205 | else | |
206 | fHistV0MultiplicityOn = new TH1F("fHistV0MultiplicityOn", "Multiplicity distribution;Number of V0s;Events", 50, 0, 50); | |
207 | fListHist->Add(fHistV0MultiplicityOn); | |
208 | } | |
209 | // Pt vs rapidity: | |
210 | fHistPtVsYK0sOn = new TH2F("h2PtVsYK0sOn", "K^{0} Onthefly candidates;p_{t} (GeV/c);rapidity",30,0,15,30,-1.5,1.5); | |
211 | fListHist->Add(fHistPtVsYK0sOn); | |
212 | fHistPtVsYLambdaOn = new TH2F("h2PtVsYLambdaOn", "#Lambda^{0} Onthefly candidates;p_{t} (GeV/c);rapidity",30,0,15,30,-1.5,1.5); | |
213 | fListHist->Add(fHistPtVsYLambdaOn); | |
214 | fHistPtVsYAntiLambdaOn = new TH2F("h2PtVsYAntiLambdaOn", "#bar{#Lambda}^{0} Onthefly candidates;p_{t} (GeV/c);rapidity",30,0,15,30,-1.5,1.5); | |
215 | fListHist->Add(fHistPtVsYAntiLambdaOn); | |
216 | // Mass: | |
217 | fHistMassK0sOn = new TH1F("h1MassK0sOn", "K^{0} Onthefly candidates;M(#pi^{+}#pi^{-}) (GeV/c^{2});Counts", 100, 0.4, 0.6); | |
218 | fListHist->Add(fHistMassK0sOn); | |
219 | fHistMassLambdaOn = new TH1F("h1MassLambdaOn", "#Lambda^{0} Onthefly candidates;M(p#pi^{-}) (GeV/c^{2});Counts", 75, 1.05, 1.2); | |
220 | fListHist->Add(fHistMassLambdaOn); | |
221 | fHistMassAntiLambdaOn = new TH1F("h1MassAntiLambdaOn", "#bar{#Lambda}^{0} Onthefly candidates;M(#bar{p}#pi^{+}) (GeV/c^{2});Counts", 75, 1.05, 1.2); | |
222 | fListHist->Add(fHistMassAntiLambdaOn); | |
223 | // Mass vs radius: | |
c2c631b3 | 224 | fHistMassVsRadiusK0sOn = new TH2F("h2MassVsRadiusK0sOn", "K^{0} Onthefly candidates;radius (cm);M(#pi^{+}#pi^{-}) (GeV/c^{2})",nBinRadius,radius, 200, 0.4, 0.6); |
9ea746fc | 225 | fListHist->Add(fHistMassVsRadiusK0sOn); |
c2c631b3 | 226 | fHistMassVsRadiusLambdaOn = new TH2F("h2MassVsRadiusLambdaOn", "#Lambda Onthefly candidates;radius (cm);M(p#pi^{-}) (GeV/c^{2})",nBinRadius,radius, 140, 1.06, 1.2); |
9ea746fc | 227 | fListHist->Add(fHistMassVsRadiusLambdaOn); |
c2c631b3 | 228 | fHistMassVsRadiusAntiLambdaOn = new TH2F("h2MassVsRadiusAntiLambdaOn", "#bar{#Lambda} Onthefly candidates;radius (cm);M(#bar{p}#pi^{+}) (GeV/c^{2})",nBinRadius,radius, 140, 1.06, 1.2); |
9ea746fc | 229 | fListHist->Add(fHistMassVsRadiusAntiLambdaOn); |
230 | // Pt Vs Mass: | |
231 | fHistPtVsMassK0sOn = new TH2F("h2PtVsMassK0sOn","K^{0} Onthefly candidates;M(#pi^{+}#pi^{-}) (GeV/c^{2});p_{t} (GeV/c)",200, 0.4, 0.6,100,0,10); | |
232 | fListHist->Add(fHistPtVsMassK0sOn); | |
233 | fHistPtVsMassLambdaOn = new TH2F("h2PtVsMassLambdaOn","#Lambda^{0} Onthefly candidates;M(p#pi^{-}) (GeV/c^{2});p_{t} (GeV/c)",140, 1.06, 1.2,100,0,10); | |
234 | fListHist->Add(fHistPtVsMassLambdaOn); | |
235 | fHistPtVsMassAntiLambdaOn = new TH2F("h2PtVsMassAntiLambdaOn","#bar{#Lambda}^{0} Onthefly candidates;M(#bar{p}#pi^{+}) (GeV/c^{2});p_{t} (GeV/c)",140, 1.06, 1.2,100,0,10); | |
236 | fListHist->Add(fHistPtVsMassAntiLambdaOn); | |
237 | //ArmenterosPodolanski: | |
238 | fHistArmenterosPodolanskiOn = new TH2F("h2ArmenterosPodolanskiOn","Armenteros-Podolanski Onthefly phase space;#alpha;p_{t} arm",100,-1.0,1.0,50,0,0.5); | |
239 | fListHist->Add(fHistArmenterosPodolanskiOn); | |
787055d3 | 240 | |
241 | // Post output data. | |
242 | PostData(1, fListHist); | |
9ea746fc | 243 | } |
244 | ||
245 | //________________________________________________________________________ | |
246 | void AliAnalysisTaskStrange::UserExec(Option_t *) | |
247 | { | |
248 | // Main loop | |
249 | // Called for each event | |
250 | AliVEvent* lEvent = InputEvent(); | |
251 | if (!lEvent) { | |
252 | Printf("ERROR: Event not available"); | |
253 | return; | |
254 | } | |
255 | ||
256 | if (!(lEvent->GetNumberOfTracks())) { | |
043d4727 | 257 | //Printf("Strange analysis task: There is no track in this event"); |
9ea746fc | 258 | return; |
259 | } | |
260 | fHistTrackMultiplicity->Fill(lEvent->GetNumberOfTracks()); | |
261 | ||
262 | Double_t tPrimaryVtxPosition[3]; | |
043d4727 | 263 | |
9ea746fc | 264 | Int_t nv0s = 0; |
265 | nv0s = lEvent->GetNumberOfV0s(); | |
043d4727 | 266 | //Printf("Strange analysis task: There are %d v0s in this event",nv0s); |
9ea746fc | 267 | |
268 | Int_t lOnFlyStatus = 0, nv0sOn = 0, nv0sOff = 0; | |
269 | Double_t lChi2V0 = 0; | |
270 | Double_t lDcaV0Daughters = 0, lDcaV0ToPrimVertex = 0; | |
271 | Double_t lDcaPosToPrimVertex = 0, lDcaNegToPrimVertex = 0; | |
272 | Double_t lV0CosineOfPointingAngle = 0; | |
273 | Double_t lV0Radius = 0; | |
043d4727 | 274 | Double_t lV0DecayLength = 0; |
9ea746fc | 275 | Double_t lInvMassK0s = 0, lInvMassLambda = 0, lInvMassAntiLambda = 0; |
276 | Double_t lPt = 0, lRapK0s = 0, lRapLambda = 0; | |
277 | Double_t lAlphaV0 = 0, lPtArmV0 = 0; | |
278 | ||
043d4727 | 279 | Double_t tV0Position[3]; |
280 | ||
281 | Double_t lMagneticField = 999; | |
282 | ||
283 | ||
284 | //*********************** | |
285 | // ESD loop | |
286 | //*********************** | |
287 | ||
9ea746fc | 288 | if(fAnalysisType == "ESD") { |
289 | ||
290 | const AliESDVertex *primaryVtx = ((AliESDEvent*)lEvent)->GetPrimaryVertex(); | |
291 | tPrimaryVtxPosition[0] = primaryVtx->GetXv(); | |
292 | tPrimaryVtxPosition[1] = primaryVtx->GetYv(); | |
293 | tPrimaryVtxPosition[2] = primaryVtx->GetZv(); | |
294 | ||
295 | fHistPrimaryVertexPosX->Fill(tPrimaryVtxPosition[0]); | |
296 | fHistPrimaryVertexPosY->Fill(tPrimaryVtxPosition[1]); | |
297 | fHistPrimaryVertexPosZ->Fill(tPrimaryVtxPosition[2]); | |
298 | ||
043d4727 | 299 | lMagneticField = ((AliESDEvent*)lEvent)->GetMagneticField(); |
9ea746fc | 300 | |
9ea746fc | 301 | |
302 | for (Int_t iV0 = 0; iV0 < nv0s; iV0++) | |
303 | {// This is the begining of the V0 loop | |
304 | AliESDv0 *v0 = ((AliESDEvent*)lEvent)->GetV0(iV0); | |
305 | if (!v0) continue; | |
306 | ||
9ea746fc | 307 | // AliAODtrack (V0 Daughters) |
308 | UInt_t lKeyPos = (UInt_t)TMath::Abs(v0->GetPindex()); | |
309 | UInt_t lKeyNeg = (UInt_t)TMath::Abs(v0->GetNindex()); | |
310 | ||
c2c631b3 | 311 | AliESDtrack *pTrack = ((AliESDEvent*)lEvent)->GetTrack(lKeyPos); |
312 | AliESDtrack *nTrack = ((AliESDEvent*)lEvent)->GetTrack(lKeyNeg); | |
313 | if (!pTrack || !nTrack) { | |
9ea746fc | 314 | Printf("ERROR: Could not retreive one of the daughter track"); |
315 | continue; | |
9d48801c | 316 | } |
317 | ||
318 | // Remove like-sign | |
319 | if ( pTrack->GetSign() == nTrack->GetSign()){ | |
320 | //cout<< "like sign, continue"<< endl; | |
321 | continue; | |
322 | } | |
043d4727 | 323 | |
324 | // Tracks quality cuts | |
325 | if ( ( (pTrack->GetTPCNcls()) < 80 ) || ( (nTrack->GetTPCNcls()) < 80 ) ) continue; | |
326 | ||
327 | // TPC refit condition (done during reconstruction for Offline but not for On-the-fly) | |
328 | if( !(pTrack->GetStatus() & AliESDtrack::kTPCrefit)) continue; | |
329 | if( !(nTrack->GetStatus() & AliESDtrack::kTPCrefit)) continue; | |
330 | ||
331 | // DCA between daughter and Primary Vertex: | |
332 | if (pTrack) lDcaPosToPrimVertex = TMath::Abs(pTrack->GetD(tPrimaryVtxPosition[0],tPrimaryVtxPosition[1],lMagneticField) ); | |
333 | ||
334 | if (nTrack) lDcaNegToPrimVertex = TMath::Abs(nTrack->GetD(tPrimaryVtxPosition[0],tPrimaryVtxPosition[1],lMagneticField) ); | |
335 | ||
336 | // VO's main characteristics: | |
337 | lOnFlyStatus = v0->GetOnFlyStatus(); | |
338 | lChi2V0 = v0->GetChi2V0(); | |
339 | lDcaV0Daughters = v0->GetDcaV0Daughters(); | |
340 | lDcaV0ToPrimVertex = v0->GetD(tPrimaryVtxPosition[0],tPrimaryVtxPosition[1],tPrimaryVtxPosition[2]); | |
341 | lV0CosineOfPointingAngle = v0->GetV0CosineOfPointingAngle(tPrimaryVtxPosition[0],tPrimaryVtxPosition[1], tPrimaryVtxPosition[2]); | |
342 | v0->GetXYZ(tV0Position[0], tV0Position[1], tV0Position[2]); | |
343 | lV0Radius = TMath::Sqrt(tV0Position[0]*tV0Position[0]+tV0Position[1]*tV0Position[1]); | |
344 | lV0DecayLength = TMath::Sqrt(TMath::Power(tV0Position[0] - tPrimaryVtxPosition[0],2) + | |
345 | TMath::Power(tV0Position[1] - tPrimaryVtxPosition[1],2) + | |
346 | TMath::Power(tV0Position[2] - tPrimaryVtxPosition[2],2 )); | |
347 | ||
348 | // Invariant mass | |
349 | v0->ChangeMassHypothesis(310); | |
350 | lInvMassK0s = v0->GetEffMass(); | |
351 | v0->ChangeMassHypothesis(3122); | |
352 | lInvMassLambda = v0->GetEffMass(); | |
353 | v0->ChangeMassHypothesis(-3122); | |
354 | lInvMassAntiLambda = v0->GetEffMass(); | |
355 | ||
356 | // Rapidity: | |
357 | lRapK0s = v0->Y(310); | |
358 | lRapLambda = v0->Y(3122); | |
359 | ||
360 | // Pt: | |
361 | lPt = v0->Pt(); | |
362 | ||
363 | // Armenteros variables: !! | |
364 | lAlphaV0 = v0->AlphaV0(); | |
365 | lPtArmV0 = v0->PtArmV0(); | |
366 | ||
9ea746fc | 367 | // Selections: |
043d4727 | 368 | if (fUseCut.Contains("yes")) { |
9ea746fc | 369 | if ( (lDcaPosToPrimVertex < 0.036 )|| |
8f99f65a | 370 | (lDcaNegToPrimVertex < 0.036 )|| |
9ea746fc | 371 | (lDcaV0Daughters > 0.5 ) || |
372 | (lV0CosineOfPointingAngle < 0.99) | |
373 | ) continue; | |
374 | } | |
375 | ||
376 | // Filling histograms | |
377 | fHistDcaPosToPrimVertex->Fill(lDcaPosToPrimVertex,lOnFlyStatus); | |
378 | fHistDcaNegToPrimVertex->Fill(lDcaNegToPrimVertex,lOnFlyStatus); | |
379 | fHistDcaPosToPrimVertexZoom->Fill(lDcaPosToPrimVertex,lOnFlyStatus); | |
380 | fHistDcaNegToPrimVertexZoom->Fill(lDcaNegToPrimVertex,lOnFlyStatus); | |
381 | fHistRadiusV0->Fill(lV0Radius,lOnFlyStatus); | |
043d4727 | 382 | fHistDecayLengthV0->Fill(lV0DecayLength,lOnFlyStatus); |
9ea746fc | 383 | fHistDcaV0Daughters->Fill(lDcaV0Daughters,lOnFlyStatus); |
384 | fHistChi2->Fill(lChi2V0,lOnFlyStatus); | |
385 | fHistCosPointAngle->Fill(lV0CosineOfPointingAngle,lOnFlyStatus); | |
386 | if (lV0CosineOfPointingAngle >= 0.9) fHistCosPointAngleZoom->Fill(lV0CosineOfPointingAngle,lOnFlyStatus); | |
387 | if(!lOnFlyStatus){ | |
388 | nv0sOff++; | |
389 | fHistPtVsYK0sOff->Fill(lPt,lRapK0s); | |
390 | fHistPtVsYLambdaOff->Fill(lPt,lRapLambda); | |
391 | fHistPtVsYAntiLambdaOff->Fill(lPt,lRapLambda); | |
392 | fHistArmenterosPodolanskiOff->Fill(lAlphaV0,lPtArmV0); | |
393 | } | |
394 | else { | |
395 | nv0sOn++; | |
396 | fHistPtVsYK0sOn->Fill(lPt,lRapK0s); | |
397 | fHistPtVsYLambdaOn->Fill(lPt,lRapLambda); | |
398 | fHistPtVsYAntiLambdaOn->Fill(lPt,lRapLambda); | |
399 | fHistArmenterosPodolanskiOn->Fill(lAlphaV0,lPtArmV0); | |
400 | } | |
401 | // K0s invariant mass histograms: | |
402 | if (TMath::Abs(lRapK0s) < 1) { | |
403 | if(!lOnFlyStatus){ | |
404 | fHistMassK0sOff->Fill(lInvMassK0s); | |
405 | fHistMassVsRadiusK0sOff->Fill(lV0Radius,lInvMassK0s); | |
406 | fHistPtVsMassK0sOff->Fill(lInvMassK0s,lPt); | |
407 | } | |
408 | else { | |
409 | fHistMassK0sOn->Fill(lInvMassK0s); | |
410 | fHistMassVsRadiusK0sOn->Fill(lV0Radius,lInvMassK0s); | |
411 | fHistPtVsMassK0sOn->Fill(lInvMassK0s,lPt); | |
412 | } | |
413 | } | |
414 | // Lambda and AntiLambda invariant mass histograms: | |
415 | if (TMath::Abs(lRapLambda) < 1) { | |
416 | if(!lOnFlyStatus){ | |
417 | fHistMassLambdaOff->Fill(lInvMassLambda); | |
418 | fHistMassAntiLambdaOff->Fill(lInvMassAntiLambda); | |
419 | fHistMassVsRadiusLambdaOff->Fill(lV0Radius,lInvMassLambda); | |
420 | fHistMassVsRadiusAntiLambdaOff->Fill(lV0Radius,lInvMassAntiLambda); | |
421 | fHistPtVsMassLambdaOff->Fill(lInvMassLambda,lPt); | |
422 | fHistPtVsMassAntiLambdaOff->Fill(lInvMassAntiLambda,lPt); | |
423 | } | |
424 | else { | |
425 | fHistMassLambdaOn->Fill(lInvMassLambda); | |
426 | fHistMassAntiLambdaOn->Fill(lInvMassAntiLambda); | |
427 | fHistMassVsRadiusLambdaOn->Fill(lV0Radius,lInvMassLambda); | |
428 | fHistMassVsRadiusAntiLambdaOn->Fill(lV0Radius,lInvMassAntiLambda); | |
429 | fHistPtVsMassLambdaOn->Fill(lInvMassLambda,lPt); | |
430 | fHistPtVsMassAntiLambdaOn->Fill(lInvMassAntiLambda,lPt); | |
431 | } | |
432 | } | |
433 | } // end V0 loop | |
434 | ||
9ea746fc | 435 | } |
043d4727 | 436 | |
437 | //*********************** | |
438 | // AOD loop | |
439 | //*********************** | |
440 | ||
9ea746fc | 441 | else if(fAnalysisType == "AOD") { |
442 | ||
443 | const AliAODVertex *primaryVtx = ((AliAODEvent*)lEvent)->GetPrimaryVertex(); | |
444 | tPrimaryVtxPosition[0] = primaryVtx->GetX(); | |
445 | tPrimaryVtxPosition[1] = primaryVtx->GetY(); | |
446 | tPrimaryVtxPosition[2] = primaryVtx->GetZ(); | |
447 | ||
448 | fHistPrimaryVertexPosX->Fill(tPrimaryVtxPosition[0]); | |
449 | fHistPrimaryVertexPosY->Fill(tPrimaryVtxPosition[1]); | |
450 | fHistPrimaryVertexPosZ->Fill(tPrimaryVtxPosition[2]); | |
451 | ||
452 | for (Int_t iV0 = 0; iV0 < nv0s; iV0++) | |
453 | {// This is the begining of the V0 loop | |
043d4727 | 454 | AliAODv0 *myAODv0 = ((AliAODEvent*)lEvent)->GetV0(iV0); |
455 | if (!myAODv0) continue; | |
9ea746fc | 456 | |
457 | // common part | |
043d4727 | 458 | lV0Radius = myAODv0->RadiusV0(); |
459 | lDcaPosToPrimVertex = myAODv0->DcaPosToPrimVertex(); | |
460 | lDcaNegToPrimVertex = myAODv0->DcaNegToPrimVertex(); | |
461 | lOnFlyStatus = myAODv0->GetOnFlyStatus(); | |
462 | lChi2V0 = myAODv0->Chi2V0(); | |
463 | lDcaV0Daughters = myAODv0->DcaV0Daughters(); | |
464 | lDcaV0ToPrimVertex = myAODv0->DcaV0ToPrimVertex(); | |
465 | lV0DecayLength = myAODv0->DecayLengthV0(tPrimaryVtxPosition); | |
466 | lV0CosineOfPointingAngle = myAODv0->CosPointingAngle(tPrimaryVtxPosition); | |
9ea746fc | 467 | |
043d4727 | 468 | lInvMassK0s = myAODv0->MassK0Short(); |
469 | lInvMassLambda = myAODv0->MassLambda(); | |
470 | lInvMassAntiLambda = myAODv0->MassAntiLambda(); | |
9ea746fc | 471 | |
043d4727 | 472 | lPt = TMath::Sqrt(myAODv0->Pt2V0()); |
473 | lRapK0s = myAODv0->RapK0Short(); | |
474 | lRapLambda = myAODv0->RapLambda(); | |
475 | lAlphaV0 = myAODv0->AlphaV0(); | |
476 | lPtArmV0 = myAODv0->PtArmV0(); | |
9ea746fc | 477 | |
478 | ||
479 | // Selections: | |
043d4727 | 480 | if (fUseCut.Contains("yes")) { |
9ea746fc | 481 | if ( (lDcaPosToPrimVertex < 0.036 )|| |
1165f2e1 | 482 | (lDcaNegToPrimVertex < 0.036 )|| |
9ea746fc | 483 | (lDcaV0Daughters > 0.5 ) || |
484 | (lV0CosineOfPointingAngle < 0.99) | |
485 | ) continue; | |
486 | } | |
487 | ||
488 | // Filling histograms | |
489 | fHistDcaPosToPrimVertex->Fill(lDcaPosToPrimVertex,lOnFlyStatus); | |
490 | fHistDcaNegToPrimVertex->Fill(lDcaNegToPrimVertex,lOnFlyStatus); | |
491 | fHistDcaPosToPrimVertexZoom->Fill(lDcaPosToPrimVertex,lOnFlyStatus); | |
492 | fHistDcaNegToPrimVertexZoom->Fill(lDcaNegToPrimVertex,lOnFlyStatus); | |
493 | fHistRadiusV0->Fill(lV0Radius,lOnFlyStatus); | |
043d4727 | 494 | fHistDecayLengthV0->Fill(lV0DecayLength,lOnFlyStatus); |
9ea746fc | 495 | fHistDcaV0Daughters->Fill(lDcaV0Daughters,lOnFlyStatus); |
496 | fHistChi2->Fill(lChi2V0,lOnFlyStatus); | |
497 | fHistCosPointAngle->Fill(lV0CosineOfPointingAngle,lOnFlyStatus); | |
498 | if (lV0CosineOfPointingAngle >= 0.9) fHistCosPointAngleZoom->Fill(lV0CosineOfPointingAngle,lOnFlyStatus); | |
499 | if(!lOnFlyStatus){ | |
500 | nv0sOff++; | |
501 | fHistPtVsYK0sOff->Fill(lPt,lRapK0s); | |
502 | fHistPtVsYLambdaOff->Fill(lPt,lRapLambda); | |
503 | fHistPtVsYAntiLambdaOff->Fill(lPt,lRapLambda); | |
504 | fHistArmenterosPodolanskiOff->Fill(lAlphaV0,lPtArmV0); | |
505 | } | |
506 | else { | |
507 | nv0sOn++; | |
508 | fHistPtVsYK0sOn->Fill(lPt,lRapK0s); | |
509 | fHistPtVsYLambdaOn->Fill(lPt,lRapLambda); | |
510 | fHistPtVsYAntiLambdaOn->Fill(lPt,lRapLambda); | |
511 | fHistArmenterosPodolanskiOn->Fill(lAlphaV0,lPtArmV0); | |
512 | } | |
513 | // K0s invariant mass histograms: | |
514 | if (TMath::Abs(lRapK0s) < 1) { | |
515 | if(!lOnFlyStatus){ | |
516 | fHistMassK0sOff->Fill(lInvMassK0s); | |
517 | fHistMassVsRadiusK0sOff->Fill(lV0Radius,lInvMassK0s); | |
518 | fHistPtVsMassK0sOff->Fill(lInvMassK0s,lPt); | |
519 | } | |
520 | else { | |
521 | fHistMassK0sOn->Fill(lInvMassK0s); | |
522 | fHistMassVsRadiusK0sOn->Fill(lV0Radius,lInvMassK0s); | |
523 | fHistPtVsMassK0sOn->Fill(lInvMassK0s,lPt); | |
524 | } | |
525 | } | |
526 | // Lambda and AntiLambda invariant mass histograms: | |
527 | if (TMath::Abs(lRapLambda) < 1) { | |
528 | if(!lOnFlyStatus){ | |
529 | fHistMassLambdaOff->Fill(lInvMassLambda); | |
530 | fHistMassAntiLambdaOff->Fill(lInvMassAntiLambda); | |
531 | fHistMassVsRadiusLambdaOff->Fill(lV0Radius,lInvMassLambda); | |
532 | fHistMassVsRadiusAntiLambdaOff->Fill(lV0Radius,lInvMassAntiLambda); | |
533 | fHistPtVsMassLambdaOff->Fill(lInvMassLambda,lPt); | |
534 | fHistPtVsMassAntiLambdaOff->Fill(lInvMassAntiLambda,lPt); | |
535 | } | |
536 | else { | |
537 | fHistMassLambdaOn->Fill(lInvMassLambda); | |
538 | fHistMassAntiLambdaOn->Fill(lInvMassAntiLambda); | |
539 | fHistMassVsRadiusLambdaOn->Fill(lV0Radius,lInvMassLambda); | |
540 | fHistMassVsRadiusAntiLambdaOn->Fill(lV0Radius,lInvMassAntiLambda); | |
541 | fHistPtVsMassLambdaOn->Fill(lInvMassLambda,lPt); | |
542 | fHistPtVsMassAntiLambdaOn->Fill(lInvMassAntiLambda,lPt); | |
543 | } | |
544 | } | |
545 | } // end V0 loop | |
546 | } | |
547 | ||
548 | fHistV0Multiplicity->Fill(nv0s); | |
549 | fHistV0MultiplicityOff->Fill(nv0sOff); | |
550 | fHistV0MultiplicityOn->Fill(nv0sOn); | |
551 | ||
552 | // Post output data. | |
553 | PostData(1, fListHist); | |
554 | } | |
555 | ||
556 | //________________________________________________________________________ | |
557 | void AliAnalysisTaskStrange::Terminate(Option_t *) | |
558 | { | |
559 | // Draw result to the screen | |
560 | // Called once at the end of the query | |
561 | } |