Changeset 3c40083 in git for external/Hector/H_TransportMatrices.cc
- Timestamp:
- Apr 16, 2014, 3:56:14 PM (11 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 64a4950
- Parents:
- f6b9fec
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/Hector/H_TransportMatrices.cc
rf6b9fec r3c40083 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 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 */ 18 11 19 12 /// \file H_TransportMatrices.cc … … 36 29 37 30 extern double omega(const double k, const double l) { 38 // [l] = [m] and [k] = [1/m ^2] for quadrupoles31 // [l] = [m] and [k] = [1/mï¿œ] for quadrupoles 39 32 // [omega] = [1] 40 33 return sqrt(fabs(k))*l; … … 42 35 43 36 extern double radius(const double k) { 44 // [k] = [1/m ^2] for quadrupoles37 // [k] = [1/mï¿œ] for quadrupoles 45 38 // [k] = [1/m] for dipoles 46 39 // [radius(k)] = [m] 47 if(k==0 && VERBOSE) cout<<" <H_TransportMatrices>ERROR : Dipole has no effect : results will be corrupted"<<endl;40 if(k==0 && VERBOSE) cout<<"ERROR : Dipole has no effect : results will be corrupted"<<endl; 48 41 // this is protected by the "if(k==0) -> driftmat" in every matrix below (ex vquatmat) 49 42 return (k==0) ? 1 : 1/k; 50 43 } 51 44 52 extern void printMatrix(TMatrix TMat) {45 extern void printMatrix(TMatrix * TMat) { 53 46 char temp[20]; 54 47 float * el = new float[MDIM*MDIM]; 55 el = (TMat .GetMatrixArray());48 el = (TMat->GetMatrixArray()); 56 49 57 50 cout << endl << "\t"; … … 156 149 double simp = r*2*sin(l/(2*r))*sin(l/(2*r))/BE; 157 150 double psy = ke*l/2.; 158 float tefmat[MDIM*MDIM] = {1., tan(psy)*ke, 0., 0., 0., 0.,151 float tefmat[MDIM*MDIM] = {1., (float)(tan(psy)*ke), 0., 0., 0., 0., 159 152 0., 1., 0., 0., 0., 0., 160 0., 0., 1., -tan(psy)*ke, 0., 0.,153 0., 0., 1., (float)(-tan(psy)*ke), 0., 0., 161 154 0., 0., 0., 1., 0., 0., 162 155 0., 0., 0., 0., 1., 0., … … 167 160 0.,0.,1.,0., 0., 0., 168 161 0.,0.,l,1., 0., 0., 169 simp, sin(l/r)/BE, 0., 0., 1., 0.,162 (float)simp, (float)(sin(l/r)/BE), 0., 0., 1., 0., 170 163 0., 0., 0., 0., 0., 1. }; 171 164 for(int i=0;i<MDIM*MDIM;i++) { … … 216 209 0.,0.,1.,0., 0., 0., 217 210 0.,0.,l,1., 0., 0., 218 simp, sin(l/r)/BE, 0., 0., 1., 0.,211 simp, (float)(sin(l/r)/BE), 0., 0., 1., 0., 219 212 0., 0., 0., 0., 0., 1. 220 213 }; … … 265 258 0.,0.,l ,1.,0.,0., 266 259 0.,0.,0.,0.,1.,0., 267 l*tan(ke)/2.,ke, 0., 0., 0., 1.260 (float)(l*tan(ke)/2.),ke, 0., 0., 0., 1. 268 261 }; 269 262 … … 292 285 0.,0.,l ,1.,0.,0., 293 286 0.,0.,0.,0.,1.,0., 294 0.,0., l*tan(ke)/2.,ke, 0., 1.287 0.,0.,(float)(l*tan(ke)/2.),ke, 0., 1. 295 288 }; 296 289
Note:
See TracChangeset
for help on using the changeset viewer.