Changeset 3c40083 in git for external/Hector/H_RectangularCollimator.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_RectangularCollimator.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_RectangularCollimator.cc … … 31 24 } 32 25 33 H_RectangularCollimator::H_RectangularCollimator(const double s, const double l) :H_Drift(s,l){ 34 type = RCOLLIMATOR; 35 init(); 26 H_RectangularCollimator::H_RectangularCollimator(const double s, const double l) :H_OpticalElement(RCOLLIMATOR,s,0.,l){ 27 init(); 36 28 return; 37 29 } 38 30 39 H_RectangularCollimator::H_RectangularCollimator(const string& nameE, const double s, const double l) :H_Drift(nameE,s,l){ 40 type = RCOLLIMATOR; 41 init(); 31 H_RectangularCollimator::H_RectangularCollimator(const string nameE, const double s, const double l) :H_OpticalElement(nameE,RCOLLIMATOR,s,0.,l){ 32 init(); 42 33 return; 43 34 } 44 35 45 std::ostream& operator<< (std::ostream& os, const H_RectangularCollimator& el) { 46 os << el.typestring << el.name << "\t\t at s = " << el.fs << "\t length = " << el.element_length <<endl; 47 if(el.element_aperture->getType()!=NONE) { 48 os << *(el.element_aperture) << endl; 36 void H_RectangularCollimator::printProperties() const { 37 cout << typestring << name; 38 cout << "\t\t at s = " << fs; 39 cout << "\t length = " << element_length; 40 cout<<endl; 41 if(element_aperture->getType()!=NONE) { 42 cout <<"\t aperture type = " << element_aperture->getTypeString(); 43 element_aperture->printProperties(); 49 44 } 50 45 51 if(el.element_length<0 && VERBOSE) os <<"<H_RectangularCollimator> ERROR : Interpenetration of elements !"<<endl; 52 else if(el.element_length==0 && VERBOSE) os <<"<H_RectangularCollimator> WARNING : 0-length "<< el.name << " !" << endl; 53 return os; 46 if(element_length<0) { if(VERBOSE) cout<<"\t ERROR : Interpenetration of elements !"<<endl; } 47 if(element_length==0) { if(VERBOSE) cout<<"\t WARNING : 0-length "<< name << " !" << endl; } 54 48 } 55 49 56 //void H_RectangularCollimator::setMatrix(const float eloss, const float p_mass, const float p_charge){57 void H_RectangularCollimator::setMatrix(const float , const float , const float ) { 58 element_mat = driftmat(element_length);50 void H_RectangularCollimator::setMatrix(const float eloss, const float p_mass, const float p_charge) const { 51 // cout<<"\t WARNING : H_RectangularCollimator matrices not yet implemented ! " << endl; 52 *element_mat = driftmat(element_length); 59 53 return ; 60 54 } 61 62 H_RectangularCollimator* H_RectangularCollimator::clone() const {63 H_RectangularCollimator* temp_coll = new H_RectangularCollimator(name,fs,element_length);64 temp_coll->setAperture(element_aperture);65 temp_coll->setX(xpos);66 temp_coll->setY(ypos);67 temp_coll->setTX(txpos);68 temp_coll->setTY(typos);69 temp_coll->setBetaX(betax);70 temp_coll->setBetaY(betay);71 return temp_coll;72 }73
Note:
See TracChangeset
for help on using the changeset viewer.