Fixing ITS circular dependecies
[u/mrichter/AliRoot.git] / ITS / ITSrec / AliITSMeanVertexer.h
CommitLineData
a3a3a28f 1#ifndef ALIITSMEANVERTEXER_H
2#define ALIITSMEANVERTEXER_H
3
a3a3a28f 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
cf0b1cea 13#include <TObject.h>
199775b9 14#include <TBits.h>
efc69e78 15#include "TClonesArray.h"
cf0b1cea 16
199775b9 17class TClonesArray;
37add1d1 18class TH1F;
19class TH2F;
a3a3a28f 20class AliRawReader;
a3a3a28f 21class AliESDVertex;
cf0b1cea 22class AliITSDetTypeRec;
d5eae813 23class AliITSVertexer;
a3a3a28f 24
25class AliITSMeanVertexer : public TObject {
26
27 public:
37add1d1 28 // default constructor
d5eae813 29 AliITSMeanVertexer(Bool_t mode = kTRUE);
a3a3a28f 30 virtual ~AliITSMeanVertexer();
37add1d1 31
32 Bool_t Init();
33
34 void SetFilterOnContributors(Int_t nc=1){fFilterOnContributors = nc;}
d5eae813 35 Bool_t Reconstruct(AliRawReader *rawReader);
51a579a9 36 void SetCutOnErrX(Double_t cut=9.5){fErrXCut = cut;}
37 void SetCutOnR(Double_t cut=0.5){fRCut = cut;}
38 void SetCutOnCls(UInt_t vmin=50, UInt_t vmax=7000){fLowSPD0=vmin; fHighSPD0=vmax;}
4f40f207 39 void SetZFiducialRegion(Double_t zcut=40.){fZCutDiamond=zcut;}
37add1d1 40 void WriteVertices(const char *filename);
a3a3a28f 41
cf0b1cea 42 const TH2F*GetVertexXY() const { return fVertexXY; }
43 const TH1F*GetVertexZ() const { return fVertexZ; }
199775b9 44
45 // Methods used for debug purposes
46 Int_t GetArrayEntries() const {return fVertArray.GetEntries();}
47 const AliESDVertex* GetElementAt(Int_t i) const {return (AliESDVertex*)fVertArray[i];}
48 UInt_t GetSPD0cls(Int_t i) const {return fClu0[i];}
49 Bool_t IsGoodVertex(Int_t i) const {return (fAccEvents.TestBitNumber(i)); }
a3a3a28f 50
37add1d1 51 private:
52 // copy constructor (NO copy allowed)
a3a3a28f 53 AliITSMeanVertexer(const AliITSMeanVertexer& vtxr);
54 // assignment operator (NO assignment allowed)
55 AliITSMeanVertexer& operator=(const AliITSMeanVertexer& /* vtxr */);
37add1d1 56
199775b9 57 Bool_t Filter(AliESDVertex *vert,UInt_t mult);
37add1d1 58 void AddToMean(AliESDVertex *vert);
199775b9 59 Bool_t ComputeMean(Bool_t killOutliers);
a1b1ad51 60 void Reset(Bool_t redefine2D,Bool_t complete);
8e2abaa0 61 void ResetArray(){fAccEvents.ResetAllBits(kTRUE); fVertArray.Clear();
62 fIndex=0; for(Int_t i=0;i<fgkMaxNumOfEvents;i++)fClu0[i]=0; }
a3a3a28f 63
199775b9 64 static const Int_t fgkMaxNumOfEvents; // max. number of events
37add1d1 65 AliITSDetTypeRec *fDetTypeRec; //! ITS reco class
66 TH2F *fVertexXY; //! histogram with transverse vertex distribution (vertex diamond)
67 TH1F *fVertexZ; //! histogram with longitudinal vertex distribution
68
762133f4 69 Double_t fWeighPosSum[3]; //! weighted average position sum (transient)
70 Double_t fWeighSigSum[3]; //! weighted average position sum (transient)
71 Double_t fAverPosSum[3]; //! average position sum (transient)
72 Double_t fAverPosSqSum[3][3];//! average square position sum for covariance (transient)
73 Double_t fWeighPos[3]; //! weighted average position
74 Double_t fWeighSig[3]; //! errors on weighted average position
75 Double_t fAverPos[3]; //! average position
76 Double_t fAverPosSq[3][3]; //! average square position for covariance
77 Int_t fNoEventsContr; //! number of events used for mean vertex
199775b9 78 Double_t fTotContributors; //! Integrated number of contributors
79 Double_t fAverContributors; //! Average number of contributors
a3a3a28f 80 Int_t fFilterOnContributors; //! Numb. of contrib must be > fFilter...
d5eae813 81 Bool_t fMode; //! kTRUE for Vertexer3D;
82 //! kFALSE for VertexerTapan
83 AliITSVertexer* fVertexer; //! vertexer
a3a3a28f 84
199775b9 85 TBits fAccEvents; //! bit string: 1 for good events 0 for bad ones
86 TClonesArray fVertArray; //! array of vertices to be averaged
87 UInt_t *fClu0; //! number of clusters on SPD inner layer
88 Int_t fIndex; //! current index on the arrays
89 Double_t fErrXCut; //! cut on error on X (error*1000<fErrXCut)
90 Double_t fRCut; //| cut on distance from first estimate (mm)
4f40f207 91 Double_t fZCutDiamond; //! -/+ fZCutDiamond is the Z fiducial region
199775b9 92 UInt_t fLowSPD0; //! low SPD0 cls value to accept event
93 UInt_t fHighSPD0; //! high SPD0 cls value to accept event
8e2abaa0 94 TH1F *fMultH; //! debug hist: mult. on SPD0 before Filter
95 TH1F *fErrXH; //! debug hist: error on X before Filter
96 TH1F *fMultHa; //! debug hist: mult. on SPD0 after Filter
97 TH1F *fErrXHa; //! debug hist: error on X after Filter
98 TH1F *fDistH; //! debug hist: distance from peak
a1b1ad51 99 TH1F *fContrH; //! debug hist: number of contributors
100 TH1F *fContrHa; //! debug hist: number of contributors - after filter
199775b9 101
cf0b1cea 102 ClassDef(AliITSMeanVertexer,0)
a3a3a28f 103};
104
105#endif