]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSMeanVertexer.h
Four overlaps fixed (M. Sitta)
[u/mrichter/AliRoot.git] / ITS / AliITSMeanVertexer.h
1 #ifndef ALIITSMEANVERTEXER_H
2 #define ALIITSMEANVERTEXER_H
3
4 #include <TString.h>
5
6 ///////////////////////////////////////////////////////////////////////
7 //                                                                   //
8 // Class to compute vertex position using SPD local reconstruction   //
9 // An average vertex position using all the events                   //
10 // is built and saved                                                //
11 ///////////////////////////////////////////////////////////////////////
12
13 /* $Id$ */
14
15 class TObject;
16 class AliRawReader;
17 class AliRunLoader;
18 class AliMultiplicity;
19 class AliESDVertex;
20
21 class AliITSMeanVertexer : public TObject {
22
23  public:
24     // default constructor
25     AliITSMeanVertexer();   
26     // standard constructor. filename is the name of the file containing
27     // raw data either in ROOT or DATE format according to file extension
28     AliITSMeanVertexer(TString &filename);   
29     // constructor with explicit assignment of names for geometry and loaders
30     AliITSMeanVertexer(TString &filename, TString &loaderfilename, 
31                        TString &geometryfilename);
32     virtual ~AliITSMeanVertexer();
33     void SetLoaderFileName(TString fn="ITSMeanVertexer.root")
34                            {fLoaderFileName = fn;}
35     void SetGeometryFileName(TString fn="geometry.root")
36                            {fGeometryFileName = fn;}
37     void SetMeanVertexFileName(TString fn) {fMVFileName = fn;}
38     void SetFilterOnContributors(Int_t nc=1){fFilterOnContributors = nc;}
39     void SetFilterOnTracklets(Int_t nc=1){fFilterOnTracklets = nc;}
40     void SetWriteVertices(Bool_t action){fWriteVertices = action;}
41     Bool_t GetWriteVertices() const {return fWriteVertices;}
42     void Reconstruct();
43     void DoVertices();
44
45  
46  protected:
47     // copy constructor (NO copy allowed: the constructor is protected
48     // to avoid misuse)
49     AliITSMeanVertexer(const AliITSMeanVertexer& vtxr);
50     // assignment operator (NO assignment allowed)
51     AliITSMeanVertexer& operator=(const AliITSMeanVertexer& /* vtxr */);
52     void Init(TString &filename);  // initialization invoked by constructors
53     Bool_t Filter(AliESDVertex *vert,AliMultiplicity *mult);
54     void AddToMean(AliESDVertex *vert);
55     Bool_t ComputeMean();
56
57     static const TString fgkMVFileNameDefault;  //! default for fMVFileName
58     TString fLoaderFileName;   //! name of the local file containing loaders
59     TString fGeometryFileName; //! name of the file containing the geometry
60     TString fMVFileName;       //! name of the file containing the mean vertex
61     AliRawReader *fRawReader;  //! rawreader object
62     AliRunLoader *fRunLoader;  //! run loader
63     Double_t fWeighPos[3];     //! weighted average position
64     Double_t fWeighSig[3];     //! errors on weighted average position
65     Double_t fAverPos[3];      //! average position
66     Double_t fAverPosSq[3][3];  //! average square position for covariance
67     Int_t fNoEventsContr;      //! number of events used for mean vertex
68     Float_t fTotTracklets;       //! total number of tracklets used (integrated)
69     Float_t fAverTracklets;    //! average number of tracklets per event
70     Float_t fSigmaOnAverTracks; //! RMS of fAverTracklets
71     Int_t fFilterOnContributors; //! Numb. of contrib must be > fFilter...
72     Int_t fFilterOnTracklets; //! Numb. of tracklets must be > fFilterOnTr...
73     Bool_t fWriteVertices; //! if kTRUE all the vertices are saved to a file
74
75   ClassDef(AliITSMeanVertexer,0);
76 };
77
78 #endif