ROOT logo
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. */
/* See cxx source for full Copyright notice */
/* $Id$ */

// AliFlowEventCuts:
// An event cut class
// origin: Mikolaj Krzewicki (mikolaj.krzewicki@cern.ch)

#ifndef ALIFLOWEVENTCUTS_H
#define ALIFLOWEVENTCUTS_H

#include <float.h>
#include <limits.h>
#include "TNamed.h"

class AliVEvent;
class AliMCEvent;
class TBrowser;
#include "TList.h"
#include "TH1.h"
#include "AliTriggerAnalysis.h"
#include "AliFlowTrackCuts.h"
#include "AliFlowEventSimpleCuts.h"

class AliFlowEventCuts : public AliFlowEventSimpleCuts {

 public:
  enum refMultMethod { kTPConly, kSPDtracklets, kVZERO, kV0=kVZERO, kSPD1clusters };

  AliFlowEventCuts();
  AliFlowEventCuts(const char* name, const char* title = "AliFlowEventCuts");
  AliFlowEventCuts(const AliFlowEventCuts& someCuts);
  AliFlowEventCuts& operator=(const AliFlowEventCuts& someCuts);
  virtual  ~AliFlowEventCuts();
   
  virtual Bool_t IsSelected(TObject* obj, TObject *objmc);

  Bool_t PassesCuts(AliVEvent* event, AliMCEvent *mcevent);
  
  static AliFlowEventCuts* StandardCuts();
  
  void SetNumberOfTracksMax(Int_t value) {fNumberOfTracksMax=value;fCutNumberOfTracks=kTRUE;}
  void SetNumberOfTracksMin(Int_t value) {fNumberOfTracksMin=value;fCutNumberOfTracks=kTRUE;}
  void SetNumberOfTracksRange(Int_t min, Int_t max) {fNumberOfTracksMin=min;fNumberOfTracksMax=max;fCutNumberOfTracks=kTRUE;}
  void SetRefMultMax(Int_t value) {fRefMultMax=value;fCutRefMult=kTRUE;}
  void SetRefMultMin(Int_t value) {fRefMultMin=value;fCutRefMult=kTRUE;}
  void SetRefMultRange(Int_t min, Int_t max) {fRefMultMin=min;fRefMultMax=max;fCutRefMult=kTRUE;}
  void SetImpactParameterMax(Double_t value) {fImpactParameterMax=value;fCutImpactParameter=kTRUE;}
  void SetImpactParameterMin(Double_t value) {fImpactParameterMin=value;fCutImpactParameter=kTRUE;}
  void SetImpactParameterRange(Double_t min, Double_t max) {fImpactParameterMin=min;fImpactParameterMax=max;fCutImpactParameter=kTRUE;}
  void SetPrimaryVertexXrange(Double_t min, Double_t max)
       {fCutPrimaryVertexX=kTRUE; fPrimaryVertexXmin=min; fPrimaryVertexXmax=max;}
  void SetPrimaryVertexYrange(Double_t min, Double_t max)
       {fCutPrimaryVertexY=kTRUE; fPrimaryVertexYmin=min; fPrimaryVertexYmax=max;}
  void SetPrimaryVertexZrange(Double_t min, Double_t max)
       {fCutPrimaryVertexZ=kTRUE; fPrimaryVertexZmin=min; fPrimaryVertexZmax=max;}
  void SetNContributorsRange(Int_t min, Int_t max=INT_MAX) 
       {fCutNContributors=kTRUE; fNContributorsMin=min; fNContributorsMax=max;}
  void SetMeanPtRange(Double_t min, Double_t max) {fCutMeanPt=kTRUE; fMeanPtMax=max; fMeanPtMin=min;}
  void SetCutSPDvertexerAnomaly(Bool_t b=kTRUE) {fCutSPDvertexerAnomaly=b;}
  void SetCutZDCtiming(Bool_t c=kTRUE) {fCutZDCtiming=c;}
  void SetCutSPDTRKVtxZ(Bool_t b=kTRUE) {fCutSPDTRKVtxZ=b;}
  void SetCutTPCmultiplicityOutliers(Bool_t b=kTRUE) {fCutTPCmultiplicityOutliers=b;}  
  void SetCutTPCmultiplicityOutliersAOD(Bool_t b=kTRUE) {fCutTPCmultiplicityOutliersAOD=b;}

