Resolving the symbols in each library
[u/mrichter/AliRoot.git] / ANALYSIS / ANALYSISalice / AliAnalysisUtils.h
1 #ifndef ALIANALYSISUTILS_H
2 #define ALIANALYSISUTILS_H
3
4 ////////////////////////////////////////////////////////////////////
5 //                                                                           //
6 // Class with functions useful for different analyses                      //
7 // - vertex selection                                                       //
8 //    * 2013 pA default cuts                                             //
9 // - identification of the fist event of the chunk                         //
10 // - identification pileup events                                           //
11 //                                                                          //
12 ///////////////////////////////////////////////////////////////////
13
14 #include "TObject.h"
15
16 class AliVEvent;
17 class AliVVertex;
18 class AliPPVsMultUtils;
19
20 class AliAnalysisUtils : public TObject {
21
22  public:
23
24   AliAnalysisUtils();
25   virtual ~AliAnalysisUtils(){};
26   
27   Bool_t IsVertexSelected2013pA(AliVEvent *event);
28   Bool_t IsFirstEventInChunk(AliVEvent *event);
29   
30   Bool_t IsPileUpEvent(AliVEvent *event); //to be used in the analysis
31   Bool_t IsPileUpMV(AliVEvent *event); //MV pileup selection implemented here
32   Bool_t IsPileUpSPD(AliVEvent *event); //this calls IsPileUpFromSPD
33   Bool_t IsOutOfBunchPileUp(AliVEvent *event); //out-of-bunch pileup rejection using trigger information
34   Bool_t IsSPDClusterVsTrackletBG(AliVEvent *event); // background rejection with cluster-vs-tracklet cut
35   
36   Double_t GetWDist(const AliVVertex* v0, const AliVVertex* v1);
37   
38   void SetMinVtxContr(Int_t contr=1) {fMinVtxContr=contr;}
39   void SetMaxVtxZ(Float_t z=1e6) {fMaxVtxZ=z;}
40   void SetCutOnZVertexSPD(Bool_t iscut=true) { fCutOnZVertexSPD = iscut; }
41   
42   //general pileup selection settings
43   void SetUseMVPlpSelection(Bool_t useMVPlpSelection) { fUseMVPlpSelection = useMVPlpSelection;}
44   void SetUseOutOfBunchPileUp(Bool_t useOutOfBunchPileUp) { fUseOutOfBunchPileUp = useOutOfBunchPileUp;}
45   
46   //Multi Vertex pileup selection
47   void SetMinPlpContribMV(Int_t minPlpContribMV) { fMinPlpContribMV = minPlpContribMV;}
48   void SetMaxPlpChi2MV(Float_t maxPlpChi2MV) { fMaxPlpChi2MV = maxPlpChi2MV;}
49   void SetMinWDistMV(Float_t minWDistMV) { fMinWDistMV = minWDistMV;}
50   void SetCheckPlpFromDifferentBCMV(Bool_t checkPlpFromDifferentBCMV) { fCheckPlpFromDifferentBCMV = checkPlpFromDifferentBCMV;}
51   //SPD Pileup slection
52   void SetMinPlpContribSPD(Int_t minPlpContribSPD) { fMinPlpContribSPD = minPlpContribSPD;}
53   void SetMinPlpZdistSPD(Float_t minPlpZdistSPD) { fMinPlpZdistSPD = minPlpZdistSPD;}
54   void SetnSigmaPlpZdistSPD(Float_t nSigmaPlpZdistSPD) { fnSigmaPlpZdistSPD = nSigmaPlpZdistSPD;}
55   void SetnSigmaPlpDiamXYSPD(Float_t nSigmaPlpDiamXYSPD) { fnSigmaPlpDiamXYSPD = nSigmaPlpDiamXYSPD;}
56   void SetnSigmaPlpDiamZSPD(Float_t nSigmaPlpDiamZSPD) { fnSigmaPlpDiamZSPD = nSigmaPlpDiamZSPD;}
57   void SetUseSPDCutInMultBins(Bool_t useSPDCutInMultBins) { fUseSPDCutInMultBins = useSPDCutInMultBins;}
58   
59   // SPD cluster-vs-tracklet cut
60   void SetASPDCvsTCut(Float_t a) { fASPDCvsTCut = a; }
61   void SetBSPDCvsTCut(Float_t b) { fBSPDCvsTCut = b; }
62   
63   //multiplicity selection in pp
64   Float_t GetMultiplicityPercentile(AliVEvent *event, TString lMethod = "V0M");
65     
66  private:
67   
68   Bool_t fisAOD; // flag for AOD:1 or ESD:0
69   
70   Int_t fMinVtxContr; // minimum vertex contributors
71   Float_t fMaxVtxZ;   // maximum |z| of primary vertex
72   
73   Bool_t fCutOnZVertexSPD; // 0: no cut, 1: |zvtx-SPD - zvtx-TPC|<0.5cm
74   
75   Bool_t  fUseMVPlpSelection; //switch between SPD and MV pileup
76   Bool_t  fUseOutOfBunchPileUp; //BC information from the trigger is used to tag out-of-bunch pileup
77   
78   Int_t    fMinPlpContribMV; //minimum contributors to the pilup vertices, multi-vertex
79   Float_t  fMaxPlpChi2MV; //minimum value of Chi2perNDF of the pileup vertex, multi-vertex
80   Float_t  fMinWDistMV; //minimum of the sqrt of weighted distance between the primary and the pilup vertex, multi-vertex
81   Bool_t  fCheckPlpFromDifferentBCMV; //pileup from different BC (Bunch Crossings)
82   
83   Int_t    fMinPlpContribSPD; //minimum contributors to the pilup vertices, SPD
84   Float_t  fMinPlpZdistSPD;  //minimum distance for the SPD pileup vertex
85   Float_t  fnSigmaPlpZdistSPD;  //cut on Z for SPD pileup
86   Float_t  fnSigmaPlpDiamXYSPD;  //cut on nsigma diamond XY for SPD pileup
87   Float_t  fnSigmaPlpDiamZSPD;  //cut on nsigma diamond Z for SPD pileup
88   Bool_t  fUseSPDCutInMultBins;  //use IsPileupFromSPDInMultBins instead of IsPileupFromSPD
89   
90   Float_t fASPDCvsTCut; // constant for the linear cut in SPD clusters vs tracklets
91   Float_t fBSPDCvsTCut; // slope for the linear cut in SPD  clusters vs tracklets
92   
93   AliPPVsMultUtils *fPPVsMultUtils; //! multiplicity selection in pp
94
95   AliAnalysisUtils(const AliAnalysisUtils& obj); // copy constructor
96   AliAnalysisUtils& operator=(const AliAnalysisUtils& other); // assignment
97     
98   ClassDef(AliAnalysisUtils,3) // base helper class
99 };
100 #endif
101