Changeset 1365 in svn for trunk/external/Hector/H_RomanPot.cc
- Timestamp:
- Apr 16, 2014, 3:56:14 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/external/Hector/H_RomanPot.cc
r1360 r1365 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_RomanPot.cc … … 32 25 } 33 26 34 H_RomanPot::H_RomanPot(const double s, const double app) :H_Drift(s,RP_LENGTH){ 35 type = RP; 27 H_RomanPot::H_RomanPot(const double s, const double app) :H_OpticalElement(RP,s,0.,RP_LENGTH){ 36 28 init(); 37 if(element_aperture) delete element_aperture;38 element_aperture = new H_RectangularAperture(app,RP_HEIGHT,0,0);29 H_RectangularAperture* rapp = new H_RectangularAperture(app,RP_HEIGHT,0,0); 30 setAperture(rapp); 39 31 } 40 32 41 H_RomanPot::H_RomanPot(const string& nameE, const double s, const double app) :H_Drift(nameE,s,RP_LENGTH){ 42 type = RP; 33 H_RomanPot::H_RomanPot(const string nameE, const double s, const double app) :H_OpticalElement(nameE,RP,s,0.,RP_LENGTH){ 43 34 init(); 44 if(element_aperture) delete element_aperture;45 element_aperture = new H_RectangularAperture(app,RP_HEIGHT,0,0);35 H_RectangularAperture* rapp = new H_RectangularAperture(app,RP_HEIGHT,0,0); 36 setAperture(rapp); 46 37 } 47 38 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; 39 void H_RomanPot::printProperties() const { 40 cout << typestring << name; 41 cout << "\t\t at s = " << fs; 42 if(element_aperture->getType()!=NONE) { 43 cout <<"\t aperture type = " << element_aperture->getTypeString(); 44 element_aperture->printProperties(); 45 } 46 47 cout<<endl; 54 48 } 55 49 56 void H_RomanPot::setMatrix(const float eloss, const float p_mass, const float p_charge) {57 element_mat = driftmat(0);50 void H_RomanPot::setMatrix(const float eloss, const float p_mass, const float p_charge) const { 51 *element_mat = driftmat(0); 58 52 return ; 59 53 } 60 61 H_RomanPot* H_RomanPot::clone() const {62 H_RomanPot* temp_rp = new H_RomanPot(name,fs,element_length);63 temp_rp->setAperture(element_aperture);64 temp_rp->setX(xpos);65 temp_rp->setY(ypos);66 temp_rp->setTX(txpos);67 temp_rp->setTY(typos);68 temp_rp->setBetaX(betax);69 temp_rp->setBetaY(betay);70 return temp_rp;71 }72
Note:
See TracChangeset
for help on using the changeset viewer.