Changeset 281 in svn for trunk/Utilities/Hector
- Timestamp:
- Mar 1, 2009, 3:56:11 PM (16 years ago)
- Location:
- trunk/Utilities/Hector
- Files:
-
- 55 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Utilities/Hector/VERSION
r3 r281 1 _1_ 4_01 _1_5_2pre -
trunk/Utilities/Hector/include/H_AbstractBeamLine.h
r216 r281 2 2 #define _H_AbstractBeamLine_ 3 3 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 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 8 21 9 http://www.fynu.ucl.ac.be/hector.html10 11 Centre de Physique des Particules et de Phï¿œnomï¿œnologie (CP3)12 Universitï¿œ Catholique de Louvain (UCL)13 */14 22 15 23 /// \file H_AbstractBeamLine.h 16 24 /// \brief Class aiming at simulating the LHC beamline. 17 25 /// 18 /// Units : angles [ ï¿œrad], distances [ï¿œm], energies [GeV], c=[1].26 /// Units : angles [urad], distances [um], energies [GeV], c=[1]. 19 27 20 28 /// default length of the beam line … … 39 47 40 48 public: 41 void init(const float );42 49 /// Constructors, destructor and operator 43 50 //@{ … … 50 57 //@} 51 58 /// Adds an element to the beamline 52 //@{53 59 void add(H_OpticalElement *); 54 void add(H_OpticalElement &);55 //@}56 60 /// Returns the (float) length of the beamline 57 inlinefloat getLength() const { return beam_length;};61 const float getLength() const { return beam_length;}; 58 62 /// Returns the (int) number of optics element of the beamline, including drifts 59 inline int getNumberOfElements() const { return (int)elements.size();};63 const unsigned int getNumberOfElements() const { return elements.size();}; 60 64 /// Returns the transport matrix for the whole beam 61 65 const TMatrix getBeamMatrix() const; … … 124 128 125 129 private: 126 /// list of all optics elements, including drifts127 vector<H_OpticalElement*> elements;128 130 /// list of matrices, 1 matrix = the transport till the end of each element 129 131 vector<TMatrix> matrices; 130 132 /// transport matrix for the whole beam 131 TMatrix beam_mat; 133 TMatrix beam_mat; 134 /// list of all optics elements, including drifts 135 vector<H_OpticalElement*> elements; 132 136 /// Orderting method for the vector of H_OpticalElement* 133 struct ordering{ bool operator()(H_OpticalElement* el1, H_OpticalElement* el2) const { return (*el1 < *el2);}}; 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&); 134 140 135 141 protected: 142 void init(const float ); 136 143 /// total length of the beamline 137 144 float beam_length; 145 friend std::ostream& operator<< (std::ostream& os, const H_AbstractBeamLine& be); 138 146 }; 139 147 -
trunk/Utilities/Hector/include/H_Aperture.h
r216 r281 2 2 #define _H_Aperture_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_Aperture.h … … 18 25 // C++ #defines 19 26 #include <string> 27 #include <iostream> 20 28 using namespace std; 21 29 22 30 // local #defines 23 #define NONE 0 24 #define RECTANGULAR 1 25 #define ELLIPTIC 2 26 #define CIRCULAR 3 27 #define RECTELLIPSE 4 31 enum {NONE=0, RECTANGULAR, ELLIPTIC, CIRCULAR, RECTELLIPSE}; 28 32 #define NONENAME "None " 29 33 #define RECTANGULARNAME "Rectangle " … … 43 47 H_Aperture& operator=(const H_Aperture&); 44 48 virtual ~H_Aperture() { }; 45 virtual H_Aperture* clone() const { return new H_Aperture(type ,x1,x2,x3,x4,fx,fy); };49 virtual H_Aperture* clone() const { return new H_Aperture(type_,x1,x2,x3,x4,fx,fy); }; 46 50 //@} 47 51 48 52 /// Prints the aperture features 49 virtual void printProperties() const; 53 //virtual void printProperties() const; 54 void printProperties() const; 50 55 /// Draws the aperture shape 51 56 virtual void draw(const float scale=1) const {return;}; … … 55 60 virtual bool isInside(const float, const float) const; 56 61 /// Returns the (int) type of aperture 57 inline int getType() const {return type ;};62 inline int getType() const {return type_;}; 58 63 /// Returns the (string) type of the aperture 59 64 inline const string getTypeString() const { return aptypestring; } … … 62 67 protected: 63 68 /// Aperture shape (either RECTANGULAR or ELLIPTIC or ...) 64 int type; 65 /// Aperture shape string 66 string aptypestring; 67 69 int type_; 68 70 /// Aperture geometrical sizes (length/width or great/small radii) [m] 69 71 //@{ 70 72 float x1, x2, x3, x4; 71 73 //@} 72 73 74 /// Horizontal coordinate of the aperture center [m] (from the nominal beam position). 74 75 //@{ 75 76 float fx, fy; 76 77 //@} 77 /// Sets the name of the aperture from its type. 78 void setApertureString(); 78 /// Aperture shape string 79 string aptypestring; 80 // Sets the name of the aperture from its type. 81 //void setApertureString(); 82 /// Gets the name of the aperture from its type. 83 const string getApertureString() const; 84 85 friend std::ostream& operator<< (std::ostream& os, const H_Aperture& ap); 79 86 }; 80 87 88 81 89 #endif -
trunk/Utilities/Hector/include/H_Beam.h
r236 r281 2 2 #define _H_Beam_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_Beam.h … … 27 34 #include "TGraphErrors.h" 28 35 #include "TMultiGraph.h" 36 #include "TMath.h" 29 37 30 38 // local #includes … … 56 64 //@} 57 65 /// Fills the beam with particles in given position/angle/energy intervals (flat distribution) 58 //void particleGun(const unsigned int Number_of_particles, const float E_min, const float E_max, const float fs_min, const float fs_max, const float fx_min, const float fx_max, const float fy_min, const float fy_max, const float tx_min, const float tx_max, const float ty_min, const float ty_max, const float p_mass, const double p_charge); 59 void particleGun(const unsigned int Number_of_particles, const float E_min=BE, const float E_max=BE, const float fs_min=0, const float fs_max=0, const float fx_min=0, const float fx_max=0, const float fy_min=0, const float fy_max=0, const float tx_min=-pi/2., const float tx_max=pi/2., const float ty_min=-pi/2., const float ty_max=pi/2., const float p_mass=MP, const double p_charge=QP, const bool flat = true); 66 void particleGun(const unsigned int Number_of_particles, const float E_min=BE, const float E_max=BE, const float fs_min=0, const float fs_max=0, const float fx_min=0, const float fx_max=0, const float fy_min=0, const float fy_max=0, const float tx_min=-TMath::Pi()/2., const float tx_max=TMath::Pi()/2., const float ty_min=-TMath::Pi()/2., const float ty_max=TMath::Pi()/2., const float p_mass=MP, const double p_charge=QP, const bool flat = true, TRandom* r=gRandom); 60 67 61 68 /// Fills the beam with particles 62 //@{ 63 void createBeamParticles(const unsigned int , const double , const double ); 64 void createBeamParticles(const unsigned int); 65 //@} 69 void createBeamParticles(const unsigned int Number_of_particles, const double p_mass=MP, const double p_charge=QP, TRandom* r=gRandom); 66 70 /// Fills the beam with particles with incremental offset and no initial transverse momentum 67 71 //@{ … … 82 86 void add(const H_BeamParticle&); 83 87 /// Compute the position of each particle in the beamline 84 //@{ 85 void computePath(const H_AbstractBeamLine *, const bool); 86 void computePath(const H_AbstractBeamLine *); 87 //@} 88 void computePath(const H_AbstractBeamLine * beamline, const bool NonLinear=false); 88 89 // Photon emission by the particle 89 // @{ 90 void emitGamma(const double, const double, const double, const double); 91 void emitGamma(const double, const double); 92 //@} 90 void emitGamma(const double gee, const double gq2, const double phimin=0, const double phimax=2*TMath::Pi()); 93 91 // Propagates the beam until a given s 94 92 void propagate(const float ); … … 146 144 void printInitialState() const; 147 145 /// Prints the properties for each particle 148 void printProperties() const ;146 void printProperties() const {cout << *this; return;} 149 147 /// Prints the list of the stopping elements in the beamline 150 148 void printStoppingElements(const vector<H_OpticalElement>&, const vector<int>&) const; … … 186 184 unsigned int Nparticles; 187 185 188 static const float pi = 3.14159265358979312;186 friend std::ostream& operator<< (std::ostream& os, const H_Beam& be); 189 187 }; 190 188 -
trunk/Utilities/Hector/include/H_BeamLine.h
r216 r281 2 2 #define _H_BeamLine_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_BeamLine.h … … 32 39 /// Constructors and destructor 33 40 //@{ 34 H_BeamLine() :H_AbstractBeamLine() {direction=1; ips=0; };41 H_BeamLine(); 35 42 H_BeamLine(const H_BeamLine& ); 36 43 H_BeamLine(const int, const float); … … 39 46 //@ 40 47 /// Finds the IP position (s) from the MAD table. Should be "IP5" or "IP1". 41 //@{ 42 void findIP(const string&); 43 void findIP(const string&, const string&); 44 //@} 48 void findIP(const string& filename, const string& ipname="IP5"); 45 49 /// Reader for the external MAD table 46 //@{ 47 void fill(const string&); 48 void fill(const string&, const int, const string& ); 49 //@} 50 void fill(const string& filename, const int dir=1, const string& ipname="IP5"); 50 51 /// Returns the IP position (s) 51 double getIP() {return ips;};52 double getIP() const {return ips;}; 52 53 /// Returns positions and angles of beam at IP 53 54 double* getIPProperties(); -
trunk/Utilities/Hector/include/H_BeamLineParser.h
r216 r281 2 2 #define _H_BeamLineParser_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_BeamLineParser.h -
trunk/Utilities/Hector/include/H_BeamParticle.h
r237 r281 2 2 #define _H_BeamParticle_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_BeamParticle.h … … 27 34 #include "TVectorD.h" 28 35 #include "TLorentzVector.h" 36 #include "TRandom3.h" 29 37 30 38 // local #includes … … 39 47 40 48 public: 41 void init();42 49 /// Constructors and Destructor 43 50 //@{ … … 49 56 //@} 50 57 /// Smears the (x,y) coordinates of the particle [\f$ \mu m \f$] 51 void smearPos(const double, const double); 52 /// Smears the (x,y) coordinates of the particle (using default values in parameters.h) 53 void smearPos(); 58 void smearPos(const double dx=SX,const double dy=SY, TRandom* r=gRandom); 54 59 /// Smears the (x,y) angular coordinates of the particle [\f$ \mu rad \f$] 55 void smearAng(const double, const double); 56 /// Smears the (x,y) angular coordinates of the particle (using default values in parameters.h) 57 void smearAng(); 60 void smearAng(const double tx=STX, const double ty=STY, TRandom* r=gRandom); 58 61 /// Smears the Energy of the particle [GeV] 59 void smearE(const double); 60 /// Smears the Energy of the particle (using default values in parameters.h) 61 void smearE(); 62 void smearE(const double erre=SBE, TRandom* r=gRandom); 62 63 /// Smears the longitudinal position of the particle [\f$ \mu m \f$] 63 void smearS(const double); 64 /// Smears the longitudinal position of the particle (using default values in parameters.h) 65 void smearS(); 64 void smearS(const double errs=SS, TRandom* r=gRandom); 66 65 /// Sets the energy [GeV]. 67 66 void setE(const double); … … 73 72 void setPosition(const double , const double , const double , const double , const double ); 74 73 /// Returns the particle mass [GeV] 75 double getM() const {return mp;};74 const double getM() const {return mp;}; 76 75 /// Returns the particle charge [e] 77 double getQ() const {return qp;};76 const double getQ() const {return qp;}; 78 77 /// Returns the current x coordinate [\f$ \mu \f$m] 79 double getX() const {return fx;};78 const double getX() const {return fx;}; 80 79 /// Returns the current y coordinate [\f$ \mu \f$m] 81 double getY() const {return fy;};80 const double getY() const {return fy;}; 82 81 /// Returns the current s coordinate [m] 83 inlinedouble getS() const {return fs;};82 const double getS() const {return fs;}; 84 83 /// Returns the current \f$ \theta_x \f$ angular coordinate [\f$ \mu \f$rad] 85 double getTX() const {return thx;};84 const double getTX() const {return thx;}; 86 85 /// Returns the current \f$ \theta_y \f$ angular coordinate [\f$ \mu \f$rad] 87 double getTY() const {return thy;};86 const double getTY() const {return thy;}; 88 87 /// Returns the current particle energy [GeV] 89 inlinedouble getE() const {return energy;};88 const double getE() const {return energy;}; 90 89 /// Returns all the positions 91 90 vector<TVectorD> getPositions() const {return positions;}; 92 bool isPhysical() const {return isphysical;};91 const bool isPhysical() const {return isphysical;}; 93 92 /// \brief Simulates the emission of a photon in a random direction 94 93 /// … … 99 98 /// \f$ Q^{2}_{max} = -2 * \big( \frac{M_{p} E_{\gamma}}{p_{1}+p_{2}} \big) \big[ 1 + \frac{E^{2}_{1} + E^{2}_{2} - M^{2}_{p} }{ E_{1} E_{2} + p_{1} p_{2}} \big] \f$ 100 99 //@{ 101 void emitGamma(const double, const double, const double, const double); 102 void emitGamma(const double, const double); 100 void emitGamma(const double gee, const double gq2, const double phimin=0, const double phimax=2*TMath::Pi()); 103 101 //@} 104 102 /// uses Pythia to generate some inelastic pp->pX collision as background … … 120 118 const TVectorD * getPosition(const int ) const; 121 119 /// Prints the properties of the particle 122 void printProperties() const ;120 void printProperties() const {cout << *this; return;}; 123 121 /// Prints the phase vector of the particle 124 122 void printV() const; … … 126 124 const H_OpticalElement * getStoppingElement() const; 127 125 /// Checks if the particle has been stopped in any element of the beamline 128 bool stopped(const H_AbstractBeamLine *);126 const bool stopped(const H_AbstractBeamLine *); 129 127 /// Returns the StopPosition vector 130 128 inline const TVectorD * getStopPosition() const { return stop_position; }; … … 134 132 /// Returns the particle path in the beamline 135 133 TGraph * getPath(const int , const int ) const; 136 /// Computes the position of the particle at the end of each element of the beam, without non linear effects137 void computePath(const H_AbstractBeamLine *);138 134 /// Computes the position of the particle at the end of each element of the beam. 139 void computePath(const H_AbstractBeamLine * , const bool);135 void computePath(const H_AbstractBeamLine * beam, const bool NonLinear=true); 140 136 /// Computes the position of the particle at the end of each element of the beam. 141 void computePath(const H_AbstractBeamLine & , const bool);137 void computePath(const H_AbstractBeamLine & beam, const bool NonLinear=true); 142 138 /// Clears H_BeamParticle::positions but keeps the initial vector. 143 139 void resetPath(); 144 140 145 141 private: 142 void init(); 146 143 /// Particle mass [GeV] 147 144 double mp; … … 175 172 void addPosition(const double , const double , const double , const double , const double ); 176 173 177 static const float pi = 3.14159265358979312;174 friend std::ostream& operator<< (std::ostream& os, const H_BeamParticle& p); 178 175 }; 179 176 #endif -
trunk/Utilities/Hector/include/H_CircularAperture.h
r216 r281 2 2 #define _H_CircularAperture_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_CircularAperture.h … … 26 33 /// Constructors and destructor 27 34 //@{ 28 H_CircularAperture():H_EllipticAperture(0,0,0,0) {type = CIRCULAR; setApertureString();} 29 H_CircularAperture(const float, const float, const float); 35 H_CircularAperture():H_EllipticAperture(CIRCULAR,0,0,0,0) {}; 36 H_CircularAperture(const float r, const float posx, const float posy) : H_EllipticAperture(CIRCULAR,r,r,posx,posy) {}; 37 /// @param r is the radius of the circular shape 38 /// @param posx, posy are the (x,y) coordinates of the center of the circle 30 39 ~H_CircularAperture() {}; 31 40 H_CircularAperture* clone() const; 32 41 //@} 33 virtual void printProperties() const;42 friend std::ostream& operator<< (std::ostream& os, const H_CircularAperture& ap); 34 43 }; 35 44 -
trunk/Utilities/Hector/include/H_Dipole.h
r216 r281 2 2 /// \brief Class aiming at simulating LHC beam dipoles. 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 #ifndef _H_Dipole_ … … 30 37 //@} 31 38 /// Prints the properties of the element 32 virtual void printProperties() const ;39 virtual void printProperties() const { cout << *this; return;}; 33 40 virtual H_Dipole* clone() const =0; 34 41 void init(); … … 37 44 virtual void setTypeString() =0; 38 45 virtual void setMatrix(const float, const float, const float) = 0; 39 46 47 friend std::ostream& operator<< (std::ostream& os, const H_Dipole& el); 40 48 }; 41 49 -
trunk/Utilities/Hector/include/H_Drift.h
r216 r281 2 2 #define _H_Drift_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_Drift.h … … 30 37 ~H_Drift() { }; 31 38 //@} 32 virtual void printProperties() const;33 39 void init(); 40 virtual void printProperties() const { cout << *this; return;}; 34 41 H_Drift* clone() const; 35 42 … … 37 44 virtual void setTypeString() {typestring = DRIFTNAME;}; 38 45 virtual void setMatrix(const float, const float, const float) ; 46 friend std::ostream& operator<< (std::ostream& os, const H_Drift& el); 39 47 }; 40 48 -
trunk/Utilities/Hector/include/H_EllipticAperture.h
r216 r281 2 2 #define _H_EllipticAperture_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_EllipticAperture.h … … 26 33 //@{ 27 34 H_EllipticAperture():H_Aperture(ELLIPTIC,0,0,0,0,0,0) {} 35 H_EllipticAperture(const int, const float, const float, const float, const float); 28 36 H_EllipticAperture(const float, const float, const float, const float); 29 37 ~H_EllipticAperture() {}; … … 34 42 /// Draws the aperture shape. 35 43 virtual void draw(const float scale=1) const; 36 virtual void printProperties() const;44 friend std::ostream& operator<< (std::ostream& os, const H_EllipticAperture& ap); 37 45 }; 38 46 -
trunk/Utilities/Hector/include/H_HorizontalKicker.h
r216 r281 1 #ifndef _H_HorizontalKicker_ 2 #define _H_HorizontalKicker_ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 21 1 22 /// \file H_HorizontalKicker.h 2 23 /// \brief Classes aiming at simulating horizontal kickers in beamline. 3 24 /// 4 25 /// fk [rad] for kickers !!!! 5 6 /*7 ---- Hector the simulator ----8 A fast simulator of particles through generic beamlines.9 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be10 11 http://www.fynu.ucl.ac.be/hector.html12 13 Centre de Physique des Particules et de Phénoménologie (CP3)14 Université Catholique de Louvain (UCL)15 */16 17 #ifndef _H_HorizontalKicker_18 #define _H_HorizontalKicker_19 26 20 27 // local #includes -
trunk/Utilities/Hector/include/H_HorizontalQuadrupole.h
r216 r281 2 2 #define _H_HorizontalQuadrupole_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_HorizontalQuadrupole.h -
trunk/Utilities/Hector/include/H_Kicker.h
r216 r281 1 #ifndef _H_Kicker_ 2 #define _H_Kicker_ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 21 1 22 /// \file H_Kicker.h 2 23 /// \brief Classes aiming at simulating kickers in LHC beamline. 3 24 /// fk [rad] for kickers !!!! 4 5 /*6 ---- Hector the simulator ----7 A fast simulator of particles through generic beamlines.8 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be9 10 http://www.fynu.ucl.ac.be/hector.html11 12 Centre de Physique des Particules et de Phénoménologie (CP3)13 Université Catholique de Louvain (UCL)14 */15 16 #ifndef _H_Kicker_17 #define _H_Kicker_18 25 19 26 // local #includes … … 31 38 virtual ~H_Kicker() {}; 32 39 //@} 33 /// prints the kicker properties34 virtual void printProperties() const;35 40 virtual H_Kicker* clone() const = 0; 41 virtual void printProperties() const { cout << *this; return;}; 36 42 void init(); 37 43 … … 39 45 virtual void setTypeString() = 0; 40 46 virtual void setMatrix(const float, const float, const float) = 0; 47 friend std::ostream& operator<< (std::ostream& os, const H_Kicker& el); 41 48 }; 42 49 -
trunk/Utilities/Hector/include/H_Marker.h
r216 r281 2 2 #define _H_Marker_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_Marker.h … … 30 37 ~H_Marker() { }; 31 38 //@} 32 virtual void printProperties() const;33 39 H_Marker* clone() const ; 34 40 void init(); … … 37 43 virtual void setTypeString() {typestring = MARKERNAME;}; 38 44 virtual void setMatrix(const float , const float, const float) ; 45 friend std::ostream& operator<< (std::ostream& os, const H_Marker& el); 39 46 }; 40 47 -
trunk/Utilities/Hector/include/H_OpticalElement.h
r216 r281 2 2 #define _H_OpticalElement_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_OpticalElement.h … … 36 43 37 44 // type #defines 38 #define DRIFT 1 39 #define RDIPOLE 2 40 #define SDIPOLE 3 41 #define VQUADRUPOLE 4 42 #define HQUADRUPOLE 5 43 #define VKICKER 6 44 #define HKICKER 7 45 #define RCOLLIMATOR 8 46 #define ECOLLIMATOR 9 47 #define CCOLLIMATOR 10 48 #define RP 11 49 #define IP 12 50 #define MARKER 13 45 enum {DRIFT=1, RDIPOLE, SDIPOLE, VQUADRUPOLE, HQUADRUPOLE, VKICKER, HKICKER, RCOLLIMATOR, ECOLLIMATOR, CCOLLIMATOR, RP, IP, MARKER}; 51 46 52 47 // typestring[30] #defines … … 82 77 //@} 83 78 /// Prints the element features 84 virtual void printProperties() const ;79 virtual void printProperties() const { cout << *this; return;}; 85 80 /// Shows the element transport matrix 86 81 void showMatrix() const ; … … 90 85 void setAperture(const H_Aperture*); 91 86 /// Ordering operator acting on the s coordinate 92 inline bool operator>(const H_OpticalElement tocomp) const {if(fs>tocomp.getS()) { return true; } else { return false; }};87 inline bool operator>(const H_OpticalElement& tocomp) const {return ( fs>tocomp.getS() ); }; 93 88 /// Ordering operator acting on the s coordinate 94 inline bool operator<(const H_OpticalElement tocomp) const {if(fs<tocomp.getS()) { return true; } else { return false; }};89 inline bool operator<(const H_OpticalElement& tocomp) const {return ( fs<tocomp.getS() ); }; 95 90 /// Copy operator 96 91 H_OpticalElement& operator=(const H_OpticalElement&); … … 178 173 //@} 179 174 virtual H_OpticalElement* clone() const { return new H_OpticalElement();}; 180 TVectorD getHitPosition( TVectorD, double, double,double);175 TVectorD getHitPosition(const TVectorD& , const double, const double, const double); 181 176 182 177 … … 210 205 virtual void setTypeString() {return;}; 211 206 /// Optical element transport matrix. 212 207 virtual void setMatrix(const float, const float, const float) { cout<<"dummy setmatrix"<<endl; return;}; 213 208 /// Optical element transport matrix. 214 209 TMatrix element_mat; 215 210 /// Optical element aperture. 216 211 H_Aperture* element_aperture; 212 213 friend std::ostream& operator<< (std::ostream& os, const H_OpticalElement& el); 217 214 }; 218 215 -
trunk/Utilities/Hector/include/H_Parameters.h
r235 r281 2 2 #define _Hector_parameters_ 3 3 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 J.~de Favereau, X.~Rouby and K.~Piotrzkowski, 11 Hector, a fast simulator for the transport of particles in beamlines, 12 JINST 2, P09005 (2007) 13 arXiv:0707.1198 [physics.acc-ph] 14 15 Centre de Physique des Particules et de Phénoménologie (CP3) 16 Université Catholique de Louvain (UCL) 17 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 18 21 19 22 /// \file H_Parameters.h -
trunk/Utilities/Hector/include/H_Quadrupole.h
r216 r281 2 2 #define _H_Quadrupole_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_Quadrupole.h … … 30 37 virtual ~H_Quadrupole() {}; 31 38 //@} 32 virtual void printProperties() const;33 39 virtual H_Quadrupole* clone() const =0 ; 40 virtual void printProperties() const { cout << *this; return;}; 34 41 void init(); 35 42 … … 38 45 virtual void setMatrix(const float, const float, const float) = 0; 39 46 47 friend std::ostream& operator<< (std::ostream& os, const H_Quadrupole& el); 40 48 }; 41 49 -
trunk/Utilities/Hector/include/H_RecRPObject.h
r3 r281 2 2 #define _H_RecRPObject_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_RecRPObject.h … … 22 29 #define NOT_YET_COMPUTED -666 23 30 31 /// Reconstruction of parameters at IP using measurements with roman pots 24 32 class H_RecRPObject { 25 33 public: 26 34 H_RecRPObject(); 27 H_RecRPObject(const float, const float, H_AbstractBeamLine* );35 H_RecRPObject(const float, const float, const H_AbstractBeamLine* ); 28 36 H_RecRPObject(const H_RecRPObject&); 29 37 H_RecRPObject& operator=(const H_RecRPObject&); 30 ~H_RecRPObject() {if(f_1) delete f_1; if(f_2) delete f_2; if(g_1) delete g_1; if(g_2) delete g_2; if(d_1) delete d_1; if(d_2) delete d_2; if(k_1) delete k_1; if(k_2) delete k_2; if(l_1) delete l_1; if(l_2) delete l_2; }; 38 ~H_RecRPObject() {delete f_1; delete f_2; delete g_1; delete g_2; 39 delete d_1; delete d_2; delete k_1; delete k_2; 40 delete l_1; delete l_2; 41 delete thebeam;}; 31 42 32 43 inline float getX1() const {return x1;}; … … 64 75 TF1* k_1, *k_2; 65 76 TF1* l_1, *l_2; 77 friend std::ostream& operator<< (std::ostream& os, const H_RecRPObject& rp); 66 78 }; 67 79 -
trunk/Utilities/Hector/include/H_RectEllipticAperture.h
r216 r281 2 2 #define _H_RectEllipticAperture_ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 21 4 22 /// \file H_RectEllipticAperture.h 5 23 /// \brief Defines the Rect-Elliptic aperture of beamline elements. 6 7 /*8 ---- Hector the simulator ----9 A fast simulator of particles through generic beamlines.10 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be11 12 http://www.fynu.ucl.ac.be/hector.html13 14 Centre de Physique des Particules et de Phénoménologie (CP3)15 Université Catholique de Louvain (UCL)16 */17 24 18 25 // local #includes … … 30 37 H_RectEllipticAperture* clone() const; 31 38 //@} 32 virtual void printProperties() const;33 39 /// Checks whether the point is inside the aperture or not 34 40 virtual bool isInside(const float, const float) const; 35 41 /// Draws the aperture shape. 36 42 virtual void draw(const float scale=1) const; 43 friend std::ostream& operator<< (std::ostream& os, const H_RectEllipticAperture& ap); 37 44 }; 38 45 -
trunk/Utilities/Hector/include/H_RectangularAperture.h
r216 r281 2 2 #define _H_RectangularAperture_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_RectangularAperture.h … … 34 41 /// Draws the aperture shape. 35 42 virtual void draw(const float scale=1) const; 36 virtual void printProperties() const;43 friend std::ostream& operator<< (std::ostream& os, const H_RectangularAperture& ap); 37 44 }; 38 45 -
trunk/Utilities/Hector/include/H_RectangularCollimator.h
r216 r281 2 2 #define _H_RectangularCollimator_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_RectangularCollimator.h … … 30 37 ~H_RectangularCollimator() {}; 31 38 //@} 32 virtual void printProperties() const;33 39 H_RectangularCollimator* clone() const; 34 40 void init(); … … 36 42 virtual void setTypeString() {typestring=RCOLLIMATORNAME;}; 37 43 virtual void setMatrix(const float, const float, const float) ; 38 44 45 friend std::ostream& operator<< (std::ostream& os, const H_RectangularCollimator& el); 39 46 }; 40 47 -
trunk/Utilities/Hector/include/H_RectangularDipole.h
r216 r281 2 2 #define _H_RectangularDipole_ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 21 4 22 /// \file H_RectangularDipole.h 5 23 /// \brief Classes aiming at simulating LHC beam rectangular dipoles. 6 7 /*8 ---- Hector the simulator ----9 A fast simulator of particles through generic beamlines.10 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be11 12 http://www.fynu.ucl.ac.be/hector.html13 14 Centre de Physique des Particules et de Phénoménologie (CP3)15 Université Catholique de Louvain (UCL)16 */17 24 18 25 #include "H_Dipole.h" -
trunk/Utilities/Hector/include/H_RomanPot.h
r216 r281 2 2 #define _H_RomanPot_ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 21 4 22 /// \file H_RomanPot.h 5 23 /// \brief Roman pot class 6 7 /*8 ---- Hector the simulator ----9 A fast simulator of particles through generic beamlines.10 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be11 12 http://www.fynu.ucl.ac.be/hector.html13 14 Centre de Physique des Particules et de Phénoménologie (CP3)15 Université Catholique de Louvain (UCL)16 */17 24 18 25 // local #includes … … 32 39 ~H_RomanPot() {}; 33 40 //@} 34 virtual void printProperties() const;35 41 H_RomanPot* clone() const ; 36 42 void init(); … … 38 44 virtual void setTypeString() {typestring=RPNAME;}; 39 45 virtual void setMatrix(const float, const float, const float) ; 40 46 friend std::ostream& operator<< (std::ostream& os, const H_RomanPot& el); 41 47 }; 42 48 -
trunk/Utilities/Hector/include/H_SectorDipole.h
r216 r281 1 /// \file H_SectorDipole.h2 /// \brief Classes aiming at simulating sector dipoles.3 4 1 #ifndef _H_SectorDipole_ 5 2 #define _H_SectorDipole_ 6 3 7 /* 8 ---- Hector the simulator ---- 9 A fast simulator of particles through generic beamlines. 10 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 21 12 http://www.fynu.ucl.ac.be/hector.html 13 14 Centre de Physique des Particules et de Phénoménologie (CP3) 15 Université Catholique de Louvain (UCL) 16 */ 22 /// \file H_SectorDipole.h 23 /// \brief Classes aiming at simulating sector dipoles. 17 24 18 25 #include "H_Dipole.h" … … 26 33 H_SectorDipole():H_Dipole(SDIPOLE,0.,0.,0.) {init();} 27 34 H_SectorDipole(const double s, const double k, const double l) :H_Dipole(SDIPOLE,s,k,l){init();} 28 H_SectorDipole(const string nameE, const double s, const double k, const double l) :H_Dipole(nameE,SDIPOLE,s,k,l){init();}35 H_SectorDipole(const string& nameE, const double s, const double k, const double l) :H_Dipole(nameE,SDIPOLE,s,k,l){init();} 29 36 ~H_SectorDipole() {}; 30 37 //@} -
trunk/Utilities/Hector/include/H_TransportMatrices.h
r3 r281 2 2 #define _H_TransportMatrices_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /** \file H_TransportMatrices.h -
trunk/Utilities/Hector/include/H_VerticalKicker.h
r216 r281 2 2 #define _H_VerticalKicker_ 3 3 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 14 21 15 22 /// \file H_VerticalKicker.h … … 30 37 H_VerticalKicker():H_Kicker(VKICKER,0.,0.,0.) {init();} 31 38 H_VerticalKicker(const double s, const double k, const double l) :H_Kicker(VKICKER,s,k,l){init();} 32 H_VerticalKicker(const string nameE, const double s, const double k, const double l) :H_Kicker(nameE,VKICKER,s,k,l){init();}39 H_VerticalKicker(const string& nameE, const double s, const double k, const double l) :H_Kicker(nameE,VKICKER,s,k,l){init();} 33 40 ~H_VerticalKicker() {}; 34 41 //@} -
trunk/Utilities/Hector/include/H_VerticalQuadrupole.h
r216 r281 2 2 #define _H_VerticalQuadrupole_ 3 3 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 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 8 21 9 http://www.fynu.ucl.ac.be/hector.html10 11 Centre de Physique des Particules et de Phénoménologie (CP3)12 Université Catholique de Louvain (UCL)13 */14 22 15 23 /// \file H_VerticalQuadrupole.h … … 27 35 H_VerticalQuadrupole():H_Quadrupole(VQUADRUPOLE,0.,0.,0.) {init();} 28 36 H_VerticalQuadrupole(const double s, const double k, const double l):H_Quadrupole(VQUADRUPOLE,s,k,l) {init();} 29 H_VerticalQuadrupole( stringnameE, const double s, const double k, const double l):H_Quadrupole(nameE,VQUADRUPOLE,s,k,l) {init();}30 31 32 33 37 H_VerticalQuadrupole(const string& nameE, const double s, const double k, const double l):H_Quadrupole(nameE,VQUADRUPOLE,s,k,l) {init();} 38 ~H_VerticalQuadrupole() {}; 39 //@} 40 H_VerticalQuadrupole* clone() const ; 41 private: 34 42 virtual void setTypeString() {typestring = VQUADRUPOLENAME;} ; 35 43 virtual void setMatrix(const float, const float, const float) ; -
trunk/Utilities/Hector/src/H_AbstractBeamLine.cc
r264 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 11 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 12 18 13 19 /// \file H_AbstractBeamLine.cc … … 45 51 } 46 52 47 H_AbstractBeamLine::H_AbstractBeamLine(const H_AbstractBeamLine& beamline) { 48 elements = beamline.elements; 49 matrices = beamline.matrices; 53 H_AbstractBeamLine::H_AbstractBeamLine(const H_AbstractBeamLine& beamline) : 54 matrices(beamline.matrices) { 55 //elements = beamline.elements; //<-- bad ! the new vector contains the same pointers as the previous one 56 cloneElements(beamline); 50 57 beam_mat.ResizeTo(MDIM,MDIM); 51 58 beam_mat = beamline.beam_mat; … … 55 62 H_AbstractBeamLine& H_AbstractBeamLine::operator=(const H_AbstractBeamLine& beamline) { 56 63 if(this== &beamline) return *this; 57 elements = beamline.elements; 64 //elements = beamline.elements; //<-- bad ! the new vector contains the same pointers as the previous one 65 cloneElements(beamline); 58 66 matrices = beamline.matrices; 59 67 beam_mat = beamline.beam_mat; … … 83 91 elements.clear(); 84 92 matrices.clear(); 93 } 94 95 void H_AbstractBeamLine::cloneElements(const H_AbstractBeamLine& beam) { 96 vector<H_OpticalElement*>::const_iterator element_i; 97 for (element_i = beam.elements.begin(); element_i< beam.elements.end(); element_i++) { 98 H_OpticalElement* temp_el = (*element_i)->clone(); 99 elements.push_back(temp_el); 100 } 85 101 } 86 102 … … 101 117 } 102 118 103 void H_AbstractBeamLine::add(H_OpticalElement & newElement) {104 /// @param newElement is added to the beamline105 // H_OpticalElement * el = new H_OpticalElement(newElement);106 // elements.push_back(el);107 elements.push_back(&newElement);108 float a = newElement.getS()+newElement.getLength();109 if (a > beam_length) {110 beam_length = a;111 if(VERBOSE) cout<<"<H_AbstractBeamLine> WARNING : element ("<< newElement.getName()<<") too far away. The beam length has been extended to "<< beam_length << ". "<<endl;112 }113 calcSequence();114 calcMatrix();115 }116 117 119 const TMatrix H_AbstractBeamLine::getBeamMatrix() const { 118 120 return beam_mat; … … 205 207 } 206 208 207 void H_AbstractBeamLine::printProperties() const { 208 vector<H_OpticalElement*>::const_iterator element_i; 209 cout << "Pointeurs des elements du faisceau" << endl; 210 for (element_i = elements.begin(); element_i < elements.end(); element_i++) { 211 cout << (int)(element_i-elements.begin()) << "\t" << (*element_i)->getName() << "\t" << (*element_i)->getS() << endl; 212 } 213 return; 214 } 209 std::ostream& operator<< (std::ostream& os, const H_AbstractBeamLine& be) { 210 vector<H_OpticalElement*>::const_iterator element_i; 211 os << "Beamline content" << endl; 212 for (element_i = be.elements.begin(); element_i < be.elements.end(); element_i++) { 213 os << (int)(element_i - be.elements.begin()) << "\t" << (*element_i)->getName() << "\t" << (*element_i)->getS() << endl; 214 } 215 return os; 216 } 217 218 void H_AbstractBeamLine::printProperties() const { cout << *this; return; } 215 219 216 220 void H_AbstractBeamLine::showElements() const{ … … 485 489 /// @param offset In meters 486 490 487 extern boolrelative_energy;491 extern int relative_energy; 488 492 if(!relative_energy) { 489 493 vector<H_OpticalElement*>::iterator element_i; -
trunk/Utilities/Hector/src/H_Aperture.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_Aperture.cc … … 20 27 using namespace std; 21 28 22 H_Aperture::H_Aperture() { 23 type = NONE; 24 setApertureString(); 25 x1 = 0; 26 x2 = 0; 27 x3 = 0; 28 x4 = 0; 29 fx = 0; 30 fy = 0; 29 H_Aperture::H_Aperture() : 30 type_(NONE), x1(0), x2(0), x3(0), x4(0), fx(0), fy(0), aptypestring(getApertureString()) { 31 31 } 32 32 33 H_Aperture::H_Aperture(const int dtype, const float size1, const float size2, const float size3, const float size4, const float posx, const float posy) { 33 H_Aperture::H_Aperture(const int dtype, const float size1, const float size2, const float size3, const float size4, const float posx, const float posy) : 34 type_(dtype), x1(size1), x2(size2), x3(size3), x4(size4), fx(posx), fy(posy), aptypestring(getApertureString()) { 34 35 /// @param dtype defines the aperture shape 35 36 /// @param size1, size2, size3, size4 are the geometrical sizes (length/width or great/small radii) in m 36 37 /// @param posx, posy are the (x,y) coordinates of the center of the aperture [m] 37 type = dtype;38 setApertureString();39 x1 = size1;40 x2 = size2;41 x3 = size3;42 x4 = size4;43 fx = posx;44 fy = posy;45 38 } 46 39 47 H_Aperture::H_Aperture(const H_Aperture& ap) { 48 type = ap.type; 49 aptypestring = ap.aptypestring; 50 x1 = ap.x1; 51 x2 = ap.x2; 52 x3 = ap.x3; 53 x4 = ap.x4; 54 fx = ap.fx; 55 fy = ap.fy; 40 H_Aperture::H_Aperture(const H_Aperture& ap) : 41 type_(ap.type_), x1(ap.x1), x2(ap.x2), x3(ap.x3), x4(ap.x4), fx(ap.fx), fy(ap.fy), aptypestring(ap.aptypestring) { 56 42 } 57 43 58 44 H_Aperture& H_Aperture::operator=(const H_Aperture& ap) { 59 45 if(this==&ap) return *this; 60 type = ap.type; 61 aptypestring = ap.aptypestring; 46 type_ = ap.type_; 62 47 x1 = ap.x1; 63 48 x2 = ap.x2; … … 66 51 fx = ap.fx; 67 52 fy = ap.fy; 53 aptypestring = ap.aptypestring; 68 54 return *this; 69 55 } 70 56 57 std::ostream& operator<< (std::ostream& os, const H_Aperture& ap) { 58 os << "Aperture shape:" << ap.aptypestring << ", parameters "<<ap.x1<<", "<<ap.x2<<", "<<ap.x3<<", "<<ap.x4<<endl; 59 os << " \t Center : " << ap.fx << "," << ap.fy << endl; 60 return os; 61 } 62 71 63 void H_Aperture::printProperties() const { 72 cout << "Aperture shape:" << getTypeString() << ", parameters "<<x1<<", "<<x2<<", "<<x3<<", "<<x4<<endl; 73 cout << " \t Center : " << fx << "," << fy << endl; 64 cout << *this; 74 65 return; 75 66 } … … 90 81 91 82 92 void H_Aperture::setApertureString() {93 switch (type ) {83 /*void H_Aperture::setApertureString() { 84 switch (type_) { 94 85 case NONE: aptypestring = NONENAME; break; 95 86 case RECTANGULAR: aptypestring = RECTANGULARNAME; break; … … 100 91 } 101 92 } 93 */ 94 95 const string H_Aperture::getApertureString() const { 96 string str; 97 switch (type_) { 98 case NONE: str = NONENAME; break; 99 case RECTANGULAR: str = RECTANGULARNAME; break; 100 case ELLIPTIC: str = ELLIPTICNAME; break; 101 case CIRCULAR: str = CIRCULARNAME; break; 102 case RECTELLIPSE: str = RECTELLIPSENAME; break; 103 default: str = NONENAME; break; 104 } 105 return str; 106 } 107 -
trunk/Utilities/Hector/src/H_Beam.cc
r233 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_Beam.cc … … 55 62 }; 56 63 57 void H_Beam::createBeamParticles(const unsigned int Number_of_particles) { 58 createBeamParticles(Number_of_particles,MP,QP); 59 } 60 61 void H_Beam::createBeamParticles(const unsigned int Number_of_particles, const double p_mass, const double p_charge) { 64 void H_Beam::createBeamParticles(const unsigned int Number_of_particles, const double p_mass, const double p_charge, TRandom* r) { 62 65 beamParticles.clear(); 63 66 Nparticles = (Number_of_particles<1) ? 1 : Number_of_particles; … … 66 69 p.setPosition(fx_ini,fy_ini,tx_ini,ty_ini,fs_ini); 67 70 p.setE(fe_ini); 68 p.smearPos(x_disp,y_disp );69 p.smearAng(tx_disp,ty_disp );70 p.smearE(e_disp );71 p.smearS(s_disp );71 p.smearPos(x_disp,y_disp,r); 72 p.smearAng(tx_disp,ty_disp,r); 73 p.smearE(e_disp,r); 74 p.smearS(s_disp,r); 72 75 if (VERBOSE) {if (i==0) cout << " x_ini , tx_ini " << p.getX() << " " << p.getTX() << endl;} 73 76 beamParticles.push_back(p); … … 76 79 77 80 //void H_Beam::particleGun(const unsigned int Number_of_particles, const float E_min=BE, const float E_max=BE, const float fs_min=0, const float fs_max=0, const float fx_min=0, const float fx_max=0, const float fy_min=0, const float fy_max=0, const float tx_min=-PI/2., const float tx_max=PI/2., const float ty_min=-PI/2., const float ty_max=PI/2., const float p_mass=MP, const double p_charge=QP) { 78 void H_Beam::particleGun(const unsigned int Number_of_particles, const float E_min, const float E_max, const float fs_min, const float fs_max, const float fx_min, const float fx_max, const float fy_min, const float fy_max, const float tx_min, const float tx_max, const float ty_min, const float ty_max, const float p_mass, const double p_charge, const bool flat ) {81 void H_Beam::particleGun(const unsigned int Number_of_particles, const float E_min, const float E_max, const float fs_min, const float fs_max, const float fx_min, const float fx_max, const float fy_min, const float fy_max, const float tx_min, const float tx_max, const float ty_min, const float ty_max, const float p_mass, const double p_charge, const bool flat, TRandom* r) { 79 82 beamParticles.clear(); 80 83 Nparticles = (Number_of_particles<2) ? 2 : Number_of_particles; … … 83 86 H_BeamParticle p(p_mass,p_charge); 84 87 if (flat) { 85 gx = gRandom->Uniform(fx_min,fx_max);86 gy = gRandom->Uniform(fy_min,fy_max);87 gs = gRandom->Uniform(fs_min,fs_max);88 gtx = gRandom->Uniform(tx_min,tx_max);89 gty = gRandom->Uniform(ty_min,ty_max);90 gE = gRandom->Uniform(E_min,E_max);88 gx = r->Uniform(fx_min,fx_max); 89 gy = r->Uniform(fy_min,fy_max); 90 gs = r->Uniform(fs_min,fs_max); 91 gtx = r->Uniform(tx_min,tx_max); 92 gty = r->Uniform(ty_min,ty_max); 93 gE = r->Uniform(E_min,E_max); 91 94 } else { 92 gx = gRandom->Gaus((fx_min+fx_max)/2,(-fx_min+fx_max)/2);93 gy = gRandom->Gaus((fy_min+fy_max)/2,(-fy_min+fy_max)/2);94 gs = gRandom->Gaus((fs_min+fs_max)/2,(-fs_min+fs_max)/2);95 gtx = gRandom->Gaus((tx_min+tx_max)/2,(-tx_min+tx_max)/2);96 gty = gRandom->Gaus((ty_min+ty_max)/2,(-ty_min+ty_max)/2);97 gE = gRandom->Gaus ((E_min+E_max)/2,(-E_min+E_max)/2);95 gx = r->Gaus((fx_min+fx_max)/2,(-fx_min+fx_max)/2); 96 gy = r->Gaus((fy_min+fy_max)/2,(-fy_min+fy_max)/2); 97 gs = r->Gaus((fs_min+fs_max)/2,(-fs_min+fs_max)/2); 98 gtx = r->Gaus((tx_min+tx_max)/2,(-tx_min+tx_max)/2); 99 gty = r->Gaus((ty_min+ty_max)/2,(-ty_min+ty_max)/2); 100 gE = r->Gaus ((E_min+E_max)/2,(-E_min+E_max)/2); 98 101 } 99 102 p.setPosition(gx,gy,gtx,gty,gs); … … 179 182 } 180 183 181 void H_Beam::computePath(const H_AbstractBeamLine * beamline) {182 computePath(beamline,false);183 }184 185 184 /// Propagates the beam until a given s 186 185 void H_Beam::propagate(const float position) { … … 189 188 particle_i->propagate(position); 190 189 } 191 }192 193 void H_Beam::emitGamma(const double gee, const double gq2) {194 /// @param gee = \f$ E_{\gamma} \f$ is the photon energy195 /// @param gq2 = \f$ Q^2 < 0 \f$ is virtuality of photon \f$ Q^{2} = E^{2}-\vec{k}^{2} \f$196 emitGamma(gee,gq2,0,2*pi);197 190 } 198 191 … … 386 379 } 387 380 388 void H_Beam::printProperties() const{381 std::ostream& operator<< (std::ostream& os, const H_Beam& be) { 389 382 vector<H_BeamParticle>::const_iterator particle_i; 390 cout << "There are " << Nparticles << " in the beam." << endl; 391 for (particle_i = beamParticles.begin();particle_i < beamParticles.end(); particle_i++) { 392 particle_i->printProperties(); 393 } 383 cout << "There are " << be.Nparticles << " in the beam." << endl; 384 for (particle_i = be.beamParticles.begin(); particle_i < be.beamParticles.end(); particle_i++) { 385 cout << *particle_i; 386 } 387 return os; 394 388 } 395 389 -
trunk/Utilities/Hector/src/H_BeamLine.cc
r238 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_BeamLine.cc … … 39 46 // are opposite to Wille's. See fill() for more details. 40 47 41 H_BeamLine::H_BeamLine(const int si, const float length) : H_AbstractBeamLine(length){ 42 direction = (si >= abs(si)) ? 1 : -1; 43 ips=0; 44 ipx=0; 45 ipy=0; 46 iptx=0; 47 ipty=0; 48 } 49 50 H_BeamLine::H_BeamLine(const H_BeamLine& beam) : H_AbstractBeamLine(beam) { 48 H_BeamLine::H_BeamLine(): H_AbstractBeamLine(), 49 direction(1), ips(0), ipx(0), ipy(0), iptx(0), ipty(0) { 50 } 51 52 H_BeamLine::H_BeamLine(const int si, const float length) : H_AbstractBeamLine(length), 53 direction((si >= abs(si)) ? 1 : -1), ips(0), ipx(0), ipy(0), iptx(0), ipty(0) { 54 } 55 56 H_BeamLine::H_BeamLine(const H_BeamLine& beam) : H_AbstractBeamLine(beam), 57 direction(beam.direction), ips(beam.ips), ipx(beam.ipx), ipy(beam.ipy), iptx(beam.iptx), ipty(beam.ipty) { 58 } 59 60 H_BeamLine& H_BeamLine::operator=(const H_BeamLine& beam) { 61 if(this==&beam) return *this; 62 H_AbstractBeamLine::operator=(beam); // call the mother's operator= 51 63 direction = beam.direction; 52 64 ips = beam.ips; … … 55 67 iptx = beam.iptx; 56 68 ipty = beam.ipty; 57 }58 59 H_BeamLine& H_BeamLine::operator=(const H_BeamLine& beam) {60 if(this==&beam) return *this;61 direction = beam.direction;62 ips = beam.ips;63 ipx = beam.ipx;64 ipy = beam.ipy;65 iptx = beam.iptx;66 ipty = beam.ipty;67 69 return *this; 68 }69 70 void H_BeamLine::findIP(const string& filename) {71 findIP(filename,"IP5");72 return;73 70 } 74 71 … … 125 122 temp[3] = ipty; 126 123 return temp; 127 }128 129 void H_BeamLine::fill(const string& filename) {130 fill(filename,1,"IP5");131 return;132 124 } 133 125 -
trunk/Utilities/Hector/src/H_BeamLineParser.cc
r216 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_BeamLineParser.cc 13 20 /// \brief Reader for madx tables 14 21 /// 15 /// Notes : V ᅵifier que tous les SBEND sont toujours appelᅵ MB. Et seulement comme ᅵ!16 /// V ᅵifier qu'il n'y a pas de problᅵed'inversion H/V QUADRUPOLES22 /// Notes : Verifier que tous les SBEND sont toujours appeles MB. Et seulement comme ca ! 23 /// Verifier qu'il n'y a pas de problemes d'inversion H/V QUADRUPOLES 17 24 /// no distinction between H and Vkickers ? 18 25 /// The identification of the element is based on the values of k1l, k2l, hkick, vkick and on their name. -
trunk/Utilities/Hector/src/H_BeamParticle.cc
r240 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_BeamParticle.cc … … 39 46 using namespace std; 40 47 41 void H_BeamParticle::init() { 48 void H_BeamParticle::init() { // for more efficiency, put the objects away from init! 42 49 mp = MP; 43 50 qp = QP; … … 57 64 } 58 65 59 H_BeamParticle::H_BeamParticle() { 66 H_BeamParticle::H_BeamParticle() { 60 67 init(); 61 68 } 62 69 63 H_BeamParticle::H_BeamParticle(const H_BeamParticle& p) { 64 mp = p.mp; 65 qp = p.qp; 66 fx = p.fx; 67 fy = p.fy; 68 thx = p.thx; 69 thy = p.thy; 70 fs = p.fs; 71 energy = p.energy; 72 hasstopped = p.hasstopped; 73 hasemitted = p.hasemitted; 74 isphysical = p.isphysical; 75 stop_position = new TVectorD(*(p.stop_position)); 70 H_BeamParticle::H_BeamParticle(const H_BeamParticle& p): 71 mp(p.mp), qp(p.qp), fs(p.fs), fx(p.fx), fy(p.fy), thx(p.thx), thy(p.thy), 72 energy(p.energy), hasstopped(p.hasstopped), hasemitted(p.hasemitted), 73 isphysical(p.isphysical), stop_position(new TVectorD(*(p.stop_position))), 74 stop_element(0), positions(p.positions) { 76 75 if(p.hasstopped) stop_element = new H_OpticalElement(*(p.stop_element)); 77 positions = p.positions;78 76 } 79 77 … … 100 98 stop_position = new TVectorD(*(p.stop_position)); 101 99 if(p.hasstopped) stop_element = new H_OpticalElement(*(p.stop_element)); 100 else stop_element = 0; 102 101 positions = p.positions; 103 102 return *this; 104 103 } 105 104 106 bool H_BeamParticle::stopped(const H_AbstractBeamLine * beamline) {105 const bool H_BeamParticle::stopped(const H_AbstractBeamLine * beamline) { 107 106 vector<TVectorD>::const_iterator position_i; 108 107 for(position_i = positions.begin(); position_i < positions.end()-1; position_i++) { … … 159 158 } 160 159 161 void H_BeamParticle::smearPos(const double dx,const double dy) { 160 161 162 void H_BeamParticle::smearPos(const double dx,const double dy, TRandom* r) { 162 163 // the beam is centered on (fx,fy) at IP 163 fx = gRandom->Gaus(fx,dx); 164 fy = gRandom->Gaus(fy,dy); 164 fx = r->Gaus(fx,dx); 165 fy = r->Gaus(fy,dy); 166 positions.clear(); 167 addPosition(fx,thx,fy,thy,fs); 168 return; 169 } 170 171 void H_BeamParticle::smearAng(const double tx, const double ty, TRandom* r) { 172 // the beam transverse direction is centered on (thx,thy) at IP 173 thx = r->Gaus(thx,tx); 174 thy = r->Gaus(thy,ty); 165 175 positions.clear(); 166 176 addPosition(fx,thx,fy,thy,fs); … … 168 178 } 169 179 170 void H_BeamParticle::smearPos() { 171 // the beam is centered on (fx,fy) at IP 172 fx = gRandom->Gaus(fx,SX); 173 fy = gRandom->Gaus(fy,SY); 174 positions.clear(); 175 addPosition(fx,thx,fy,thy,fs); 176 return; 177 } 178 179 void H_BeamParticle::smearAng(const double tx, const double ty) { 180 // the beam transverse direction is centered on (thx,thy) at IP 181 thx = gRandom->Gaus(thx,tx); 182 thy = gRandom->Gaus(thy,ty); 183 positions.clear(); 184 addPosition(fx,thx,fy,thy,fs); 185 return; 186 } 187 188 void H_BeamParticle::smearAng() { 189 // the beam transverse direction is centered on (thx,thy) at IP 190 thx = gRandom->Gaus(thx,STX); 191 thy = gRandom->Gaus(thy,STY); 192 positions.clear(); 193 addPosition(fx,thx,fy,thy,fs); 194 return; 195 } 196 197 void H_BeamParticle::smearE(const double erre) { 198 energy = gRandom->Gaus(energy,erre); 199 return; 200 } 201 202 void H_BeamParticle::smearE() { 203 energy = gRandom->Gaus(energy,SBE); 204 return; 205 } 206 207 void H_BeamParticle::smearS(const double errs) { 208 fs= gRandom->Gaus(fs,errs); 180 void H_BeamParticle::smearE(const double erre, TRandom* r) { 181 energy = r->Gaus(energy,erre); 182 return; 183 } 184 185 void H_BeamParticle::smearS(const double errs, TRandom* r) { 186 fs= r->Gaus(fs,errs); 209 187 positions.clear(); 210 188 addPosition(fx,thx,fy,thy,fs); … … 212 190 } 213 191 214 void H_BeamParticle::smearS() {215 fs = gRandom->Gaus(fs,SS);216 positions.clear();217 addPosition(fx,thx,fy,thy,fs);218 return;219 }220 192 221 193 void H_BeamParticle::set4Momentum(const double px, const double py, const double pz, const double ene) { … … 267 239 if(hasstopped) return stop_element; 268 240 else { H_OpticalElement * dummy_el = new H_Drift("",0,0); return dummy_el;} 269 }270 271 void H_BeamParticle::emitGamma(const double gee, const double gq2) {272 emitGamma(gee,gq2,0,2*pi);273 return;274 241 } 275 242 … … 362 329 } 363 330 364 void H_BeamParticle::printProperties() const{365 cout << " M = " <<getM() << "GeV ";366 cout << " Q = " <<getQ() << "e";367 cout << " fx = " <<getX() << "m ";368 cout << " fy = " <<getY() << "m ";369 cout << " thx = " <<getTX() << "rad ";370 cout << " thy = " <<getTY() << "rad ";371 cout<< endl;372 return;331 std::ostream& operator<< (std::ostream& os, const H_BeamParticle& p) { 332 os << " M = " << p.getM() << "GeV "; 333 os << " Q = " << p.getQ() << "e"; 334 os << " fx = " << p.getX() << "m "; 335 os << " fy = " << p.getY() << "m "; 336 os << " thx = " << p.getTX() << "rad "; 337 os << " thy = " << p.getTY() << "rad "; 338 os << endl; 339 return os; 373 340 } 374 341 … … 491 458 delete [] graph; 492 459 return ppath; 493 }494 495 void H_BeamParticle::computePath(const H_AbstractBeamLine * beam) {496 computePath(beam,true);497 460 } 498 461 -
trunk/Utilities/Hector/src/H_CircularAperture.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_CircularAperture.cc … … 23 30 using namespace std; 24 31 25 /// Circular apertures26 H_CircularAperture::H_CircularAperture(const float r, const float posx, const float posy) :H_EllipticAperture(r,r,posx,posy) {27 /// @param r is the radius of the circular shape28 /// @param posx, posy are the (x,y) coordinates of the center of the circle29 type= CIRCULAR;30 }31 32 32 H_CircularAperture* H_CircularAperture::clone() const { 33 33 return new H_CircularAperture(x1,fx,fy); 34 34 } 35 35 36 void H_CircularAperture::printProperties() const{37 cout << "Aperture shape:" << getTypeString() << ", aperture radius : " <<x1 << endl;38 cout << " \t Center : " << fx << "," <<fy << endl;39 return ;36 std::ostream& operator<< (std::ostream& os, const H_CircularAperture& ap) { 37 os << "Aperture shape:" << ap.aptypestring << ", aperture radius : " << ap.x1 << endl; 38 os << " \t Center : " << ap.fx << "," << ap.fy << endl; 39 return os; 40 40 } -
trunk/Utilities/Hector/src/H_Dipole.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_Dipole.cc … … 25 32 } 26 33 27 void H_Dipole::printProperties() const { 28 cout << typestring; 29 cout << name; 30 cout<<"\t at s = "<< fs; 31 cout<<"\t length = "<< element_length; 32 cout<<"\t k0 = "<<fk; 33 cout<<endl; 34 if(element_aperture->getType()!=NONE) { 35 cout <<"\t aperture type = " << element_aperture->getTypeString(); 36 element_aperture->printProperties(); 34 std::ostream& operator<< (std::ostream& os, const H_Dipole& el) { 35 os << el.typestring << el.name <<"\t at s = "<< el.fs <<"\t length = "<< el.element_length <<"\t k0 = "<<el.fk << endl; 36 if(el.element_aperture->getType()!=NONE) { 37 os << *(el.element_aperture) << endl; 37 38 } 38 39 39 if(element_length<0) { if(VERBOSE) cout<<"<H_Dipole> ERROR : Interpenetration of elements !"<<endl; } 40 if(element_length==0) { if(VERBOSE) cout<<"<H_Dipole> WARNING : 0-length "<< name << " !" << endl; } 40 if(el.element_length<0) { if(VERBOSE) os <<"<H_Dipole> ERROR : Interpenetration of elements !"<<endl; } 41 if(el.element_length==0) { if(VERBOSE) os <<"<H_Dipole> WARNING : 0-length "<< el.name << " !" << endl; } 42 return os; 41 43 } -
trunk/Utilities/Hector/src/H_Drift.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_Drift.cc … … 26 33 } 27 34 28 void H_Drift::printProperties() const { 29 cout << typestring << name; 30 cout << "\t\t at s = " << fs; 31 cout << "\t length = " << element_length; 32 cout<<endl; 33 if(element_aperture->getType()!=NONE) { 34 cout <<"\t aperture type = " << element_aperture->getTypeString(); 35 element_aperture->printProperties(); 35 std::ostream& operator<< (std::ostream& os, const H_Drift& el) { 36 os << el.typestring << el.name << "\t\t at s = " << el.fs << "\t length = " << el.element_length <<endl; 37 if(el.element_aperture->getType()!=NONE) { 38 os << *(el.element_aperture) << endl; 36 39 } 37 if(element_length<0) { if(VERBOSE) cout<<"<H_Drift> ERROR : Interpenetration of elements !"<<endl; } 38 if(element_length==0) { if(VERBOSE) cout<<"<H_Drift> WARNING : 0-length "<< name << " !" << endl; } 40 if(el.element_length<0 && VERBOSE) os <<"<H_Drift> ERROR : Interpenetration of elements !"<<endl; 41 else if(el.element_length==0 && VERBOSE) os <<"<H_Drift> WARNING : 0-length "<< el.name << " !" << endl; 42 return os; 39 43 } 40 44 -
trunk/Utilities/Hector/src/H_EllipticAperture.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_EllipticAperture.cc … … 25 32 using namespace std; 26 33 27 H_EllipticAperture::H_EllipticAperture(const float l, const float h, const float posx, const float posy) :H_Aperture(ELLIPTIC,l,h,0,0,posx,posy) { 34 H_EllipticAperture::H_EllipticAperture(const int type, const float l, const float h, const float posx, const float posy) : 35 H_Aperture(type,l,h,0,0,posx,posy) { 36 /// @param type is the aperture type (ELLIPTIC or CIRCULAR) 37 /// @param l, h are the length and height of the elliptic shape 38 /// @param posx, posy are the (x,y) coordinates of the center of the ellipse 39 40 if (type!= ELLIPTIC && type != CIRCULAR) { 41 cout << "Warning: trying to define an EllipticalAperture which is neither elliptical nor circular." << endl; 42 cout << "'Elliptical' type forced\n"; 43 type_ = ELLIPTIC; 44 aptypestring = getApertureString(); 45 } 46 } 47 48 H_EllipticAperture::H_EllipticAperture(const float l, const float h, const float posx, const float posy) : 49 H_Aperture(ELLIPTIC,l,h,0,0,posx,posy) { 28 50 /// @param l, h are the length and height of the elliptic shape 29 51 /// @param posx, posy are the (x,y) coordinates of the center of the ellipse … … 48 70 } 49 71 50 void H_EllipticAperture::printProperties() const{51 cout<< "Aperture shape:" << getTypeString() << ", ellipse axes : "<<x1<<", "<<x2<<endl;52 cout << " \t Center : " << fx << "," <<fy << endl;53 return ;72 std::ostream& operator<< (std::ostream& os, const H_EllipticAperture& ap) { 73 os<< "Aperture shape:" << ap.aptypestring << ", ellipse axes : "<< ap.x1 <<", " << ap.x2 << endl; 74 os << " \t Center : " << ap.fx << "," << ap.fy << endl; 75 return os; 54 76 } -
trunk/Utilities/Hector/src/H_HorizontalKicker.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_HorizontalKicker.cc -
trunk/Utilities/Hector/src/H_HorizontalQuadrupole.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_HorizontalQuadrupole.cc -
trunk/Utilities/Hector/src/H_Kicker.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_Kicker.cc … … 27 34 } 28 35 29 void H_Kicker::printProperties() const { 30 cout << typestring; 31 cout << name; 32 cout<<"\t at s = "<< fs; 33 cout<<"\t length = "<< element_length; 34 cout<<"\t k0 = "<<fk; 35 cout<<endl; 36 if(element_aperture->getType()!=NONE) { 37 cout <<"\t aperture type = " << element_aperture->getTypeString(); 38 element_aperture->printProperties(); 36 std::ostream& operator<< (std::ostream& os, const H_Kicker& el) { 37 os << el.typestring << el.name <<"\t at s = "<< el.fs <<"\t length = "<< el.element_length; 38 os<<"\t k0 = "<< el.fk <<endl; 39 if(el.element_aperture->getType()!=NONE) { 40 os << *(el.element_aperture) << endl; 39 41 } 40 42 41 if(element_length<0) { if(VERBOSE) cout<<"<H_Kicker> ERROR : Interpenetration of elements !"<<endl; } 42 if(element_length==0) { if(VERBOSE) cout<<"<H_Kicker> WARNING : 0-length "<< name << " !" << endl; } 43 if(el.element_length<0 && VERBOSE) os<<"<H_Kicker> ERROR : Interpenetration of elements !"<<endl; 44 else if(el.element_length==0 && VERBOSE) os<<"<H_Kicker> WARNING : 0-length "<< el.name << " !" << endl; 45 return os; 43 46 } -
trunk/Utilities/Hector/src/H_Marker.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_Marker.cc … … 24 31 } 25 32 26 void H_Marker::printProperties() const { 27 cout << typestring << name; 28 cout << "\t\t at s = " << fs << endl; 29 if(element_aperture->getType()!=NONE) { 30 cout <<"\t aperture type = " << element_aperture->getTypeString(); 31 element_aperture->printProperties(); 33 std::ostream& operator<< (std::ostream& os, const H_Marker& el) { 34 os << el.typestring << el.name << "\t\t at s = " << el.fs; 35 if(el.element_aperture->getType()!=NONE) { 36 os << *(el.element_aperture) << endl; 32 37 } 38 return os; 33 39 } 34 40 -
trunk/Utilities/Hector/src/H_OpticalElement.cc
r239 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_OpticalElement.cc … … 135 142 */ 136 143 137 138 139 void H_OpticalElement::printProperties() const { 140 cout << typestring; 141 cout << name; 142 cout <<"\t at s = " << fs; 143 cout <<"\t length = "<< element_length; 144 if(fk!=0) cout <<"\t strength = " << fk; 145 if(element_aperture->getType()!=NONE) { 146 cout <<"\t aperture type = " << element_aperture->getTypeString(); 147 element_aperture->printProperties(); 148 } 149 150 cout<<endl; 151 if(element_length<0) { if(VERBOSE) cout<<"<H_OpticalElement> ERROR : Interpenetration of elements !"<<endl; } 152 if(element_length==0) { if(VERBOSE) cout<<"<H_OpticalElement> WARNING : 0-length "<< typestring << " !" << endl; } 153 154 return; 144 std::ostream& operator<< (std::ostream& os, const H_OpticalElement& el) { 145 os << el.typestring << el.name << "\t at s = " << el.fs << "\t length = "<< el.element_length; 146 if(el.fk!=0) os <<"\t strength = " << el.fk; 147 if(el.element_aperture->getType()!=NONE) { 148 os << *(el.element_aperture) << endl; 149 } 150 os<<endl; 151 if(el.element_length<0 && VERBOSE) 152 os <<"<H_OpticalElement> ERROR : Interpenetration of elements !"<<endl; 153 else if(el.element_length==0 && VERBOSE) 154 os <<"<H_OpticalElement> WARNING : 0-length "<< el.typestring << " !" << endl; 155 return os; 155 156 } 156 157 … … 189 190 } 190 191 191 TVectorD H_OpticalElement::getHitPosition( TVectorD init_pos, double energy_loss, double mp,double qp) {192 TVectorD H_OpticalElement::getHitPosition(const TVectorD& init_pos, const double energy_loss, const double mp, const double qp) { 192 193 if(!element_length) { 193 194 // cout<<"O-length element ("<<getName()<<"), should not appear here !"<<endl; … … 196 197 // some declarations 197 198 bool inside = false; 198 double vec[MDIM] = {init_pos[INDEX_X]/URAD,tan(init_pos[INDEX_TX]/URAD),init_pos[INDEX_Y]/URAD,tan(init_pos[INDEX_TY]/URAD),-energy_loss,1}; 199 double vec[MDIM] = {init_pos[INDEX_X]/URAD, tan(init_pos[INDEX_TX]/URAD), 200 init_pos[INDEX_Y]/URAD, tan(init_pos[INDEX_TY]/URAD), 201 -energy_loss, 1}; 199 202 TMatrixD mat_init(1,MDIM,vec); 200 203 TMatrixD mat_min(1,MDIM,vec); … … 253 256 mat_min[0][1] = mat_min[0][1] + tan(temp_el->getTX()); 254 257 mat_min[0][2] = mat_min[0][2] + temp_el->getY(); 255 258 mat_min[0][3] = mat_min[0][3] + tan(temp_el->getTY()); 256 259 mat_min[0][4] = min_pos + init_pos[4]; 257 260 // getting vector at max_pos (for second boundary) : 258 261 temp_el->setLength(max_pos); 259 262 mat_max[0][0] = mat_init[0][0] - temp_el->getX(); 260 261 262 263 264 265 266 267 263 mat_max[0][1] = mat_init[0][1] - tan(temp_el->getTX()); 264 mat_max[0][2] = mat_init[0][2] - temp_el->getY(); 265 mat_max[0][3] = mat_init[0][3] - tan(temp_el->getTY()); 266 mat_max *= temp_el->getMatrix(energy_loss,mp,qp); 267 mat_max[0][0] = mat_max[0][0] + temp_el->getX(); 268 mat_max[0][1] = mat_max[0][1] + tan(temp_el->getTX()); 269 mat_max[0][2] = mat_max[0][2] + temp_el->getY(); 270 mat_max[0][3] = mat_max[0][3] + tan(temp_el->getTY()); 268 271 mat_max[0][4] = max_pos + init_pos[4]; 269 272 } 270 273 // getting vector in the middle (for estimate) : 271 274 temp_el->setLength((max_pos+min_pos)/2.); 272 273 274 275 276 277 278 279 280 275 mat_stop[0][0] = mat_init[0][0] - temp_el->getX(); 276 mat_stop[0][1] = mat_init[0][1] - tan(temp_el->getTX()); 277 mat_stop[0][2] = mat_init[0][2] - temp_el->getY(); 278 mat_stop[0][3] = mat_init[0][3] - tan(temp_el->getTY()); 279 mat_stop *= temp_el->getMatrix(energy_loss,mp,qp); 280 mat_stop[0][0] = mat_stop[0][0] + temp_el->getX(); 281 mat_stop[0][1] = mat_stop[0][1] + tan(temp_el->getTX()); 282 mat_stop[0][2] = mat_stop[0][2] + temp_el->getY(); 283 mat_stop[0][3] = mat_stop[0][3] + tan(temp_el->getTY()); 281 284 mat_stop[0][4] = (max_pos+min_pos)/2. + init_pos[4]; 282 285 283 284 285 286 287 288 289 286 double xys[LENGTH_VEC]; 287 xys[INDEX_X]= mat_stop[0][0]*URAD; 288 xys[INDEX_TX]= atan(mat_stop[0][1])*URAD; 289 xys[INDEX_Y]= mat_stop[0][2]*URAD; 290 xys[INDEX_TY]= atan(mat_stop[0][3])*URAD; 291 xys[INDEX_S]= mat_stop[0][4] ; 292 TVectorD temp_vec(LENGTH_VEC,xys); 290 293 291 294 if(precision_estimate) { … … 297 300 cout<<" - "<<fabs(((mat_min[0][0]<mat_max[0][0])?(mat_stop[0][0]-mat_min[0][0])*URAD:(mat_stop[0][0]-mat_max[0][0])*URAD))<<" µm"<<endl; 298 301 cout<<"\t hit point y : "<<mat_stop[0][2]*URAD; 299 300 301 302 303 302 cout<<" + "<<fabs(((mat_min[0][0]<mat_max[0][2])?(mat_max[0][2]-mat_stop[0][2])*URAD:(mat_min[0][2]-mat_stop[0][2])*URAD)); 303 cout<<" - "<<fabs(((mat_min[0][0]<mat_max[0][2])?(mat_stop[0][2]-mat_min[0][2])*URAD:(mat_stop[0][2]-mat_max[0][2])*URAD))<<" µm"<<endl; 304 cout<<"\t hit point tx : "<<mat_stop[0][1]*URAD; 305 cout<<" + "<<fabs(((mat_min[0][0]<mat_max[0][1])?(mat_max[0][1]-mat_stop[0][1])*URAD:(mat_min[0][1]-mat_stop[0][1])*URAD)); 306 cout<<" - "<<fabs(((mat_min[0][0]<mat_max[0][1])?(mat_stop[0][1]-mat_min[0][1])*URAD:(mat_stop[0][1]-mat_max[0][1])*URAD))<<" µrad"<<endl; 304 307 cout<<"\t hit point ty : "<<mat_stop[0][3]*URAD; 305 306 308 cout<<" + "<<fabs(((mat_min[0][0]<mat_max[0][3])?(mat_max[0][3]-mat_stop[0][3])*URAD:(mat_min[0][3]-mat_stop[0][3])*URAD)); 309 cout<<" - "<<fabs(((mat_min[0][0]<mat_max[0][3])?(mat_stop[0][3]-mat_min[0][3])*URAD:(mat_stop[0][3]-mat_max[0][3])*URAD))<<" µrad"<<endl; 307 310 308 311 } -
trunk/Utilities/Hector/src/H_Parameters.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 ///\file H_Parameters.cc -
trunk/Utilities/Hector/src/H_Quadrupole.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_Quadrupole.cc … … 24 31 } 25 32 26 void H_Quadrupole::printProperties() const{ 27 cout << typestring; 28 cout << name; 29 cout << "\t at s = " << fs; 30 cout << "\t length = " << element_length; 31 cout << "\t k1 = " << fk; 32 cout<<endl; 33 if(element_aperture->getType()!=NONE) { 34 cout <<"\t aperture type = " << element_aperture->getTypeString(); 35 element_aperture->printProperties(); 33 std::ostream& operator<< (std::ostream& os, const H_Quadrupole& el) { 34 os << el.typestring << el.name << "\t at s = " << el.fs << "\t length = " << el.element_length << "\t k1 = " << el.fk <<endl; 35 if(el.element_aperture->getType()!=NONE) { 36 os << *(el.element_aperture) << endl; 36 37 } 37 38 38 if(element_length<0) { if(VERBOSE) cout<<"<H_Quadrupole> ERROR : Interpenetration of elements !"<<endl; } 39 if(element_length==0) { if(VERBOSE) cout<<"<H_Quadrupole> WARNING : 0-length "<< typestring << " !" << endl; } 39 if(el.element_length<0 && VERBOSE) os<<"<H_Quadrupole> ERROR : Interpenetration of elements !"<<endl; 40 else if(el.element_length==0 && VERBOSE) os<<"<H_Quadrupole> WARNING : 0-length "<< el.typestring << " !" << endl; 41 return os; 40 42 } -
trunk/Utilities/Hector/src/H_RecRPObject.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 11 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 12 18 13 19 /// \file H_RecRPObject.cc … … 41 47 l_1(new TF1("l_1","[0] + [1]*x + [2]*x*x ",emin,emax)), 42 48 l_2(new TF1("l_2","[0] + [1]*x + [2]*x*x ",emin,emax)) 43 { 44 // emax = -1; /* GeV */ 45 } 46 47 H_RecRPObject::H_RecRPObject(float ss1, float ss2, H_AbstractBeamLine* beam) : emin(0), emax(-1), x1(0), x2(0), y1(0), y2(0), s1(ss1), s2(ss2), 49 {} 50 51 H_RecRPObject::H_RecRPObject(const float ss1, const float ss2, const H_AbstractBeamLine* beam) : emin(0), emax(-1), x1(0), x2(0), y1(0), y2(0), s1(ss1), s2(ss2), 48 52 txip(NOT_YET_COMPUTED), tyip(NOT_YET_COMPUTED), energy(NOT_YET_COMPUTED), q2(NOT_YET_COMPUTED), pt(NOT_YET_COMPUTED), 49 thebeam(beam ),53 thebeam(beam->clone()), 50 54 f_1(new TF1("f_1","[0] + [1]*x + [2]*x*x ",emin,emax)), 51 55 f_2(new TF1("f_2","[0] + [1]*x + [2]*x*x ",emin,emax)), … … 58 62 l_1(new TF1("l_1","[0] + [1]*x + [2]*x*x ",emin,emax)), 59 63 l_2(new TF1("l_2","[0] + [1]*x + [2]*x*x ",emin,emax)) 60 { 61 if(ss1==ss2) cout<<"<H_RecRPObject> WARNING : detectors are on same position"<<endl; 62 // emax = -1; /* GeV */ 64 {if(ss1==ss2) cout<<"<H_RecRPObject> WARNING : detectors are on same position"<<endl; 65 } 66 67 H_RecRPObject::H_RecRPObject(const H_RecRPObject& r): 68 emin(r.emin), emax(r.emax), x1(r.x1), x2(r.x2), y1(r.y1), y2(r.y2), s1(r.s1), s2(r.s2), 69 txip(r.txip), tyip(r.tyip), energy(r.energy), q2(r.q2), pt(r.pt), 70 //thebeam(r.thebeam->clone()), 71 thebeam(new H_AbstractBeamLine(*(r.thebeam))), 72 f_1(new TF1(*(r.f_1))), f_2(new TF1(*(r.f_2))), g_1(new TF1(*(r.g_1))), g_2(new TF1(*(r.g_2))), 73 d_1(new TF1(*(r.d_1))), d_2(new TF1(*(r.d_2))), k_1(new TF1(*(r.k_1))), k_2(new TF1(*(r.k_2))), 74 l_1(new TF1(*(r.l_1))), l_2(new TF1(*(r.l_2))) 75 {} 76 77 H_RecRPObject& H_RecRPObject::operator=(const H_RecRPObject& r) { 78 if (this == &r) return *this; 79 emin = r.emin, emax = r.emax; 80 x1 = r.x1; x2 = r.x2; 81 y1 = r.y1; y2 = r.y2; 82 s1 = r.s1; s2 = r.s2; 83 txip= r.txip; tyip=r.tyip; 84 energy= r.energy; q2= r.q2; pt= r.pt; 85 //thebeam = r.thebeam->clone(); 86 thebeam = new H_AbstractBeamLine(*(r.thebeam)); 87 f_1 = new TF1(*(r.f_1)); 88 f_2 = new TF1(*(r.f_2)); 89 g_1 = new TF1(*(r.g_1)); 90 g_2 = new TF1(*(r.g_2)); 91 d_1 = new TF1(*(r.d_1)); 92 d_2 = new TF1(*(r.d_2)); 93 k_1 = new TF1(*(r.k_1)); 94 k_2 = new TF1(*(r.k_2)); 95 l_1 = new TF1(*(r.l_1)); 96 l_2 = new TF1(*(r.l_2)); 97 return *this; 63 98 } 64 99 … … 308 343 return pt; 309 344 } 345 346 std::ostream& operator<< (std::ostream& os, const H_RecRPObject& rp) { 347 os << "e_min=" << rp.emin << "\t e_max= " << rp.emax << endl; 348 os << "x1=" << rp.x1 << "\t x2= " << rp.x2 << "\t y1=" << rp.y1 << "\t y2=" << rp.y2 349 << "\t s1=" << rp.s1 << "\t s2=" << rp.s2 << endl; 350 os << "txip=" << rp.txip << "\t tyip=" << rp.tyip << "\t energy=" << rp.energy << "\t q2=" << rp.q2 << "\t pt=" << rp.pt << endl; 351 return os; 352 } -
trunk/Utilities/Hector/src/H_RectEllipticAperture.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_RectEllipticAperture.cc … … 29 36 /// @param l, h, L, H are the geometrical parameters of the rect-ellipse shape 30 37 /// @param posx, posy defines the (x,y) of the center of the shape 31 type= RECTELLIPSE;32 38 } 33 39 … … 127 133 } 128 134 129 void H_RectEllipticAperture::printProperties() const{130 cout << "Aperture shape:" << getTypeString() << ", parameters " <<x1<<", "<<x2<<", "<<x3<<", "<<x4<< endl;131 cout << " \t Center : "<<fx<<", "<<fy<<endl;132 return ;135 std::ostream& operator<< (std::ostream& os, const H_RectEllipticAperture& ap) { 136 os << "Aperture shape:" << ap.aptypestring << ", parameters " << ap.x1 <<", "<< ap.x2 <<", "<< ap.x3 <<", "<< ap.x4 << endl; 137 os << " \t Center : " << ap.fx <<", "<< ap.fy <<endl; 138 return os; 133 139 } -
trunk/Utilities/Hector/src/H_RectangularAperture.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_RectangularAperture.cc … … 48 55 return; 49 56 } 50 void H_RectangularAperture::printProperties() const { 51 cout << "Aperture shape:" << getTypeString() << ", rectangle Sides : "<<x1<<", "<<x2<<endl; 52 cout << " \t Center : " << fx << "," << fy << endl; 53 return; 57 58 std::ostream& operator<< (std::ostream& os, const H_RectangularAperture& ap) { 59 os << "Aperture shape:" << ap.aptypestring << ", rectangle sides : " << ap. x1 <<", " << ap.x2 <<endl; 60 os << " \t Center : " << ap.fx << "," << ap.fy << endl; 61 return os; 54 62 } 63 -
trunk/Utilities/Hector/src/H_RectangularCollimator.cc
r216 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_RectangularCollimator.cc … … 36 43 } 37 44 38 void H_RectangularCollimator::printProperties() const { 39 cout << typestring << name; 40 cout << "\t\t at s = " << fs; 41 cout << "\t length = " << element_length; 42 cout<<endl; 43 if(element_aperture->getType()!=NONE) { 44 cout <<"\t aperture type = " << element_aperture->getTypeString(); 45 element_aperture->printProperties(); 45 std::ostream& operator<< (std::ostream& os, const H_RectangularCollimator& el) { 46 os << el.typestring << el.name << "\t\t at s = " << el.fs << "\t length = " << el.element_length <<endl; 47 if(el.element_aperture->getType()!=NONE) { 48 os << *(el.element_aperture) << endl; 46 49 } 47 50 48 if(element_length<0) { if(VERBOSE) cout<<"<H_RectangularCollimator> ERROR : Interpenetration of elements !"<<endl; } 49 if(element_length==0) { if(VERBOSE) cout<<"<H_RectangularCollimator> WARNING : 0-length "<< name << " !" << endl; } 51 if(el.element_length<0 && VERBOSE) os <<"<H_RectangularCollimator> ERROR : Interpenetration of elements !"<<endl; 52 else if(el.element_length==0 && VERBOSE) os <<"<H_RectangularCollimator> WARNING : 0-length "<< el.name << " !" << endl; 53 return os; 50 54 } 51 55 -
trunk/Utilities/Hector/src/H_RectangularDipole.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_RectangularDipole.cc -
trunk/Utilities/Hector/src/H_RomanPot.cc
r232 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_RomanPot.cc … … 39 46 } 40 47 41 void H_RomanPot::printProperties() const { 42 cout << typestring << name; 43 cout << "\t\t at s = " << fs; 44 if(element_aperture->getType()!=NONE) { 45 cout <<"\t aperture type = " << element_aperture->getTypeString(); 46 element_aperture->printProperties(); 47 } 48 49 cout<<endl; 48 std::ostream& operator<< (std::ostream& os, const H_RomanPot& el) { 49 os << el.typestring << el.name << "\t\t at s = " << el.fs; 50 if(el.element_aperture->getType()!=NONE) { 51 os << *(el.element_aperture) << endl; 52 } 53 return os; 50 54 } 51 55 -
trunk/Utilities/Hector/src/H_SectorDipole.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_SectorDipole.cc -
trunk/Utilities/Hector/src/H_TransportMatrices.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_TransportMatrices.cc … … 29 36 30 37 extern double omega(const double k, const double l) { 31 // [l] = [m] and [k] = [1/m ï¿œ] for quadrupoles38 // [l] = [m] and [k] = [1/m^2] for quadrupoles 32 39 // [omega] = [1] 33 40 return sqrt(fabs(k))*l; … … 35 42 36 43 extern double radius(const double k) { 37 // [k] = [1/m ï¿œ] for quadrupoles44 // [k] = [1/m^2] for quadrupoles 38 45 // [k] = [1/m] for dipoles 39 46 // [radius(k)] = [m] -
trunk/Utilities/Hector/src/H_VerticalKicker.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_VerticalKicker.cc -
trunk/Utilities/Hector/src/H_VerticalQuadrupole.cc
r3 r281 1 /* 2 ---- Hector the simulator ---- 3 A fast simulator of particles through generic beamlines. 4 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 5 6 http://www.fynu.ucl.ac.be/hector.html 7 8 Centre de Physique des Particules et de Phénoménologie (CP3) 9 Université Catholique de Louvain (UCL) 10 */ 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * 3 * --<--<-- A fast simulator --<--<-- * 4 * / --<--<-- of particle --<--<-- * 5 * ----HECTOR----< * 6 * \ -->-->-- transport through -->-->-- * 7 * -->-->-- generic beamlines -->-->-- * 8 * * 9 * JINST 2:P09005 (2007) * 10 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 11 * http://www.fynu.ucl.ac.be/hector.html * 12 * * 13 * Center for Cosmology, Particle Physics and Phenomenology * 14 * Universite catholique de Louvain * 15 * Louvain-la-Neuve, Belgium * 16 * * 17 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_VerticalQuadrupole.cc
Note:
See TracChangeset
for help on using the changeset viewer.