Ignore:
Timestamp:
Feb 18, 2013, 1:52:42 PM (11 years ago)
Author:
touze
Message:

menu analyse graphique + histo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/sources/controler/src/particleBeam.cc

    r314 r324  
    428428}
    429429
    430 void particleBeam::histogramme(vector<double>&xcor,vector<int>& hist,int& cnts)
     430void particleBeam::histogramme(vector<double>&xcor,vector<int>& hist,int& cnts,double out[3])
    431431{
     432  // sortie pour la legende: out[0]= entries, out[1]= mean, out[2]= rms
     433
    432434  double gammin= GRAND;
    433435  double gammax= -gammin;
     
    446448
    447449  double sum= (float)goodPartic_.size();
     450  out[0]= sum;
    448451  Emoy /= sum;
     452  out[1]= Emoy; //MeV
    449453  ecatyp /= sum;
     454  out[2]= 1000.0*sqrt(ecatyp); //KeV
    450455  ecatyp = sqrt(abs(ecatyp-Emoy*Emoy));
    451456
     
    487492  for (int i = 0; i < ihist; ++i) {
    488493
    489     // on gradue l'abcisse en pourcents
     494    // on gradue l'abscisse en pourcents
    490495    xcor[i]= 100.*( vmin+i*hpas );
    491496  }
     
    497502    int k= var/hpas;
    498503    int kk= (int)floor(var/hpas);
    499     if(i%20 == 0) cout<<"v("<<i<<")= " <<var<<" ["<<k<<"-"<<kk<<"], "<<endl;
     504    //if(i%20 == 0) cout<<"v("<<i<<")= " <<var<<" ["<<k<<"-"<<kk<<"], "<<endl;
    500505    hist[kk]++;
    501506  }
     
    504509  for (int i = 0; i < ihist; ++i) {
    505510    if(hist.at(i) > 0) cnts++;
    506     cout<<"("<<xcor.at(i)<<","<<hist.at(i)<<") ";
     511    //cout<<"("<<xcor.at(i)<<","<<hist.at(i)<<") ";
    507512  }
    508513  cout<< " ... cnts=  " << cnts << endl;
Note: See TracChangeset for help on using the changeset viewer.