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