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