]>
Commit | Line | Data |
---|---|---|
1 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
2 | * * | |
3 | * Author: The ALICE Off-line Project. * | |
4 | * Contributors are mentioned in the code where appropriate. * | |
5 | * * | |
6 | * Permission to use, copy, modify and distribute this software and its * | |
7 | * documentation strictly for non-commercial purposes is hereby granted * | |
8 | * without fee, provided that the above copyright notice appears in all * | |
9 | * copies and that both the copyright notice and this permission notice * | |
10 | * appear in the supporting documentation. The authors make no claims * | |
11 | * about the suitability of this software for any purpose. It is * | |
12 | * provided "as is" without express or implied warranty. * | |
13 | **************************************************************************/ | |
14 | ||
15 | /* $Id$ */ | |
16 | ||
17 | // AliFlowEventCuts: | |
18 | // An event cut class for the flow framework | |
19 | // | |
20 | // origin: Mikolaj Krzewicki (mikolaj.krzewicki@cern.ch) | |
21 | ||
22 | #include <limits.h> | |
23 | #include <float.h> | |
24 | #include <TList.h> | |
25 | #include <TH1F.h> | |
26 | #include <TH2F.h> | |
27 | #include <TBrowser.h> | |
28 | #include "TMath.h" | |
29 | #include "TNamed.h" | |
30 | #include "AliVVertex.h" | |
31 | #include "AliVEvent.h" | |
32 | #include "AliESDEvent.h" | |
33 | #include "AliAODEvent.h" | |
34 | #include "AliAODHeader.h" | |
35 | #include "AliCentrality.h" | |
36 | #include "AliESDVZERO.h" | |
37 | #include "AliMultiplicity.h" | |
38 | #include "AliMCEvent.h" | |
39 | #include "AliFlowEventCuts.h" | |
40 | #include "AliFlowTrackCuts.h" | |
41 | #include "AliTriggerAnalysis.h" | |
42 | #include "AliCollisionGeometry.h" | |
43 | #include "AliGenEventHeader.h" | |
44 | #include <iostream> | |
45 | using namespace std; | |
46 | ||
47 | ClassImp(AliFlowEventCuts) | |
48 | ||
49 | //----------------------------------------------------------------------- | |
50 | AliFlowEventCuts::AliFlowEventCuts(): | |
51 | AliFlowEventSimpleCuts(), | |
52 | fQA(NULL), | |
53 | fCutNumberOfTracks(kFALSE), | |
54 | fNumberOfTracksMax(INT_MAX), | |
55 | fNumberOfTracksMin(INT_MIN), | |
56 | fCutRefMult(kFALSE), | |
57 | fRefMultMethod(kTPConly), | |
58 | fUseAliESDtrackCutsRefMult(kFALSE), | |
59 | fRefMultMethodAliESDtrackCuts(AliESDtrackCuts::kTrackletsITSTPC), | |
60 | fRefMultMax(INT_MAX), | |
61 | fRefMultMin(INT_MIN), | |
62 | fRefMultCuts(NULL), | |
63 | fMeanPtCuts(NULL), | |
64 | fStandardTPCcuts(NULL), | |
65 | fStandardGlobalCuts(NULL), | |
66 | fCutPrimaryVertexX(kFALSE), | |
67 | fPrimaryVertexXmax(INT_MAX), | |
68 | fPrimaryVertexXmin(INT_MIN), | |
69 | fCutPrimaryVertexY(kFALSE), | |
70 | fPrimaryVertexYmax(INT_MAX), | |
71 | fPrimaryVertexYmin(INT_MIN), | |
72 | fCutPrimaryVertexZ(kFALSE), | |
73 | fPrimaryVertexZmax(INT_MAX), | |
74 | fPrimaryVertexZmin(INT_MIN), | |
75 | fCutNContributors(kFALSE), | |
76 | fNContributorsMax(INT_MAX), | |
77 | fNContributorsMin(INT_MIN), | |
78 | fCutMeanPt(kFALSE), | |
79 | fMeanPtMax(-DBL_MAX), | |
80 | fMeanPtMin(DBL_MAX), | |
81 | fCutSPDvertexerAnomaly(kFALSE), | |
82 | fCutSPDTRKVtxZ(kFALSE), | |
83 | fCutTPCmultiplicityOutliers(kFALSE), | |
84 | fUseCentralityUnchecked(kFALSE), | |
85 | fCentralityPercentileMethod(kTPConly), | |
86 | fCutZDCtiming(kFALSE), | |
87 | fTrigAna(), | |
88 | fCutImpactParameter(kFALSE), | |
89 | fImpactParameterMin(0.0), | |
90 | fImpactParameterMax(100.0), | |
91 | fhistTPCvsGlobalMult(0), | |
92 | fData2011(kFALSE) | |
93 | { | |
94 | //constructor | |
95 | } | |
96 | ||
97 | //----------------------------------------------------------------------- | |
98 | AliFlowEventCuts::AliFlowEventCuts(const char* name, const char* title): | |
99 | AliFlowEventSimpleCuts(name, title), | |
100 | fQA(NULL), | |
101 | fCutNumberOfTracks(kFALSE), | |
102 | fNumberOfTracksMax(INT_MAX), | |
103 | fNumberOfTracksMin(INT_MIN), | |
104 | fCutRefMult(kFALSE), | |
105 | fRefMultMethod(kTPConly), | |
106 | fUseAliESDtrackCutsRefMult(kFALSE), | |
107 | fRefMultMethodAliESDtrackCuts(AliESDtrackCuts::kTrackletsITSTPC), | |
108 | fRefMultMax(INT_MAX), | |
109 | fRefMultMin(INT_MIN), | |
110 | fRefMultCuts(NULL), | |
111 | fMeanPtCuts(NULL), | |
112 | fStandardTPCcuts(AliFlowTrackCuts::GetStandardTPCStandaloneTrackCuts2010()), | |
113 | fStandardGlobalCuts(AliFlowTrackCuts::GetStandardGlobalTrackCuts2010()), | |
114 | fCutPrimaryVertexX(kFALSE), | |
115 | fPrimaryVertexXmax(INT_MAX), | |
116 | fPrimaryVertexXmin(INT_MIN), | |
117 | fCutPrimaryVertexY(kFALSE), | |
118 | fPrimaryVertexYmax(INT_MAX), | |
119 | fPrimaryVertexYmin(INT_MIN), | |
120 | fCutPrimaryVertexZ(kFALSE), | |
121 | fPrimaryVertexZmax(INT_MAX), | |
122 | fPrimaryVertexZmin(INT_MIN), | |
123 | fCutNContributors(kFALSE), | |
124 | fNContributorsMax(INT_MAX), | |
125 | fNContributorsMin(INT_MIN), | |
126 | fCutMeanPt(kFALSE), | |
127 | fMeanPtMax(-DBL_MAX), | |
128 | fMeanPtMin(DBL_MAX), | |
129 | fCutSPDvertexerAnomaly(kFALSE), | |
130 | fCutSPDTRKVtxZ(kFALSE), | |
131 | fCutTPCmultiplicityOutliers(kFALSE), | |
132 | fUseCentralityUnchecked(kFALSE), | |
133 | fCentralityPercentileMethod(kTPConly), | |
134 | fCutZDCtiming(kFALSE), | |
135 | fTrigAna(), | |
136 | fCutImpactParameter(kFALSE), | |
137 | fImpactParameterMin(0.0), | |
138 | fImpactParameterMax(100.0), | |
139 | fhistTPCvsGlobalMult(0), | |
140 | fData2011(kFALSE) | |
141 | { | |
142 | //constructor | |
143 | } | |
144 | ||
145 | ////----------------------------------------------------------------------- | |
146 | AliFlowEventCuts::AliFlowEventCuts(const AliFlowEventCuts& that): | |
147 | AliFlowEventSimpleCuts(that), | |
148 | fQA(NULL), | |
149 | fCutNumberOfTracks(that.fCutNumberOfTracks), | |
150 | fNumberOfTracksMax(that.fNumberOfTracksMax), | |
151 | fNumberOfTracksMin(that.fNumberOfTracksMin), | |
152 | fCutRefMult(that.fCutRefMult), | |
153 | fRefMultMethod(that.fRefMultMethod), | |
154 | fUseAliESDtrackCutsRefMult(that.fUseAliESDtrackCutsRefMult), | |
155 | fRefMultMethodAliESDtrackCuts(that.fRefMultMethodAliESDtrackCuts), | |
156 | fRefMultMax(that.fRefMultMax), | |
157 | fRefMultMin(that.fRefMultMin), | |
158 | fRefMultCuts(NULL), | |
159 | fMeanPtCuts(NULL), | |
160 | fStandardTPCcuts(NULL), | |
161 | fStandardGlobalCuts(NULL), | |
162 | fCutPrimaryVertexX(that.fCutPrimaryVertexX), | |
163 | fPrimaryVertexXmax(that.fPrimaryVertexXmax), | |
164 | fPrimaryVertexXmin(that.fPrimaryVertexXmin), | |
165 | fCutPrimaryVertexY(that.fCutPrimaryVertexX), | |
166 | fPrimaryVertexYmax(that.fPrimaryVertexYmax), | |
167 | fPrimaryVertexYmin(that.fPrimaryVertexYmin), | |
168 | fCutPrimaryVertexZ(that.fCutPrimaryVertexX), | |
169 | fPrimaryVertexZmax(that.fPrimaryVertexZmax), | |
170 | fPrimaryVertexZmin(that.fPrimaryVertexZmin), | |
171 | fCutNContributors(that.fCutNContributors), | |
172 | fNContributorsMax(that.fNContributorsMax), | |
173 | fNContributorsMin(that.fNContributorsMin), | |
174 | fCutMeanPt(that.fCutMeanPt), | |
175 | fMeanPtMax(that.fMeanPtMax), | |
176 | fMeanPtMin(that.fMeanPtMin), | |
177 | fCutSPDvertexerAnomaly(that.fCutSPDvertexerAnomaly), | |
178 | fCutSPDTRKVtxZ(that.fCutSPDTRKVtxZ), | |
179 | fCutTPCmultiplicityOutliers(that.fCutTPCmultiplicityOutliers), | |
180 | fUseCentralityUnchecked(that.fUseCentralityUnchecked), | |
181 | fCentralityPercentileMethod(that.fCentralityPercentileMethod), | |
182 | fCutZDCtiming(that.fCutZDCtiming), | |
183 | fTrigAna(), | |
184 | fCutImpactParameter(that.fCutImpactParameter), | |
185 | fImpactParameterMin(that.fImpactParameterMin), | |
186 | fImpactParameterMax(that.fImpactParameterMax), | |
187 | fhistTPCvsGlobalMult(that.fhistTPCvsGlobalMult), | |
188 | fData2011(that.fData2011) | |
189 | { | |
190 | if (that.fQA) DefineHistograms(); | |
191 | //copy constructor | |
192 | if (that.fRefMultCuts) | |
193 | fRefMultCuts = new AliFlowTrackCuts(*(that.fRefMultCuts)); | |
194 | if (that.fMeanPtCuts) | |
195 | fMeanPtCuts = new AliFlowTrackCuts(*(that.fMeanPtCuts)); | |
196 | fStandardTPCcuts = AliFlowTrackCuts::GetStandardTPCStandaloneTrackCuts2010(); | |
197 | fStandardGlobalCuts = AliFlowTrackCuts::GetStandardGlobalTrackCuts2010(); | |
198 | } | |
199 | ||
200 | ////----------------------------------------------------------------------- | |
201 | AliFlowEventCuts::~AliFlowEventCuts() | |
202 | { | |
203 | //dtor | |
204 | delete fMeanPtCuts; | |
205 | delete fRefMultCuts; | |
206 | delete fStandardGlobalCuts; | |
207 | delete fStandardTPCcuts; | |
208 | if (fQA) { fQA->SetOwner(); fQA->Delete(); delete fQA; } | |
209 | } | |
210 | ||
211 | ////----------------------------------------------------------------------- | |
212 | AliFlowEventCuts& AliFlowEventCuts::operator=(const AliFlowEventCuts& that) | |
213 | { | |
214 | //assignment | |
215 | if (this==&that) return *this; | |
216 | ||
217 | if (that.fQA) | |
218 | { | |
219 | if (fQA) | |
220 | { | |
221 | fQA->Delete(); | |
222 | delete fQA; | |
223 | } | |
224 | fQA = static_cast<TList*>(that.fQA->Clone()); | |
225 | } | |
226 | else | |
227 | { | |
228 | fQA->Delete(); | |
229 | delete fQA; | |
230 | fQA=NULL; | |
231 | } | |
232 | ||
233 | fCutNumberOfTracks=that.fCutNumberOfTracks; | |
234 | fNumberOfTracksMax=that.fNumberOfTracksMax; | |
235 | fNumberOfTracksMin=that.fNumberOfTracksMin; | |
236 | fCutRefMult=that.fCutRefMult; | |
237 | fRefMultMethod=that.fRefMultMethod; | |
238 | fUseAliESDtrackCutsRefMult=that.fUseAliESDtrackCutsRefMult; | |
239 | fRefMultMethodAliESDtrackCuts=that.fRefMultMethodAliESDtrackCuts; | |
240 | fRefMultMax=that.fRefMultMax; | |
241 | fRefMultMin=that.fRefMultMin; | |
242 | if (that.fRefMultCuts) *fRefMultCuts=*(that.fRefMultCuts); | |
243 | if (that.fMeanPtCuts) *fMeanPtCuts=*(that.fMeanPtCuts); | |
244 | fStandardTPCcuts = AliFlowTrackCuts::GetStandardTPCStandaloneTrackCuts2010(); | |
245 | fStandardGlobalCuts = AliFlowTrackCuts::GetStandardGlobalTrackCuts2010(); | |
246 | fCutPrimaryVertexX=that.fCutPrimaryVertexX; | |
247 | fPrimaryVertexXmax=that.fPrimaryVertexXmax; | |
248 | fPrimaryVertexXmin=that.fPrimaryVertexXmin; | |
249 | fCutPrimaryVertexY=that.fCutPrimaryVertexY; | |
250 | fPrimaryVertexYmax=that.fPrimaryVertexYmax; | |
251 | fPrimaryVertexYmin=that.fPrimaryVertexYmin; | |
252 | fCutPrimaryVertexZ=that.fCutPrimaryVertexZ; | |
253 | fPrimaryVertexZmax=that.fPrimaryVertexZmax; | |
254 | fPrimaryVertexZmin=that.fPrimaryVertexZmin; | |
255 | fCutNContributors=that.fCutNContributors; | |
256 | fNContributorsMax=that.fNContributorsMax; | |
257 | fNContributorsMin=that.fNContributorsMin; | |
258 | fCutMeanPt=that.fCutMeanPt; | |
259 | fMeanPtMax=that.fMeanPtMax; | |
260 | fMeanPtMin=that.fMeanPtMin; | |
261 | fCutSPDvertexerAnomaly=that.fCutSPDvertexerAnomaly; | |
262 | fCutSPDTRKVtxZ=that.fCutSPDTRKVtxZ; | |
263 | fCutTPCmultiplicityOutliers=that.fCutTPCmultiplicityOutliers; | |
264 | fUseCentralityUnchecked=that.fUseCentralityUnchecked; | |
265 | fCentralityPercentileMethod=that.fCentralityPercentileMethod; | |
266 | fCutZDCtiming=that.fCutZDCtiming; | |
267 | fhistTPCvsGlobalMult=that.fhistTPCvsGlobalMult; | |
268 | fData2011=that.fData2011; | |
269 | return *this; | |
270 | } | |
271 | ||
272 | //----------------------------------------------------------------------- | |
273 | Bool_t AliFlowEventCuts::IsSelected(TObject* obj, TObject* objmc) | |
274 | { | |
275 | //check cuts | |
276 | AliVEvent* vevent = dynamic_cast<AliVEvent*>(obj); | |
277 | AliMCEvent* mcevent = dynamic_cast<AliMCEvent*>(objmc); | |
278 | if (vevent) return PassesCuts(vevent,mcevent);; | |
279 | return kFALSE; //when passed wrong type of object | |
280 | } | |
281 | //----------------------------------------------------------------------- | |
282 | Bool_t AliFlowEventCuts::PassesCuts(AliVEvent *event, AliMCEvent *mcevent) | |
283 | { | |
284 | ///check if event passes cuts | |
285 | const AliVVertex* pvtx=event->GetPrimaryVertex(); | |
286 | Double_t pvtxx = pvtx->GetX(); | |
287 | Double_t pvtxy = pvtx->GetY(); | |
288 | Double_t pvtxz = pvtx->GetZ(); | |
289 | Int_t ncontrib = pvtx->GetNContributors(); | |
290 | Bool_t pass=kTRUE; | |
291 | AliESDEvent* esdevent = dynamic_cast<AliESDEvent*>(event); | |
292 | AliAODEvent* aodevent = dynamic_cast<AliAODEvent*>(event); | |
293 | Int_t multTPC = 0; | |
294 | Int_t multGlobal = 0; | |
295 | multTPC = fStandardTPCcuts->Count(event); | |
296 | multGlobal = fStandardGlobalCuts->Count(event); | |
297 | if (fQA) | |
298 | { | |
299 | QAbefore(0)->Fill(pvtxz); | |
300 | QAbefore(1)->Fill(multGlobal,multTPC); | |
301 | } | |
302 | if ( (fCutTPCmultiplicityOutliers && esdevent) || (fCutTPCmultiplicityOutliers && aodevent) ) | |
303 | { | |
304 | //this is pretty slow as we check the event track by track twice | |
305 | //this cut will work for 2010 PbPb data and is dependent on | |
306 | //TPC and ITS reco efficiency (e.g. geometry, calibration etc) | |
307 | if(esdevent){ | |
308 | if (multTPC > ( 23+1.216*multGlobal)) {pass=kFALSE;} | |
309 | if (multTPC < (-20+1.087*multGlobal)) {pass=kFALSE;} | |
310 | } | |
311 | ||
312 | /* commenting conflicting code, fix is pending | |
313 | if(aodevent && fData2011){ | |
314 | if (multTPC > ( 62.87+1.78*multGlobal)) {pass=kFALSE;} | |
315 | if (multTPC < (-36.73+1.48*multGlobal)) {pass=kFALSE;} | |
316 | } | |
317 | if(aodevent && !fData2011){ | |
318 | if (multTPC > ( 32.1+1.59*multGlobal)) {pass=kFALSE;} | |
319 | if (multTPC < (-40.3+1.22*multGlobal)) {pass=kFALSE;} | |
320 | } | |
321 | */ | |
322 | } | |
323 | if (fCutNContributors) | |
324 | { | |
325 | if (ncontrib < fNContributorsMin || ncontrib >= fNContributorsMax) pass=kFALSE; | |
326 | } | |
327 | if (fCutPrimaryVertexX) | |
328 | { | |
329 | if (pvtxx < fPrimaryVertexXmin || pvtxx >= fPrimaryVertexXmax) pass=kFALSE; | |
330 | } | |
331 | if (fCutPrimaryVertexY) | |
332 | { | |
333 | if (pvtxy < fPrimaryVertexYmin || pvtxy >= fPrimaryVertexYmax) pass=kFALSE; | |
334 | } | |
335 | if (fCutPrimaryVertexZ) | |
336 | { | |
337 | if (pvtxz < fPrimaryVertexZmin || pvtxz >= fPrimaryVertexZmax) | |
338 | pass=kFALSE; | |
339 | } | |
340 | if (fCutCentralityPercentile&&esdevent) | |
341 | { | |
342 | AliCentrality* centr = esdevent->GetCentrality(); | |
343 | if (fUseCentralityUnchecked) | |
344 | { | |
345 | if (!centr->IsEventInCentralityClassUnchecked( fCentralityPercentileMin, | |
346 | fCentralityPercentileMax, | |
347 | CentrMethName(fCentralityPercentileMethod) )) | |
348 | { | |
349 | pass=kFALSE; | |
350 | } | |
351 | } | |
352 | else | |
353 | { | |
354 | if (!centr->IsEventInCentralityClass( fCentralityPercentileMin, | |
355 | fCentralityPercentileMax, | |
356 | CentrMethName(fCentralityPercentileMethod) )) | |
357 | { | |
358 | pass=kFALSE; | |
359 | } | |
360 | } | |
361 | } | |
362 | if (fCutSPDvertexerAnomaly&&esdevent) | |
363 | { | |
364 | const AliESDVertex* sdpvertex = esdevent->GetPrimaryVertexSPD(); | |
365 | if (sdpvertex->GetNContributors()<1) pass=kFALSE; | |
366 | if (sdpvertex->GetDispersion()>0.04) pass=kFALSE; | |
367 | if (sdpvertex->GetZRes()>0.25) pass=kFALSE; | |
368 | const AliESDVertex* tpcvertex = esdevent->GetPrimaryVertexTPC(); | |
369 | if (tpcvertex->GetNContributors()<1) pass=kFALSE; | |
370 | const AliMultiplicity* tracklets = esdevent->GetMultiplicity(); | |
371 | if (tpcvertex->GetNContributors()<(-10.0+0.25*tracklets->GetNumberOfITSClusters(0))) | |
372 | { | |
373 | pass=kFALSE; | |
374 | } | |
375 | } | |
376 | if (fCutZDCtiming&&esdevent) | |
377 | { | |
378 | if (!fTrigAna.ZDCTimeTrigger(esdevent)) | |
379 | { | |
380 | pass=kFALSE; | |
381 | } | |
382 | } | |
383 | if(fCutNumberOfTracks) {if ( event->GetNumberOfTracks() < fNumberOfTracksMin || | |
384 | event->GetNumberOfTracks() >= fNumberOfTracksMax ) pass=kFALSE;} | |
385 | if((fCutRefMult&&mcevent)||(fCutRefMult&&esdevent)) | |
386 | { | |
387 | //reference multiplicity still to be defined | |
388 | Double_t refMult = RefMult(event,mcevent); | |
389 | if (refMult < fRefMultMin || refMult >= fRefMultMax ) | |
390 | { | |
391 | pass=kFALSE; | |
392 | } | |
393 | } | |
394 | ||
395 | // Handles AOD event | |
396 | if(aodevent) { | |
397 | if(fCutSPDTRKVtxZ) { | |
398 | Double_t tVtxZ = aodevent->GetPrimaryVertex()->GetZ(); | |
399 | Double_t tSPDVtxZ = aodevent->GetPrimaryVertexSPD()->GetZ(); | |
400 | if( TMath::Abs(tVtxZ-tSPDVtxZ) > 0.5 ) pass = kFALSE; | |
401 | } | |
402 | AliCentrality* centr = aodevent->GetHeader()->GetCentralityP(); | |
403 | if(fCutTPCmultiplicityOutliers){ | |
404 | Double_t v0Centr = centr->GetCentralityPercentile("V0M"); | |
405 | Double_t trkCentr = centr->GetCentralityPercentile("TRK"); | |
406 | if(TMath::Abs(v0Centr-trkCentr) > 5) pass = kFALSE; | |
407 | } | |
408 | if (fCutCentralityPercentile) { | |
409 | if (fUseCentralityUnchecked) { | |
410 | if (!centr->IsEventInCentralityClassUnchecked( fCentralityPercentileMin, | |
411 | fCentralityPercentileMax, | |
412 | CentrMethName(fCentralityPercentileMethod) )) { | |
413 | pass = kFALSE; | |
414 | } | |
415 | } else { | |
416 | if (!centr->IsEventInCentralityClass( fCentralityPercentileMin, | |
417 | fCentralityPercentileMax, | |
418 | CentrMethName(fCentralityPercentileMethod) )) { | |
419 | pass = kFALSE; | |
420 | } | |
421 | } | |
422 | } | |
423 | } | |
424 | ||
425 | if (fCutMeanPt) | |
426 | { | |
427 | Float_t meanpt=0.0; | |
428 | Int_t ntracks=event->GetNumberOfTracks(); | |
429 | Int_t nselected=0; | |
430 | for (Int_t i=0; i<ntracks; i++) | |
431 | { | |
432 | AliVParticle* track = event->GetTrack(i); | |
433 | if (!track) continue; | |
434 | Bool_t localpass=kTRUE; | |
435 | if (fMeanPtCuts) localpass=fMeanPtCuts->IsSelected(track); | |
436 | if (localpass) | |
437 | { | |
438 | meanpt += track->Pt(); | |
439 | nselected++; | |
440 | } | |
441 | } | |
442 | if (nselected) meanpt=meanpt/nselected; | |
443 | if (meanpt<fMeanPtMin || meanpt >= fMeanPtMax) pass=kFALSE; | |
444 | } | |
445 | ||
446 | //impact parameter cut | |
447 | if(fCutImpactParameter) { | |
448 | Double_t gImpactParameter = 0.; | |
449 | if(mcevent) { | |
450 | AliCollisionGeometry* headerH = dynamic_cast<AliCollisionGeometry*>(dynamic_cast<AliMCEvent*>(mcevent)->GenEventHeader()); | |
451 | if(headerH) | |
452 | gImpactParameter = headerH->ImpactParameter(); | |
453 | } | |
454 | if ((gImpactParameter < fImpactParameterMin) || (gImpactParameter >= fImpactParameterMax )) | |
455 | pass=kFALSE; | |
456 | } | |
457 | ||
458 | if (fQA&&pass) | |
459 | { | |
460 | QAafter(1)->Fill(multGlobal,multTPC); | |
461 | QAafter(0)->Fill(pvtxz); | |
462 | } | |
463 | return pass; | |
464 | } | |
465 | ||
466 | //----------------------------------------------------------------------- | |
467 | Float_t AliFlowEventCuts::GetCentrality(AliVEvent* event, AliMCEvent* /*mcEvent*/) | |
468 | { | |
469 | //get the centrality percentile of the event | |
470 | AliESDEvent* esdEvent = dynamic_cast<AliESDEvent*>(event); | |
471 | AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(event); | |
472 | ||
473 | Float_t centrality=-1.; | |
474 | ||
475 | AliCentrality* centr = NULL; | |
476 | if (esdEvent) | |
477 | centr = esdEvent->GetCentrality(); | |
478 | if (aodEvent) | |
479 | centr = aodEvent->GetHeader()->GetCentralityP(); | |
480 | ||
481 | if (!centr) return -1.; | |
482 | ||
483 | if (fUseCentralityUnchecked) | |
484 | centrality=centr->GetCentralityPercentileUnchecked(CentrMethName(fCentralityPercentileMethod)); | |
485 | else | |
486 | centrality=centr->GetCentralityPercentile(CentrMethName(fCentralityPercentileMethod)); | |
487 | ||
488 | return centrality; | |
489 | } | |
490 | ||
491 | //----------------------------------------------------------------------- | |
492 | const char* AliFlowEventCuts::CentrMethName(refMultMethod method) const | |
493 | { | |
494 | //get the string for refmultmethod, for use with AliCentrality in | |
495 | //the cut on centrality percentile | |
496 | switch (method) | |
497 | { | |
498 | case kSPDtracklets: | |
499 | return "TKL"; | |
500 | case kSPD1clusters: | |
501 | return "CL1"; | |
502 | case kTPConly: | |
503 | return "TRK"; | |
504 | case kVZERO: | |
505 | return "V0M"; | |
506 | default: | |
507 | return ""; | |
508 | } | |
509 | } | |
510 | //----------------------------------------------------------------------- | |
511 | AliFlowEventCuts* AliFlowEventCuts::StandardCuts() | |
512 | { | |
513 | //make a set of standard event cuts, caller becomes owner | |
514 | AliFlowEventCuts* cuts = new AliFlowEventCuts(); | |
515 | return cuts; | |
516 | } | |
517 | ||
518 | //----------------------------------------------------------------------- | |
519 | Int_t AliFlowEventCuts::RefMult(AliVEvent* event, AliMCEvent *mcEvent) | |
520 | { | |
521 | //calculate the reference multiplicity, if all fails return 0 | |
522 | AliESDVZERO* vzero = NULL; | |
523 | AliESDEvent* esdevent = dynamic_cast<AliESDEvent*>(event); | |
524 | ||
525 | if (fUseAliESDtrackCutsRefMult && esdevent) | |
526 | { | |
527 | //use the standard ALICE reference multiplicity with the default eta range | |
528 | return AliESDtrackCuts::GetReferenceMultiplicity(esdevent, fRefMultMethodAliESDtrackCuts); | |
529 | } | |
530 | ||
531 | if (fRefMultMethod==kTPConly && !fRefMultCuts) | |
532 | { | |
533 | fRefMultCuts = AliFlowTrackCuts::GetStandardTPCStandaloneTrackCuts(); | |
534 | fRefMultCuts->SetEtaRange(-0.8,0.8); | |
535 | fRefMultCuts->SetPtMin(0.15); | |
536 | } | |
537 | else if (fRefMultMethod==kSPDtracklets && !fRefMultCuts) | |
538 | { | |
539 | fRefMultCuts = new AliFlowTrackCuts("tracklet refmult cuts"); | |
540 | fRefMultCuts->SetParamType(AliFlowTrackCuts::kSPDtracklet); | |
541 | fRefMultCuts->SetEtaRange(-0.8,0.8); | |
542 | } | |
543 | else if (fRefMultMethod==kVZERO) | |
544 | { | |
545 | if (!esdevent) return 0; | |
546 | vzero=esdevent->GetVZEROData(); | |
547 | if (!vzero) return 0; | |
548 | return TMath::Nint(vzero->GetMTotV0A()+vzero->GetMTotV0C()); | |
549 | } | |
550 | else if (fRefMultMethod==kSPD1clusters) | |
551 | { | |
552 | if (!esdevent) return 0; | |
553 | const AliMultiplicity* mult = esdevent->GetMultiplicity(); | |
554 | if (!mult) return 0; | |
555 | return mult->GetNumberOfITSClusters(1); | |
556 | } | |
557 | ||
558 | Int_t refmult=0; | |
559 | fRefMultCuts->SetEvent(event,mcEvent); | |
560 | Int_t numberOfInputObjects = fRefMultCuts->GetNumberOfInputObjects(); | |
561 | for (Int_t i=0; i<numberOfInputObjects; i++) { | |
562 | if (fRefMultCuts->IsSelected(fRefMultCuts->GetInputObject(i),i)) | |
563 | refmult++; | |
564 | } | |
565 | return refmult; | |
566 | } | |
567 | //_____________________________________________________________________________ | |
568 | void AliFlowEventCuts::DefineHistograms() | |
569 | { | |
570 | //define QA histos | |
571 | if (fQA) return; | |
572 | ||
573 | Bool_t adddirstatus = TH1::AddDirectoryStatus(); | |
574 | TH1::AddDirectory(kFALSE); | |
575 | fQA = new TList(); fQA->SetOwner(); | |
576 | fQA->SetName(Form("%s QA",GetName())); | |
577 | TList* before = new TList(); before->SetOwner(); | |
578 | before->SetName("before"); | |
579 | TList* after = new TList(); after->SetOwner(); | |
580 | after->SetName("after"); | |
581 | fQA->Add(before); | |
582 | fQA->Add(after); | |
583 | before->Add(new TH1F("zvertex",";z;event cout",500,-15.,15.)); //0 | |
584 | after->Add(new TH1F("zvertex",";z;event cout",500,-15.,15.)); //0 | |
585 | before->Add(new TH2F("fTPCvsGlobalMult","TPC only vs Global track multiplicity;global;TPC only",500,0,2500,500,0,3500));//1 | |
586 | after->Add(new TH2F("fTPCvsGlobalMult","TPC only vs Global track multiplicity;global;TPC only",500,0,2500,500,0,3500));//1 | |
587 | TH1::AddDirectory(adddirstatus); | |
588 | } | |
589 | ||
590 | //---------------------------------------------------------------// | |
591 | void AliFlowEventCuts::Browse(TBrowser* b) | |
592 | { | |
593 | //some browsing capabilities | |
594 | if (fQA) b->Add(fQA); | |
595 | } | |
596 | ||
597 | //---------------------------------------------------------------// | |
598 | Long64_t AliFlowEventCuts::Merge(TCollection* list) | |
599 | { | |
600 | //merge | |
601 | Int_t number=0; | |
602 | AliFlowEventCuts* obj; | |
603 | if (!list) return 0; | |
604 | if (list->GetEntries()<1) return 0; | |
605 | TIter next(list); | |
606 | while ( (obj = dynamic_cast<AliFlowEventCuts*>(next())) ) | |
607 | { | |
608 | if (obj==this) continue; | |
609 | TList listwrapper; | |
610 | listwrapper.Add(obj->GetQA()); | |
611 | fQA->Merge(&listwrapper); | |
612 | number++; | |
613 | } | |
614 | return number; | |
615 | } | |
616 | ||
617 |