]>
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; |
8f861a97 | 264 | fUseCentralityUnchecked=that.fUseCentralityUnchecked; |
7d9ab4fb | 265 | fCentralityPercentileMethod=that.fCentralityPercentileMethod; |
cdc20344 | 266 | fCutZDCtiming=that.fCutZDCtiming; |
97c3cecc | 267 | fhistTPCvsGlobalMult=that.fhistTPCvsGlobalMult; |
268 | fData2011=that.fData2011; | |
03d364db | 269 | return *this; |
270 | } | |
daf66719 | 271 | |
272 | //----------------------------------------------------------------------- | |
e821bc8b | 273 | Bool_t AliFlowEventCuts::IsSelected(TObject* obj, TObject* objmc) |
daf66719 | 274 | { |
275 | //check cuts | |
7d9ab4fb | 276 | AliVEvent* vevent = dynamic_cast<AliVEvent*>(obj); |
e821bc8b | 277 | AliMCEvent* mcevent = dynamic_cast<AliMCEvent*>(objmc); |
278 | if (vevent) return PassesCuts(vevent,mcevent);; | |
daf66719 | 279 | return kFALSE; //when passed wrong type of object |
280 | } | |
281 | //----------------------------------------------------------------------- | |
e821bc8b | 282 | Bool_t AliFlowEventCuts::PassesCuts(AliVEvent *event, AliMCEvent *mcevent) |
daf66719 | 283 | { |
284 | ///check if event passes cuts | |
cd62a2a8 | 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(); | |
a14b8f3c | 290 | Bool_t pass=kTRUE; |
7d9ab4fb | 291 | AliESDEvent* esdevent = dynamic_cast<AliESDEvent*>(event); |
60875c3c | 292 | AliAODEvent* aodevent = dynamic_cast<AliAODEvent*>(event); |
a14b8f3c | 293 | Int_t multTPC = 0; |
294 | Int_t multGlobal = 0; | |
97c3cecc | 295 | multTPC = fStandardTPCcuts->Count(event); |
296 | multGlobal = fStandardGlobalCuts->Count(event); | |
a14b8f3c | 297 | if (fQA) |
298 | { | |
cd62a2a8 | 299 | QAbefore(0)->Fill(pvtxz); |
a14b8f3c | 300 | QAbefore(1)->Fill(multGlobal,multTPC); |
301 | } | |
97c3cecc | 302 | if ( (fCutTPCmultiplicityOutliers && esdevent) || (fCutTPCmultiplicityOutliers && aodevent) ) |
a14b8f3c | 303 | { |
a14b8f3c | 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) | |
97c3cecc | 307 | if(esdevent){ |
308 | if (multTPC > ( 23+1.216*multGlobal)) {pass=kFALSE;} | |
309 | if (multTPC < (-20+1.087*multGlobal)) {pass=kFALSE;} | |
a14b8f3c | 310 | } |
cbeb2c2c | 311 | |
312 | /* commenting conflicting code, fix is pending | |
97c3cecc | 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 | } | |
f4429386 | 317 | if(aodevent && !fData2011){ |
97c3cecc | 318 | if (multTPC > ( 32.1+1.59*multGlobal)) {pass=kFALSE;} |
319 | if (multTPC < (-40.3+1.22*multGlobal)) {pass=kFALSE;} | |
320 | } | |
dbffa593 | 321 | */ |
a14b8f3c | 322 | } |
a14b8f3c | 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 | } | |
a14b8f3c | 335 | if (fCutPrimaryVertexZ) |
336 | { | |
a14b8f3c | 337 | if (pvtxz < fPrimaryVertexZmin || pvtxz >= fPrimaryVertexZmax) |
a14b8f3c | 338 | pass=kFALSE; |
a14b8f3c | 339 | } |
441ea1cf | 340 | if (fCutCentralityPercentile&&esdevent) |
7d9ab4fb | 341 | { |
23b09634 | 342 | AliCentrality* centr = esdevent->GetCentrality(); |
8f861a97 | 343 | if (fUseCentralityUnchecked) |
441ea1cf | 344 | { |
8f861a97 | 345 | if (!centr->IsEventInCentralityClassUnchecked( fCentralityPercentileMin, |
346 | fCentralityPercentileMax, | |
347 | CentrMethName(fCentralityPercentileMethod) )) | |
348 | { | |
cd62a2a8 | 349 | pass=kFALSE; |
8f861a97 | 350 | } |
351 | } | |
352 | else | |
353 | { | |
354 | if (!centr->IsEventInCentralityClass( fCentralityPercentileMin, | |
355 | fCentralityPercentileMax, | |
356 | CentrMethName(fCentralityPercentileMethod) )) | |
357 | { | |
cd62a2a8 | 358 | pass=kFALSE; |
8f861a97 | 359 | } |
441ea1cf | 360 | } |
7d9ab4fb | 361 | } |
362 | if (fCutSPDvertexerAnomaly&&esdevent) | |
363 | { | |
364 | const AliESDVertex* sdpvertex = esdevent->GetPrimaryVertexSPD(); | |
cd62a2a8 | 365 | if (sdpvertex->GetNContributors()<1) pass=kFALSE; |
366 | if (sdpvertex->GetDispersion()>0.04) pass=kFALSE; | |
367 | if (sdpvertex->GetZRes()>0.25) pass=kFALSE; | |
7d9ab4fb | 368 | const AliESDVertex* tpcvertex = esdevent->GetPrimaryVertexTPC(); |
cd62a2a8 | 369 | if (tpcvertex->GetNContributors()<1) pass=kFALSE; |
7d9ab4fb | 370 | const AliMultiplicity* tracklets = esdevent->GetMultiplicity(); |
371 | if (tpcvertex->GetNContributors()<(-10.0+0.25*tracklets->GetNumberOfITSClusters(0))) | |
441ea1cf | 372 | { |
cd62a2a8 | 373 | pass=kFALSE; |
441ea1cf | 374 | } |
7d9ab4fb | 375 | } |
441ea1cf | 376 | if (fCutZDCtiming&&esdevent) |
e7b9ed1d | 377 | { |
441ea1cf | 378 | if (!fTrigAna.ZDCTimeTrigger(esdevent)) |
379 | { | |
cd62a2a8 | 380 | pass=kFALSE; |
441ea1cf | 381 | } |
e7b9ed1d | 382 | } |
7d9ab4fb | 383 | if(fCutNumberOfTracks) {if ( event->GetNumberOfTracks() < fNumberOfTracksMin || |
cd62a2a8 | 384 | event->GetNumberOfTracks() >= fNumberOfTracksMax ) pass=kFALSE;} |
e821bc8b | 385 | if((fCutRefMult&&mcevent)||(fCutRefMult&&esdevent)) |
5559ce24 | 386 | { |
387 | //reference multiplicity still to be defined | |
e821bc8b | 388 | Double_t refMult = RefMult(event,mcevent); |
03d364db | 389 | if (refMult < fRefMultMin || refMult >= fRefMultMax ) |
441ea1cf | 390 | { |
cd62a2a8 | 391 | pass=kFALSE; |
441ea1cf | 392 | } |
5559ce24 | 393 | } |
60875c3c | 394 | |
395 | // Handles AOD event | |
396 | if(aodevent) { | |
392bb597 | 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 | } | |
35de36b0 | 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 | } | |
60875c3c | 408 | if (fCutCentralityPercentile) { |
60875c3c | 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 | ||
d32716f4 | 425 | if (fCutMeanPt) |
426 | { | |
427 | Float_t meanpt=0.0; | |
428 | Int_t ntracks=event->GetNumberOfTracks(); | |
f33c7420 | 429 | Int_t nselected=0; |
d32716f4 | 430 | for (Int_t i=0; i<ntracks; i++) |
431 | { | |
432 | AliVParticle* track = event->GetTrack(i); | |
433 | if (!track) continue; | |
a14b8f3c | 434 | Bool_t localpass=kTRUE; |
435 | if (fMeanPtCuts) localpass=fMeanPtCuts->IsSelected(track); | |
436 | if (localpass) | |
f33c7420 | 437 | { |
438 | meanpt += track->Pt(); | |
439 | nselected++; | |
440 | } | |
d32716f4 | 441 | } |
2047680a | 442 | if (nselected) meanpt=meanpt/nselected; |
cd62a2a8 | 443 | if (meanpt<fMeanPtMin || meanpt >= fMeanPtMax) pass=kFALSE; |
444 | } | |
e821bc8b | 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 | ||
cd62a2a8 | 458 | if (fQA&&pass) |
459 | { | |
460 | QAafter(1)->Fill(multGlobal,multTPC); | |
461 | QAafter(0)->Fill(pvtxz); | |
d32716f4 | 462 | } |
a14b8f3c | 463 | return pass; |
daf66719 | 464 | } |
465 | ||
8fa6a5fa MK |
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 | ||
7d9ab4fb | 491 | //----------------------------------------------------------------------- |
492 | const char* AliFlowEventCuts::CentrMethName(refMultMethod method) const | |
493 | { | |
23b09634 | 494 | //get the string for refmultmethod, for use with AliCentrality in |
7d9ab4fb | 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"; | |
8fa6a5fa | 504 | case kVZERO: |
7d9ab4fb | 505 | return "V0M"; |
506 | default: | |
507 | return ""; | |
508 | } | |
509 | } | |
daf66719 | 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 | } | |
333ce021 | 517 | |
518 | //----------------------------------------------------------------------- | |
4aae2a93 | 519 | Int_t AliFlowEventCuts::RefMult(AliVEvent* event, AliMCEvent *mcEvent) |
333ce021 | 520 | { |
9a0783cc | 521 | //calculate the reference multiplicity, if all fails return 0 |
1c4a5bf7 | 522 | AliESDVZERO* vzero = NULL; |
7d9ab4fb | 523 | AliESDEvent* esdevent = dynamic_cast<AliESDEvent*>(event); |
32b846cd | 524 | |
0249320d | 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 | ||
2a745a5f | 531 | if (fRefMultMethod==kTPConly && !fRefMultCuts) |
9a0783cc | 532 | { |
1a80f9f6 | 533 | fRefMultCuts = AliFlowTrackCuts::GetStandardTPCStandaloneTrackCuts(); |
2a745a5f | 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"); | |
1a80f9f6 | 540 | fRefMultCuts->SetParamType(AliFlowTrackCuts::kSPDtracklet); |
2a745a5f | 541 | fRefMultCuts->SetEtaRange(-0.8,0.8); |
542 | } | |
8fa6a5fa | 543 | else if (fRefMultMethod==kVZERO) |
2a745a5f | 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); | |
9a0783cc | 556 | } |
557 | ||
2a745a5f | 558 | Int_t refmult=0; |
4aae2a93 | 559 | fRefMultCuts->SetEvent(event,mcEvent); |
560 | Int_t numberOfInputObjects = fRefMultCuts->GetNumberOfInputObjects(); | |
561 | for (Int_t i=0; i<numberOfInputObjects; i++) { | |
2948ac5a | 562 | if (fRefMultCuts->IsSelected(fRefMultCuts->GetInputObject(i),i)) |
563 | refmult++; | |
564 | } | |
565 | return refmult; | |
333ce021 | 566 | } |
499fe731 | 567 | //_____________________________________________________________________________ |
568 | void AliFlowEventCuts::DefineHistograms() | |
569 | { | |
a14b8f3c | 570 | //define QA histos |
571 | if (fQA) return; | |
572 | ||
499fe731 | 573 | Bool_t adddirstatus = TH1::AddDirectoryStatus(); |
574 | TH1::AddDirectory(kFALSE); | |
a14b8f3c | 575 | fQA = new TList(); fQA->SetOwner(); |
499fe731 | 576 | fQA->SetName(Form("%s QA",GetName())); |
a14b8f3c | 577 | TList* before = new TList(); before->SetOwner(); |
499fe731 | 578 | before->SetName("before"); |
a14b8f3c | 579 | TList* after = new TList(); after->SetOwner(); |
499fe731 | 580 | after->SetName("after"); |
581 | fQA->Add(before); | |
582 | fQA->Add(after); | |
a14b8f3c | 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 | |
499fe731 | 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 | ||
97c3cecc | 617 |