]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSstatistics2.h
Bethe-Bloch formula normalized to one at the minimum (Yuri)
[u/mrichter/AliRoot.git] / ITS / AliITSstatistics2.h
index 5004fcfd7067f73e81b0b3e976ae1c7fc91754e6..b3d8a0667dd332277a5f1b426a4a77ee634c568b 100644 (file)
 
 class AliITSstatistics2 : public TObject {
 //
-
  public:
-    AliITSstatistics2();
-    AliITSstatistics2(Int_t order);
-        AliITSstatistics2(AliITSstatistics2 &source); // copy  constructor
-        AliITSstatistics2& operator=(AliITSstatistics2 &source); // operator=   
-    virtual ~AliITSstatistics2();
-    void Reset();
+    AliITSstatistics2(); // default constructor
+    AliITSstatistics2(Int_t order); // Standard constructor
+    AliITSstatistics2(AliITSstatistics2 &source); // copy  constructor
+    AliITSstatistics2& operator=(AliITSstatistics2 &source); // operator=
+    virtual ~AliITSstatistics2();// destructor
+    void Reset(Int_t order=-1); // Resets statictisc order=-1 do not change order.
     void AddValue(Double_t y,Double_t x,Double_t w);
-    void AddValue(Double_t y,Double_t x){AddValue(y,x,1.0);} // default weight
-    void AddValue(Float_t y,Float_t x,Float_t w){
-             AddValue((Double_t)y,(Double_t)x,(Double_t)w);} // Floating point version
-    void AddValue(Float_t y,Float_t x){AddValue(y,x,1.0);}// default weight F.
-    Double_t GetXNth (Int_t order);
-    Double_t GetYNth (Int_t order);
-    Double_t GetYXNth(Int_t order);
-    Double_t GetMeanY()  {
-                              // return mean y
-                              return GetYNth(1);
-                                                                };
-    Double_t GetMeanX()  {
-                              // return mean x
-                              return GetXNth(1);
-                                                                };
-    Double_t GetMeanYX() {
-                              // return mean Y*X
-                              return GetYXNth(1);
-                                                                };
-    Int_t GetN(){
-                     // retrun the number of entries
-                     return fN;
-                                        };
-    Int_t GetOrder(){
-                         // return the maximum moment order
-                         return fOrder;
-                                                 };
-    Double_t GetXN (Int_t order){
-                                     // returns x^n
-                                     return fx[order-1];
-                                                                                 };
-    Double_t GetYN (Int_t order){
-                                     // returns y^n
-                                     return fy[order-1];
-                                                                                 };
-    Double_t GetYXN(Int_t order){
-                                     // returns (yx)^n
-                                     return fyx[order-1];
-                                                                                 };
-    Double_t GetWN (Int_t order){
-                                     // returns w^n (weight)
-                                     return fw[order-1];
-                                                                                 };
-    Double_t GetRMSY();
-    Double_t GetRMSX();
-    Double_t GetRMSYX();
-    Double_t GetErrorMeanY();
-    Double_t GetErrorMeanX();
-    Double_t GetErrorMeanYX();
-    Double_t GetErrorRMSY();
-    Double_t GetErrorRMSX();
-    Double_t GetErrorRMSYX();
-    Double_t FitToLine(Double_t &a,Double_t &b);
+    Double_t GetXNth (Int_t order)const;
+    Double_t GetYNth (Int_t order)const;
+    Double_t GetYXNth(Int_t order)const;
+    Double_t GetMeanY()const{// return mean y
+        return GetYNth(1);};
+    Double_t GetMeanX()const{// return mean x
+        return GetXNth(1);};
+    Double_t GetMeanYX()const{// return mean Y*X
+        return GetYXNth(1);};
+    Int_t GetN()const{// retrun the number of entries
+        // Int_t n=0; n=fN;if(fOver!=0) n+=fOver->GetN(); return n;
+        return fN;};
+    Int_t GetOrder()const{// return the maximum moment order
+        return fOrder;};
+    Double_t GetXN (Int_t order)const{// returns x^n
+        // Double_t x=0.0; x = fX[order-1];if(fOver!=0) x+=fOver->GetXN(order);
+        return fX[order-1];};
+    Double_t GetYN (Int_t order)const{// returns y^n
+        // Double_t y=0.0; y = fY[order-1];if(fOver!=0) y+=fOver->GetYN(order);
+        return fY[order-1];};
+    Double_t GetYXN(Int_t order)const{// returns (yx)^n
+        // Double_t yx=0.0; yx = fYx[order-1];if(fOver!=0) yx+=fOver->GetYXN(order);
+        return fYx[order-1];};
+    Double_t GetWN (Int_t order)const{// returns w^n (weight)
+        // Double_t w=0.0; w = fW[order-1];if(fOver!=0) w+=fOver->GetWN(order);
+        return fW[order-1];};
+    Double_t GetRMSY()const; // Returns Y rms value
+    Double_t GetRMSX()const; // Returns X rms value
+    Double_t GetRMSYX()const;// Return XY rms value
+    Double_t GetErrorMeanY()const; // returns error on y mean
+    Double_t GetErrorMeanX()const; // returns error on x mean
+    Double_t GetErrorMeanYX()const;// returns error on xy mean
+    Double_t GetErrorRMSY()const;  // returns error on y rms
+    Double_t GetErrorRMSX()const;  // returns error on x rms
+    Double_t GetErrorRMSYX()const; // returns error on xy rms
+    // returns Chi^2 value of data to line y=ax+b with given a,b
+    Double_t GetChiSquared(Double_t a,Double_t b)const; 
+    // Fits data to a line of the form y=ax+b and returns values
+    // for a and b.
+    Double_t FitToLine(Double_t &a,Double_t &b)const
+    {Double_t ea,eb; return FitToLine(a,ea,b,eb);};
+    // Fits data to a line of the form y=ax+b and returns values
+    // for a and b and find errors on a and b.
+    Double_t FitToLine(Double_t &a,Double_t &ea,Double_t &b,Double_t &eb)const;
+    // Get the minimal significance value
+    // Int_t GetSignificantDigits()const{return fDig;}
+    // Set the minimal significance value
+    // void SetSignificantDigits(Int_t d);
+    // Print class in ascii form to stream
+    virtual void PrintAscii(ostream *os)const;
+    // Read in class in ascii form from stream
+    virtual void ReadAscii(istream *is);
 
  private:
-    Double_t *fx;    // array of sums of x^n
-        Double_t *fyx;   // array of sums of (xy)^n
-        Double_t *fy;    // array of sums of y^n
-        Double_t *fw;    // array of sums of w^n (weights)
     Int_t  fN;       // number of enetries
-        Int_t  fOrder;   // maximum moment of distributions (^n)
-
+    Int_t  fOrder;   // maximum moment of distributions (^n)
+    Double_t *fX;    //[fOrder] array of sums of x^n
+    Double_t *fYx;   //[fOrder] array of sums of (xy)^n
+    Double_t *fY;    //[fOrder] array of sums of y^n
+    Double_t *fW;    //[fOrder] array of sums of w^n (weights)
+    //Int_t fDig;               //  The number of significant digits to keep
+    //AliITSstatistics2 *fOver; //! In case of numerical precistion problems
 
-    ClassDef(AliITSstatistics2,1)  //
+    ClassDef(AliITSstatistics2,1)  //compute usueful statistics in 2D
 };
+// Input and output function for standard C++ input/output.
+ostream &operator<<(ostream &os,const AliITSstatistics2 &s);
+istream &operator>>(istream &is,AliITSstatistics2 &s);
 #endif
+