]>
Commit | Line | Data |
---|---|---|
d88f97cc | 1 | #ifndef ALISAMPLE_H |
2 | #define ALISAMPLE_H | |
3da30618 | 3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
f531a546 | 6 | // $Id$ |
3da30618 | 7 | |
d88f97cc | 8 | #include <math.h> |
d88f97cc | 9 | |
10 | #include "Rtypes.h" | |
11 | ||
12 | class AliSample | |
13 | { | |
14 | public: | |
15 | AliSample(); // Default constructor | |
16 | virtual ~AliSample(); // Default destructor | |
17 | void Reset(); // Reset complete statistics | |
18 | void Enter(Float_t x); // Enter value for 1-dim. sample | |
19 | void Remove(Float_t x); // Remove value from 1-dim. sample | |
20 | void Enter(Float_t x, Float_t y); // Enter value for 2-dim. sample | |
21 | void Remove(Float_t x, Float_t y); // Remove value from 2-dim. sample | |
22 | void Enter(Float_t x, Float_t y, Float_t z); // Enter value for 3-dim. sample | |
23 | void Remove(Float_t x, Float_t y, Float_t z); // Remove value from 3-dim. sample | |
261c0caf | 24 | Int_t GetDimension() const; // Provide dimension of the sample |
25 | Int_t GetN() const; // Provide the number of entries | |
26 | Float_t GetSum(Int_t i) const; // Provide sum for i-th variable | |
27 | Float_t GetMean(Int_t i) const; // Provide mean for i-th variable | |
28 | Float_t GetVar(Int_t i) const; // Provide variance for i-th variable | |
29 | Float_t GetSigma(Int_t i) const; // Standard deviation for i-th variable | |
30 | Float_t GetCov(Int_t i, Int_t j) const; // Covariance for i-th and j-th variable | |
31 | Float_t GetCor(Int_t i, Int_t j) const; // Correlation for i-th and j-th variable | |
32 | void Data() const; // Stat. info for the complete sample | |
33 | void Data(Int_t i) const; // Stat. info for the i-th variable | |
34 | void Data(Int_t i, Int_t j) const; // Stat. info for i-th and j-th variable | |
d88f97cc | 35 | |
36 | private: | |
37 | Int_t fDim; // Dimension of the sample | |
38 | Int_t fN; // Number of entries of the sample | |
39 | enum {fMaxdim=3}; // Maximum supported dimension | |
40 | char fNames[fMaxdim]; // Variable names i.e. X,Y,Z | |
41 | Float_t fSum[fMaxdim]; // Total sum for each variable | |
42 | Float_t fSum2[fMaxdim][fMaxdim]; // Total sum**2 for each variable | |
43 | void Compute(); // Compute the various quantities | |
44 | Float_t fMean[fMaxdim]; // Mean for each variable | |
45 | Float_t fVar[fMaxdim]; // Variation for each variable | |
46 | Float_t fSigma[fMaxdim]; // Standard deviation for each variable | |
47 | Float_t fCov[fMaxdim][fMaxdim]; // Covariances of pairs of variables | |
48 | Float_t fCor[fMaxdim][fMaxdim]; // Correlations of pairs of variables | |
6516b62d | 49 | |
50 | ClassDef(AliSample,0) // Statistics tools for various multi-dimensional data samples. | |
d88f97cc | 51 | }; |
52 | #endif |