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_OpticalElement.h

    r1360 r1365  
    22#define _H_OpticalElement_
    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
     8
     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*/
    2114
    2215/// \file H_OpticalElement.h
     
    3326// ROOT #includes
    3427#include "TMatrix.h"
    35 #include "TVectorD.h"
    3628
    3729// local #includes
     
    4335
    4436        // type #defines
    45 enum {DRIFT=1, RDIPOLE, SDIPOLE, VQUADRUPOLE, HQUADRUPOLE, VKICKER, HKICKER, RCOLLIMATOR, ECOLLIMATOR, CCOLLIMATOR, RP, IP, MARKER};
     37#define DRIFT        1
     38#define RDIPOLE      2
     39#define SDIPOLE      3
     40#define VQUADRUPOLE  4
     41#define HQUADRUPOLE  5
     42#define VKICKER      6
     43#define HKICKER      7
     44#define RCOLLIMATOR  8
     45#define ECOLLIMATOR  9
     46#define CCOLLIMATOR 10
     47#define RP          11
     48#define IP          12
     49#define MARKER      13
    4650
    4751        // typestring[30] #defines
     
    6569        public:
    6670        ///     init method for constructors
    67                 void init(const string&, const int , const double , const double , const double);
     71                void init(const string, const int , const double , const double , const double, H_Aperture*);
    6872                /// Constructors and destructor
    6973                //@{
    70                 H_OpticalElement(const string&, const int, const double, const double, const double, H_Aperture*);
     74                H_OpticalElement(const string, const int, const double, const double, const double, H_Aperture*);
    7175                H_OpticalElement(const int, const double, const double, const double, H_Aperture*);
    72                 H_OpticalElement(const string&, const int, const double, const double, const double);
     76                H_OpticalElement(const string, const int, const double, const double, const double);
    7377                H_OpticalElement(const int, const double, const double, const double);
    7478                H_OpticalElement();
    7579                H_OpticalElement(const H_OpticalElement&);
    76                 virtual ~H_OpticalElement() { delete element_aperture;};
     80                virtual ~H_OpticalElement() {delete element_mat; delete element_aperture;};
    7781                //@}
    7882                ///     Prints the element features
    79                 virtual void printProperties() const { cout << *this; return;};
     83                virtual void printProperties() const ;
    8084                ///     Shows the element transport matrix
    8185                void showMatrix() const ;
     
    8387                void drawAperture() const ;
    8488                ///     Sets the aperture of the element
    85                 void setAperture(const H_Aperture*);
     89                void setAperture(H_Aperture *);
    8690                ///     Ordering operator acting on the s coordinate
    87                 inline bool operator>(const H_OpticalElement& tocomp) const {return ( fs>tocomp.getS() ); };
     91                inline bool operator>(const H_OpticalElement tocomp) const {if(fs>tocomp.getS()) { return true; } else { return false; }};
    8892                ///     Ordering operator acting on the s coordinate
    89                 inline bool operator<(const H_OpticalElement& tocomp) const {return ( fs<tocomp.getS() ); };
     93                inline bool operator<(const H_OpticalElement tocomp) const {if(fs<tocomp.getS()) { return true; } else { return false; }};
    9094                ///     Copy operator
    9195                H_OpticalElement& operator=(const H_OpticalElement&);
     
    9397                //@{
    9498                inline void setS(const double new_s) {fs=new_s;};
    95                 inline void setLength(const double new_l) { element_length = new_l;};
    9699                inline void setX(const double new_pos) {
    97100                        /// @param new_pos in [m]
     
    136139                ///     Returns the element transport matrix
    137140                //@{
    138                 TMatrix getMatrix() ;
    139                 TMatrix getMatrix(const float, const float, const float) ;
     141                TMatrix getMatrix() const;
     142                TMatrix getMatrix(const float, const float, const float) const;
    140143                //@}
    141144                ///     Returns the element aperture
    142                 H_Aperture* getAperture() const {return element_aperture;};
     145                H_Aperture * getAperture() const {return element_aperture;};
    143146                ///     Sets the beta functions
    144147                //@{
     
    172175                inline double getRelY() const {return rely;};
    173176                //@}
    174                 virtual H_OpticalElement* clone() const { return new H_OpticalElement();};
    175                 TVectorD getHitPosition(const TVectorD& , const double, const double, const double);
    176177
    177178
     
    205206                virtual void setTypeString() {return;};
    206207                /// Optical element transport matrix.
    207                 virtual void setMatrix(const float, const float, const float) { cout<<"dummy setmatrix"<<endl; return;};
     208                virtual void setMatrix(const float, const float, const float) const {return;};
    208209                /// Optical element transport matrix.
    209                 TMatrix element_mat;
    210                 /// Optical element aperture.
    211                 H_Aperture* element_aperture;
    212 
    213         friend std::ostream& operator<< (std::ostream& os, const H_OpticalElement& el);
     210                TMatrix * element_mat;
     211                /// Optical element aperture.
     212                H_Aperture * element_aperture;
    214213};
    215214
Note: See TracChangeset for help on using the changeset viewer.