  Int_t GetNumberOfTracksMax() const {return fNumberOfTracksMax;}
  Int_t GetNumberOfTracksMin() const {return fNumberOfTracksMin;}
  Int_t GetRefMultMax() const {return fRefMultMax;}
  Int_t GetRefMultMin() const {return fRefMultMin;}
  void SetRefMultMethod(refMultMethod m) {fRefMultMethod=m;}
  void SetRefMultMethod(AliESDtrackCuts::MultEstTrackType m) { fRefMultMethodAliESDtrackCuts=m; 
                                                               fUseAliESDtrackCutsRefMult=kTRUE; }
  refMultMethod GetRefMultMethod() const {return fRefMultMethod;}
  void SetRefMultCuts( AliFlowTrackCuts* cuts ) {fRefMultCuts=static_cast<AliFlowTrackCuts*>(cuts->Clone());}
  void SetMeanPtCuts( AliFlowTrackCuts* cuts ) {fMeanPtCuts=static_cast<AliFlowTrackCuts*>(cuts->Clone());}
  AliFlowTrackCuts* GetRefMultCuts() const {return fRefMultCuts;}
  void DefineHistograms();
  void SetQA(Bool_t b=kTRUE) {if (b) DefineHistograms();}
  TList* GetQA() const {return fQA;}
  TH1* QAbefore(Int_t i) {return static_cast<TH1*>(static_cast<TList*>(fQA->At(0))->At(i));}
  TH1* QAafter(Int_t i) {return static_cast<TH1*>(static_cast<TList*>(fQA->At(1))->At(i));}

  Int_t RefMult(AliVEvent* event, AliMCEvent *mcEvent = 0x0);
  //Int_t GetRefMult() {return fRefMult;}
  Int_t GetReferenceMultiplicity(AliVEvent* event, AliMCEvent *mcEvent) {return RefMult(event,mcEvent);}
  const char* CentrMethName(refMultMethod method) const;
  void SetCentralityPercentileMethod( refMultMethod m) {fCentralityPercentileMethod=m;}
  void SetUseCentralityUnchecked(Bool_t b=kTRUE) {fUseCentralityUnchecked=b;}

  Float_t GetCentrality(AliVEvent* event, AliMCEvent* mcEvent);
  void SetUsedDataset(Bool_t b=kTRUE) {fData2011=b;}    // confusing name, better use different interface
  void SetLHC10h(Bool_t b=kTRUE) {fData2011=(!b);}      // TODO let cut object determine runnumber and period
  void SetLHC11h(Bool_t b=kTRUE) {fData2011=b;}         // use this only as 'manual override'
  

  void Browse(TBrowser* b);
  Long64_t Merge(TCollection* list);  
  TH2F *GetCorrelationTPCvsGlobalMultiplicity() {return fhistTPCvsGlobalMult;}  


