Changeset 1091 in Sophya for trunk/SophyaPI/PIext/pawexecut.cc


Ignore:
Timestamp:
Jul 26, 2000, 3:15:43 PM (25 years ago)
Author:
ercodmgr
Message:

Histos/Hprof/Histo2D en r_8 cmv 26/7/00

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/pawexecut.cc

    r1090 r1091  
    368368  {cout<<"PAWExecutor::h_integ Error: unknow object"<<tokens[0]<<endl;
    369369  return;}
    370 double norm = 1.;
     370r_8 norm = 1.;
    371371if(tokens.size()>=2) norm = atof(tokens[1].c_str());
    372372// attention: dynamic_cast<Histo*>(HProf)=Vrai!
     
    410410  {cout<<"PAWExecutor::h_rebin Error: unknow object"<<tokens[0]<<endl;
    411411  return;}
    412 int nbin = atoi(tokens[1].c_str());
     412int_4 nbin = atoi(tokens[1].c_str());
    413413Histo* h1 = dynamic_cast<Histo*>(mobj);
    414414// Ca marche aussi pour les HProf, HRebin a ete passe virtuel
     
    431431  {cout<<"PAWExecutor::h_cadd Error: unknow object"<<tokens[0]<<endl;
    432432  return;}
    433 double val = atof(tokens[1].c_str());
     433r_8 val = atof(tokens[1].c_str());
    434434Histo*   h1 = dynamic_cast<Histo*>(mobj);
    435435HProf*   hp = dynamic_cast<HProf*>(mobj);
     
    455455  {cout<<"PAWExecutor::h_cmult Error: unknow object"<<tokens[0]<<endl;
    456456  return;}
    457 double val = atof(tokens[1].c_str());
     457r_8 val = atof(tokens[1].c_str());
    458458Histo*   h1 = dynamic_cast<Histo*>(mobj);
    459459HProf*   hp = dynamic_cast<HProf*>(mobj);
     
    703703  if(tokens.size()<3)
    704704    {cout<<"Usage: h/plot/2d nameh2d bx/by/sx/sy n [dopt]"<<endl; return;}
    705   int n = atoi(tokens[2].c_str());
     705  int_4 n = atoi(tokens[2].c_str());
    706706  dopt = ""; if(tokens.size()>=4) dopt = tokens[3];
    707707  if(proj == "bx") {
     
    848848   return;}
    849849string proj = "h";  if(tokens.size()>3) proj = tokens[3];
    850 int nproj = -1;     if(tokens.size()>4) nproj = atoi(tokens[4].c_str());
     850int_4 nproj = -1;   if(tokens.size()>4) nproj = atoi(tokens[4].c_str());
    851851string hname = tokens[0];
    852852string vname = tokens[1];
     
    988988  Histo* v2 = NULL;
    989989  if(mobjv2==NULL)
    990     {v2 = new Histo(0.,(float)(i2-i1+1),i2-i1+1);
     990    {v2 = new Histo(0.,(r_8)(i2-i1+1),i2-i1+1);
    991991     omg.AddObj(v2,tokens[1]); mobjv2 = omg.GetObj(tokens[1]);}
    992992  if(typeid(*mobjv2) != typeid(Histo))
     
    10501050  Histo2D* v2 = NULL;
    10511051  if(mobjv2==NULL)
    1052     {v2 = new Histo2D(0.,(float)(i2-i1+1),i2-i1+1,0.,(float)(j2-j1+1),j2-j1+1);
     1052    {v2 = new Histo2D(0.,(r_8)(i2-i1+1),i2-i1+1,0.,(r_8)(j2-j1+1),j2-j1+1);
    10531053     omg.AddObj(v2,tokens[1]); mobjv2 = omg.GetObj(tokens[1]);}
    10541054  if(typeid(*mobjv2) != typeid(Histo2D))
     
    10961096// Decodage arguments
    10971097bool replerr = false; if(dum=="err") replerr = true;
    1098 float setval = (float) atof(tokens[1].c_str());
     1098r_8 setval = atof(tokens[1].c_str());
    10991099int testcont=0; if(tokens[2]=="v") testcont=1; if(tokens[2]=="e") testcont=2;
    11001100int_4 i1=-1, i2=-1, j1=-1, j2=-1;
    1101 float v1=0., v2=0.;
     1101r_8 v1=0., v2=0.;
    11021102if(testcont==0) {
    11031103  sscanf(tokens[2].c_str(),"%d:%d",&i1,&i2);
     
    11071107    {cout<<"PAWExecutor::h_set Error: h/set/... v v1:v2, please give v1:v2"<<endl;
    11081108    return;}
    1109   sscanf(tokens[3].c_str(),"%f:%f",&v1,&v2);
     1109  sscanf(tokens[3].c_str(),"%lf:%lf",&v1,&v2);
    11101110}
    11111111
     
    11301130    {cout<<"PAWExecutor::h_set Error: bad bin range i1="<<i1<<endl; return;}
    11311131  if(i2<i1) i2=i1; if(i2>=h->NBins()) i2=h->NBins()-1;
    1132   for(int i=i1;i<=i2;i++) {
     1132  for(int_4 i=i1;i<=i2;i++) {
    11331133    bool change = true;
    11341134    if(testcont==1) {if((*h)(i)<v1 || (*h)(i)>v2) change = false;}
     
    11471147  if(i2<i1) i2=i1; if(i2>=h2->NBinX()) i2=h2->NBinX()-1;
    11481148  if(j2<j1) j2=j1; if(j2>=h2->NBinY()) j2=h2->NBinY()-1;
    1149   for(int i=i1;i<=i2;i++) for(int j=j1;j<=j2;j++) {
     1149  for(int_4 i=i1;i<=i2;i++) for(int_4 j=j1;j<=j2;j++) {
    11501150    bool change = true;
    11511151    if(testcont==1) {if((*h2)(i,j)<v1 || (*h2)(i,j)>v2) change = false;}
     
    12011201  Histo* h  = dynamic_cast<Histo*>(mobj);
    12021202  if(!(h->HasErrors())) h->Errors();
    1203   for(int i=0;i<h->NBins();i++) {
    1204     double x = (double) (*h)(i);
    1205     double e = f(x);
     1203  for(int_4 i=0;i<h->NBins();i++) {
     1204    r_8 x = (*h)(i);
     1205    r_8 e = f(x);
    12061206    h->SetErr2(i,e*e);
    12071207  }
     
    12101210  Histo2D* h2 = dynamic_cast<Histo2D*>(mobj);
    12111211  if(!(h2->HasErrors())) h2->Errors();
    1212   for(int i=0;i<h2->NBinX();i++) for(int j=0;j<h2->NBinY();j++) {
    1213     double x = (double) (*h2)(i,j);
    1214     double e = f(x);
     1212  for(int_4 i=0;i<h2->NBinX();i++) for(int_4 j=0;j<h2->NBinY();j++) {
     1213    r_8 x = (*h2)(i,j);
     1214    r_8 e = f(x);
    12151215    h2->Error2(i,j) = e*e;
    12161216  }
Note: See TracChangeset for help on using the changeset viewer.