Changeset 1413 in Sophya


Ignore:
Timestamp:
Feb 20, 2001, 7:29:48 PM (25 years ago)
Author:
ansari
Message:

Methode Show et operateur << pour Histos - Reza 20/2/2001

Location:
trunk/SophyaLib/HiStats
Files:
7 edited

Legend:

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

    r1135 r1413  
    315315}
    316316
     317void HProf::Show(ostream & os) const
     318{
     319  UpdateHisto();
     320  Histo::Show(os);
     321}
     322
    317323///////////////////////////////////////////////////////////
    318324// --------------------------------------------------------
  • trunk/SophyaLib/HiStats/hisprof.h

    r1201 r1413  
    6161  virtual void HRebin(int_4 nbinew);
    6262
     63  virtual void Show(ostream& os) const;
    6364  //! Print, voir detail dans Histo::Print
    6465  inline void Print(int_4 dyn=100,r_8 hmin=1.,r_8 hmax=-1.
  • trunk/SophyaLib/HiStats/histos.cc

    r1201 r1413  
    11//
    2 // $Id: histos.cc,v 1.14 2000-09-26 15:53:34 ansari Exp $
     2// $Id: histos.cc,v 1.15 2001-02-20 18:29:48 ansari Exp $
    33//
    44
     
    12761276  \endverbatim
    12771277*/
     1278
     1279void Histo::Show(ostream & os) const
     1280{
     1281 os << " Histo::Show  "
     1282      << " nHist=" << nHist << "  nEntries=" << nEntries
     1283      << "  mUnder=" << mUnder << "  mOver=" << mOver << endl;
     1284 os << "       mBins=" << mBins
     1285      << "  min=" << mMin << "  mMax=" << mMax
     1286      << "  binWidth=" << binWidth << endl;
     1287 os << "       mean=" << Mean() << " r.m.s=" << Sigma()
     1288      << "  Errors="<<HasErrors()<< endl;
     1289}
     1290
    12781291void Histo::Print(int_4 hdyn,r_8 hmin, r_8 hmax,int_4 pflag,
    12791292                  int_4 il, int_4 ih) const
     
    12901303 if(hdyn==0) hdyn = 100;
    12911304
    1292  cout << "~Histo::Print  "
    1293       << " nHist=" << nHist << "  nEntries=" << nEntries
    1294       << "  mUnder=" << mUnder << "  mOver=" << mOver << endl;
    1295  cout << "       mBins=" << mBins
    1296       << "  min=" << mMin << "  mMax=" << mMax
    1297       << "  binWidth=" << binWidth << endl;
    1298  cout << "       mean=" << Mean() << " r.m.s=" << Sigma()
    1299       << "  Errors="<<HasErrors()<< endl;
     1305 Show(cout);
    13001306
    13011307 if(hdyn<0 || pflag<0 ) return;
  • trunk/SophyaLib/HiStats/histos.h

    r1201 r1413  
    11// This may look like C code, but it is really -*- C++ -*-
    22//
    3 // $Id: histos.h,v 1.14 2000-09-26 15:53:34 ansari Exp $
     3// $Id: histos.h,v 1.15 2001-02-20 18:29:48 ansari Exp $
    44//
    55
     
    143143
    144144  // Print et Display ASCII
     145  virtual void Show(ostream& os) const;
     146  inline  void Show() const { Show(cout); }
    145147  void Print(int_4 dyn = 100, r_8 hmin = 1., r_8 hmax = -1.,
    146148             int_4 pflag = 0, int_4 il = 1, int_4 ih = -1) const;
    147 
     149 
    148150protected:
    149151  void Delete();
     
    161163};
    162164
     165/*! Prints histogram information on stream \b s (h.Show(s)) */
     166inline ostream& operator << (ostream& s, Histo const & h)
     167  {  h.Show(s);  return(s);  }
    163168
    164169/*! \ingroup HiStats \fn operator<<(POuttPersist&,Histo)
  • trunk/SophyaLib/HiStats/histos2.cc

    r1109 r1413  
    936936  Impression des informations sur l'histogramme.
    937937*/
    938 void Histo2D::PrintStatus() const
    939 {
    940 printf("~Histo::Print    nHist=%g nEntries=%d",nHist,nEntries);
    941 if(HasErrors()) printf("  Errors=1\n"); else printf("  Errors=0\n");
    942 printf("mOver: [ %g %g %g // %g %g %g  // %g %g %g ]\n"
    943       ,mOver[2][0],mOver[2][1],mOver[2][2]
    944       ,mOver[1][0],mOver[1][1],mOver[1][2]
    945       ,mOver[0][0],mOver[0][1],mOver[0][2]);
    946 printf("  nx=%d xmin=%g xmax=%g binx=%g  ",mNx,mXmin,mXmax,mWBinx);
    947 printf("  ny=%d ymin=%g ymax=%g biny=%g\n",mNy,mYmin,mYmax,mWBiny);
     938void Histo2D::Show(ostream & os) const
     939{
     940  os << "Histo2D::Show    nHist=" << nHist << " nEntries=" << nEntries;
     941  if(HasErrors()) os << "  Errors=Y \n"; else os << "  Errors=N\n";
     942  os << "mOver: [ " ;
     943  for(int j=2; j>=0; j--) {
     944    for(int i=0; i<3; i++)
     945      os << mOver[j][i] << " " ;
     946    if (j != 0) os << "// ";
     947  }
     948  os << "]\n";
     949  os << "  nx=" << mNx << " xmin=" << mXmin << " xmax=" << mXmax
     950     << " binx=" << mWBinx ;
     951  os << "  ny=" << mNy << " ymin=" << mYmin << " ymax=" << mYmax
     952     << " biny=" << mWBiny << endl;
     953   
     954  //printf("mOver: [ %g %g %g // %g %g %g  // %g %g %g ]\n"
     955  //      ,mOver[2][0],mOver[2][1],mOver[2][2]
     956  //      ,mOver[1][0],mOver[1][1],mOver[1][2]
     957  //      ,mOver[0][0],mOver[0][1],mOver[0][2]);
     958  //printf("  nx=%d xmin=%g xmax=%g binx=%g  ",mNx,mXmin,mXmax,mWBinx);
     959  //printf("  ny=%d ymin=%g ymax=%g biny=%g\n",mNy,mYmin,mYmax,mWBiny);
    948960}
    949961
  • trunk/SophyaLib/HiStats/histos2.h

    r1109 r1413  
    138138
    139139  // Print et Display ASCII
    140   void PrintStatus() const;
     140  virtual void Show(ostream& os) const;
     141  inline void  PrintStatus() const { Show(cout); }
     142 
    141143  void Print(r_8 min=1.,r_8 max=-1.
    142144            ,int_4 il=1,int_4 ih= -1,int_4 jl=1,int_4 jh= -1) const;
     
    237239};
    238240
     241/*! Prints histogram information on stream \b s (h.Show(s)) */
     242inline ostream& operator << (ostream& s, Histo2D const & h)
     243  {  h.Show(s);  return(s);  }
     244
    239245/////////////////////////////////////////////////////////////////////////
    240246// Classe pour la gestion de persistance
  • trunk/SophyaLib/HiStats/ntuple.h

    r1405 r1413  
    9797};
    9898
    99 /*! Prints table information on stream \b s (nt.Show(os)) */
     99/*! Prints table information on stream \b s (nt.Show(s)) */
    100100inline ostream& operator << (ostream& s, NTuple const & nt)
    101101  {  nt.Show(s);  return(s);  }
Note: See TracChangeset for help on using the changeset viewer.