]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSMeanVertexer.h
Script to draw occupancies
[u/mrichter/AliRoot.git] / ITS / AliITSMeanVertexer.h
1 #ifndef ALIITSMEANVERTEXER_H
2 #define ALIITSMEANVERTEXER_H
3
4 ///////////////////////////////////////////////////////////////////////
5 //                                                                   //
6 // Class to compute vertex position using SPD local reconstruction   //
7 // An average vertex position using all the events                   //
8 // is built and saved                                                //
9 ///////////////////////////////////////////////////////////////////////
10
11 /* $Id$ */
12
13 #include <TObject.h>
14 #include <TBits.h>
15
16 class TClonesArray;
17 class TH1F;
18 class TH2F;
19 class AliRawReader;
20 class AliESDVertex;
21 class AliITSDetTypeRec;
22 class AliITSVertexer;
23
24 class AliITSMeanVertexer : public TObject {
25
26  public:
27   // default constructor
28     AliITSMeanVertexer(Bool_t mode = kTRUE);   
29     virtual ~AliITSMeanVertexer();
30  
31     Bool_t Init();
32  
33     void   SetFilterOnContributors(Int_t nc=1){fFilterOnContributors = nc;}
34     Bool_t Reconstruct(AliRawReader *rawReader);
35     void SetCutOnErrX(Double_t cut=3.){fErrXCut = cut;}
36     void SetCutOnR(Double_t cut=0.2){fRCut = cut;}
37     void SetCutOnCls(UInt_t vmin=50, UInt_t vmax=4000){fLowSPD0=vmin; fHighSPD0=vmax;}
38     void   WriteVertices(const char *filename);
39
40     const TH2F*GetVertexXY() const { return fVertexXY; }
41     const TH1F*GetVertexZ()  const { return fVertexZ;  }
42
43     // Methods used for debug purposes
44     Int_t GetArrayEntries() const {return fVertArray.GetEntries();}
45     const AliESDVertex* GetElementAt(Int_t i) const {return (AliESDVertex*)fVertArray[i];}
46     UInt_t GetSPD0cls(Int_t i) const {return fClu0[i];}
47     Bool_t IsGoodVertex(Int_t i) const {return (fAccEvents.TestBitNumber(i)); }
48  
49  private:
50     // copy constructor (NO copy allowed)
51     AliITSMeanVertexer(const AliITSMeanVertexer& vtxr);
52     // assignment operator (NO assignment allowed)
53     AliITSMeanVertexer& operator=(const AliITSMeanVertexer& /* vtxr */);
54
55     Bool_t Filter(AliESDVertex *vert,UInt_t mult);
56     void   AddToMean(AliESDVertex *vert);
57     Bool_t ComputeMean(Bool_t killOutliers);
58     void Reset();
59
60     static const Int_t fgkMaxNumOfEvents;   // max. number of events 
61     AliITSDetTypeRec *fDetTypeRec; //! ITS reco class
62     TH2F    *fVertexXY;        //! histogram with transverse vertex distribution (vertex diamond)
63     TH1F    *fVertexZ;         //! histogram with longitudinal vertex distribution
64
65     Double_t fWeighPosSum[3];    //! weighted average position sum (transient)
66     Double_t fWeighSigSum[3];    //! weighted average position sum (transient)
67     Double_t fAverPosSum[3];     //! average position sum (transient)
68     Double_t fAverPosSqSum[3][3];//! average square position sum for covariance (transient)
69     Double_t fWeighPos[3];       //! weighted average position
70     Double_t fWeighSig[3];       //! errors on weighted average position
71     Double_t fAverPos[3];        //! average position
72     Double_t fAverPosSq[3][3];   //! average square position for covariance
73     Int_t fNoEventsContr;        //! number of events used for mean vertex
74     Double_t fTotContributors;      //! Integrated number of contributors
75     Double_t fAverContributors;  //! Average number of contributors
76     Int_t fFilterOnContributors; //! Numb. of contrib must be > fFilter...
77     Bool_t fMode;                //! kTRUE for Vertexer3D; 
78                                  //! kFALSE for VertexerTapan
79     AliITSVertexer* fVertexer;   //! vertexer
80
81     TBits fAccEvents;           //! bit string: 1 for good events 0 for bad ones
82     TClonesArray fVertArray;     //! array of vertices to be averaged
83     UInt_t *fClu0;              //! number of clusters on SPD inner layer
84     Int_t fIndex;               //! current index on the arrays
85     Double_t fErrXCut;          //! cut on error on X (error*1000<fErrXCut)
86     Double_t fRCut;             //| cut on distance from first estimate (mm)
87     UInt_t fLowSPD0;            //! low SPD0 cls value to accept event
88     UInt_t fHighSPD0;           //! high SPD0 cls value to accept event
89
90     ClassDef(AliITSMeanVertexer,0)
91 };
92
93 #endif