Changeset 324 in PSPA for Interface_Web/trunk/pspaWT/sources/controler/src/particleBeam.cc
- Timestamp:
- Feb 18, 2013, 1:52:42 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/controler/src/particleBeam.cc
r314 r324 428 428 } 429 429 430 void particleBeam::histogramme(vector<double>&xcor,vector<int>& hist,int& cnts )430 void particleBeam::histogramme(vector<double>&xcor,vector<int>& hist,int& cnts,double out[3]) 431 431 { 432 // sortie pour la legende: out[0]= entries, out[1]= mean, out[2]= rms 433 432 434 double gammin= GRAND; 433 435 double gammax= -gammin; … … 446 448 447 449 double sum= (float)goodPartic_.size(); 450 out[0]= sum; 448 451 Emoy /= sum; 452 out[1]= Emoy; //MeV 449 453 ecatyp /= sum; 454 out[2]= 1000.0*sqrt(ecatyp); //KeV 450 455 ecatyp = sqrt(abs(ecatyp-Emoy*Emoy)); 451 456 … … 487 492 for (int i = 0; i < ihist; ++i) { 488 493 489 // on gradue l'ab cisse en pourcents494 // on gradue l'abscisse en pourcents 490 495 xcor[i]= 100.*( vmin+i*hpas ); 491 496 } … … 497 502 int k= var/hpas; 498 503 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; 500 505 hist[kk]++; 501 506 } … … 504 509 for (int i = 0; i < ihist; ++i) { 505 510 if(hist.at(i) > 0) cnts++; 506 cout<<"("<<xcor.at(i)<<","<<hist.at(i)<<") ";511 //cout<<"("<<xcor.at(i)<<","<<hist.at(i)<<") "; 507 512 } 508 513 cout<< " ... cnts= " << cnts << endl;
Note: See TracChangeset
for help on using the changeset viewer.