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