 private:
  TList* fQA; //QA
  Bool_t fCutNumberOfTracks;//cut on # of tracks
  Int_t fNumberOfTracksMax;  //limits
  Int_t fNumberOfTracksMin;  //limits
  Bool_t fCutRefMult; //cut on refmult
  refMultMethod fRefMultMethod; //how do we calculate refmult?
  Bool_t fUseAliESDtrackCutsRefMult; //use AliESDtrackCuts for refmult calculation
  AliESDtrackCuts::MultEstTrackType fRefMultMethodAliESDtrackCuts;
  Int_t fRefMultMax; //max refmult
  Int_t fRefMultMin; //min refmult
  AliFlowTrackCuts* fRefMultCuts; //cuts
  AliFlowTrackCuts* fMeanPtCuts; //mean pt cuts
  AliFlowTrackCuts* fStandardTPCcuts; //Standard TPC cuts
  AliFlowTrackCuts* fStandardGlobalCuts; //StandardGlobalCuts
  Bool_t fCutPrimaryVertexX; //cut on x of prim vtx
  Double_t fPrimaryVertexXmax; //max x prim vtx
  Double_t fPrimaryVertexXmin; //min x prim vtx
  Bool_t fCutPrimaryVertexY; //cut on y of prim vtx
  Double_t fPrimaryVertexYmax; //max y prim vtx
  Double_t fPrimaryVertexYmin; //min y prim vtx
  Bool_t fCutPrimaryVertexZ; //cut on z of prim vtx
  Double_t fPrimaryVertexZmax; //max z prim vtx
  Double_t fPrimaryVertexZmin; //min z prim vtx
  Bool_t fCutNContributors; //cut on number of contributors
  Int_t fNContributorsMax; //maximal number of contrib
  Int_t fNContributorsMin; //minimal number of contrib
  Bool_t fCutMeanPt; //cut on mean pt
  Double_t fMeanPtMax; //max mean pt
  Double_t fMeanPtMin; //min mean pt
  Bool_t fCutSPDvertexerAnomaly; //cut on the spd vertexer anomaly
  Bool_t fCutSPDTRKVtxZ; //require compatibility between SPDvertexz TRKvertexz
  Bool_t fCutTPCmultiplicityOutliers; //cut TPC multiplicity outliers
  Bool_t fCutTPCmultiplicityOutliersAOD; // cut TPC outliers in 10h or 11h aod
  Bool_t fUseCentralityUnchecked; //use the unchecked method
  refMultMethod fCentralityPercentileMethod; //where to get the percentile from
  Bool_t fCutZDCtiming;   //cut on ZDC timing
  AliTriggerAnalysis fTrigAna; //trigger analysis object
  Bool_t fCutImpactParameter; //cut on impact parameter (MC header)
  Double_t fImpactParameterMin; // min impact parameter
  Double_t fImpactParameterMax; // max impact parameter
  TH2F *fhistTPCvsGlobalMult; //!correlation between TPCMult and GlobalMult
  Bool_t fData2011; //2011 data is used

  ClassDef(AliFlowEventCuts,6)
};

