Changeset 388 in svn for trunk/Utilities
- Timestamp:
- May 16, 2009, 10:31:14 AM (16 years ago)
- Location:
- trunk/Utilities/Hector
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Utilities/Hector/include/H_BeamParticle.h
r281 r388 132 132 /// Returns the particle path in the beamline 133 133 TGraph * getPath(const int , const int ) const; 134 void getPath(const int , const string& ) const; 134 135 /// Computes the position of the particle at the end of each element of the beam. 135 136 void computePath(const H_AbstractBeamLine * beam, const bool NonLinear=true); -
trunk/Utilities/Hector/src/H_BeamParticle.cc
r281 r388 26 26 // c++ #includes 27 27 #include <iostream> 28 #include <fstream> 28 29 #include <iomanip> 29 30 #include <vector> … … 458 459 delete [] graph; 459 460 return ppath; 461 } 462 463 void H_BeamParticle::getPath(const int x_or_y, const string& filename) const { 464 ofstream outfile(filename.c_str()); 465 int index; 466 if(x_or_y==0) {index = INDEX_X;} else {index = INDEX_Y;} 467 468 vector<TVectorD>::const_iterator position_i; 469 for(position_i = positions.begin(); position_i < positions.end(); position_i++) { 470 outfile << (*position_i)[INDEX_S] <<"\t\t" << (*position_i)[index] << endl; 471 } 472 outfile.close(); 460 473 } 461 474
Note:
See TracChangeset
for help on using the changeset viewer.