Changeset 281 in svn for trunk/Utilities/Hector/include/H_BeamParticle.h
- Timestamp:
- Mar 1, 2009, 3:56:11 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.