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