|
BrStatisticsclass description - source file - inheritance tree class BrStatistics : public TObjectpublic: Data Membersprivate: Class DescriptionClass for low-level statistics /* BrStatistics() Default CTOR, do not use BrStatistics(Int_t n, Bool_t storeData, Int_t m) Create a low-level statistics object for n variables, with initial room for m rows. n must be bigger than 1. For one variable statistics, use the static AddPoint method for high-precision statistics. ~BrStatistics() Destructor void CombineSamples(UInt_t n1, Double_t m1, Double_t s1, UInt_t n2, Double_t m2, Double_t s2, Double_t& m, Double_t& s) Static method. Given the two partial sample of the same stocastic variable, of size n1 and n2, with averages m1 and m2, and square variances, s1 and s2, calculate the full sample average and square variance, and return them in m and s. The formulas used are: n1 * m1 + n2 * m2 m = ----------------- n1 + n2 n1 * s1 + n2 * s2 n1 * n2 * (m1 - m2)^2 s = ----------------- + --------------------- n1 + n2 (n1 + n2)^2 void AddPoint(Double_t data, UInt_t n, Double_t& average, Double_t& sqvar) Static method to add a point to a 1D statistics. The arguments are: data the n'th data point n number of data point (must be in [1,M]) average on input this must be the average after n-1 data points. On output this contains the new average sqvar on input this must be the sqyare variance after n-1 data points. On output this contains the new square variance The algorithm is the one used in TPrincipal::AddRow. void AddRow(Double_t* row) Add one row (observation) to the statisical sample. Values are stored internally. Average, Max, Min, and the covariance matrix is calculated on the fly (It actually improves accuary). See also TPrincipal::AddRow. void Draw(Option_t* option) Draw variables as given by option. The form of the option is <option> ::= <var list><option list> where <var list> ::= <quantity> | <var number> | <var number>:<var number> | <var number>:<var number>:<var number> <option list> ::= | ::<histogram draw option> <quantity> ::= one of A, S, C, L, U where <histogram draw option> is any valid histogram option for the type of histogram drawn (1D, 2D, or 3D). See TH1::Draw. The <quantity>'s corresponds to A Average in each variable (1D) S Spread in each varaible (1D) C Covariance matrix (2D) L Mimimum in each varaible (1D) U Maximum in each variable (1D) F Spread^2 / average in each variable (1D) G Spread^2 / average^2 in each variable (1D) W Covariance / sqrt(average * average) in each cell (2D) X Covariance / (average * average) in each cell (2D) K Correlation matrix (2D) V Alias for S M Alias for A Double_t* GetRow(Int_t i) const Get a pointer into internal data, starting at row i TH1* Project(Int_t i) Project variable i into a 1D histogram (TH1D). User need to store the histogram immediately TH1* Project(Int_t i, Int_t j) Project variables i and j into a 2D histogram (TH2D). User need to cast the returned histogram to a TH2D pointer. User need to store the histogram immediately TH1* Project(Int_t i, Int_t j, Int_t k) Project variables i, j and k into a 3D histogram (TH3D). User need to store the histogram immediately void Print(Option_t* option) const Print the statistics Options: B Basic information A Average (a.k.a. sample mean) L Minimum U Maximum S Spread C Covariance matrix F Fluctuation matrix K Kovariance matrix D Data Default is BALUS void Set(Int_t n, Bool_t store, Int_t m) Set the dimension and initial size of the sample storage, if store is true. All arrays are reset Inline Functionsvoid Browse(TBrowser* b) Int_t GetSampleSize() Double_t GetMax(Int_t i) const const TArrayD& GetMaxArray() const Double_t GetCovariance(Int_t i, Int_t j) const const TArrayD& GetCovarianceArray() const Double_t GetAverage(Int_t i) const const TArrayD& GetAverageArray() const Double_t GetMin(Int_t i) const const TArrayD& GetMinArray() const Double_t GetVariance(Int_t i) const Double_t GetFluctuation(Int_t i, Int_t j) const Double_t GetCorrelation(Int_t i, Int_t j) const Bool_t IsDataStored() const TClass* Class() TClass* IsA() const void ShowMembers(TMemberInspector& insp, char* parent) void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) BrStatistics BrStatistics(BrStatistics&) |
||||||
This page automatically generated by script docBrat by Christian Holm |
Copyright ; 2002 BRAHMS Collaboration
<brahmlib@rcf.rhic.bnl.gov>
|