Fork me on GitHub

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


Ignore:
Timestamp:
Feb 2, 2009, 12:26:00 PM (16 years ago)
Author:
Xavier Rouby
Message:

passing all objects as references

Location:
trunk/Utilities/Hector/src
Files:
7 edited

Legend:

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

    r3 r216  
    134134}
    135135
    136 const TMatrix H_AbstractBeamLine::getPartialMatrix(const string elname, const float eloss, const float p_mass, const float p_charge) {
     136const TMatrix H_AbstractBeamLine::getPartialMatrix(const string& elname, const float eloss, const float p_mass, const float p_charge) {
    137137
    138138        vector<H_OpticalElement*>::iterator element_i;
     
    186186
    187187
    188 H_OpticalElement * H_AbstractBeamLine::getElement(const string el_name) {
     188H_OpticalElement * H_AbstractBeamLine::getElement(const string& el_name) {
    189189        for(unsigned int i=0; i < elements.size(); i++) {
    190190                if( (*(elements.begin()+i))->getName() == el_name )
     
    195195}
    196196
    197 H_OpticalElement * H_AbstractBeamLine::getElement(const string el_name) const {
     197H_OpticalElement * H_AbstractBeamLine::getElement(const string& el_name) const {
    198198        for(unsigned int i=0; i < elements.size(); i++) {
    199199                if( (*(elements.begin()+i))->getName() == el_name)
     
    435435}
    436436
    437 void H_AbstractBeamLine::moveElement(const string name, const float new_s) {
     437void H_AbstractBeamLine::moveElement(const string& name, const float new_s) {
    438438        /// @param name identifies the element to move
    439439        /// @param new_s is where to put it
     
    448448}
    449449
    450 void H_AbstractBeamLine::alignElement(const string name, const float disp_x, const float disp_y) {
     450void H_AbstractBeamLine::alignElement(const string& name, const float disp_x, const float disp_y) {
    451451        /// @param name identifies the element to move
    452452        /// @param disp_x identifies the displacement to add in x [\f$ \mu m \f$]
     
    464464}
    465465
    466 void H_AbstractBeamLine::tiltElement(const string name, const float ang_x, const float ang_y) {
     466void H_AbstractBeamLine::tiltElement(const string& name, const float ang_x, const float ang_y) {
    467467        /// @param name identifies the element to move
    468468        /// @param ang_x identifies the angle to add in x
  • trunk/Utilities/Hector/src/H_BeamLine.cc

    r3 r216  
    6868}
    6969
    70 void H_BeamLine::findIP(const string filename) {
     70void H_BeamLine::findIP(const string& filename) {
    7171        findIP(filename,"IP5");
    7272        return;
    7373}
    7474
    75 void H_BeamLine::findIP(const string filename, const string ipname) {
     75void H_BeamLine::findIP(const string& filename, const string& ipname) {
    7676        // searches for the IP position in the extended table.
    7777        ifstream tabfile(filename.c_str());
     
    127127}
    128128
    129 void H_BeamLine::fill(const string filename) {
     129void H_BeamLine::fill(const string& filename) {
    130130        fill(filename,1,"IP5");
    131131        return;
     
    133133
    134134
    135 void H_BeamLine::fill(const string filename, const int dir, const string ipname) {
     135void H_BeamLine::fill(const string& filename, const int dir, const string& ipname) {
    136136        string headers[40];  // table of all column headers
    137137        int header_type[40]; // table of all column types
  • trunk/Utilities/Hector/src/H_BeamLineParser.cc

    r3 r216  
    3131
    3232/// Identifies the column content from its header
    33 int column_identification(const string header) {
     33int column_identification(const string& header) {
    3434        // identifies the column type from its name
    3535
  • trunk/Utilities/Hector/src/H_BeamParticle.cc

    r3 r216  
    444444}
    445445
    446 void H_BeamParticle::propagate(const H_AbstractBeamLine * beam, const string el_name) {
     446void H_BeamParticle::propagate(const H_AbstractBeamLine * beam, const string& el_name) {
    447447        propagate(beam->getElement(el_name)->getS()+beam->getElement(el_name)->getLength());
    448448        return;
  • trunk/Utilities/Hector/src/H_OpticalElement.cc

    r3 r216  
    2828
    2929/// called by the constructors
    30 void H_OpticalElement::init(const string nameE, const int typeE, const double s, const double k, const double l) {
     30void H_OpticalElement::init(const string& nameE, const int typeE, const double s, const double k, const double l) {
    3131        // this is called by the constructors
    3232        // must be in public section !
     
    5656}
    5757
    58 H_OpticalElement::H_OpticalElement(const string nameE, const int typeE, const double s, const double k, const double l) : element_aperture(new H_Aperture()) {
     58H_OpticalElement::H_OpticalElement(const string& nameE, const int typeE, const double s, const double k, const double l) : element_aperture(new H_Aperture()) {
    5959        init(nameE,typeE,s,k,l);
    6060}
    6161
    62 H_OpticalElement::H_OpticalElement(const string nameE, const int typeE, const double s, const double k, const double l, H_Aperture* the_app) : element_aperture(the_app->clone()) {
     62H_OpticalElement::H_OpticalElement(const string& nameE, const int typeE, const double s, const double k, const double l, H_Aperture* the_app) : element_aperture(the_app->clone()) {
    6363        init(nameE,typeE,s,k,l);
    6464}
  • trunk/Utilities/Hector/src/H_RectangularCollimator.cc

    r3 r216  
    3030}
    3131
    32 H_RectangularCollimator::H_RectangularCollimator(const string nameE, const double s, const double l) :H_Drift(nameE,s,l){
     32H_RectangularCollimator::H_RectangularCollimator(const string& nameE, const double s, const double l) :H_Drift(nameE,s,l){
    3333        type = RCOLLIMATOR;
    3434        init();
  • trunk/Utilities/Hector/src/H_RomanPot.cc

    r3 r216  
    3232}
    3333
    34 H_RomanPot::H_RomanPot(const string nameE, const double s, const double app) :H_Drift(nameE,s,RP_LENGTH){
     34H_RomanPot::H_RomanPot(const string& nameE, const double s, const double app) :H_Drift(nameE,s,RP_LENGTH){
    3535                type = RP;
    3636                init();
Note: See TracChangeset for help on using the changeset viewer.