CMS 3D CMS Logo

TDistrib.h

Go to the documentation of this file.
00001 #ifndef   CL_TDistrib_H
00002 #define   CL_TDistrib_H
00003 
00004 #include "TObject.h"
00005 #include "TString.h"
00006 #include "TVectorD.h"
00007 
00008 //--------------------------- TDistrib.h ---------------------------------
00009 // 
00010 //   Creation: 01 Jul  2002
00011 //   Update  : 03 Feb  2003
00012 //
00013 //   For questions or comments, please send e-mail to:
00014 //
00015 //   Bernard Fabbro             
00016 //   fabbro@hep.saclay.cea.fr 
00017 //
00018 //------------------------------------------------------------------------
00019 
00020 //------------------------------------------------------------------------
00021 //
00022 //               Declaration de la classe TDistrib 
00023 //
00024 //       Une "Distribution" (classe "TDistrib") est definie comme
00025 //       un ensemble de N valeurs qui representent les valeurs
00026 //       que prend une variable aleatoire au cours de N evenements.
00027 //       Les attributs de la classe sont: un entier ("Int_t") qui doit
00028 //       contenir le nombre N d'evenements et un pointeur sur reels
00029 //       longs (Double_t *) qui doit contenir l'adresse du premier element
00030 //       (element numero 0) d'un tableau qui contient les valeurs.
00031 //
00032 //-----------------------------------------------------------------------
00033 
00034 class TDistrib: public TObject {
00035   
00036  private:
00037   
00038   //............ attributes
00039   
00040   Int_t      fCnew;
00041   Int_t      fCdelete;
00042   
00043   Int_t      fNbEvents;       //  number of events of the distribution
00044   Double_t*  fValues;         //  pointer to the first value
00045   
00046   void     fCopy(const TDistrib&);   // private copy
00047 
00048   //................ memo errors tag
00049   Int_t    fCodeErrMax;
00050 
00051   Int_t    fMemoErrEv;
00052   Int_t    fMemoErrVar;
00053   Int_t    fMemoErrSdev;
00054   Int_t    fMemoErrCovar;
00055  
00056  public:
00057   
00058   //................. constructors
00059   
00060   TDistrib();
00061   //  TDistrib(const TDistrib&);
00062   TDistrib&  operator=(const TDistrib&);
00063   TDistrib(const Int_t&, const  Double_t*);
00064   TDistrib(const Int_t&, const  TVectorD);
00065 
00066   //................. destructor
00067   
00068   virtual ~TDistrib();
00069   
00070   //................. methods
00071   
00072   void          Init();
00073   Bool_t        Resize(const Int_t&);
00074   Bool_t        Refill(const Int_t&, const  TVectorD);
00075 
00076   Int_t         NumberOfEvents();
00077   Double_t*     VariableValues();
00078   Double_t*     DeviationValues();
00079 
00080   Double_t      ExpectationValue();
00081   Double_t      VarianceValue();
00082   Double_t      StandardDeviation();
00083   Double_t      StandardDeviation(TString);     
00084   Double_t      Covariance(TDistrib&);
00085   void          HistoDistrib(const Int_t&, Double_t&, Double_t&, Double_t*,
00086                              Int_t&, Int_t&, Int_t&);
00087   
00088   ClassDef(TDistrib,1)// Distribution 1D of a random variable
00089     
00090     };  
00091     
00092 #endif     //   CL_TDistrib_H
00093 
00094 
00095 
00096 
00097 
00098 
00099 
00100 
00101 
00102 
00103 

Generated on Tue Jun 9 17:25:16 2009 for CMSSW by  doxygen 1.5.4