Changeset 1365 in svn for trunk/external/Hector/H_OpticalElement.h
- Timestamp:
- Apr 16, 2014, 3:56:14 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/external/Hector/H_OpticalElement.h
r1360 r1365 2 2 #define _H_OpticalElement_ 3 3 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 */ 21 14 22 15 /// \file H_OpticalElement.h … … 33 26 // ROOT #includes 34 27 #include "TMatrix.h" 35 #include "TVectorD.h"36 28 37 29 // local #includes … … 43 35 44 36 // 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 46 50 47 51 // typestring[30] #defines … … 65 69 public: 66 70 /// 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*); 68 72 /// Constructors and destructor 69 73 //@{ 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*); 71 75 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); 73 77 H_OpticalElement(const int, const double, const double, const double); 74 78 H_OpticalElement(); 75 79 H_OpticalElement(const H_OpticalElement&); 76 virtual ~H_OpticalElement() {delete element_aperture;};80 virtual ~H_OpticalElement() {delete element_mat; delete element_aperture;}; 77 81 //@} 78 82 /// Prints the element features 79 virtual void printProperties() const { cout << *this; return;};83 virtual void printProperties() const ; 80 84 /// Shows the element transport matrix 81 85 void showMatrix() const ; … … 83 87 void drawAperture() const ; 84 88 /// Sets the aperture of the element 85 void setAperture( const H_Aperture*);89 void setAperture(H_Aperture *); 86 90 /// 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; }}; 88 92 /// 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; }}; 90 94 /// Copy operator 91 95 H_OpticalElement& operator=(const H_OpticalElement&); … … 93 97 //@{ 94 98 inline void setS(const double new_s) {fs=new_s;}; 95 inline void setLength(const double new_l) { element_length = new_l;};96 99 inline void setX(const double new_pos) { 97 100 /// @param new_pos in [m] … … 136 139 /// Returns the element transport matrix 137 140 //@{ 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; 140 143 //@} 141 144 /// Returns the element aperture 142 H_Aperture * getAperture() const {return element_aperture;};145 H_Aperture * getAperture() const {return element_aperture;}; 143 146 /// Sets the beta functions 144 147 //@{ … … 172 175 inline double getRelY() const {return rely;}; 173 176 //@} 174 virtual H_OpticalElement* clone() const { return new H_OpticalElement();};175 TVectorD getHitPosition(const TVectorD& , const double, const double, const double);176 177 177 178 … … 205 206 virtual void setTypeString() {return;}; 206 207 /// 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;}; 208 209 /// 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; 214 213 }; 215 214
Note:
See TracChangeset
for help on using the changeset viewer.