Fork me on GitHub

Changeset 216 in svn


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
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/Hector/include/H_AbstractBeamLine.h

    r3 r216  
    6767                const TMatrix getPartialMatrix(const unsigned int ) const;
    6868                ///     Returns the transport matrix for a part of the beam from the IP to a given element, given energy loss/mass/charge
    69                 const TMatrix getPartialMatrix(const string, const float, const float, const float);
     69                const TMatrix getPartialMatrix(const string&, const float, const float, const float);
    7070                ///     Returns the ith element of the beamline
    7171                //@{
     
    7575                ///     Returns a given element of the beamline, choosen by name
    7676                //@{
    77                 H_OpticalElement * getElement(const string );
    78                 H_OpticalElement * getElement(const string ) const;
     77                H_OpticalElement * getElement(const string& );
     78                H_OpticalElement * getElement(const string& ) const;
    7979                //@}
    8080                ///     Print some info
     
    9999                void drawY(const float, const float) const;
    100100                ///     Moves an element in the list, reorders the lists and recomputes the transport matrix
    101                 void moveElement(const string, const float );
     101                void moveElement(const string&, const float );
    102102                /// Moves the given element tranversely by given amounts.
    103                 void alignElement(const string, const float, const float);
     103                void alignElement(const string&, const float, const float);
    104104                /// Tilts the given element tranversely by given angles.
    105                 void tiltElement(const string, const float, const float);
     105                void tiltElement(const string&, const float, const float);
    106106                ///     Offsets all element in X pos from the start position
    107107                void offsetElements(const float start, const float offset);
  • trunk/Utilities/Hector/include/H_Aperture.h

    r3 r216  
    4242                H_Aperture(const H_Aperture&);
    4343                H_Aperture& operator=(const H_Aperture&);
    44                 virtual ~H_Aperture() { return; };
     44                virtual ~H_Aperture() { };
    4545                virtual H_Aperture* clone() const { return new H_Aperture(type,x1,x2,x3,x4,fx,fy); };
    4646                //@}
  • trunk/Utilities/Hector/include/H_BeamLine.h

    r3 r216  
    3636                H_BeamLine(const int, const float);
    3737                H_BeamLine& operator=(const H_BeamLine& );
    38                 ~H_BeamLine() {return;};
     38                ~H_BeamLine() {};
    3939        //@
    4040                ///     Finds the IP position (s) from the MAD table. Should be "IP5" or "IP1".
    4141                //@{
    42                 void findIP(const string);
    43                 void findIP(const string, const string);
     42                void findIP(const string&);
     43                void findIP(const string&, const string&);
    4444                //@}
    4545                ///     Reader for the external MAD table
    4646                //@{
    47                 void fill(const string);
    48                 void fill(const string, const int, const string );
     47                void fill(const string&);
     48                void fill(const string&, const int, const string& );
    4949                //@}
    5050                ///     Returns the IP position (s)
  • trunk/Utilities/Hector/include/H_BeamLineParser.h

    r3 r216  
    7171*/
    7272
    73 extern int column_identification(const string );
     73extern int column_identification(const string& );
    7474
    7575/// \brief Reader for madx tables to use in H_BeamLine
     
    8282        //@{
    8383                H_BeamLineParser() {init();}
    84                 ~H_BeamLineParser() {return;}
     84                ~H_BeamLineParser() {}
    8585        //@}
    8686                void init();
  • trunk/Utilities/Hector/include/H_BeamParticle.h

    r3 r216  
    4646                H_BeamParticle(const double, const double);
    4747                H_BeamParticle& operator=(const H_BeamParticle&);
    48                 ~H_BeamParticle() {if(stop_position) delete stop_position; if(!stop_element) delete stop_element; positions.clear(); return; }
     48                ~H_BeamParticle() {if(stop_position) delete stop_position; if(!stop_element) delete stop_element; positions.clear();}
    4949                //@}
    5050                /// Smears the (x,y) coordinates of the particle [\f$ \mu m \f$]
     
    112112                void propagate(const H_AbstractBeamLine *, const H_OpticalElement *);
    113113                /// Propagates the particle accross the beamline until a given element
    114                 void propagate(const H_AbstractBeamLine *, const string);
     114                void propagate(const H_AbstractBeamLine *, const string&);
    115115                /// Propagates the particle until the end of the beamline
    116116                void propagate(const H_AbstractBeamLine *);
  • trunk/Utilities/Hector/include/H_CircularAperture.h

    r3 r216  
    2828                H_CircularAperture():H_EllipticAperture(0,0,0,0) {type = CIRCULAR; setApertureString();}
    2929                H_CircularAperture(const float, const float, const float);
    30                 ~H_CircularAperture() {return;};
     30                ~H_CircularAperture() {};
    3131                H_CircularAperture* clone() const;
    3232                //@}
  • trunk/Utilities/Hector/include/H_Dipole.h

    r3 r216  
    2626                H_Dipole():H_OpticalElement() {}
    2727                H_Dipole(const int dtype, const double s, const double k, const double l):H_OpticalElement(dtype,s,k,l){}
    28                 H_Dipole(const string nameE, const int dtype, const double s, const double k, const double l):H_OpticalElement(nameE,dtype,s,k,l){}
    29                 virtual ~H_Dipole() {return;};
     28                H_Dipole(const string& nameE, const int dtype, const double s, const double k, const double l):H_OpticalElement(nameE,dtype,s,k,l){}
     29                virtual ~H_Dipole() {};
    3030                //@}
    3131                /// Prints the properties of the element
  • trunk/Utilities/Hector/include/H_Drift.h

    r3 r216  
    2525        /// Constructors and destructor
    2626        //@{
    27                         H_Drift():H_OpticalElement(DRIFT,0.,0.,0.) {init();}
     27                H_Drift():H_OpticalElement(DRIFT,0.,0.,0.) {init();}
    2828                H_Drift(const double s, const double l):H_OpticalElement(DRIFT,s,0.,l){init();}
    29                 H_Drift(const string nameE, const double s, const double l):H_OpticalElement(nameE,DRIFT,s,0.,l){init();}
    30                 ~H_Drift() { return; };
     29                H_Drift(const string& nameE, const double s, const double l):H_OpticalElement(nameE,DRIFT,s,0.,l){init();}
     30                ~H_Drift() { };
    3131        //@}
    3232                virtual void printProperties() const;
    3333                void init();
    34                         H_Drift* clone() const;
     34                H_Drift* clone() const;
    3535
    3636        protected:
  • trunk/Utilities/Hector/include/H_EllipticAperture.h

    r3 r216  
    2727                H_EllipticAperture():H_Aperture(ELLIPTIC,0,0,0,0,0,0) {}
    2828                H_EllipticAperture(const float, const float, const float, const float);
    29                 ~H_EllipticAperture() {return;};
     29                ~H_EllipticAperture() {};
    3030                virtual H_EllipticAperture* clone() const;
    3131                //@}
  • trunk/Utilities/Hector/include/H_HorizontalKicker.h

    r3 r216  
    2929                H_HorizontalKicker():H_Kicker(HKICKER,0.,0.,0.) {init();}
    3030                H_HorizontalKicker(const double s, const double k, const double l) :H_Kicker(HKICKER,s,k,l){init();}
    31                 H_HorizontalKicker(const string nameE, const double s, const double k, const double l) :H_Kicker(nameE,HKICKER,s,k,l){init();}
    32                 ~H_HorizontalKicker() {return;};
     31                H_HorizontalKicker(const string &nameE, const double s, const double k, const double l) :H_Kicker(nameE,HKICKER,s,k,l){init();}
     32                ~H_HorizontalKicker() {};
    3333        //@}
    3434                H_HorizontalKicker* clone() const;
  • trunk/Utilities/Hector/include/H_HorizontalQuadrupole.h

    r3 r216  
    2727                H_HorizontalQuadrupole():H_Quadrupole(HQUADRUPOLE,0.,0.,0.) {init();}
    2828                H_HorizontalQuadrupole(const double s, const double k, const double l) : H_Quadrupole(HQUADRUPOLE,s,k,l){init();}
    29                 H_HorizontalQuadrupole(const string nameE, const double s, const double k, const double l) : H_Quadrupole(nameE,HQUADRUPOLE,s,k,l){init();}
    30                 ~H_HorizontalQuadrupole() {return;};
     29                H_HorizontalQuadrupole(const string& nameE, const double s, const double k, const double l) : H_Quadrupole(nameE,HQUADRUPOLE,s,k,l){init();}
     30                ~H_HorizontalQuadrupole() {};
    3131        //@}
    3232                H_HorizontalQuadrupole* clone() const ;
  • trunk/Utilities/Hector/include/H_Kicker.h

    r3 r216  
    2828                H_Kicker():H_OpticalElement() {}
    2929                H_Kicker(const int dtype, const double s, const double k, const double l):H_OpticalElement(dtype,s,k,l){}
    30                 H_Kicker(const string nameE, const int dtype, const double s, const double k, const double l):H_OpticalElement(nameE,dtype,s,k,l){}
    31                 virtual ~H_Kicker() {return;};
     30                H_Kicker(const string& nameE, const int dtype, const double s, const double k, const double l):H_OpticalElement(nameE,dtype,s,k,l){}
     31                virtual ~H_Kicker() {};
    3232        //@}
    3333        /// prints the kicker properties
  • trunk/Utilities/Hector/include/H_Marker.h

    r3 r216  
    2727                H_Marker():H_Drift() { type = MARKER; init();}
    2828                H_Marker(const double s):H_Drift(s,0.) { type =MARKER; init();}
    29                 H_Marker(const string nameE, const double s):H_Drift(nameE,s,0.) { type=MARKER; init();}
    30                 ~H_Marker() { return; };
     29                H_Marker(const string& nameE, const double s):H_Drift(nameE,s,0.) { type=MARKER; init();}
     30                ~H_Marker() { };
    3131        //@}
    3232                virtual void printProperties() const;
  • trunk/Utilities/Hector/include/H_OpticalElement.h

    r3 r216  
    7070        public:
    7171        ///     init method for constructors
    72                 void init(const string, const int , const double , const double , const double);
     72                void init(const string&, const int , const double , const double , const double);
    7373                /// Constructors and destructor
    7474                //@{
    75                 H_OpticalElement(const string, const int, const double, const double, const double, H_Aperture*);
     75                H_OpticalElement(const string&, const int, const double, const double, const double, H_Aperture*);
    7676                H_OpticalElement(const int, const double, const double, const double, H_Aperture*);
    77                 H_OpticalElement(const string, const int, const double, const double, const double);
     77                H_OpticalElement(const string&, const int, const double, const double, const double);
    7878                H_OpticalElement(const int, const double, const double, const double);
    7979                H_OpticalElement();
  • trunk/Utilities/Hector/include/H_Quadrupole.h

    r3 r216  
    2727                H_Quadrupole():H_OpticalElement() {}
    2828                H_Quadrupole(const int dtype, const double s, const double k, const double l) : H_OpticalElement(dtype,s,k,l) {}
    29                 H_Quadrupole(const string nameE, const int dtype, const double s, const double k, const double l) : H_OpticalElement(nameE,dtype,s,k,l) {}
    30                 virtual ~H_Quadrupole() {return;};
     29                H_Quadrupole(const string& nameE, const int dtype, const double s, const double k, const double l) : H_OpticalElement(nameE,dtype,s,k,l) {}
     30                virtual ~H_Quadrupole() {};
    3131        //@}   
    3232                virtual void printProperties() const;
  • trunk/Utilities/Hector/include/H_RectEllipticAperture.h

    r3 r216  
    2727                H_RectEllipticAperture():H_Aperture(RECTELLIPSE,0,0,0,0,0,0) {}
    2828                H_RectEllipticAperture(const float,const float,const float,const float, const float, const float);
    29                 ~H_RectEllipticAperture() {return;};
     29                ~H_RectEllipticAperture() {};
    3030                H_RectEllipticAperture* clone() const;
    3131                //@}
  • trunk/Utilities/Hector/include/H_RectangularAperture.h

    r3 r216  
    2727                H_RectangularAperture():H_Aperture(RECTANGULAR,0,0,0,0,0,0) {}
    2828                H_RectangularAperture(const float,const float,const float,const float);
    29                 ~H_RectangularAperture() {return;};
     29                ~H_RectangularAperture() {};
    3030                H_RectangularAperture* clone() const;
    3131                //@}
  • trunk/Utilities/Hector/include/H_RectangularCollimator.h

    r3 r216  
    2727                H_RectangularCollimator():H_Drift() {type = RCOLLIMATOR; init();}
    2828                H_RectangularCollimator(const double, const double );
    29                 H_RectangularCollimator(const string, const double, const double );
    30                 ~H_RectangularCollimator() { return; };
     29                H_RectangularCollimator(const string&, const double, const double );
     30                ~H_RectangularCollimator() {};
    3131        //@}
    3232                virtual void printProperties() const;
  • trunk/Utilities/Hector/include/H_RectangularDipole.h

    r3 r216  
    2626                H_RectangularDipole():H_Dipole(RDIPOLE,0.,0.,0.) {init();}
    2727                H_RectangularDipole(const double s, const double k, const double l) :H_Dipole(RDIPOLE,s,k,l){init();}
    28                 H_RectangularDipole(const string nameE, const double s, const double k, const double l) :H_Dipole(nameE,RDIPOLE,s,k,l){init();}
    29                 ~H_RectangularDipole() { return; };
     28                H_RectangularDipole(const string& nameE, const double s, const double k, const double l) :H_Dipole(nameE,RDIPOLE,s,k,l){init();}
     29                ~H_RectangularDipole() {};
    3030                //@}
    3131                H_RectangularDipole* clone() const ;
  • trunk/Utilities/Hector/include/H_RomanPot.h

    r3 r216  
    2828        //@{
    2929                H_RomanPot():H_Drift() {type = RP; init();}
    30                 H_RomanPot(const string, const double, const double);
     30                H_RomanPot(const string&, const double, const double);
    3131                H_RomanPot(const double, const double);
    32                 ~H_RomanPot() { return; };
     32                ~H_RomanPot() {};
    3333        //@}
    3434                virtual void printProperties() const;
  • trunk/Utilities/Hector/include/H_SectorDipole.h

    r3 r216  
    2727                H_SectorDipole(const double s, const double k, const double l) :H_Dipole(SDIPOLE,s,k,l){init();}
    2828                H_SectorDipole(const string nameE, const double s, const double k, const double l) :H_Dipole(nameE,SDIPOLE,s,k,l){init();}
    29                 ~H_SectorDipole() {return;};
     29                ~H_SectorDipole() {};
    3030                //@}
    3131                H_SectorDipole* clone() const ;
  • trunk/Utilities/Hector/include/H_VerticalKicker.h

    r3 r216  
    3131                H_VerticalKicker(const double s, const double k, const double l) :H_Kicker(VKICKER,s,k,l){init();}
    3232                H_VerticalKicker(const string nameE, const double s, const double k, const double l) :H_Kicker(nameE,VKICKER,s,k,l){init();}
    33                 ~H_VerticalKicker() {return;};
     33                ~H_VerticalKicker() {};
    3434        //@}
    3535                H_VerticalKicker* clone() const ;
  • trunk/Utilities/Hector/include/H_VerticalQuadrupole.h

    r3 r216  
    2828                H_VerticalQuadrupole(const double s, const double k, const double l):H_Quadrupole(VQUADRUPOLE,s,k,l) {init();}
    2929                H_VerticalQuadrupole(string nameE, const double s, const double k, const double l):H_Quadrupole(nameE,VQUADRUPOLE,s,k,l) {init();}
    30                 ~H_VerticalQuadrupole() {return;};
     30                ~H_VerticalQuadrupole() {};
    3131        //@}
    3232                H_VerticalQuadrupole* clone() const ;
  • 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.