Ignore:
Timestamp:
Jan 10, 2007, 12:53:57 PM (19 years ago)
Author:
cmv
Message:

modif HistoErr Histo2DErr cmv 10/01/07

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/FitsIOServer/fitshistos.cc

    r3059 r3123  
    99#include "histos.h"
    1010#include "hisprof.h"
    11 #include "histerr.h"
    1211#include "histos2.h"
    1312
     
    1615
    1716
    18 ///////////////////////////////////////////////////////////////////////////
    19 ///////////////////////// Histo , HProf , HistoErr ////////////////////////
    20 ///////////////////////////////////////////////////////////////////////////
     17////////////////////////////////////////////////////////////////
     18///////////////////////// Histo , HProf ////////////////////////
     19////////////////////////////////////////////////////////////////
    2120
    2221DECL_TEMP_SPEC  /* equivalent a template <> , pour SGI-CC en particulier */
     
    2726  string clsnm = is.KeyValue(key);
    2827  if ( (clsnm == "SOPHYA::Histo")
    29      || (clsnm == "SOPHYA::HProf")
    30      || (clsnm == "SOPHYA::HistoErr") ) return 2;
     28     || (clsnm == "SOPHYA::HProf") ) return 2;
    3129  return 0;
    3230}
     
    5048  Histo*    h  = dynamic_cast< Histo *> (dobj);
    5149  HProf*    hp = dynamic_cast< HProf *> (dobj);
    52   HistoErr* he = dynamic_cast< HistoErr *> (dobj);
    5350
    5451  //--- Les noms de colonnes
     
    6663  }
    6764  // Le nombre d'entrees dans le bin
    68   if(he!=NULL || hp!=NULL) {
     65  if(hp!=NULL) {
    6966    if(tbltyp==ASCII_TBL) tform.push_back("D15.8"); else tform.push_back("D");
    7067    colnames.push_back("nb");
     
    8380    if(h->mErr2) FitsBlockRW<r_8>::WriteColumnData(os,2,1,1,h->mErr2,n);
    8481    if(hp!=NULL) FitsBlockRW<r_8>::WriteColumnData(os,3,1,1,hp->mSumW,n);
    85     if(he!=NULL) FitsBlockRW<r_8>::WriteColumnData(os,3,1,1,he->mNData,n);
    8682  }
    8783
     
    9187  mtv = "SOPHYA::Histo";
    9288  if(hp) mtv = "SOPHYA::HProf";
    93   else if(he) mtv = "SOPHYA::HistoErr";
    9489  os.WriteKey("SOPCLSNM",mtv," SOPHYA class name");
    9590
    9691  mtv = "Histo";
    9792  if(hp) mtv = "HProf";
    98   else if(he) mtv = "HistoErr";
    9993  os.WriteKey("CONTENT",mtv," name of SOPHYA object");
    10094
     
    142136  }
    143137 
    144   if(he) {
    145     mtv = he->mCorrel;
    146     os.WriteKey("NCORREL",mtv," number of Correl calls");
    147   }
    148 
    149138  return;
    150139}
     
    185174    if(clsnm == "SOPHYA::Histo") dobj = new Histo;
    186175    else if(clsnm == "SOPHYA::HProf") dobj = new HProf;
    187     else if(clsnm == "SOPHYA::HistoErr") dobj = new HistoErr;
    188176  }
    189177
     
    191179  Histo*    h  = dynamic_cast< Histo *> (dobj);
    192180  HProf*    hp = dynamic_cast< HProf *> (dobj);
    193   HistoErr* he = dynamic_cast< HistoErr *> (dobj);
    194181
    195182  //--- Allocation pour histo
    196   if(he && (clsnm=="SOPHYA::HistoErr")) {
    197     if(ncol<3)
    198       throw FitsIOException("FitsHandler<Histo>::Read() wrong number of columns for HistoErr");
    199     he->CreateOrResize(xmin,xmax,nbin);
    200   } else if(hp&& (clsnm=="SOPHYA::HProf")) {
     183  if(hp&& (clsnm=="SOPHYA::HProf")) {
    201184    if(ncol<3)
    202185      throw FitsIOException("FitsHandler<Histo>::Read() wrong number of columns for HProf");
     
    225208  }
    226209
    227   if(he) he->mCorrel = dvl.GetI("NCORREL",0);
    228 
    229210  //--- remplissage de l'histo
    230211  FitsBlockRW<r_8>::ReadColumnData(is,1,1,1,h->mData,nbin);
    231212  if(h->mErr2) FitsBlockRW<r_8>::ReadColumnData(is,2,1,1,h->mErr2,nbin);
    232213  if(hp) FitsBlockRW<r_8>::ReadColumnData(is,3,1,1,hp->mSumW,nbin);
    233   if(he) FitsBlockRW<r_8>::ReadColumnData(is,3,1,1,he->mNData,nbin);
    234214
    235215  return;
Note: See TracChangeset for help on using the changeset viewer.