AliPhysics  b7e5564 (b7e5564)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliFlowEventCuts.cxx
Go to the documentation of this file.
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 "AliMultSelection.h" // available from November 2015
37 #include "AliESDVZERO.h"
38 #include "AliMultiplicity.h"
39 #include "AliMCEvent.h"
40 #include "AliFlowEventCuts.h"
41 #include "AliFlowTrackCuts.h"
42 #include "AliTriggerAnalysis.h"
43 #include "AliCollisionGeometry.h"
44 #include "AliGenEventHeader.h"
45 #include "AliAnalysisUtils.h"
46 #include "AliMultSelection.h"
47 #include <iostream>
48 using namespace std;
49 
51 
52 //-----------------------------------------------------------------------
55  fQA(NULL),
56  fCutNumberOfTracks(kFALSE),
57  fNumberOfTracksMax(INT_MAX),
58  fNumberOfTracksMin(INT_MIN),
59  fCutRefMult(kFALSE),
60  fRefMultMethod(kTPConly),
61  fUseAliESDtrackCutsRefMult(kFALSE),
62  fRefMultMethodAliESDtrackCuts(AliESDtrackCuts::kTrackletsITSTPC),
63  fRefMultMax(INT_MAX),
64  fRefMultMin(INT_MIN),
65  fRefMultCuts(NULL),
66  fMeanPtCuts(NULL),
67  fStandardTPCcuts(NULL),
68  fStandardGlobalCuts(NULL),
69  fUtils(NULL),
70  fMultSelection(NULL),
71  fCutPrimaryVertexX(kFALSE),
72  fPrimaryVertexXmax(INT_MAX),
73  fPrimaryVertexXmin(INT_MIN),
74  fCutPrimaryVertexY(kFALSE),
75  fPrimaryVertexYmax(INT_MAX),
76  fPrimaryVertexYmin(INT_MIN),
77  fCutPrimaryVertexZ(kFALSE),
78  fPrimaryVertexZmax(INT_MAX),
79  fPrimaryVertexZmin(INT_MIN),
80  fCutNContributors(kFALSE),
81  fNContributorsMax(INT_MAX),
82  fNContributorsMin(INT_MIN),
83  fCutMeanPt(kFALSE),
84  fMeanPtMax(-DBL_MAX),
85  fMeanPtMin(DBL_MAX),
86  fCutSPDvertexerAnomaly(kFALSE),
87  fCutSPDTRKVtxZ(kFALSE),
88  fCutTPCmultiplicityOutliers(kFALSE),
89  fCutTPCmultiplicityOutliersAOD(kFALSE),
90  fUseCentralityUnchecked(kFALSE),
91  fCentralityPercentileMethod(kTPConly),
92  fCutZDCtiming(kFALSE),
93  fTrigAna(),
94  fCutImpactParameter(kFALSE),
95  fImpactParameterMin(0.0),
96  fImpactParameterMax(100.0),
97  fhistTPCvsGlobalMult(0),
98  fData2011(kFALSE),
99  fCheckPileUp(kFALSE)
100 {
101  //constructor
102 }
103 
104 //-----------------------------------------------------------------------
105 AliFlowEventCuts::AliFlowEventCuts(const char* name, const char* title):
106  AliFlowEventSimpleCuts(name, title),
107  fQA(NULL),
108  fCutNumberOfTracks(kFALSE),
109  fNumberOfTracksMax(INT_MAX),
110  fNumberOfTracksMin(INT_MIN),
111  fCutRefMult(kFALSE),
112  fRefMultMethod(kTPConly),
113  fUseAliESDtrackCutsRefMult(kFALSE),
114  fRefMultMethodAliESDtrackCuts(AliESDtrackCuts::kTrackletsITSTPC),
115  fRefMultMax(INT_MAX),
116  fRefMultMin(INT_MIN),
117  fRefMultCuts(NULL),
118  fMeanPtCuts(NULL),
119  fStandardTPCcuts(AliFlowTrackCuts::GetStandardTPCStandaloneTrackCuts2010()),
120  fStandardGlobalCuts(AliFlowTrackCuts::GetStandardGlobalTrackCuts2010()),
121  fUtils(NULL),
122  fMultSelection(NULL),
123  fCutPrimaryVertexX(kFALSE),
124  fPrimaryVertexXmax(INT_MAX),
125  fPrimaryVertexXmin(INT_MIN),
126  fCutPrimaryVertexY(kFALSE),
127  fPrimaryVertexYmax(INT_MAX),
128  fPrimaryVertexYmin(INT_MIN),
129  fCutPrimaryVertexZ(kFALSE),
130  fPrimaryVertexZmax(INT_MAX),
131  fPrimaryVertexZmin(INT_MIN),
132  fCutNContributors(kFALSE),
133  fNContributorsMax(INT_MAX),
134  fNContributorsMin(INT_MIN),
135  fCutMeanPt(kFALSE),
136  fMeanPtMax(-DBL_MAX),
137  fMeanPtMin(DBL_MAX),
138  fCutSPDvertexerAnomaly(kFALSE),
139  fCutSPDTRKVtxZ(kFALSE),
140  fCutTPCmultiplicityOutliers(kFALSE),
141  fCutTPCmultiplicityOutliersAOD(kFALSE),
142  fUseCentralityUnchecked(kFALSE),
143  fCentralityPercentileMethod(kTPConly),
144  fCutZDCtiming(kFALSE),
145  fTrigAna(),
146  fCutImpactParameter(kFALSE),
147  fImpactParameterMin(0.0),
148  fImpactParameterMax(100.0),
149  fhistTPCvsGlobalMult(0),
150  fData2011(kFALSE),
151  fCheckPileUp(kFALSE)
152 {
153  //constructor
154 }
155 
159  fQA(NULL),
160  fCutNumberOfTracks(that.fCutNumberOfTracks),
161  fNumberOfTracksMax(that.fNumberOfTracksMax),
162  fNumberOfTracksMin(that.fNumberOfTracksMin),
163  fCutRefMult(that.fCutRefMult),
164  fRefMultMethod(that.fRefMultMethod),
165  fUseAliESDtrackCutsRefMult(that.fUseAliESDtrackCutsRefMult),
166  fRefMultMethodAliESDtrackCuts(that.fRefMultMethodAliESDtrackCuts),
167  fRefMultMax(that.fRefMultMax),
168  fRefMultMin(that.fRefMultMin),
169  fRefMultCuts(NULL),
170  fMeanPtCuts(NULL),
171  fStandardTPCcuts(NULL),
172  fStandardGlobalCuts(NULL),
173  fUtils(NULL),
174  fMultSelection(NULL),
175  fCutPrimaryVertexX(that.fCutPrimaryVertexX),
176  fPrimaryVertexXmax(that.fPrimaryVertexXmax),
177  fPrimaryVertexXmin(that.fPrimaryVertexXmin),
178  fCutPrimaryVertexY(that.fCutPrimaryVertexX),
179  fPrimaryVertexYmax(that.fPrimaryVertexYmax),
180  fPrimaryVertexYmin(that.fPrimaryVertexYmin),
181  fCutPrimaryVertexZ(that.fCutPrimaryVertexX),
182  fPrimaryVertexZmax(that.fPrimaryVertexZmax),
183  fPrimaryVertexZmin(that.fPrimaryVertexZmin),
184  fCutNContributors(that.fCutNContributors),
185  fNContributorsMax(that.fNContributorsMax),
186  fNContributorsMin(that.fNContributorsMin),
187  fCutMeanPt(that.fCutMeanPt),
188  fMeanPtMax(that.fMeanPtMax),
189  fMeanPtMin(that.fMeanPtMin),
190  fCutSPDvertexerAnomaly(that.fCutSPDvertexerAnomaly),
191  fCutSPDTRKVtxZ(that.fCutSPDTRKVtxZ),
192  fCutTPCmultiplicityOutliers(that.fCutTPCmultiplicityOutliers),
193  fCutTPCmultiplicityOutliersAOD(that.fCutTPCmultiplicityOutliersAOD),
194  fUseCentralityUnchecked(that.fUseCentralityUnchecked),
195  fCentralityPercentileMethod(that.fCentralityPercentileMethod),
196  fCutZDCtiming(that.fCutZDCtiming),
197  fTrigAna(),
198  fCutImpactParameter(that.fCutImpactParameter),
199  fImpactParameterMin(that.fImpactParameterMin),
200  fImpactParameterMax(that.fImpactParameterMax),
201  fhistTPCvsGlobalMult(that.fhistTPCvsGlobalMult),
202  fData2011(that.fData2011),
203  fCheckPileUp(that.fCheckPileUp)
204 {
205  if (that.fQA) DefineHistograms();
206  //copy constructor
207  if (that.fRefMultCuts)
209  if (that.fMeanPtCuts)
213 
214  if (that.fUtils) {
215  fUtils = new AliAnalysisUtils();
216  fUtils->SetUseMVPlpSelection(kTRUE);
217  fUtils->SetUseOutOfBunchPileUp(kTRUE);
218  }
219 }
220 
223 {
224  //dtor
225  delete fMeanPtCuts;
226  delete fRefMultCuts;
227  delete fStandardGlobalCuts;
228  delete fStandardTPCcuts;
229  if(fUtils) {
230  delete fUtils;
231  fUtils = NULL;
232  }
233  if (fQA) { fQA->SetOwner(); fQA->Delete(); delete fQA; }
234 }
235 
238 {
239  //assignment
240  if (this==&that) return *this;
241 
242  if (that.fQA)
243  {
244  if (fQA)
245  {
246  fQA->Delete();
247  delete fQA;
248  }
249  fQA = static_cast<TList*>(that.fQA->Clone());
250  }
251  else
252  {
253  fQA->Delete();
254  delete fQA;
255  fQA=NULL;
256  }
257 
267  if (that.fRefMultCuts) *fRefMultCuts=*(that.fRefMultCuts);
268  if (that.fMeanPtCuts) *fMeanPtCuts=*(that.fMeanPtCuts);
271  if (that.fUtils) {
272  fUtils = new AliAnalysisUtils();
273  fUtils->SetUseMVPlpSelection(kTRUE);
274  fUtils->SetUseOutOfBunchPileUp(kTRUE);
275  }
276 
289  fCutMeanPt=that.fCutMeanPt;
290  fMeanPtMax=that.fMeanPtMax;
291  fMeanPtMin=that.fMeanPtMin;
300  fData2011=that.fData2011;
302  return *this;
303 }
304 
305 //-----------------------------------------------------------------------
306 Bool_t AliFlowEventCuts::IsSelected(TObject* obj, TObject* objmc)
307 {
308  //check cuts
309  AliVEvent* vevent = dynamic_cast<AliVEvent*>(obj);
310  AliMCEvent* mcevent = dynamic_cast<AliMCEvent*>(objmc);
311  if (vevent) return PassesCuts(vevent,mcevent);;
312  return kFALSE; //when passed wrong type of object
313 }
314 //-----------------------------------------------------------------------
315 Bool_t AliFlowEventCuts::PassesCuts(AliVEvent *event, AliMCEvent *mcevent)
316 {
318  const AliVVertex* pvtx=event->GetPrimaryVertex();
319  Double_t pvtxx = 0.;
320  Double_t pvtxy = 0.;
321  Double_t pvtxz = 0.;
322  Int_t ncontrib = 0;
323 
324  if(pvtx){
325  pvtxx = pvtx->GetX();
326  pvtxy = pvtx->GetY();
327  pvtxz = pvtx->GetZ();
328  ncontrib = pvtx->GetNContributors();
329  }
330 
331  Bool_t pass=kTRUE;
332  AliESDEvent* esdevent = dynamic_cast<AliESDEvent*>(event);
333  AliAODEvent* aodevent = dynamic_cast<AliAODEvent*>(event);
334 
335 
336  if(fCheckPileUp){
337  // pile-up rejection
338  if(!fUtils) {
339  fUtils = new AliAnalysisUtils();
340  fUtils->SetUseMVPlpSelection(kTRUE);
341  fUtils->SetUseOutOfBunchPileUp(kTRUE);
342  }
343  if(fUtils->IsPileUpEvent(aodevent)) pass = kFALSE;
344  }
345 
346 
347  Int_t multTPC = 0;
348  Int_t multGlobal = 0;
349 
350  // to remove multiplicity outliers, an explicit cut on the correlation
351  // between global and tpc only tracks can be made by counting the two
352  // sets. as counting is expensive, only count when qa is requested or cut is enabeled
353  // the cut criteria are different for different data takign periods
354  // and (of course) cut criteria, specific routines exist for 10h, 11h data
355  // and esds (by calling AliFlowTrackCuts) or aods (evaluated here explicitely)
356  if(esdevent && (fQA || fCutTPCmultiplicityOutliers))
357  {
358  //this is pretty slow as we check the event track by track twice
359  //this cut will work for 2010 PbPb data and is dependent on
360  //TPC and ITS reco efficiency (e.g. geometry, calibration etc)
361  multTPC = fStandardTPCcuts->Count(event);
362  multGlobal = fStandardGlobalCuts->Count(event);
364  if (multTPC > ( 23+1.216*multGlobal)) pass = kFALSE;
365  if (multTPC < (-20+1.087*multGlobal)) pass = kFALSE;
366  }
367  }
368  if(aodevent && (fQA || fCutTPCmultiplicityOutliersAOD))
369  {
370  //similar (slow) cut for aod's. will work for both 2010 and 2010 pbpb data
371  //but the user is responsible that this object is configured
372  //correctly to select the dataset
373  //FIXME data could dynamically be determined by this class via the
374  //runnumber
375  Int_t nTracks(aodevent->GetNumberOfTracks());
376  for(Int_t iTracks = 0; iTracks < nTracks; iTracks++) {
377  AliAODTrack* track = dynamic_cast<AliAODTrack*>(aodevent->GetTrack(iTracks));
378  if(!track) continue;
379  if (!track || track->Pt() < .2 || track->Pt() > 5.0 || TMath::Abs(track->Eta()) > .8 || track->GetTPCNcls() < 70 || !track->GetDetPid() || track->GetDetPid()->GetTPCsignal() < 10.0) continue; // general quality cut
380  if (track->TestFilterBit(1) && track->Chi2perNDF() > 0.2) multTPC++;
381  if (!track->TestFilterBit(16) || track->Chi2perNDF() < 0.1) continue;
382  Double_t b[2] = {-99., -99.};
383  Double_t bCov[3] = {-99., -99., -99.};
384  AliAODTrack copy(*track);
385  if (copy.PropagateToDCA(event->GetPrimaryVertex(), event->GetMagneticField(), 100., b, bCov) && TMath::Abs(b[0]) < 0.3 && TMath::Abs(b[1]) < 0.3) multGlobal++;
386  }
388  {
389  if(event->GetRunNumber() < 209122) {
390  if(!fData2011 && (multTPC < (-40.3+1.22*multGlobal) || multTPC > (32.1+1.59*multGlobal))) pass = kFALSE;
391  else if(fData2011 && (multTPC < (-36.73 + 1.48*multGlobal) || multTPC > (62.87 + 1.78*multGlobal))) pass = kFALSE;
392  } else {
393  if(multTPC < (-15.5+1.16*multGlobal) || multTPC > (15.8+1.28*multGlobal)) pass = kFALSE;
394  }
395  }
396  }
397 
398  if (fQA)
399  {
400  QAbefore(0)->Fill(pvtxz);
401  QAbefore(1)->Fill(multGlobal,multTPC);
402  }
403 
404  if (fCutNContributors)
405  {
406  if (ncontrib < fNContributorsMin || ncontrib >= fNContributorsMax) pass=kFALSE;
407  }
408  if (fCutPrimaryVertexX)
409  {
410  if (pvtxx < fPrimaryVertexXmin || pvtxx >= fPrimaryVertexXmax) pass=kFALSE;
411  }
412  if (fCutPrimaryVertexY)
413  {
414  if (pvtxy < fPrimaryVertexYmin || pvtxy >= fPrimaryVertexYmax) pass=kFALSE;
415  }
416  if (fCutPrimaryVertexZ)
417  {
418  if (pvtxz < fPrimaryVertexZmin || pvtxz >= fPrimaryVertexZmax)
419  pass=kFALSE;
420  }
421 
422  // Handles ESD event
423  if (fCutCentralityPercentile&&esdevent)
424  {
426  {
427  AliCentrality* centr = esdevent->GetCentrality();
429  {
430  if (!centr->IsEventInCentralityClassUnchecked( fCentralityPercentileMin,
433  {
434  pass=kFALSE;
435  }
436  }
437  else
438  {
439  if (!centr->IsEventInCentralityClass( fCentralityPercentileMin,
442  {
443  pass=kFALSE;
444  }
445  }
446  } // if(!fUseNewCentralityFramework)
447  else
448  {
449  fMultSelection = (AliMultSelection *) esdevent->FindListObject("MultSelection");
450  Float_t lPercentile = fMultSelection->GetMultiplicityPercentile(CentrMethName(fCentralityPercentileMethod));
451  if(!(fCentralityPercentileMin <= lPercentile && lPercentile < fCentralityPercentileMax))
452  {
453  pass=kFALSE;
454  }
455  } // else
456  }
457  if (fCutSPDvertexerAnomaly&&esdevent)
458  {
459  const AliESDVertex* sdpvertex = esdevent->GetPrimaryVertexSPD();
460  if (sdpvertex->GetNContributors()<1) pass=kFALSE;
461  if (sdpvertex->GetDispersion()>0.04) pass=kFALSE;
462  if (sdpvertex->GetZRes()>0.25) pass=kFALSE;
463  const AliESDVertex* tpcvertex = esdevent->GetPrimaryVertexTPC();
464  if (tpcvertex->GetNContributors()<1) pass=kFALSE;
465  const AliMultiplicity* tracklets = esdevent->GetMultiplicity();
466  if (tpcvertex->GetNContributors()<(-10.0+0.25*tracklets->GetNumberOfITSClusters(0)))
467  {
468  pass=kFALSE;
469  }
470  }
471  if (fCutZDCtiming&&esdevent)
472  {
473  if (!fTrigAna.ZDCTimeTrigger(esdevent))
474  {
475  pass=kFALSE;
476  }
477  }
478  if(fCutNumberOfTracks) {if ( event->GetNumberOfTracks() < fNumberOfTracksMin ||
479  event->GetNumberOfTracks() >= fNumberOfTracksMax ) pass=kFALSE;}
480  if((fCutRefMult&&mcevent)||(fCutRefMult&&esdevent))
481  {
482  //reference multiplicity still to be defined
483  Double_t refMult = RefMult(event,mcevent);
484  if (refMult < fRefMultMin || refMult >= fRefMultMax )
485  {
486  pass=kFALSE;
487  }
488  }
489 
490  // Handles AOD event
491  if(aodevent) {
492  if(fCutSPDTRKVtxZ) {
493  Double_t tVtxZ = aodevent->GetPrimaryVertex()->GetZ();
494  Double_t tSPDVtxZ = aodevent->GetPrimaryVertexSPD()->GetZ();
495  if( TMath::Abs(tVtxZ-tSPDVtxZ) > 0.5 ) pass = kFALSE;
496  }
498  AliCentrality* centr = ((AliVAODHeader*)aodevent->GetHeader())->GetCentralityP();
500  Double_t v0Centr = centr->GetCentralityPercentile("V0M");
501  Double_t trkCentr = centr->GetCentralityPercentile("TRK");
502  if(TMath::Abs(v0Centr-trkCentr) > 5) pass = kFALSE;
503  }
506  if (!centr->IsEventInCentralityClassUnchecked( fCentralityPercentileMin,
509  pass = kFALSE;
510  }
511  } else {
512  if (!centr->IsEventInCentralityClass( fCentralityPercentileMin,
515  pass = kFALSE;
516  }
517  }
518  }
519  }
520  else {
522  fMultSelection = (AliMultSelection *) aodevent->FindListObject("MultSelection");
523  Float_t lPercentile = fMultSelection->GetMultiplicityPercentile(CentrMethName(fCentralityPercentileMethod));
524  if(!fMultSelection){
525  AliWarning("AliMultSelection not found, did you Run AliMultSelectionTask? \n");
526  }
527  if(!(fCentralityPercentileMin <= lPercentile && lPercentile < fCentralityPercentileMax))
528  {
529  pass=kFALSE;
530  }
531  }
532  }
533  }
534 
535  if (fCutMeanPt)
536  {
537  Float_t meanpt=0.0;
538  Int_t ntracks=event->GetNumberOfTracks();
539  Int_t nselected=0;
540  for (Int_t i=0; i<ntracks; i++)
541  {
542  AliVParticle* track = event->GetTrack(i);
543  if (!track) continue;
544  Bool_t localpass=kTRUE;
545  if (fMeanPtCuts) localpass=fMeanPtCuts->IsSelected(track);
546  if (localpass)
547  {
548  meanpt += track->Pt();
549  nselected++;
550  }
551  }
552  if (nselected) meanpt=meanpt/nselected;
553  if (meanpt<fMeanPtMin || meanpt >= fMeanPtMax) pass=kFALSE;
554  }
555 
556  //impact parameter cut
557  if(fCutImpactParameter) {
558  Double_t gImpactParameter = 0.;
559  if(mcevent) {
560  AliCollisionGeometry* headerH = dynamic_cast<AliCollisionGeometry*>(dynamic_cast<AliMCEvent*>(mcevent)->GenEventHeader());
561  if(headerH)
562  gImpactParameter = headerH->ImpactParameter();
563  }
564  if ((gImpactParameter < fImpactParameterMin) || (gImpactParameter >= fImpactParameterMax ))
565  pass=kFALSE;
566  }
567 
568  if (fQA&&pass)
569  {
570  QAafter(1)->Fill(multGlobal,multTPC);
571  QAafter(0)->Fill(pvtxz);
572  }
573  return pass;
574 }
575 
576 //-----------------------------------------------------------------------
577 Float_t AliFlowEventCuts::GetCentrality(AliVEvent* event, AliMCEvent* /*mcEvent*/)
578 {
579  //get the centrality percentile of the event
580  AliESDEvent* esdEvent = dynamic_cast<AliESDEvent*>(event);
581  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(event);
582 
583  Float_t centrality=-1.;
584 
586  {
587  AliCentrality* centr = NULL;
588  if (esdEvent)
589  centr = esdEvent->GetCentrality();
590  if (aodEvent)
591  centr = ((AliVAODHeader*)aodEvent->GetHeader())->GetCentralityP();
592 
593  if (!centr) return -1.;
594 
596  centrality=centr->GetCentralityPercentileUnchecked(CentrMethName(fCentralityPercentileMethod));
597  else
598  centrality=centr->GetCentralityPercentile(CentrMethName(fCentralityPercentileMethod));
599  }
600  else // if(!fUseNewCentralityFramework)
601  {
602  if (esdEvent)
603  {
604  fMultSelection = (AliMultSelection *) esdEvent->FindListObject("MultSelection");
605  Float_t lPercentile = fMultSelection->GetMultiplicityPercentile(CentrMethName(fCentralityPercentileMethod));
606  centrality = lPercentile;
607  }
608  else if (aodEvent)
609  {
610  fMultSelection = (AliMultSelection *) aodEvent->FindListObject("MultSelection");
611  Float_t lPercentile = fMultSelection->GetMultiplicityPercentile(CentrMethName(fCentralityPercentileMethod));
612  if(!fMultSelection){
613  AliWarning("AliMultSelection not found, did you Run AliMultSelectionTask? \n");
614  }
615  centrality = lPercentile;
616  } // else if (aodEvent)
617  } // else // if(!fUseNewCentralityFramework)
618 
619  return centrality;
620 }
621 
622 //-----------------------------------------------------------------------
624 {
625  //get the string for refmultmethod, for use with AliCentrality in
626  //the cut on centrality percentile
627  switch (method)
628  {
629  case kSPDtracklets:
630  return "TKL";
631  case kSPD1clusters:
632  return "CL1";
633  case kTPConly:
634  return "TRK";
635  case kVZERO:
636  return "V0M";
637  case kZDC:
638  return "ZDC";
639  default:
640  return "";
641  }
642 }
643 //-----------------------------------------------------------------------
645 {
646  //make a set of standard event cuts, caller becomes owner
647  AliFlowEventCuts* cuts = new AliFlowEventCuts();
648  return cuts;
649 }
650 
651 //-----------------------------------------------------------------------
652 Int_t AliFlowEventCuts::RefMult(AliVEvent* event, AliMCEvent *mcEvent)
653 {
654  //calculate the reference multiplicity, if all fails return 0
655  AliESDVZERO* vzero = NULL;
656  AliESDEvent* esdevent = dynamic_cast<AliESDEvent*>(event);
657 
658  if (fUseAliESDtrackCutsRefMult && esdevent)
659  {
660  //use the standard ALICE reference multiplicity with the default eta range
661  return AliESDtrackCuts::GetReferenceMultiplicity(esdevent, fRefMultMethodAliESDtrackCuts);
662  }
663 
665  {
667  fRefMultCuts->SetEtaRange(-0.8,0.8);
668  fRefMultCuts->SetPtMin(0.15);
669  }
671  {
672  fRefMultCuts = new AliFlowTrackCuts("tracklet refmult cuts");
674  fRefMultCuts->SetEtaRange(-0.8,0.8);
675  }
676  else if (fRefMultMethod==kVZERO)
677  {
678  if (!esdevent) return 0;
679  vzero=esdevent->GetVZEROData();
680  if (!vzero) return 0;
681  return TMath::Nint(vzero->GetMTotV0A()+vzero->GetMTotV0C());
682  }
683  else if (fRefMultMethod==kSPD1clusters)
684  {
685  if (!esdevent) return 0;
686  const AliMultiplicity* mult = esdevent->GetMultiplicity();
687  if (!mult) return 0;
688  return mult->GetNumberOfITSClusters(1);
689  }
690 
691  Int_t refmult=0;
692  fRefMultCuts->SetEvent(event,mcEvent);
693  Int_t numberOfInputObjects = fRefMultCuts->GetNumberOfInputObjects();
694  for (Int_t i=0; i<numberOfInputObjects; i++) {
696  refmult++;
697  }
698  return refmult;
699 }
700 //_____________________________________________________________________________
702 {
703  //define QA histos
704  if (fQA) return;
705 
706  Bool_t adddirstatus = TH1::AddDirectoryStatus();
707  TH1::AddDirectory(kFALSE);
708  fQA = new TList(); fQA->SetOwner();
709  fQA->SetName(Form("%s QA",GetName()));
710  TList* before = new TList(); before->SetOwner();
711  before->SetName("before");
712  TList* after = new TList(); after->SetOwner();
713  after->SetName("after");
714  fQA->Add(before);
715  fQA->Add(after);
716  before->Add(new TH1F("zvertex",";z;event cout",500,-15.,15.)); //0
717  after->Add(new TH1F("zvertex",";z;event cout",500,-15.,15.)); //0
718  before->Add(new TH2F("fTPCvsGlobalMult","TPC only vs Global track multiplicity;global;TPC only",600,0,3000,600,0,4000));//1
719  after->Add(new TH2F("fTPCvsGlobalMult","TPC only vs Global track multiplicity;global;TPC only",600,0,3000,600,0,4000));//1
720  TH1::AddDirectory(adddirstatus);
721 }
722 
723 //---------------------------------------------------------------//
724 void AliFlowEventCuts::Browse(TBrowser* b)
725 {
726  //some browsing capabilities
727  if (fQA) b->Add(fQA);
728 }
729 
730 //---------------------------------------------------------------//
731 Long64_t AliFlowEventCuts::Merge(TCollection* list)
732 {
733  //merge
734  Int_t number=0;
735  AliFlowEventCuts* obj;
736  if (!list) return 0;
737  if (list->GetEntries()<1) return 0;
738  TIter next(list);
739  while ( (obj = dynamic_cast<AliFlowEventCuts*>(next())) )
740  {
741  if (obj==this) continue;
742  TList listwrapper;
743  listwrapper.Add(obj->GetQA());
744  fQA->Merge(&listwrapper);
745  number++;
746  }
747  return number;
748 }
749 
750 
Double_t fPrimaryVertexZmax
AliESDtrackCuts::MultEstTrackType fRefMultMethodAliESDtrackCuts
Float_t GetCentrality(AliVEvent *event, AliMCEvent *mcEvent)
Double_t fPrimaryVertexXmax
Bool_t fData2011
correlation between TPCMult and GlobalMult
TObject * GetInputObject(Int_t i)
const char * title
Definition: MakeQAPdf.C:26
Long64_t Merge(TCollection *list)
TH1 * QAbefore(Int_t i)
Bool_t fCutTPCmultiplicityOutliersAOD
static AliFlowTrackCuts * GetStandardGlobalTrackCuts2010()
AliFlowTrackCuts * fStandardTPCcuts
AliFlowTrackCuts * fMeanPtCuts
centrality
Double_t fPrimaryVertexYmin
Double_t fPrimaryVertexYmax
TList * list
TH1 * QAafter(Int_t i)
AliFlowEventCuts & operator=(const AliFlowEventCuts &someCuts)
Int_t Count(AliVEvent *event=NULL)
AliAnalysisUtils * fUtils
virtual Bool_t IsSelected(TObject *obj, Int_t id=-666)
void SetParamType(trackParameterType paramType)
const char * CentrMethName(refMultMethod method) const
refMultMethod fRefMultMethod
Bool_t PassesCuts(AliVEvent *event, AliMCEvent *mcevent)
Int_t GetNumberOfInputObjects() const
static AliFlowTrackCuts * GetStandardTPCStandaloneTrackCuts()
Int_t RefMult(AliVEvent *event, AliMCEvent *mcEvent=0x0)
static AliFlowTrackCuts * GetStandardTPCStandaloneTrackCuts2010()
ClassImp(AliFlowEventCuts) AliFlowEventCuts
refMultMethod fCentralityPercentileMethod
void Browse(TBrowser *b)
Bool_t fCutPrimaryVertexX
new centrality framework
AliTriggerAnalysis fTrigAna
Double_t fPrimaryVertexZmin
AliMultSelection * fMultSelection
analysis utils object
Bool_t fUseAliESDtrackCutsRefMult
Double_t fImpactParameterMax
void SetEvent(AliVEvent *event, AliMCEvent *mcEvent=NULL)
AliFlowTrackCuts * fStandardGlobalCuts
Bool_t fUseCentralityUnchecked
AliFlowTrackCuts * fRefMultCuts
TList * GetQA() const
static AliFlowEventCuts * StandardCuts()
Double_t fImpactParameterMin
Double_t fPrimaryVertexXmin
virtual Bool_t IsSelected(TObject *obj, TObject *objmc)
Bool_t fCutTPCmultiplicityOutliers
void SetEtaRange(Float_t r1, Float_t r2)