Fork me on GitHub

Changeset 388 in svn for trunk/Utilities/Hector/src


Ignore:
Timestamp:
May 16, 2009, 10:31:14 AM (16 years ago)
Author:
Xavier Rouby
Message:

modif Xav

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/Hector/src/H_BeamParticle.cc

    r281 r388  
    2626// c++ #includes
    2727#include <iostream>
     28#include <fstream>
    2829#include <iomanip>
    2930#include <vector>
     
    458459        delete [] graph;
    459460        return ppath;
     461}
     462
     463void 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();
    460473}
    461474
Note: See TracChangeset for help on using the changeset viewer.