]>
Commit | Line | Data |
---|---|---|
b0f5e3fc | 1 | #ifndef ALIITSSTATISTICS2_H |
2 | #define ALIITSSTATISTICS2_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 AliITSstatistics2 : public TObject { | |
14 | // | |
b0f5e3fc | 15 | public: |
492b8715 | 16 | AliITSstatistics2(); // default constructor |
17 | AliITSstatistics2(Int_t order); // Standard constructor | |
18 | AliITSstatistics2(AliITSstatistics2 &source); // copy constructor | |
19 | AliITSstatistics2& operator=(AliITSstatistics2 &source); // operator= | |
20 | virtual ~AliITSstatistics2();// destructor | |
21 | void Reset(Int_t order=-1); // Resets statictisc order=-1 do not change order. | |
b0f5e3fc | 22 | void AddValue(Double_t y,Double_t x,Double_t w); |
492b8715 | 23 | Double_t GetXNth (Int_t order)const; |
24 | Double_t GetYNth (Int_t order)const; | |
25 | Double_t GetYXNth(Int_t order)const; | |
26 | Double_t GetMeanY()const{// return mean y | |
27 | return GetYNth(1);}; | |
28 | Double_t GetMeanX()const{// return mean x | |
29 | return GetXNth(1);}; | |
30 | Double_t GetMeanYX()const{// return mean Y*X | |
31 | return GetYXNth(1);}; | |
32 | Int_t GetN()const{// retrun the number of entries | |
a2bea7ce | 33 | // Int_t n=0; n=fN;if(fOver!=0) n+=fOver->GetN(); return n; |
492b8715 | 34 | return fN;}; |
35 | Int_t GetOrder()const{// return the maximum moment order | |
36 | return fOrder;}; | |
37 | Double_t GetXN (Int_t order)const{// returns x^n | |
a2bea7ce | 38 | // Double_t x=0.0; x = fX[order-1];if(fOver!=0) x+=fOver->GetXN(order); |
492b8715 | 39 | return fX[order-1];}; |
40 | Double_t GetYN (Int_t order)const{// returns y^n | |
a2bea7ce | 41 | // Double_t y=0.0; y = fY[order-1];if(fOver!=0) y+=fOver->GetYN(order); |
492b8715 | 42 | return fY[order-1];}; |
43 | Double_t GetYXN(Int_t order)const{// returns (yx)^n | |
a2bea7ce | 44 | // Double_t yx=0.0; yx = fYx[order-1];if(fOver!=0) yx+=fOver->GetYXN(order); |
492b8715 | 45 | return fYx[order-1];}; |
46 | Double_t GetWN (Int_t order)const{// returns w^n (weight) | |
a2bea7ce | 47 | // Double_t w=0.0; w = fW[order-1];if(fOver!=0) w+=fOver->GetWN(order); |
492b8715 | 48 | return fW[order-1];}; |
49 | Double_t GetRMSY()const; // Returns Y rms value | |
50 | Double_t GetRMSX()const; // Returns X rms value | |
51 | Double_t GetRMSYX()const;// Return XY rms value | |
52 | Double_t GetErrorMeanY()const; // returns error on y mean | |
53 | Double_t GetErrorMeanX()const; // returns error on x mean | |
54 | Double_t GetErrorMeanYX()const;// returns error on xy mean | |
55 | Double_t GetErrorRMSY()const; // returns error on y rms | |
56 | Double_t GetErrorRMSX()const; // returns error on x rms | |
57 | Double_t GetErrorRMSYX()const; // returns error on xy rms | |
58 | // returns Chi^2 value of data to line y=ax+b with given a,b | |
59 | Double_t GetChiSquared(Double_t a,Double_t b)const; | |
60 | // Fits data to a line of the form y=ax+b and returns values | |
61 | // for a and b. | |
a2bea7ce | 62 | Double_t FitToLine(Double_t &a,Double_t &b)const |
63 | {Double_t ea,eb; return FitToLine(a,ea,b,eb);}; | |
64 | // Fits data to a line of the form y=ax+b and returns values | |
65 | // for a and b and find errors on a and b. | |
66 | Double_t FitToLine(Double_t &a,Double_t &ea,Double_t &b,Double_t &eb)const; | |
67 | // Get the minimal significance value | |
68 | // Int_t GetSignificantDigits()const{return fDig;} | |
69 | // Set the minimal significance value | |
70 | // void SetSignificantDigits(Int_t d); | |
492b8715 | 71 | // Print class in ascii form to stream |
72 | virtual void PrintAscii(ostream *os)const; | |
73 | // Read in class in ascii form from stream | |
74 | virtual void ReadAscii(istream *is); | |
b0f5e3fc | 75 | |
76 | private: | |
b0f5e3fc | 77 | Int_t fN; // number of enetries |
e8189707 | 78 | Int_t fOrder; // maximum moment of distributions (^n) |
07025d6d | 79 | Double_t *fX; //[fOrder] array of sums of x^n |
80 | Double_t *fYx; //[fOrder] array of sums of (xy)^n | |
81 | Double_t *fY; //[fOrder] array of sums of y^n | |
82 | Double_t *fW; //[fOrder] array of sums of w^n (weights) | |
a2bea7ce | 83 | //Int_t fDig; // The number of significant digits to keep |
84 | //AliITSstatistics2 *fOver; //! In case of numerical precistion problems | |
b0f5e3fc | 85 | |
07025d6d | 86 | ClassDef(AliITSstatistics2,1) //compute usueful statistics in 2D |
b0f5e3fc | 87 | }; |
492b8715 | 88 | // Input and output function for standard C++ input/output. |
89 | ostream &operator<<(ostream &os,const AliITSstatistics2 &s); | |
90 | istream &operator>>(istream &is,AliITSstatistics2 &s); | |
b0f5e3fc | 91 | #endif |
a2bea7ce | 92 |