]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/AliAnalysisUtils.h
try to fix coverity 24179, 24178, 24125, 24124, check cast to pointers not being...
[u/mrichter/AliRoot.git] / ANALYSIS / 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
19 class AliAnalysisUtils : public TObject {
20
21  public:
22
23   AliAnalysisUtils();
24   virtual ~AliAnalysisUtils(){};
25   
26   Bool_t IsVertexSelected2013pA(AliVEvent *event);
27   Bool_t IsFirstEventInChunk(AliVEvent *event);
28   
29   Bool_t IsPileUpEvent(AliVEvent *event); //to be used in the analysis
30   Bool_t IsPileUpMV(AliVEvent *event); //MV pileup selection implemented here
31   Bool_t IsPileUpSPD(AliVEvent *event); //this calls IsPileUpFromSPD
32   Bool_t IsOutOfBunchPileUp(AliVEvent *event); //out-of-bunch pileup rejection using trigger information
33   
34   Double_t GetWDist(const AliVVertex* v0, const AliVVertex* v1);
35   
36   void SetMinVtxContr(Int_t contr=1) {fMinVtxContr=contr;}
37   void SetMaxVtxZ(Float_t z=1e6) {fMaxVtxZ=z;}
38   void SetCutOnZVertexSPD(Bool_t iscut=true) { fCutOnZVertexSPD = iscut; }
39   
40   //general pileup selection settings
41   void SetUseMVPlpSelection(Bool_t useMVPlpSelection) { fUseMVPlpSelection = useMVPlpSelection;}
42   void SetUseOutOfBunchPileUp(Bool_t useOutOfBunchPileUp) { fUseOutOfBunchPileUp = useOutOfBunchPileUp;}
43   
44   //Multi Vertex pileup selection
45   void SetMinPlpContribMV(Int_t minPlpContribMV) { fMinPlpContribMV = minPlpContribMV;}
46   void SetMaxPlpChi2MV(Float_t maxPlpChi2MV) { fMaxPlpChi2MV = maxPlpChi2MV;}
47   void SetMinWDistMV(Float_t minWDistMV) { fMinWDistMV = minWDistMV;}
48   void SetCheckPlpFromDifferentBCMV(Bool_t checkPlpFromDifferentBCMV) { fCheckPlpFromDifferentBCMV = checkPlpFromDifferentBCMV;}
49   //SPD Pileup slection
50   void SetMinPlpContribSPD(Int_t minPlpContribSPD) { fMinPlpContribSPD = minPlpContribSPD;}
51   void SetMinPlpZdistSPD(Float_t minPlpZdistSPD) { fMinPlpZdistSPD = minPlpZdistSPD;}
52   void SetnSigmaPlpZdistSPD(Float_t nSigmaPlpZdistSPD) { fnSigmaPlpZdistSPD = nSigmaPlpZdistSPD;}
53   void SetnSigmaPlpDiamXYSPD(Float_t nSigmaPlpDiamXYSPD) { fnSigmaPlpDiamXYSPD = nSigmaPlpDiamXYSPD;}
54   void SetnSigmaPlpDiamZSPD(Float_t nSigmaPlpDiamZSPD) { fnSigmaPlpDiamZSPD = nSigmaPlpDiamZSPD;}
55   void SetUseSPDCutInMultBins(Bool_t useSPDCutInMultBins) { fUseSPDCutInMultBins = useSPDCutInMultBins;}
56   
57   
58  private:
59   
60   Bool_t fisAOD; // flag for AOD:1 or ESD:0
61   
62   Int_t fMinVtxContr; // minimum vertex contributors
63   Float_t fMaxVtxZ;   // maximum |z| of primary vertex
64   
65   Bool_t fCutOnZVertexSPD; // 0: no cut, 1: |zvtx-SPD - zvtx-TPC|<0.5cm
66   
67   Bool_t  fUseMVPlpSelection; //switch between SPD and MV pileup
68   Bool_t  fUseOutOfBunchPileUp; //BC information from the trigger is used to tag out-of-bunch pileup
69   
70   Int_t    fMinPlpContribMV; //minimum contributors to the pilup vertices, multi-vertex
71   Float_t  fMaxPlpChi2MV; //minimum value of Chi2perNDF of the pileup vertex, multi-vertex
72   Float_t  fMinWDistMV; //minimum of the sqrt of weighted distance between the primary and the pilup vertex, multi-vertex
73   Bool_t  fCheckPlpFromDifferentBCMV; //pileup from different BC (Bunch Crossings)
74   
75   Int_t    fMinPlpContribSPD; //minimum contributors to the pilup vertices, SPD
76   Float_t  fMinPlpZdistSPD;  //minimum distance for the SPD pileup vertex
77   Float_t  fnSigmaPlpZdistSPD;  //cut on Z for SPD pileup
78   Float_t  fnSigmaPlpDiamXYSPD;  //cut on nsigma diamond XY for SPD pileup
79   Float_t  fnSigmaPlpDiamZSPD;  //cut on nsigma diamond Z for SPD pileup
80   Bool_t  fUseSPDCutInMultBins;  //use IsPileupFromSPDInMultBins instead of IsPileupFromSPD
81   
82   ClassDef(AliAnalysisUtils,1) // base helper class
83 };
84 #endif
85