Changeset 3c40083 in git for external/Hector/H_Drift.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_Drift.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_Drift.cc … … 24 17 #include "H_TransportMatrices.h" 25 18 26 27 19 void H_Drift::init() { 28 20 // must be in public section 29 element_mat.ResizeTo(MDIM,MDIM);30 21 setTypeString(); 31 22 setMatrix(0,MP,QP); … … 33 24 } 34 25 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; 26 void H_Drift::printProperties() const { 27 cout << typestring << name; 28 cout << "\t\t at s = " << fs; 29 cout << "\t length = " << element_length; 30 cout<<endl; 31 if(element_aperture->getType()!=NONE) { 32 cout <<"\t aperture type = " << element_aperture->getTypeString(); 33 element_aperture->printProperties(); 39 34 } 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; 35 if(element_length<0) { if(VERBOSE) cout<<"\t ERROR : Interpenetration of elements !"<<endl; } 36 if(element_length==0) { if(VERBOSE) cout<<"\t WARNING : 0-length "<< name << " !" << endl; } 43 37 } 44 38 45 //void H_Drift::setMatrix(const float eloss, const float p_mass, const float p_charge) { 46 void H_Drift::setMatrix(const float , const float , const float ) { 47 element_mat = driftmat(element_length); 39 void H_Drift::setMatrix(const float eloss, const float p_mass, const float p_charge) const { 40 *element_mat = driftmat(element_length); 48 41 return ; 49 42 } 50 51 H_Drift* H_Drift::clone() const {52 H_Drift* temp_drift = new H_Drift(name,fs,element_length);53 temp_drift->setX(xpos);54 temp_drift->setY(ypos);55 temp_drift->setTX(txpos);56 temp_drift->setTY(typos);57 temp_drift->setBetaX(betax);58 temp_drift->setBetaY(betay);59 return temp_drift;60 }61
Note:
See TracChangeset
for help on using the changeset viewer.