]>
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), |
441ea1cf | 67 | fCutSPDvertexerAnomaly(kFALSE), |
7d9ab4fb | 68 | fCutCentralityPercentile(kFALSE), |
69 | fCentralityPercentileMethod(kTPConly), | |
70 | fCentralityPercentileMax(100.), | |
e7b9ed1d | 71 | fCentralityPercentileMin(0.), |
441ea1cf | 72 | fCutZDCtiming(kFALSE), |
e7b9ed1d | 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.), |
441ea1cf | 110 | fCutZDCtiming(kFALSE), |
e7b9ed1d | 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); |
441ea1cf | 213 | if (fCutCentralityPercentile&&esdevent) |
7d9ab4fb | 214 | { |
215 | AliESDCentrality* centr = esdevent->GetCentrality(); | |
e7b9ed1d | 216 | if (!centr->IsEventInCentralityClass( fCentralityPercentileMin, |
217 | fCentralityPercentileMax, | |
218 | CentrMethName(fCentralityPercentileMethod) )) | |
441ea1cf | 219 | { |
e7b9ed1d | 220 | return kFALSE; |
441ea1cf | 221 | } |
7d9ab4fb | 222 | } |
223 | if (fCutSPDvertexerAnomaly&&esdevent) | |
224 | { | |
225 | const AliESDVertex* sdpvertex = esdevent->GetPrimaryVertexSPD(); | |
226 | if (sdpvertex->GetNContributors()<1) return kFALSE; | |
227 | if (sdpvertex->GetDispersion()>0.04) return kFALSE; | |
228 | if (sdpvertex->GetZRes()>0.25) return kFALSE; | |
229 | const AliESDVertex* tpcvertex = esdevent->GetPrimaryVertexTPC(); | |
230 | if (tpcvertex->GetNContributors()<1) return kFALSE; | |
231 | const AliMultiplicity* tracklets = esdevent->GetMultiplicity(); | |
232 | if (tpcvertex->GetNContributors()<(-10.0+0.25*tracklets->GetNumberOfITSClusters(0))) | |
441ea1cf | 233 | { |
7d9ab4fb | 234 | return kFALSE; |
441ea1cf | 235 | } |
7d9ab4fb | 236 | } |
441ea1cf | 237 | if (fCutZDCtiming&&esdevent) |
e7b9ed1d | 238 | { |
441ea1cf | 239 | if (!fTrigAna.ZDCTimeTrigger(esdevent)) |
240 | { | |
241 | return kFALSE; | |
242 | } | |
e7b9ed1d | 243 | } |
7d9ab4fb | 244 | if(fCutNumberOfTracks) {if ( event->GetNumberOfTracks() < fNumberOfTracksMin || |
245 | event->GetNumberOfTracks() >= fNumberOfTracksMax ) return kFALSE;} | |
441ea1cf | 246 | if(fCutRefMult&&esdevent) |
5559ce24 | 247 | { |
248 | //reference multiplicity still to be defined | |
03d364db | 249 | Double_t refMult = RefMult(event); |
250 | if (refMult < fRefMultMin || refMult >= fRefMultMax ) | |
441ea1cf | 251 | { |
5559ce24 | 252 | return kFALSE; |
441ea1cf | 253 | } |
5559ce24 | 254 | } |
ee242db3 | 255 | const AliVVertex* pvtx=event->GetPrimaryVertex(); |
256 | Double_t pvtxx = pvtx->GetX(); | |
257 | Double_t pvtxy = pvtx->GetY(); | |
258 | Double_t pvtxz = pvtx->GetZ(); | |
259 | Int_t ncontrib = pvtx->GetNContributors(); | |
260 | if (fCutNContributors) | |
261 | { | |
262 | if (ncontrib < fNContributorsMin || ncontrib >= fNContributorsMax) | |
263 | return kFALSE; | |
264 | } | |
265 | if (fCutPrimaryVertexX) | |
266 | { | |
267 | if (pvtxx < fPrimaryVertexXmin || pvtxx >= fPrimaryVertexXmax) | |
268 | return kFALSE; | |
269 | } | |
270 | if (fCutPrimaryVertexY) | |
271 | { | |
272 | if (pvtxy < fPrimaryVertexYmin || pvtxy >= fPrimaryVertexYmax) | |
273 | return kFALSE; | |
274 | } | |
275 | if (fCutPrimaryVertexZ) | |
276 | { | |
277 | if (pvtxz < fPrimaryVertexZmin || pvtxz >= fPrimaryVertexZmax) | |
278 | return kFALSE; | |
279 | } | |
d32716f4 | 280 | if (fCutMeanPt) |
281 | { | |
282 | Float_t meanpt=0.0; | |
283 | Int_t ntracks=event->GetNumberOfTracks(); | |
f33c7420 | 284 | Int_t nselected=0; |
d32716f4 | 285 | for (Int_t i=0; i<ntracks; i++) |
286 | { | |
287 | AliVParticle* track = event->GetTrack(i); | |
288 | if (!track) continue; | |
2279052e | 289 | Bool_t pass=kTRUE; |
290 | if (fMeanPtCuts) pass=fMeanPtCuts->IsSelected(track); | |
f33c7420 | 291 | if (pass) |
292 | { | |
293 | meanpt += track->Pt(); | |
294 | nselected++; | |
295 | } | |
d32716f4 | 296 | } |
f33c7420 | 297 | meanpt=meanpt/nselected; |
d32716f4 | 298 | if (meanpt<fMeanPtMin || meanpt >= fMeanPtMax) return kFALSE; |
299 | } | |
daf66719 | 300 | return kTRUE; |
301 | } | |
302 | ||
7d9ab4fb | 303 | //----------------------------------------------------------------------- |
304 | const char* AliFlowEventCuts::CentrMethName(refMultMethod method) const | |
305 | { | |
306 | //get the string for refmultmethod, for use with AliESDCentrality in | |
307 | //the cut on centrality percentile | |
308 | switch (method) | |
309 | { | |
310 | case kSPDtracklets: | |
311 | return "TKL"; | |
312 | case kSPD1clusters: | |
313 | return "CL1"; | |
314 | case kTPConly: | |
315 | return "TRK"; | |
316 | case kV0: | |
317 | return "V0M"; | |
318 | default: | |
319 | return ""; | |
320 | } | |
321 | } | |
daf66719 | 322 | //----------------------------------------------------------------------- |
323 | AliFlowEventCuts* AliFlowEventCuts::StandardCuts() | |
324 | { | |
325 | //make a set of standard event cuts, caller becomes owner | |
326 | AliFlowEventCuts* cuts = new AliFlowEventCuts(); | |
327 | return cuts; | |
328 | } | |
333ce021 | 329 | |
330 | //----------------------------------------------------------------------- | |
7d9ab4fb | 331 | Int_t AliFlowEventCuts::RefMult(AliVEvent* event) |
333ce021 | 332 | { |
9a0783cc | 333 | //calculate the reference multiplicity, if all fails return 0 |
1c4a5bf7 | 334 | AliESDVZERO* vzero = NULL; |
7d9ab4fb | 335 | AliESDEvent* esdevent = dynamic_cast<AliESDEvent*>(event); |
32b846cd | 336 | |
2a745a5f | 337 | if (fRefMultMethod==kTPConly && !fRefMultCuts) |
9a0783cc | 338 | { |
2a745a5f | 339 | fRefMultCuts = AliFlowTrackCuts::GetStandardTPCOnlyTrackCuts(); |
340 | fRefMultCuts->SetEtaRange(-0.8,0.8); | |
341 | fRefMultCuts->SetPtMin(0.15); | |
342 | } | |
343 | else if (fRefMultMethod==kSPDtracklets && !fRefMultCuts) | |
344 | { | |
345 | fRefMultCuts = new AliFlowTrackCuts("tracklet refmult cuts"); | |
346 | fRefMultCuts->SetParamType(AliFlowTrackCuts::kESD_SPDtracklet); | |
347 | fRefMultCuts->SetEtaRange(-0.8,0.8); | |
348 | } | |
349 | else if (fRefMultMethod==kV0) | |
350 | { | |
351 | if (!esdevent) return 0; | |
352 | vzero=esdevent->GetVZEROData(); | |
353 | if (!vzero) return 0; | |
354 | return TMath::Nint(vzero->GetMTotV0A()+vzero->GetMTotV0C()); | |
355 | } | |
356 | else if (fRefMultMethod==kSPD1clusters) | |
357 | { | |
358 | if (!esdevent) return 0; | |
359 | const AliMultiplicity* mult = esdevent->GetMultiplicity(); | |
360 | if (!mult) return 0; | |
361 | return mult->GetNumberOfITSClusters(1); | |
9a0783cc | 362 | } |
363 | ||
2a745a5f | 364 | Int_t refmult=0; |
7d9ab4fb | 365 | fRefMultCuts->SetEvent(event); |
2948ac5a | 366 | for (Int_t i=0; i<fRefMultCuts->GetNumberOfInputObjects(); i++) |
367 | { | |
368 | if (fRefMultCuts->IsSelected(fRefMultCuts->GetInputObject(i),i)) | |
369 | refmult++; | |
370 | } | |
371 | return refmult; | |
333ce021 | 372 | } |