]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSstatistics.h
Adding protection on time of flight (E. Fragiacomo)
[u/mrichter/AliRoot.git] / ITS / AliITSstatistics.h
1 #ifndef ALIITSSTATISTICS_H
2 #define ALIITSSTATISTICS_H
3 //////////////////////////////////////////////////////////////////////////
4 //  Alice ITS first detector alignment program.                         //
5 //                                                                      //
6 // version: 0.0.0 Draft.                                                //
7 // Date: April 18 1999                                                  //
8 // By: Bjorn S. Nilsen                                                  //
9 //                                                                      //
10 //////////////////////////////////////////////////////////////////////////
11 #include "TObject.h"
12
13 class AliITSstatistics : public TObject {
14 //
15
16  public:
17   AliITSstatistics();
18   AliITSstatistics(Int_t order);
19   AliITSstatistics(const AliITSstatistics &source); // copy  constructor
20   AliITSstatistics& operator=(const AliITSstatistics &source); // operator=
21   virtual ~AliITSstatistics();
22   void Reset();
23   void AddValue(Double_t x,Double_t w);
24   void AddValue(Double_t x){ Double_t weight=1.0; AddValue(x,weight);} // Default weight of 1
25   void AddValue(Float_t x,Float_t w){AddValue((Double_t)x,(Double_t)w);} //float
26   void AddValue(Float_t x){Float_t weight=1.0; AddValue(x,weight);} // floats default weight of 1
27   Double_t GetNth(Int_t order);
28   Double_t GetMean() {// returns the mean
29     return GetNth(1);};
30   Int_t GetN() const{// returns the number of entries
31     return fN;
32   };
33   Int_t GetOrder() const {// returns the order of the moment of the distribution
34     return fOrder;
35   };
36   Double_t GetXN(Int_t order) const{// returns X^N
37     return fX[order-1];
38   };
39   Double_t GetWN(Int_t order)const {// returns W^N
40     return fW[order-1];
41   };
42   Double_t GetRMS();
43   Double_t GetErrorMean();
44   Double_t GetErrorRMS();
45
46  private:
47   Int_t    fN;    //fN number of enetries
48   Int_t    fOrder;//fOrder maximum allowed moment
49   Double_t *fX;   //[fOrder] fX array of x moments
50   Double_t *fW;   //[fOrder] fW array of weight by moment
51
52   ClassDef(AliITSstatistics,1)// A class to do simple statistics calculations
53 };
54 #endif