]>
Commit | Line | Data |
---|---|---|
daf66719 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /* $Id$ */ | |
17 | ||
18 | // AliFlowEventCuts: | |
19 | // An event cut class for the flow framework | |
20 | // | |
21 | // origin: Mikolaj Krzewicki (mikolaj.krzewicki@cern.ch) | |
22 | ||
23 | #include <limits.h> | |
24 | #include <float.h> | |
1c4a5bf7 | 25 | #include "TMath.h" |
daf66719 | 26 | #include "TNamed.h" |
ee242db3 | 27 | #include "AliVVertex.h" |
daf66719 | 28 | #include "AliVEvent.h" |
333ce021 | 29 | #include "AliESDEvent.h" |
7d9ab4fb | 30 | #include "AliESDCentrality.h" |
1c4a5bf7 | 31 | #include "AliESDVZERO.h" |
9a0783cc | 32 | #include "AliMultiplicity.h" |
333ce021 | 33 | #include "AliMCEvent.h" |
daf66719 | 34 | #include "AliFlowEventCuts.h" |
9a0783cc | 35 | #include "AliFlowTrackCuts.h" |
e7b9ed1d | 36 | #include "AliTriggerAnalysis.h" |
daf66719 | 37 | |
38 | ClassImp(AliFlowEventCuts) | |
39 | ||
40 | //----------------------------------------------------------------------- | |
41 | AliFlowEventCuts::AliFlowEventCuts(): | |
42 | TNamed(), | |
43 | fCutNumberOfTracks(kFALSE), | |
44 | fNumberOfTracksMax(INT_MAX), | |
5559ce24 | 45 | fNumberOfTracksMin(INT_MIN), |
46 | fCutRefMult(kFALSE), | |
9a0783cc | 47 | fRefMultMethod(kTPConly), |
5559ce24 | 48 | fRefMultMax(INT_MAX), |
333ce021 | 49 | fRefMultMin(INT_MIN), |
ee242db3 | 50 | fRefMultCuts(NULL), |
2279052e | 51 | fMeanPtCuts(NULL), |
ee242db3 | 52 | fCutPrimaryVertexX(kFALSE), |
53 | fPrimaryVertexXmax(INT_MAX), | |
54 | fPrimaryVertexXmin(INT_MIN), | |
55 | fCutPrimaryVertexY(kFALSE), | |
56 | fPrimaryVertexYmax(INT_MAX), | |
57 | fPrimaryVertexYmin(INT_MIN), | |
58 | fCutPrimaryVertexZ(kFALSE), | |
59 | fPrimaryVertexZmax(INT_MAX), | |
60 | fPrimaryVertexZmin(INT_MIN), | |
61 | fCutNContributors(kFALSE), | |
62 | fNContributorsMax(INT_MAX), | |
d32716f4 | 63 | fNContributorsMin(INT_MIN), |
64 | fCutMeanPt(kFALSE), | |
e90a4b03 | 65 | fMeanPtMax(-DBL_MAX), |
d7e66a39 | 66 | fMeanPtMin(DBL_MAX), |
7d9ab4fb | 67 | fCutSPDvertexerAnomaly(kTRUE), |
68 | fCutCentralityPercentile(kFALSE), | |
69 | fCentralityPercentileMethod(kTPConly), | |
70 | fCentralityPercentileMax(100.), | |
e7b9ed1d | 71 | fCentralityPercentileMin(0.), |
72 | fCutZDCtiming(kTRUE), | |
73 | fTrigAna() | |
daf66719 | 74 | { |
75 | //constructor | |
76 | } | |
77 | ||
957517fa | 78 | //----------------------------------------------------------------------- |
79 | AliFlowEventCuts::AliFlowEventCuts(const char* name, const char* title): | |
80 | TNamed(name, title), | |
81 | fCutNumberOfTracks(kFALSE), | |
82 | fNumberOfTracksMax(INT_MAX), | |
83 | fNumberOfTracksMin(INT_MIN), | |
84 | fCutRefMult(kFALSE), | |
9a0783cc | 85 | fRefMultMethod(kTPConly), |
957517fa | 86 | fRefMultMax(INT_MAX), |
333ce021 | 87 | fRefMultMin(INT_MIN), |
ee242db3 | 88 | fRefMultCuts(NULL), |
2279052e | 89 | fMeanPtCuts(NULL), |
ee242db3 | 90 | fCutPrimaryVertexX(kFALSE), |
91 | fPrimaryVertexXmax(INT_MAX), | |
92 | fPrimaryVertexXmin(INT_MIN), | |
93 | fCutPrimaryVertexY(kFALSE), | |
94 | fPrimaryVertexYmax(INT_MAX), | |
95 | fPrimaryVertexYmin(INT_MIN), | |
96 | fCutPrimaryVertexZ(kFALSE), | |
97 | fPrimaryVertexZmax(INT_MAX), | |
98 | fPrimaryVertexZmin(INT_MIN), | |
99 | fCutNContributors(kFALSE), | |
100 | fNContributorsMax(INT_MAX), | |
d32716f4 | 101 | fNContributorsMin(INT_MIN), |
102 | fCutMeanPt(kFALSE), | |
e90a4b03 | 103 | fMeanPtMax(-DBL_MAX), |
d7e66a39 | 104 | fMeanPtMin(DBL_MAX), |
7d9ab4fb | 105 | fCutSPDvertexerAnomaly(kTRUE), |
106 | fCutCentralityPercentile(kFALSE), | |
107 | fCentralityPercentileMethod(kTPConly), | |
108 | fCentralityPercentileMax(100.), | |
e7b9ed1d | 109 | fCentralityPercentileMin(0.), |
110 | fCutZDCtiming(kTRUE), | |
111 | fTrigAna() | |
957517fa | 112 | { |
113 | //constructor | |
114 | } | |
115 | ||
daf66719 | 116 | ////----------------------------------------------------------------------- |
03d364db | 117 | AliFlowEventCuts::AliFlowEventCuts(const AliFlowEventCuts& that): |
118 | TNamed(that), | |
119 | fCutNumberOfTracks(that.fCutNumberOfTracks), | |
120 | fNumberOfTracksMax(that.fNumberOfTracksMax), | |
121 | fNumberOfTracksMin(that.fNumberOfTracksMin), | |
122 | fCutRefMult(that.fCutRefMult), | |
123 | fRefMultMethod(that.fRefMultMethod), | |
124 | fRefMultMax(that.fRefMultMax), | |
125 | fRefMultMin(that.fRefMultMin), | |
ee242db3 | 126 | fRefMultCuts(NULL), |
2279052e | 127 | fMeanPtCuts(NULL), |
ee242db3 | 128 | fCutPrimaryVertexX(that.fCutPrimaryVertexX), |
129 | fPrimaryVertexXmax(that.fPrimaryVertexXmax), | |
130 | fPrimaryVertexXmin(that.fPrimaryVertexXmin), | |
131 | fCutPrimaryVertexY(that.fCutPrimaryVertexX), | |
132 | fPrimaryVertexYmax(that.fPrimaryVertexYmax), | |
133 | fPrimaryVertexYmin(that.fPrimaryVertexYmin), | |
134 | fCutPrimaryVertexZ(that.fCutPrimaryVertexX), | |
135 | fPrimaryVertexZmax(that.fPrimaryVertexZmax), | |
136 | fPrimaryVertexZmin(that.fPrimaryVertexZmin), | |
137 | fCutNContributors(that.fCutNContributors), | |
138 | fNContributorsMax(that.fNContributorsMax), | |
d32716f4 | 139 | fNContributorsMin(that.fNContributorsMin), |
140 | fCutMeanPt(that.fCutMeanPt), | |
141 | fMeanPtMax(that.fMeanPtMax), | |
d7e66a39 | 142 | fMeanPtMin(that.fMeanPtMin), |
7d9ab4fb | 143 | fCutSPDvertexerAnomaly(that.fCutSPDvertexerAnomaly), |
144 | fCutCentralityPercentile(that.fCutCentralityPercentile), | |
145 | fCentralityPercentileMethod(that.fCentralityPercentileMethod), | |
146 | fCentralityPercentileMax(that.fCentralityPercentileMax), | |
e7b9ed1d | 147 | fCentralityPercentileMin(that.fCentralityPercentileMin), |
148 | fCutZDCtiming(that.fCutZDCtiming), | |
149 | fTrigAna() | |
03d364db | 150 | { |
151 | //copy constructor | |
ee242db3 | 152 | if (that.fRefMultCuts) |
153 | fRefMultCuts = new AliFlowTrackCuts(*(that.fRefMultCuts)); | |
2279052e | 154 | if (that.fMeanPtCuts) |
155 | fMeanPtCuts = new AliFlowTrackCuts(*(that.fMeanPtCuts)); | |
156 | } | |
157 | ||
158 | ////----------------------------------------------------------------------- | |
159 | AliFlowEventCuts::~AliFlowEventCuts() | |
160 | { | |
161 | //dtor | |
162 | delete fMeanPtCuts; | |
163 | delete fRefMultCuts; | |
03d364db | 164 | } |
165 | ||
daf66719 | 166 | ////----------------------------------------------------------------------- |
03d364db | 167 | AliFlowEventCuts& AliFlowEventCuts::operator=(const AliFlowEventCuts& that) |
168 | { | |
169 | //assignment | |
170 | fCutNumberOfTracks=that.fCutNumberOfTracks; | |
171 | fNumberOfTracksMax=that.fNumberOfTracksMax; | |
172 | fNumberOfTracksMin=that.fNumberOfTracksMin; | |
173 | fCutRefMult=that.fCutRefMult; | |
174 | fRefMultMethod=that.fRefMultMethod; | |
175 | fRefMultMax=that.fRefMultMax; | |
176 | fRefMultMin=that.fRefMultMin; | |
ee242db3 | 177 | if (that.fRefMultCuts) *fRefMultCuts=*(that.fRefMultCuts); |
2279052e | 178 | if (that.fMeanPtCuts) *fMeanPtCuts=*(that.fMeanPtCuts); |
ee242db3 | 179 | fCutPrimaryVertexX=that.fCutPrimaryVertexX; |
180 | fPrimaryVertexXmin=that.fPrimaryVertexXmin; | |
181 | fPrimaryVertexXmax=that.fPrimaryVertexXmax; | |
182 | fPrimaryVertexYmin=that.fPrimaryVertexYmin; | |
183 | fPrimaryVertexYmax=that.fPrimaryVertexYmax; | |
184 | fPrimaryVertexZmin=that.fPrimaryVertexZmin; | |
185 | fPrimaryVertexZmax=that.fPrimaryVertexZmax; | |
186 | fCutNContributors=that.fCutNContributors; | |
187 | fNContributorsMax=that.fNContributorsMax; | |
188 | fNContributorsMin=that.fNContributorsMin; | |
d32716f4 | 189 | fCutMeanPt=that.fCutMeanPt; |
190 | fMeanPtMax=that.fMeanPtMax; | |
191 | fMeanPtMin=that.fMeanPtMin; | |
d7e66a39 | 192 | fCutSPDvertexerAnomaly=that.fCutSPDvertexerAnomaly; |
7d9ab4fb | 193 | fCutCentralityPercentile=that.fCutCentralityPercentile; |
194 | fCentralityPercentileMethod=that.fCentralityPercentileMethod; | |
195 | fCentralityPercentileMax=that.fCentralityPercentileMax; | |
196 | fCentralityPercentileMin=that.fCentralityPercentileMin; | |
03d364db | 197 | return *this; |
198 | } | |
daf66719 | 199 | |
200 | //----------------------------------------------------------------------- | |
7d9ab4fb | 201 | Bool_t AliFlowEventCuts::IsSelected(TObject* obj) |
daf66719 | 202 | { |
203 | //check cuts | |
7d9ab4fb | 204 | AliVEvent* vevent = dynamic_cast<AliVEvent*>(obj); |
daf66719 | 205 | if (vevent) return PassesCuts(vevent); |
206 | return kFALSE; //when passed wrong type of object | |
207 | } | |
208 | //----------------------------------------------------------------------- | |
7d9ab4fb | 209 | Bool_t AliFlowEventCuts::PassesCuts(AliVEvent *event) |
daf66719 | 210 | { |
211 | ///check if event passes cuts | |
7d9ab4fb | 212 | AliESDEvent* esdevent = dynamic_cast<AliESDEvent*>(event); |
213 | if (fCutCentralityPercentile) | |
214 | { | |
215 | AliESDCentrality* centr = esdevent->GetCentrality(); | |
e7b9ed1d | 216 | if (!centr->IsEventInCentralityClass( fCentralityPercentileMin, |
217 | fCentralityPercentileMax, | |
218 | CentrMethName(fCentralityPercentileMethod) )) | |
219 | return kFALSE; | |
7d9ab4fb | 220 | } |
221 | if (fCutSPDvertexerAnomaly&&esdevent) | |
222 | { | |
223 | const AliESDVertex* sdpvertex = esdevent->GetPrimaryVertexSPD(); | |
224 | if (sdpvertex->GetNContributors()<1) return kFALSE; | |
225 | if (sdpvertex->GetDispersion()>0.04) return kFALSE; | |
226 | if (sdpvertex->GetZRes()>0.25) return kFALSE; | |
227 | const AliESDVertex* tpcvertex = esdevent->GetPrimaryVertexTPC(); | |
228 | if (tpcvertex->GetNContributors()<1) return kFALSE; | |
229 | const AliMultiplicity* tracklets = esdevent->GetMultiplicity(); | |
230 | if (tpcvertex->GetNContributors()<(-10.0+0.25*tracklets->GetNumberOfITSClusters(0))) | |
231 | return kFALSE; | |
232 | } | |
e7b9ed1d | 233 | if (fCutZDCtiming) |
234 | { | |
235 | if (!fTrigAna.ZDCTimeTrigger(esdevent)) return kFALSE; | |
236 | } | |
7d9ab4fb | 237 | if(fCutNumberOfTracks) {if ( event->GetNumberOfTracks() < fNumberOfTracksMin || |
238 | event->GetNumberOfTracks() >= fNumberOfTracksMax ) return kFALSE;} | |
5559ce24 | 239 | if(fCutRefMult) |
240 | { | |
241 | //reference multiplicity still to be defined | |
03d364db | 242 | Double_t refMult = RefMult(event); |
243 | if (refMult < fRefMultMin || refMult >= fRefMultMax ) | |
5559ce24 | 244 | return kFALSE; |
245 | } | |
ee242db3 | 246 | const AliVVertex* pvtx=event->GetPrimaryVertex(); |
247 | Double_t pvtxx = pvtx->GetX(); | |
248 | Double_t pvtxy = pvtx->GetY(); | |
249 | Double_t pvtxz = pvtx->GetZ(); | |
250 | Int_t ncontrib = pvtx->GetNContributors(); | |
251 | if (fCutNContributors) | |
252 | { | |
253 | if (ncontrib < fNContributorsMin || ncontrib >= fNContributorsMax) | |
254 | return kFALSE; | |
255 | } | |
256 | if (fCutPrimaryVertexX) | |
257 | { | |
258 | if (pvtxx < fPrimaryVertexXmin || pvtxx >= fPrimaryVertexXmax) | |
259 | return kFALSE; | |
260 | } | |
261 | if (fCutPrimaryVertexY) | |
262 | { | |
263 | if (pvtxy < fPrimaryVertexYmin || pvtxy >= fPrimaryVertexYmax) | |
264 | return kFALSE; | |
265 | } | |
266 | if (fCutPrimaryVertexZ) | |
267 | { | |
268 | if (pvtxz < fPrimaryVertexZmin || pvtxz >= fPrimaryVertexZmax) | |
269 | return kFALSE; | |
270 | } | |
d32716f4 | 271 | if (fCutMeanPt) |
272 | { | |
273 | Float_t meanpt=0.0; | |
274 | Int_t ntracks=event->GetNumberOfTracks(); | |
f33c7420 | 275 | Int_t nselected=0; |
d32716f4 | 276 | for (Int_t i=0; i<ntracks; i++) |
277 | { | |
278 | AliVParticle* track = event->GetTrack(i); | |
279 | if (!track) continue; | |
2279052e | 280 | Bool_t pass=kTRUE; |
281 | if (fMeanPtCuts) pass=fMeanPtCuts->IsSelected(track); | |
f33c7420 | 282 | if (pass) |
283 | { | |
284 | meanpt += track->Pt(); | |
285 | nselected++; | |
286 | } | |
d32716f4 | 287 | } |
f33c7420 | 288 | meanpt=meanpt/nselected; |
d32716f4 | 289 | if (meanpt<fMeanPtMin || meanpt >= fMeanPtMax) return kFALSE; |
290 | } | |
daf66719 | 291 | return kTRUE; |
292 | } | |
293 | ||
7d9ab4fb | 294 | //----------------------------------------------------------------------- |
295 | const char* AliFlowEventCuts::CentrMethName(refMultMethod method) const | |
296 | { | |
297 | //get the string for refmultmethod, for use with AliESDCentrality in | |
298 | //the cut on centrality percentile | |
299 | switch (method) | |
300 | { | |
301 | case kSPDtracklets: | |
302 | return "TKL"; | |
303 | case kSPD1clusters: | |
304 | return "CL1"; | |
305 | case kTPConly: | |
306 | return "TRK"; | |
307 | case kV0: | |
308 | return "V0M"; | |
309 | default: | |
310 | return ""; | |
311 | } | |
312 | } | |
daf66719 | 313 | //----------------------------------------------------------------------- |
314 | AliFlowEventCuts* AliFlowEventCuts::StandardCuts() | |
315 | { | |
316 | //make a set of standard event cuts, caller becomes owner | |
317 | AliFlowEventCuts* cuts = new AliFlowEventCuts(); | |
318 | return cuts; | |
319 | } | |
333ce021 | 320 | |
321 | //----------------------------------------------------------------------- | |
7d9ab4fb | 322 | Int_t AliFlowEventCuts::RefMult(AliVEvent* event) |
333ce021 | 323 | { |
9a0783cc | 324 | //calculate the reference multiplicity, if all fails return 0 |
1c4a5bf7 | 325 | AliESDVZERO* vzero = NULL; |
7d9ab4fb | 326 | AliESDEvent* esdevent = dynamic_cast<AliESDEvent*>(event); |
2cdf5762 | 327 | const AliMultiplicity* mult = esdevent->GetMultiplicity(); |
1c4a5bf7 | 328 | Int_t refmult=0; |
32b846cd | 329 | |
330 | switch (fRefMultMethod) | |
9a0783cc | 331 | { |
32b846cd | 332 | case kTPConly: |
333 | if (fRefMultCuts) break; | |
334 | fRefMultCuts = AliFlowTrackCuts::GetStandardTPCOnlyTrackCuts(); | |
335 | fRefMultCuts->SetEtaRange(-0.8,0.8); | |
336 | fRefMultCuts->SetPtMin(0.15); | |
337 | break; | |
338 | case kSPDtracklets: | |
339 | if (fRefMultCuts) break; | |
340 | fRefMultCuts = new AliFlowTrackCuts(); | |
341 | fRefMultCuts->SetParamType(AliFlowTrackCuts::kESD_SPDtracklet); | |
342 | fRefMultCuts->SetEtaRange(-0.8,0.8); | |
343 | break; | |
344 | case kV0: | |
345 | if (!esdevent) return 0; | |
346 | vzero=esdevent->GetVZEROData(); | |
347 | if (!vzero) return 0; | |
348 | refmult = TMath::Nint(vzero->GetMTotV0A()+vzero->GetMTotV0C()); | |
349 | return refmult; | |
350 | case kSPD1clusters: | |
351 | if (!mult) return 0; | |
352 | refmult = mult->GetNumberOfITSClusters(1); | |
353 | return refmult; | |
354 | default: | |
355 | return 0; | |
9a0783cc | 356 | } |
357 | ||
7d9ab4fb | 358 | fRefMultCuts->SetEvent(event); |
2948ac5a | 359 | for (Int_t i=0; i<fRefMultCuts->GetNumberOfInputObjects(); i++) |
360 | { | |
361 | if (fRefMultCuts->IsSelected(fRefMultCuts->GetInputObject(i),i)) | |
362 | refmult++; | |
363 | } | |
364 | return refmult; | |
333ce021 | 365 | } |