]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSstatistics.h
Some errors on HP and DEC fixed.
[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(AliITSstatistics &source); // copy  constructor
20   AliITSstatistics& operator=(AliITSstatistics &source); // operator=
21   virtual ~AliITSstatistics();
22   void Reset();
23   void AddValue(Double_t x,Double_t w);
24   void AddValue(Double_t x){
25                             // Default weight of 1
26                             AddValue(x,1.0);
27                                                                          } 
28   void AddValue(Float_t x,Float_t w){
29                                      //float
30                                      AddValue((Double_t)x,(Double_t)w);
31                                                                                                  } 
32   void AddValue(Float_t x){
33                            // floats default weight of 1
34                            AddValue((Double_t)x,(Double_t)1.0);} 
35   Double_t GetNth(Int_t order);
36   Double_t GetMean() {
37                       // returns the mean
38                       return GetNth(1);
39                                                         };
40   Int_t GetN(){
41                // returns the number of entries
42                return fN;
43               };
44   Int_t GetOrder(){
45                    // returns the order of the moment of the distribution
46                    return 
47                                                  fOrder;
48                   };
49   Double_t GetXN(Int_t order){
50                               // returns X^N
51                               return fx[order-1];
52                               };
53   Double_t GetWN(Int_t order){
54                               // returns W^N
55                               return fw[order-1];
56                              };
57   Double_t GetRMS();
58   Double_t GetErrorMean();
59   Double_t GetErrorRMS();
60
61  private:
62   Double_t *fx;   // fx array of x moments
63   Double_t *fw;   // fw array of weight by moment
64   Int_t    fN;    // fN number of enetries
65   Int_t    fOrder;// fOrder maximum allowed moment
66
67   ClassDef(AliITSstatistics,1)// A class to do simple statistics calculations
68 };
69 #endif