#endif


 AliFlowEventCuts.h:1
 AliFlowEventCuts.h:2
 AliFlowEventCuts.h:3
 AliFlowEventCuts.h:4
 AliFlowEventCuts.h:5
 AliFlowEventCuts.h:6
 AliFlowEventCuts.h:7
 AliFlowEventCuts.h:8
 AliFlowEventCuts.h:9
 AliFlowEventCuts.h:10
 AliFlowEventCuts.h:11
 AliFlowEventCuts.h:12
 AliFlowEventCuts.h:13
 AliFlowEventCuts.h:14
 AliFlowEventCuts.h:15
 AliFlowEventCuts.h:16
 AliFlowEventCuts.h:17
 AliFlowEventCuts.h:18
 AliFlowEventCuts.h:19
 AliFlowEventCuts.h:20
 AliFlowEventCuts.h:21
 AliFlowEventCuts.h:22
 AliFlowEventCuts.h:23
 AliFlowEventCuts.h:24
 AliFlowEventCuts.h:25
 AliFlowEventCuts.h:26
 AliFlowEventCuts.h:27
 AliFlowEventCuts.h:28
 AliFlowEventCuts.h:29
 AliFlowEventCuts.h:30
 AliFlowEventCuts.h:31
 AliFlowEventCuts.h:32
 AliFlowEventCuts.h:33
 AliFlowEventCuts.h:34
 AliFlowEventCuts.h:35
 AliFlowEventCuts.h:36
 AliFlowEventCuts.h:37
 AliFlowEventCuts.h:38
 AliFlowEventCuts.h:39
 AliFlowEventCuts.h:40
 AliFlowEventCuts.h:41
 AliFlowEventCuts.h:42
 AliFlowEventCuts.h:43
 AliFlowEventCuts.h:44
 AliFlowEventCuts.h:45
 AliFlowEventCuts.h:46
 AliFlowEventCuts.h:47
 AliFlowEventCuts.h:48
 AliFlowEventCuts.h:49
 AliFlowEventCuts.h:50
 AliFlowEventCuts.h:51
 AliFlowEventCuts.h:52
 AliFlowEventCuts.h:53
 AliFlowEventCuts.h:54
 AliFlowEventCuts.h:55
 AliFlowEventCuts.h:56
 AliFlowEventCuts.h:57
 AliFlowEventCuts.h:58
 AliFlowEventCuts.h:59
 AliFlowEventCuts.h:60
 AliFlowEventCuts.h:61
 AliFlowEventCuts.h:62
 AliFlowEventCuts.h:63
 AliFlowEventCuts.h:64
 AliFlowEventCuts.h:65
 AliFlowEventCuts.h:66
 AliFlowEventCuts.h:67
 AliFlowEventCuts.h:68
 AliFlowEventCuts.h:69
 AliFlowEventCuts.h:70
 AliFlowEventCuts.h:71
 AliFlowEventCuts.h:72
 AliFlowEventCuts.h:73
 AliFlowEventCuts.h:74
 AliFlowEventCuts.h:75
 AliFlowEventCuts.h:76
 AliFlowEventCuts.h:77
 AliFlowEventCuts.h:78
 AliFlowEventCuts.h:79
 AliFlowEventCuts.h:80
 AliFlowEventCuts.h:81
 AliFlowEventCuts.h:82
 AliFlowEventCuts.h:83
 AliFlowEventCuts.h:84
 AliFlowEventCuts.h:85
 AliFlowEventCuts.h:86
 AliFlowEventCuts.h:87
 AliFlowEventCuts.h:88
 AliFlowEventCuts.h:89
 AliFlowEventCuts.h:90
 AliFlowEventCuts.h:91
 AliFlowEventCuts.h:92
 AliFlowEventCuts.h:93
 AliFlowEventCuts.h:94
 AliFlowEventCuts.h:95
 AliFlowEventCuts.h:96
 AliFlowEventCuts.h:97
 AliFlowEventCuts.h:98
 AliFlowEventCuts.h:99
 AliFlowEventCuts.h:100
 AliFlowEventCuts.h:101
 AliFlowEventCuts.h:102
 AliFlowEventCuts.h:103
 AliFlowEventCuts.h:104
 AliFlowEventCuts.h:105
 AliFlowEventCuts.h:106
 AliFlowEventCuts.h:107
 AliFlowEventCuts.h:108
 AliFlowEventCuts.h:109
 AliFlowEventCuts.h:110
 AliFlowEventCuts.h:111
 AliFlowEventCuts.h:112
 AliFlowEventCuts.h:113
 AliFlowEventCuts.h:114
 AliFlowEventCuts.h:115
 AliFlowEventCuts.h:116
 AliFlowEventCuts.h:117
 AliFlowEventCuts.h:118
 AliFlowEventCuts.h:119
 AliFlowEventCuts.h:120
 AliFlowEventCuts.h:121
 AliFlowEventCuts.h:122
 AliFlowEventCuts.h:123
 AliFlowEventCuts.h:124
 AliFlowEventCuts.h:125
 AliFlowEventCuts.h:126
 AliFlowEventCuts.h:127
 AliFlowEventCuts.h:128
 AliFlowEventCuts.h:129
 AliFlowEventCuts.h:130
 AliFlowEventCuts.h:131
 AliFlowEventCuts.h:132
 AliFlowEventCuts.h:133
 AliFlowEventCuts.h:134
 AliFlowEventCuts.h:135
 AliFlowEventCuts.h:136
 AliFlowEventCuts.h:137
 AliFlowEventCuts.h:138
 AliFlowEventCuts.h:139
 AliFlowEventCuts.h:140
 AliFlowEventCuts.h:141
 AliFlowEventCuts.h:142
 AliFlowEventCuts.h:143
 AliFlowEventCuts.h:144
 AliFlowEventCuts.h:145
 AliFlowEventCuts.h:146
 AliFlowEventCuts.h:147
 AliFlowEventCuts.h:148
 AliFlowEventCuts.h:149
 AliFlowEventCuts.h:150