Fork me on GitHub

Ignore:
Timestamp:
Apr 16, 2014, 3:56:14 PM (10 years ago)
Author:
Pavel Demin
Message:

switch to a more stable Hector version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/external/Hector/H_AbstractBeamLine.h

    r1360 r1365  
    22#define _H_AbstractBeamLine_
    33
    4   /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
    5  *                                                         *
    6 *                   --<--<--  A fast simulator --<--<--     *
    7 *                 / --<--<--     of particle   --<--<--     *
    8 *  ----HECTOR----<                                          *
    9 *                 \ -->-->-- transport through -->-->--     *
    10 *                   -->-->-- generic beamlines -->-->--     *
    11 *                                                           *
    12 * JINST 2:P09005 (2007)                                     *
    13 *      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
    14 *       http://www.fynu.ucl.ac.be/hector.html               *
    15 *                                                           *
    16 * Center for Cosmology, Particle Physics and Phenomenology  *
    17 *              Universite catholique de Louvain             *
    18 *                 Louvain-la-Neuve, Belgium                 *
    19  *                                                         *
    20    * * * * * * * * * * * * * * * * * * * * * * * * * * * */
     4/*
     5---- Hector the simulator ----
     6   A fast simulator of particles through generic beamlines.
     7   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
    218
     9        http://www.fynu.ucl.ac.be/hector.html
     10
     11   Centre de Physique des Particules et de Phénoménologie (CP3)
     12   Université Catholique de Louvain (UCL)
     13*/
    2214
    2315/// \file H_AbstractBeamLine.h
    2416/// \brief Class aiming at simulating the LHC beamline.
    2517///
    26 /// Units : angles [urad], distances [um], energies [GeV], c=[1].
     18/// Units : angles [µrad], distances [µm], energies [GeV], c=[1].
    2719
    2820        /// default length of the beam line
     
    3729// ROOT #includes
    3830#include "TMatrix.h"
    39 #include "TGraph.h"
     31////#include "TGraph.h"
    4032
    4133// local #includes
     
    4739
    4840        public:
     41                void init(const float );
    4942                ///     Constructors, destructor and operator
    5043                //@{
     
    5346                H_AbstractBeamLine(const H_AbstractBeamLine &);
    5447                H_AbstractBeamLine& operator=(const H_AbstractBeamLine&);
    55                 H_AbstractBeamLine* clone() const ;
    5648                ~H_AbstractBeamLine();
    5749                //@}
    5850                ///     Adds an element to the beamline
     51                //@{
    5952                void add(H_OpticalElement *);
     53                void add(H_OpticalElement &);
     54                //@}
    6055                ///     Returns the (float) length of the beamline
    61                 const float getLength() const { return beam_length;};
     56                inline float getLength() const { return beam_length;};
    6257                ///     Returns the (int) number of optics element of the beamline, including drifts
    63                 const unsigned int getNumberOfElements() const { return elements.size();};
     58                inline int getNumberOfElements() const { return (int)elements.size();};
    6459                ///     Returns the transport matrix for the whole beam
    65                 const TMatrix getBeamMatrix() const;
     60                const TMatrix * getBeamMatrix() const;
    6661                ///     Returns the transport matrix for the whole beam, for given energy loss/mass/charge
    67                 const TMatrix getBeamMatrix(const float , const float, const float ) ;
     62                const TMatrix * getBeamMatrix(const float , const float, const float ) ;
    6863                ///     Returns the transport matrix for a part of the beam from the IP to a given element
    69                 const TMatrix getPartialMatrix(const H_OpticalElement *) const;
     64                const TMatrix * getPartialMatrix(const H_OpticalElement *) const;
    7065                ///     Returns the transport matrix for a part of the beam from the IP to the ith element
    71                 const TMatrix getPartialMatrix(const unsigned int ) const;
     66                const TMatrix * getPartialMatrix(const unsigned int ) const;
    7267                ///     Returns the transport matrix for a part of the beam from the IP to a given element, given energy loss/mass/charge
    73                 const TMatrix getPartialMatrix(const string&, const float, const float, const float);
     68                const TMatrix * getPartialMatrix(const string, const float, const float, const float);
    7469                ///     Returns the ith element of the beamline
    7570                //@{
    7671                H_OpticalElement * getElement(const unsigned int );
    77                 H_OpticalElement * getElement(const unsigned int ) const;
     72                const H_OpticalElement * getElement(const unsigned int ) const;
    7873                //@}
    7974                ///     Returns a given element of the beamline, choosen by name
    8075                //@{
    81                 H_OpticalElement * getElement(const string& );
    82                 H_OpticalElement * getElement(const string& ) const;
     76                H_OpticalElement * getElement(const string );
     77                const H_OpticalElement * getElement(const string ) const;
    8378                //@}
    8479                ///     Print some info
     
    9691                ///     Computes global transport matrix
    9792                void calcMatrix();
    98                 ///     Draws the legend of the elements of the beam
    99                 void draw(const float xmin =0.85, const float ymin=0.5, const float xmax=1, const float ymax=1) const;
     93                ///     Draws the elements of the beam
     94                void draw() const;
    10095                ///     Draws the elements of the beam in the (x,s) plane
    101                 void drawX(const float, const float, const float scale=1) const;
     96                void drawX(const float, const float) const;
    10297                ///     Draws the elements of the beam in the (y,s) plane
    10398                void drawY(const float, const float) const;
    10499                ///     Moves an element in the list, reorders the lists and recomputes the transport matrix
    105                 void moveElement(const string&, const float );
     100                void moveElement(const string, const float );
    106101                /// Moves the given element tranversely by given amounts.
    107                 void alignElement(const string&, const float, const float);
     102                void alignElement(const string, const float, const float);
    108103                /// Tilts the given element tranversely by given angles.
    109                 void tiltElement(const string&, const float, const float);
     104                void tiltElement(const string, const float, const float);
    110105                ///     Offsets all element in X pos from the start position
    111106                void offsetElements(const float start, const float offset);
    112107                ///     Draws the beta functions, from MAD
    113108                //@{
    114                 TGraph * getBetaX() const;
    115                 TGraph * getBetaY() const;
     109                ////TGraph * getBetaX() const;
     110                ////TGraph * getBetaY() const;
    116111                //@}
    117112                ///     Draws the dispersion functions, from MAD
    118113                //@{
    119                 TGraph * getDX() const;
    120                 TGraph * getDY() const;
     114                ////TGraph * getDX() const;
     115                ////TGraph * getDY() const;
    121116                //@}
    122117                ///     Draws the relative position functions, from MAD
    123118                //@{
    124                 TGraph * getRelX() const;
    125                 TGraph * getRelY() const;
     119                ////TGraph * getRelX() const;
     120                ////TGraph * getRelY() const;
    126121                //@}
    127122
    128123
    129124        private:
     125                /// list of all optics elements, including drifts
     126                vector<H_OpticalElement*> elements;
    130127                /// list of matrices, 1 matrix = the transport till the end of each element
    131128                vector<TMatrix> matrices;
    132129                /// transport matrix for the whole beam
    133                 TMatrix beam_mat;
    134                 /// list of all optics elements, including drifts
    135                 vector<H_OpticalElement*> elements;
     130                TMatrix * beam_mat;                     
    136131                /// Orderting method for the vector of H_OpticalElement*
    137                 struct ordering{ bool operator()(const H_OpticalElement* el1, const H_OpticalElement* el2) const {return (*el1 < *el2);}};
    138                 // private method for copying the contents of "elements"
    139                 void cloneElements(const H_AbstractBeamLine&);
     132                struct ordering{ bool operator()(H_OpticalElement* el1, H_OpticalElement* el2) const { return (*el1 < *el2);}};
    140133
    141134        protected:
    142                 void init(const float );
    143135                /// total length of the beamline
    144136                float beam_length;
    145         friend std::ostream& operator<< (std::ostream& os, const H_AbstractBeamLine& be);
    146137};
    147138
Note: See TracChangeset for help on using the changeset viewer.