Changeset 3c40083 in git for external/Hector/H_Beam.h
- Timestamp:
- Apr 16, 2014, 3:56:14 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 64a4950
- Parents:
- f6b9fec
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/Hector/H_Beam.h
rf6b9fec r3c40083 2 2 #define _H_Beam_ 3 3 4 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * 5 * * 6 * --<--<-- A fast simulator --<--<-- * 7 * / --<--<-- of particle --<--<-- * 8 * ----HECTOR----< * 9 * \ -->-->-- transport through -->-->-- * 10 * -->-->-- generic beamlines -->-->-- * 11 * * 12 * JINST 2:P09005 (2007) * 13 * X Rouby, J de Favereau, K Piotrzkowski (CP3) * 14 * http://www.fynu.ucl.ac.be/hector.html * 15 * * 16 * Center for Cosmology, Particle Physics and Phenomenology * 17 * Universite catholique de Louvain * 18 * Louvain-la-Neuve, Belgium * 19 * * 20 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 4 /* 5 ---- Hector the simulator ---- 6 A fast simulator of particles through generic beamlines. 7 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be 8 9 http://www.fynu.ucl.ac.be/hector.html 10 11 Centre de Physique des Particules et de Phénoménologie (CP3) 12 Université Catholique de Louvain (UCL) 13 */ 21 14 22 15 /// \file H_Beam.h … … 31 24 32 25 // ROOT #includes 33 #include "TH2F.h" 34 #include "TGraphErrors.h" 35 #include "TMultiGraph.h" 36 #include "TMath.h" 26 ////#include "TH2F.h" 27 ////#include "TGraphErrors.h" 28 ////#include "TMultiGraph.h" 37 29 38 30 // local #includes … … 63 55 ~H_Beam(); 64 56 //@} 65 /// Fills the beam with particles in given position/angle/energy intervals (flat distribution)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);67 68 57 /// Fills the beam with particles 69 void createBeamParticles(const unsigned int Number_of_particles, const double p_mass=MP, const double p_charge=QP, TRandom* r=gRandom); 58 //@{ 59 void createBeamParticles(const unsigned int , const double , const double ); 60 void createBeamParticles(const unsigned int); 61 //@} 70 62 /// Fills the beam with particles with incremental offset and no initial transverse momentum 71 63 //@{ … … 86 78 void add(const H_BeamParticle&); 87 79 /// Compute the position of each particle in the beamline 88 void computePath(const H_AbstractBeamLine * beamline, const bool NonLinear=false); 80 //@{ 81 void computePath(const H_AbstractBeamLine *, const bool); 82 void computePath(const H_AbstractBeamLine *); 83 //@} 89 84 // Photon emission by the particle 90 void emitGamma(const double gee, const double gq2, const double phimin=0, const double phimax=2*TMath::Pi()); 85 // @{ 86 void emitGamma(const double, const double, const double, const double); 87 void emitGamma(const double, const double); 88 //@} 91 89 // Propagates the beam until a given s 92 90 void propagate(const float ); … … 98 96 /// Draws the \f$ \beta \f$ function of the beam 99 97 //@{ 100 101 TGraphErrors * getBetaY(const float, const unsigned int);98 //// TGraphErrors * getBetaX(const float, const unsigned int); 99 //// TGraphErrors * getBetaY(const float, const unsigned int); 102 100 //@} 103 101 /// Returns the position of the beam … … 108 106 /// Returns the emittance \f$ \epsilon \f$ of the beam in x and y 109 107 //@{ 110 inline const float getEmittanceX() const {111 108 inline const float getEmittanceX() const { 109 if(!x_disp*tx_disp) cout<<"Warning : Degenerate Beam : x-emittance = 0"<<endl; 112 110 return x_disp * tan(tx_disp/URAD)/URAD; 113 111 } … … 140 138 unsigned int getStoppedNumber(const H_AbstractBeamLine *); 141 139 /// Returns the list of the stopping elements in the beamline 142 v ector<TVectorD>getStoppingElements(const H_AbstractBeamLine *, vector<H_OpticalElement>&, vector<int>&);140 void getStoppingElements(const H_AbstractBeamLine *, vector<H_OpticalElement>&, vector<int>&); 143 141 /// Prints the initial parameters 144 142 void printInitialState() const; 145 143 /// Prints the properties for each particle 146 void printProperties() const {cout << *this; return;}144 void printProperties() const; 147 145 /// Prints the list of the stopping elements in the beamline 148 146 void printStoppingElements(const vector<H_OpticalElement>&, const vector<int>&) const; … … 150 148 const int getNumberOfBeamParticles() const {return Nparticles;} 151 149 /// Draws the beam profile at a given s 152 TH2F * drawProfile(const float); 153 TH2F * drawAngleProfile(const float); 150 //// TH2F * drawProfile(const float); 154 151 /// Draws the beam width and height 155 152 //@{ 156 TMultiGraph * drawBeamX(const int) const;157 TMultiGraph * drawBeamY(const int) const ;153 //// TMultiGraph * drawBeamX(const int) const; 154 //// TMultiGraph * drawBeamY(const int) const ; 158 155 //@} 159 156 … … 183 180 /// Number of particles in this beam 184 181 unsigned int Nparticles; 185 186 friend std::ostream& operator<< (std::ostream& os, const H_Beam& be);187 182 }; 188 183
Note:
See TracChangeset
for help on using the changeset viewer.