Changeset 1056 in Sophya for trunk/SophyaLib/HiStats/hisprof.h


Ignore:
Timestamp:
Jul 7, 2000, 10:41:11 AM (25 years ago)
Author:
ansari
Message:

cmv 7/7/2000

hisprof.cc,h:

fonction IsOk()
GetMean -> GetValue (mauvais nom)
float Error2() -> double Error2()
nouveau: GetError(TVector<r_8>& v)
HProf::PrintF() sur-ecriture de Histo::PrintF
protection dans createur par copie dans alloc

SumY... pour le cas ou H.bins==0

protection dans UpdateHisto pour HProf cree par defaut (bins==0)
Dans WriteSelf UpdateHisto appele que si necessaire (IsOk()?)

histos2.cc : le Print() dit si les erreurs ont ete demandees
histos.cc,h:

protection dans createur par copie dans alloc

pour le cas ou H.bins==0

protection dans Zero() pour Histo cree par defaut (bins==0)
protection dans operator=() pour Histo cree par defaut (bins==0)
le Print() dit si les erreurs ont ete demandees

cmv 7/7/2000

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/HiStats/hisprof.h

    r1053 r1056  
    2222
    2323  // UPDATING or SETTING
    24   void   Zero();
    25   void   UpdateHisto() const;
    26   void   SetErrOpt(bool spread = true);
    27   void   Add(float x, float y, float w = 1.);
    28   void   AddBin(int numBin, float y, float w = 1.);
     24  void UpdateHisto() const;
     25  void SetErrOpt(bool spread = true);
     26  void Zero();
     27  void Add(float x, float y, float w = 1.);
     28  void AddBin(int numBin, float y, float w = 1.);
    2929 
    3030  // Acces a l information
     31  //! Retourne true si l'histogramme est a jours, false sinon.
     32  inline bool IsOk() const {return Ok;}
    3133  //! Retourne l'histogramme de profil.
    3234  inline Histo GetHisto()
    3335               {if(!Ok) UpdateHisto(); return (Histo) *this;}
    3436  //! Retourne le contenu de la moyenne dans le vecteur v
    35   inline void GetMean(TVector<r_8>& v)
     37  inline void GetValue(TVector<r_8>& v)
    3638              {if(!Ok) UpdateHisto(); Histo::GetValue(v);}
    3739  //! Retourne le contenu au carre de la dispersion/erreur dans le vecteur v
    3840  inline void GetError2(TVector<r_8>& v)
    3941              {if(!Ok) UpdateHisto(); Histo::GetError2(v);}
     42  //! Retourne le contenu au carre de la dispersion/erreur dans le vecteur v
     43  inline void GetError(TVector<r_8>& v)
     44              {if(!Ok) UpdateHisto(); Histo::GetError(v);}
    4045  //! Retourne le contenu du bin i
    4146  inline float operator()(int i) const
    4247               {if(!Ok) UpdateHisto(); return data[i];}
    4348  //! Retourne le carre de la dispersion/erreur du bin i
    44   inline float Error2(int i) const
    45                {if(!Ok) UpdateHisto(); return (float) err2[i];}
     49  inline double Error2(int i) const
     50         {if(!Ok) UpdateHisto(); return (float) err2[i];}
    4651  //! Retourne la dispersion/erreur du bin i
    4752  inline float Error(int i) const
    4853         {if(!Ok) UpdateHisto();
    49           return err2[i]>0. ? (float) sqrt(err2[i]) : 0.f;}
     54          return (err2[i]>0.) ? (float) sqrt(err2[i]) : 0.f;}
    5055
    5156  // Operators
     
    5560  // Fit
    5661  //! Fit du profile par ``gfit''.
    57   inline int    Fit(GeneralFit& gfit)
     62  inline int Fit(GeneralFit& gfit)
    5863         {if(!Ok) UpdateHisto(); return Histo::Fit(gfit,0);}
    5964  //! Retourne l'Histogramme des residus par ``gfit''.
    60   inline Histo  FitResidus(GeneralFit& gfit)
     65  inline Histo FitResidus(GeneralFit& gfit)
    6166         {if(!Ok) UpdateHisto(); return Histo::FitResidus(gfit);}
    6267  //! Retourne l'Histogramme de la fonction fittee par ``gfit''.
    63   inline Histo  FitFunction(GeneralFit& gfit)
     68  inline Histo FitFunction(GeneralFit& gfit)
    6469         {if(!Ok) UpdateHisto(); return Histo::FitFunction(gfit);}
    6570
    6671  // Print
    6772  //! Print, voir detail dans Histo::Print
    68   inline void Print(int dyn=100,float hmin=1.,float hmax=-1.,int pflag=0,int il=1,int ih=-1)
    69               {if(!Ok) UpdateHisto(); Histo::Print(dyn,hmin,hmax,pflag,il,ih);}
     73  inline void Print(int dyn=100,float hmin=1.,float hmax=-1.
     74                   ,int pflag=0,int il=1,int ih=-1)
     75         {if(!Ok) UpdateHisto(); Histo::Print(dyn,hmin,hmax,pflag,il,ih);}
     76  //! PrintF, voir detail dans Histo::PrintF
     77  inline void PrintF(FILE * fp,int dyn=100,float hmin=1.,float hmax=-1.
     78                    ,int pflag=0,int il=1,int ih=-1)
     79         {if(!Ok) UpdateHisto(); Histo::PrintF(fp,dyn,hmin,hmax,pflag,il,ih);}
    7080
    7181protected:
     
    7585  double*        SumY2; //!< somme des carres
    7686  double*        SumW;  //!< somme des poids
    77   bool           Ok;    //!< true isiupdate fait
     87  bool           Ok;    //!< true if update fait
    7888  float          YMin;  //!< limite minimum Y pour somme
    7989  float          YMax;  //!< limite maximum Y pour somme
Note: See TracChangeset for help on using the changeset viewer.