Changeset 281 in svn for trunk/Utilities/Hector/src
- Timestamp:
- Mar 1, 2009, 3:56:11 PM (16 years ago)
- Location:
- trunk/Utilities/Hector/src
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Utilities/Hector/src/H_AbstractBeamLine.cc
r264 r281 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 */ 11 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 12 18 13 19 /// \file H_AbstractBeamLine.cc … … 45 51 } 46 52 47 H_AbstractBeamLine::H_AbstractBeamLine(const H_AbstractBeamLine& beamline) { 48 elements = beamline.elements; 49 matrices = beamline.matrices; 53 H_AbstractBeamLine::H_AbstractBeamLine(const H_AbstractBeamLine& beamline) : 54 matrices(beamline.matrices) { 55 //elements = beamline.elements; //<-- bad ! the new vector contains the same pointers as the previous one 56 cloneElements(beamline); 50 57 beam_mat.ResizeTo(MDIM,MDIM); 51 58 beam_mat = beamline.beam_mat; … … 55 62 H_AbstractBeamLine& H_AbstractBeamLine::operator=(const H_AbstractBeamLine& beamline) { 56 63 if(this== &beamline) return *this; 57 elements = beamline.elements; 64 //elements = beamline.elements; //<-- bad ! the new vector contains the same pointers as the previous one 65 cloneElements(beamline); 58 66 matrices = beamline.matrices; 59 67 beam_mat = beamline.beam_mat; … … 83 91 elements.clear(); 84 92 matrices.clear(); 93 } 94 95 void H_AbstractBeamLine::cloneElements(const H_AbstractBeamLine& beam) { 96 vector<H_OpticalElement*>::const_iterator element_i; 97 for (element_i = beam.elements.begin(); element_i< beam.elements.end(); element_i++) { 98 H_OpticalElement* temp_el = (*element_i)->clone(); 99 elements.push_back(temp_el); 100 } 85 101 } 86 102 … … 101 117 } 102 118 103 void H_AbstractBeamLine::add(H_OpticalElement & newElement) {104 /// @param newElement is added to the beamline105 // H_OpticalElement * el = new H_OpticalElement(newElement);106 // elements.push_back(el);107 elements.push_back(&newElement);108 float a = newElement.getS()+newElement.getLength();109 if (a > beam_length) {110 beam_length = a;111 if(VERBOSE) cout<<"<H_AbstractBeamLine> WARNING : element ("<< newElement.getName()<<") too far away. The beam length has been extended to "<< beam_length << ". "<<endl;112 }113 calcSequence();114 calcMatrix();115 }116 117 119 const TMatrix H_AbstractBeamLine::getBeamMatrix() const { 118 120 return beam_mat; … … 205 207 } 206 208 207 void H_AbstractBeamLine::printProperties() const { 208 vector<H_OpticalElement*>::const_iterator element_i; 209 cout << "Pointeurs des elements du faisceau" << endl; 210 for (element_i = elements.begin(); element_i < elements.end(); element_i++) { 211 cout << (int)(element_i-elements.begin()) << "\t" << (*element_i)->getName() << "\t" << (*element_i)->getS() << endl; 212 } 213 return; 214 } 209 std::ostream& operator<< (std::ostream& os, const H_AbstractBeamLine& be) { 210 vector<H_OpticalElement*>::const_iterator element_i; 211 os << "Beamline content" << endl; 212 for (element_i = be.elements.begin(); element_i < be.elements.end(); element_i++) { 213 os << (int)(element_i - be.elements.begin()) << "\t" << (*element_i)->getName() << "\t" << (*element_i)->getS() << endl; 214 } 215 return os; 216 } 217 218 void H_AbstractBeamLine::printProperties() const { cout << *this; return; } 215 219 216 220 void H_AbstractBeamLine::showElements() const{ … … 485 489 /// @param offset In meters 486 490 487 extern boolrelative_energy;491 extern int relative_energy; 488 492 if(!relative_energy) { 489 493 vector<H_OpticalElement*>::iterator element_i; -
trunk/Utilities/Hector/src/H_Aperture.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_Aperture.cc … … 20 27 using namespace std; 21 28 22 H_Aperture::H_Aperture() { 23 type = NONE; 24 setApertureString(); 25 x1 = 0; 26 x2 = 0; 27 x3 = 0; 28 x4 = 0; 29 fx = 0; 30 fy = 0; 29 H_Aperture::H_Aperture() : 30 type_(NONE), x1(0), x2(0), x3(0), x4(0), fx(0), fy(0), aptypestring(getApertureString()) { 31 31 } 32 32 33 H_Aperture::H_Aperture(const int dtype, const float size1, const float size2, const float size3, const float size4, const float posx, const float posy) { 33 H_Aperture::H_Aperture(const int dtype, const float size1, const float size2, const float size3, const float size4, const float posx, const float posy) : 34 type_(dtype), x1(size1), x2(size2), x3(size3), x4(size4), fx(posx), fy(posy), aptypestring(getApertureString()) { 34 35 /// @param dtype defines the aperture shape 35 36 /// @param size1, size2, size3, size4 are the geometrical sizes (length/width or great/small radii) in m 36 37 /// @param posx, posy are the (x,y) coordinates of the center of the aperture [m] 37 type = dtype;38 setApertureString();39 x1 = size1;40 x2 = size2;41 x3 = size3;42 x4 = size4;43 fx = posx;44 fy = posy;45 38 } 46 39 47 H_Aperture::H_Aperture(const H_Aperture& ap) { 48 type = ap.type; 49 aptypestring = ap.aptypestring; 50 x1 = ap.x1; 51 x2 = ap.x2; 52 x3 = ap.x3; 53 x4 = ap.x4; 54 fx = ap.fx; 55 fy = ap.fy; 40 H_Aperture::H_Aperture(const H_Aperture& ap) : 41 type_(ap.type_), x1(ap.x1), x2(ap.x2), x3(ap.x3), x4(ap.x4), fx(ap.fx), fy(ap.fy), aptypestring(ap.aptypestring) { 56 42 } 57 43 58 44 H_Aperture& H_Aperture::operator=(const H_Aperture& ap) { 59 45 if(this==&ap) return *this; 60 type = ap.type; 61 aptypestring = ap.aptypestring; 46 type_ = ap.type_; 62 47 x1 = ap.x1; 63 48 x2 = ap.x2; … … 66 51 fx = ap.fx; 67 52 fy = ap.fy; 53 aptypestring = ap.aptypestring; 68 54 return *this; 69 55 } 70 56 57 std::ostream& operator<< (std::ostream& os, const H_Aperture& ap) { 58 os << "Aperture shape:" << ap.aptypestring << ", parameters "<<ap.x1<<", "<<ap.x2<<", "<<ap.x3<<", "<<ap.x4<<endl; 59 os << " \t Center : " << ap.fx << "," << ap.fy << endl; 60 return os; 61 } 62 71 63 void H_Aperture::printProperties() const { 72 cout << "Aperture shape:" << getTypeString() << ", parameters "<<x1<<", "<<x2<<", "<<x3<<", "<<x4<<endl; 73 cout << " \t Center : " << fx << "," << fy << endl; 64 cout << *this; 74 65 return; 75 66 } … … 90 81 91 82 92 void H_Aperture::setApertureString() {93 switch (type ) {83 /*void H_Aperture::setApertureString() { 84 switch (type_) { 94 85 case NONE: aptypestring = NONENAME; break; 95 86 case RECTANGULAR: aptypestring = RECTANGULARNAME; break; … … 100 91 } 101 92 } 93 */ 94 95 const string H_Aperture::getApertureString() const { 96 string str; 97 switch (type_) { 98 case NONE: str = NONENAME; break; 99 case RECTANGULAR: str = RECTANGULARNAME; break; 100 case ELLIPTIC: str = ELLIPTICNAME; break; 101 case CIRCULAR: str = CIRCULARNAME; break; 102 case RECTELLIPSE: str = RECTELLIPSENAME; break; 103 default: str = NONENAME; break; 104 } 105 return str; 106 } 107 -
trunk/Utilities/Hector/src/H_Beam.cc
r233 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_Beam.cc … … 55 62 }; 56 63 57 void H_Beam::createBeamParticles(const unsigned int Number_of_particles) { 58 createBeamParticles(Number_of_particles,MP,QP); 59 } 60 61 void H_Beam::createBeamParticles(const unsigned int Number_of_particles, const double p_mass, const double p_charge) { 64 void H_Beam::createBeamParticles(const unsigned int Number_of_particles, const double p_mass, const double p_charge, TRandom* r) { 62 65 beamParticles.clear(); 63 66 Nparticles = (Number_of_particles<1) ? 1 : Number_of_particles; … … 66 69 p.setPosition(fx_ini,fy_ini,tx_ini,ty_ini,fs_ini); 67 70 p.setE(fe_ini); 68 p.smearPos(x_disp,y_disp );69 p.smearAng(tx_disp,ty_disp );70 p.smearE(e_disp );71 p.smearS(s_disp );71 p.smearPos(x_disp,y_disp,r); 72 p.smearAng(tx_disp,ty_disp,r); 73 p.smearE(e_disp,r); 74 p.smearS(s_disp,r); 72 75 if (VERBOSE) {if (i==0) cout << " x_ini , tx_ini " << p.getX() << " " << p.getTX() << endl;} 73 76 beamParticles.push_back(p); … … 76 79 77 80 //void H_Beam::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=-PI/2., const float tx_max=PI/2., const float ty_min=-PI/2., const float ty_max=PI/2., const float p_mass=MP, const double p_charge=QP) { 78 void H_Beam::particleGun(const unsigned int Number_of_particles, const float E_min, const float E_max, const float fs_min, const float fs_max, const float fx_min, const float fx_max, const float fy_min, const float fy_max, const float tx_min, const float tx_max, const float ty_min, const float ty_max, const float p_mass, const double p_charge, const bool flat ) {81 void H_Beam::particleGun(const unsigned int Number_of_particles, const float E_min, const float E_max, const float fs_min, const float fs_max, const float fx_min, const float fx_max, const float fy_min, const float fy_max, const float tx_min, const float tx_max, const float ty_min, const float ty_max, const float p_mass, const double p_charge, const bool flat, TRandom* r) { 79 82 beamParticles.clear(); 80 83 Nparticles = (Number_of_particles<2) ? 2 : Number_of_particles; … … 83 86 H_BeamParticle p(p_mass,p_charge); 84 87 if (flat) { 85 gx = gRandom->Uniform(fx_min,fx_max);86 gy = gRandom->Uniform(fy_min,fy_max);87 gs = gRandom->Uniform(fs_min,fs_max);88 gtx = gRandom->Uniform(tx_min,tx_max);89 gty = gRandom->Uniform(ty_min,ty_max);90 gE = gRandom->Uniform(E_min,E_max);88 gx = r->Uniform(fx_min,fx_max); 89 gy = r->Uniform(fy_min,fy_max); 90 gs = r->Uniform(fs_min,fs_max); 91 gtx = r->Uniform(tx_min,tx_max); 92 gty = r->Uniform(ty_min,ty_max); 93 gE = r->Uniform(E_min,E_max); 91 94 } else { 92 gx = gRandom->Gaus((fx_min+fx_max)/2,(-fx_min+fx_max)/2);93 gy = gRandom->Gaus((fy_min+fy_max)/2,(-fy_min+fy_max)/2);94 gs = gRandom->Gaus((fs_min+fs_max)/2,(-fs_min+fs_max)/2);95 gtx = gRandom->Gaus((tx_min+tx_max)/2,(-tx_min+tx_max)/2);96 gty = gRandom->Gaus((ty_min+ty_max)/2,(-ty_min+ty_max)/2);97 gE = gRandom->Gaus ((E_min+E_max)/2,(-E_min+E_max)/2);95 gx = r->Gaus((fx_min+fx_max)/2,(-fx_min+fx_max)/2); 96 gy = r->Gaus((fy_min+fy_max)/2,(-fy_min+fy_max)/2); 97 gs = r->Gaus((fs_min+fs_max)/2,(-fs_min+fs_max)/2); 98 gtx = r->Gaus((tx_min+tx_max)/2,(-tx_min+tx_max)/2); 99 gty = r->Gaus((ty_min+ty_max)/2,(-ty_min+ty_max)/2); 100 gE = r->Gaus ((E_min+E_max)/2,(-E_min+E_max)/2); 98 101 } 99 102 p.setPosition(gx,gy,gtx,gty,gs); … … 179 182 } 180 183 181 void H_Beam::computePath(const H_AbstractBeamLine * beamline) {182 computePath(beamline,false);183 }184 185 184 /// Propagates the beam until a given s 186 185 void H_Beam::propagate(const float position) { … … 189 188 particle_i->propagate(position); 190 189 } 191 }192 193 void H_Beam::emitGamma(const double gee, const double gq2) {194 /// @param gee = \f$ E_{\gamma} \f$ is the photon energy195 /// @param gq2 = \f$ Q^2 < 0 \f$ is virtuality of photon \f$ Q^{2} = E^{2}-\vec{k}^{2} \f$196 emitGamma(gee,gq2,0,2*pi);197 190 } 198 191 … … 386 379 } 387 380 388 void H_Beam::printProperties() const{381 std::ostream& operator<< (std::ostream& os, const H_Beam& be) { 389 382 vector<H_BeamParticle>::const_iterator particle_i; 390 cout << "There are " << Nparticles << " in the beam." << endl; 391 for (particle_i = beamParticles.begin();particle_i < beamParticles.end(); particle_i++) { 392 particle_i->printProperties(); 393 } 383 cout << "There are " << be.Nparticles << " in the beam." << endl; 384 for (particle_i = be.beamParticles.begin(); particle_i < be.beamParticles.end(); particle_i++) { 385 cout << *particle_i; 386 } 387 return os; 394 388 } 395 389 -
trunk/Utilities/Hector/src/H_BeamLine.cc
r238 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_BeamLine.cc … … 39 46 // are opposite to Wille's. See fill() for more details. 40 47 41 H_BeamLine::H_BeamLine(const int si, const float length) : H_AbstractBeamLine(length){ 42 direction = (si >= abs(si)) ? 1 : -1; 43 ips=0; 44 ipx=0; 45 ipy=0; 46 iptx=0; 47 ipty=0; 48 } 49 50 H_BeamLine::H_BeamLine(const H_BeamLine& beam) : H_AbstractBeamLine(beam) { 48 H_BeamLine::H_BeamLine(): H_AbstractBeamLine(), 49 direction(1), ips(0), ipx(0), ipy(0), iptx(0), ipty(0) { 50 } 51 52 H_BeamLine::H_BeamLine(const int si, const float length) : H_AbstractBeamLine(length), 53 direction((si >= abs(si)) ? 1 : -1), ips(0), ipx(0), ipy(0), iptx(0), ipty(0) { 54 } 55 56 H_BeamLine::H_BeamLine(const H_BeamLine& beam) : H_AbstractBeamLine(beam), 57 direction(beam.direction), ips(beam.ips), ipx(beam.ipx), ipy(beam.ipy), iptx(beam.iptx), ipty(beam.ipty) { 58 } 59 60 H_BeamLine& H_BeamLine::operator=(const H_BeamLine& beam) { 61 if(this==&beam) return *this; 62 H_AbstractBeamLine::operator=(beam); // call the mother's operator= 51 63 direction = beam.direction; 52 64 ips = beam.ips; … … 55 67 iptx = beam.iptx; 56 68 ipty = beam.ipty; 57 }58 59 H_BeamLine& H_BeamLine::operator=(const H_BeamLine& beam) {60 if(this==&beam) return *this;61 direction = beam.direction;62 ips = beam.ips;63 ipx = beam.ipx;64 ipy = beam.ipy;65 iptx = beam.iptx;66 ipty = beam.ipty;67 69 return *this; 68 }69 70 void H_BeamLine::findIP(const string& filename) {71 findIP(filename,"IP5");72 return;73 70 } 74 71 … … 125 122 temp[3] = ipty; 126 123 return temp; 127 }128 129 void H_BeamLine::fill(const string& filename) {130 fill(filename,1,"IP5");131 return;132 124 } 133 125 -
trunk/Utilities/Hector/src/H_BeamLineParser.cc
r216 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_BeamLineParser.cc 13 20 /// \brief Reader for madx tables 14 21 /// 15 /// Notes : V ᅵifier que tous les SBEND sont toujours appelᅵ MB. Et seulement comme ᅵ!16 /// V ᅵifier qu'il n'y a pas de problᅵed'inversion H/V QUADRUPOLES22 /// Notes : Verifier que tous les SBEND sont toujours appeles MB. Et seulement comme ca ! 23 /// Verifier qu'il n'y a pas de problemes d'inversion H/V QUADRUPOLES 17 24 /// no distinction between H and Vkickers ? 18 25 /// The identification of the element is based on the values of k1l, k2l, hkick, vkick and on their name. -
trunk/Utilities/Hector/src/H_BeamParticle.cc
r240 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_BeamParticle.cc … … 39 46 using namespace std; 40 47 41 void H_BeamParticle::init() { 48 void H_BeamParticle::init() { // for more efficiency, put the objects away from init! 42 49 mp = MP; 43 50 qp = QP; … … 57 64 } 58 65 59 H_BeamParticle::H_BeamParticle() { 66 H_BeamParticle::H_BeamParticle() { 60 67 init(); 61 68 } 62 69 63 H_BeamParticle::H_BeamParticle(const H_BeamParticle& p) { 64 mp = p.mp; 65 qp = p.qp; 66 fx = p.fx; 67 fy = p.fy; 68 thx = p.thx; 69 thy = p.thy; 70 fs = p.fs; 71 energy = p.energy; 72 hasstopped = p.hasstopped; 73 hasemitted = p.hasemitted; 74 isphysical = p.isphysical; 75 stop_position = new TVectorD(*(p.stop_position)); 70 H_BeamParticle::H_BeamParticle(const H_BeamParticle& p): 71 mp(p.mp), qp(p.qp), fs(p.fs), fx(p.fx), fy(p.fy), thx(p.thx), thy(p.thy), 72 energy(p.energy), hasstopped(p.hasstopped), hasemitted(p.hasemitted), 73 isphysical(p.isphysical), stop_position(new TVectorD(*(p.stop_position))), 74 stop_element(0), positions(p.positions) { 76 75 if(p.hasstopped) stop_element = new H_OpticalElement(*(p.stop_element)); 77 positions = p.positions;78 76 } 79 77 … … 100 98 stop_position = new TVectorD(*(p.stop_position)); 101 99 if(p.hasstopped) stop_element = new H_OpticalElement(*(p.stop_element)); 100 else stop_element = 0; 102 101 positions = p.positions; 103 102 return *this; 104 103 } 105 104 106 bool H_BeamParticle::stopped(const H_AbstractBeamLine * beamline) {105 const bool H_BeamParticle::stopped(const H_AbstractBeamLine * beamline) { 107 106 vector<TVectorD>::const_iterator position_i; 108 107 for(position_i = positions.begin(); position_i < positions.end()-1; position_i++) { … … 159 158 } 160 159 161 void H_BeamParticle::smearPos(const double dx,const double dy) { 160 161 162 void H_BeamParticle::smearPos(const double dx,const double dy, TRandom* r) { 162 163 // the beam is centered on (fx,fy) at IP 163 fx = gRandom->Gaus(fx,dx); 164 fy = gRandom->Gaus(fy,dy); 164 fx = r->Gaus(fx,dx); 165 fy = r->Gaus(fy,dy); 166 positions.clear(); 167 addPosition(fx,thx,fy,thy,fs); 168 return; 169 } 170 171 void H_BeamParticle::smearAng(const double tx, const double ty, TRandom* r) { 172 // the beam transverse direction is centered on (thx,thy) at IP 173 thx = r->Gaus(thx,tx); 174 thy = r->Gaus(thy,ty); 165 175 positions.clear(); 166 176 addPosition(fx,thx,fy,thy,fs); … … 168 178 } 169 179 170 void H_BeamParticle::smearPos() { 171 // the beam is centered on (fx,fy) at IP 172 fx = gRandom->Gaus(fx,SX); 173 fy = gRandom->Gaus(fy,SY); 174 positions.clear(); 175 addPosition(fx,thx,fy,thy,fs); 176 return; 177 } 178 179 void H_BeamParticle::smearAng(const double tx, const double ty) { 180 // the beam transverse direction is centered on (thx,thy) at IP 181 thx = gRandom->Gaus(thx,tx); 182 thy = gRandom->Gaus(thy,ty); 183 positions.clear(); 184 addPosition(fx,thx,fy,thy,fs); 185 return; 186 } 187 188 void H_BeamParticle::smearAng() { 189 // the beam transverse direction is centered on (thx,thy) at IP 190 thx = gRandom->Gaus(thx,STX); 191 thy = gRandom->Gaus(thy,STY); 192 positions.clear(); 193 addPosition(fx,thx,fy,thy,fs); 194 return; 195 } 196 197 void H_BeamParticle::smearE(const double erre) { 198 energy = gRandom->Gaus(energy,erre); 199 return; 200 } 201 202 void H_BeamParticle::smearE() { 203 energy = gRandom->Gaus(energy,SBE); 204 return; 205 } 206 207 void H_BeamParticle::smearS(const double errs) { 208 fs= gRandom->Gaus(fs,errs); 180 void H_BeamParticle::smearE(const double erre, TRandom* r) { 181 energy = r->Gaus(energy,erre); 182 return; 183 } 184 185 void H_BeamParticle::smearS(const double errs, TRandom* r) { 186 fs= r->Gaus(fs,errs); 209 187 positions.clear(); 210 188 addPosition(fx,thx,fy,thy,fs); … … 212 190 } 213 191 214 void H_BeamParticle::smearS() {215 fs = gRandom->Gaus(fs,SS);216 positions.clear();217 addPosition(fx,thx,fy,thy,fs);218 return;219 }220 192 221 193 void H_BeamParticle::set4Momentum(const double px, const double py, const double pz, const double ene) { … … 267 239 if(hasstopped) return stop_element; 268 240 else { H_OpticalElement * dummy_el = new H_Drift("",0,0); return dummy_el;} 269 }270 271 void H_BeamParticle::emitGamma(const double gee, const double gq2) {272 emitGamma(gee,gq2,0,2*pi);273 return;274 241 } 275 242 … … 362 329 } 363 330 364 void H_BeamParticle::printProperties() const{365 cout << " M = " <<getM() << "GeV ";366 cout << " Q = " <<getQ() << "e";367 cout << " fx = " <<getX() << "m ";368 cout << " fy = " <<getY() << "m ";369 cout << " thx = " <<getTX() << "rad ";370 cout << " thy = " <<getTY() << "rad ";371 cout<< endl;372 return;331 std::ostream& operator<< (std::ostream& os, const H_BeamParticle& p) { 332 os << " M = " << p.getM() << "GeV "; 333 os << " Q = " << p.getQ() << "e"; 334 os << " fx = " << p.getX() << "m "; 335 os << " fy = " << p.getY() << "m "; 336 os << " thx = " << p.getTX() << "rad "; 337 os << " thy = " << p.getTY() << "rad "; 338 os << endl; 339 return os; 373 340 } 374 341 … … 491 458 delete [] graph; 492 459 return ppath; 493 }494 495 void H_BeamParticle::computePath(const H_AbstractBeamLine * beam) {496 computePath(beam,true);497 460 } 498 461 -
trunk/Utilities/Hector/src/H_CircularAperture.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_CircularAperture.cc … … 23 30 using namespace std; 24 31 25 /// Circular apertures26 H_CircularAperture::H_CircularAperture(const float r, const float posx, const float posy) :H_EllipticAperture(r,r,posx,posy) {27 /// @param r is the radius of the circular shape28 /// @param posx, posy are the (x,y) coordinates of the center of the circle29 type= CIRCULAR;30 }31 32 32 H_CircularAperture* H_CircularAperture::clone() const { 33 33 return new H_CircularAperture(x1,fx,fy); 34 34 } 35 35 36 void H_CircularAperture::printProperties() const{37 cout << "Aperture shape:" << getTypeString() << ", aperture radius : " <<x1 << endl;38 cout << " \t Center : " << fx << "," <<fy << endl;39 return ;36 std::ostream& operator<< (std::ostream& os, const H_CircularAperture& ap) { 37 os << "Aperture shape:" << ap.aptypestring << ", aperture radius : " << ap.x1 << endl; 38 os << " \t Center : " << ap.fx << "," << ap.fy << endl; 39 return os; 40 40 } -
trunk/Utilities/Hector/src/H_Dipole.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_Dipole.cc … … 25 32 } 26 33 27 void H_Dipole::printProperties() const { 28 cout << typestring; 29 cout << name; 30 cout<<"\t at s = "<< fs; 31 cout<<"\t length = "<< element_length; 32 cout<<"\t k0 = "<<fk; 33 cout<<endl; 34 if(element_aperture->getType()!=NONE) { 35 cout <<"\t aperture type = " << element_aperture->getTypeString(); 36 element_aperture->printProperties(); 34 std::ostream& operator<< (std::ostream& os, const H_Dipole& el) { 35 os << el.typestring << el.name <<"\t at s = "<< el.fs <<"\t length = "<< el.element_length <<"\t k0 = "<<el.fk << endl; 36 if(el.element_aperture->getType()!=NONE) { 37 os << *(el.element_aperture) << endl; 37 38 } 38 39 39 if(element_length<0) { if(VERBOSE) cout<<"<H_Dipole> ERROR : Interpenetration of elements !"<<endl; } 40 if(element_length==0) { if(VERBOSE) cout<<"<H_Dipole> WARNING : 0-length "<< name << " !" << endl; } 40 if(el.element_length<0) { if(VERBOSE) os <<"<H_Dipole> ERROR : Interpenetration of elements !"<<endl; } 41 if(el.element_length==0) { if(VERBOSE) os <<"<H_Dipole> WARNING : 0-length "<< el.name << " !" << endl; } 42 return os; 41 43 } -
trunk/Utilities/Hector/src/H_Drift.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_Drift.cc … … 26 33 } 27 34 28 void H_Drift::printProperties() const { 29 cout << typestring << name; 30 cout << "\t\t at s = " << fs; 31 cout << "\t length = " << element_length; 32 cout<<endl; 33 if(element_aperture->getType()!=NONE) { 34 cout <<"\t aperture type = " << element_aperture->getTypeString(); 35 element_aperture->printProperties(); 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; 36 39 } 37 if(element_length<0) { if(VERBOSE) cout<<"<H_Drift> ERROR : Interpenetration of elements !"<<endl; } 38 if(element_length==0) { if(VERBOSE) cout<<"<H_Drift> WARNING : 0-length "<< name << " !" << endl; } 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; 39 43 } 40 44 -
trunk/Utilities/Hector/src/H_EllipticAperture.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_EllipticAperture.cc … … 25 32 using namespace std; 26 33 27 H_EllipticAperture::H_EllipticAperture(const float l, const float h, const float posx, const float posy) :H_Aperture(ELLIPTIC,l,h,0,0,posx,posy) { 34 H_EllipticAperture::H_EllipticAperture(const int type, const float l, const float h, const float posx, const float posy) : 35 H_Aperture(type,l,h,0,0,posx,posy) { 36 /// @param type is the aperture type (ELLIPTIC or CIRCULAR) 37 /// @param l, h are the length and height of the elliptic shape 38 /// @param posx, posy are the (x,y) coordinates of the center of the ellipse 39 40 if (type!= ELLIPTIC && type != CIRCULAR) { 41 cout << "Warning: trying to define an EllipticalAperture which is neither elliptical nor circular." << endl; 42 cout << "'Elliptical' type forced\n"; 43 type_ = ELLIPTIC; 44 aptypestring = getApertureString(); 45 } 46 } 47 48 H_EllipticAperture::H_EllipticAperture(const float l, const float h, const float posx, const float posy) : 49 H_Aperture(ELLIPTIC,l,h,0,0,posx,posy) { 28 50 /// @param l, h are the length and height of the elliptic shape 29 51 /// @param posx, posy are the (x,y) coordinates of the center of the ellipse … … 48 70 } 49 71 50 void H_EllipticAperture::printProperties() const{51 cout<< "Aperture shape:" << getTypeString() << ", ellipse axes : "<<x1<<", "<<x2<<endl;52 cout << " \t Center : " << fx << "," <<fy << endl;53 return ;72 std::ostream& operator<< (std::ostream& os, const H_EllipticAperture& ap) { 73 os<< "Aperture shape:" << ap.aptypestring << ", ellipse axes : "<< ap.x1 <<", " << ap.x2 << endl; 74 os << " \t Center : " << ap.fx << "," << ap.fy << endl; 75 return os; 54 76 } -
trunk/Utilities/Hector/src/H_HorizontalKicker.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_HorizontalKicker.cc -
trunk/Utilities/Hector/src/H_HorizontalQuadrupole.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_HorizontalQuadrupole.cc -
trunk/Utilities/Hector/src/H_Kicker.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_Kicker.cc … … 27 34 } 28 35 29 void H_Kicker::printProperties() const { 30 cout << typestring; 31 cout << name; 32 cout<<"\t at s = "<< fs; 33 cout<<"\t length = "<< element_length; 34 cout<<"\t k0 = "<<fk; 35 cout<<endl; 36 if(element_aperture->getType()!=NONE) { 37 cout <<"\t aperture type = " << element_aperture->getTypeString(); 38 element_aperture->printProperties(); 36 std::ostream& operator<< (std::ostream& os, const H_Kicker& el) { 37 os << el.typestring << el.name <<"\t at s = "<< el.fs <<"\t length = "<< el.element_length; 38 os<<"\t k0 = "<< el.fk <<endl; 39 if(el.element_aperture->getType()!=NONE) { 40 os << *(el.element_aperture) << endl; 39 41 } 40 42 41 if(element_length<0) { if(VERBOSE) cout<<"<H_Kicker> ERROR : Interpenetration of elements !"<<endl; } 42 if(element_length==0) { if(VERBOSE) cout<<"<H_Kicker> WARNING : 0-length "<< name << " !" << endl; } 43 if(el.element_length<0 && VERBOSE) os<<"<H_Kicker> ERROR : Interpenetration of elements !"<<endl; 44 else if(el.element_length==0 && VERBOSE) os<<"<H_Kicker> WARNING : 0-length "<< el.name << " !" << endl; 45 return os; 43 46 } -
trunk/Utilities/Hector/src/H_Marker.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_Marker.cc … … 24 31 } 25 32 26 void H_Marker::printProperties() const { 27 cout << typestring << name; 28 cout << "\t\t at s = " << fs << endl; 29 if(element_aperture->getType()!=NONE) { 30 cout <<"\t aperture type = " << element_aperture->getTypeString(); 31 element_aperture->printProperties(); 33 std::ostream& operator<< (std::ostream& os, const H_Marker& el) { 34 os << el.typestring << el.name << "\t\t at s = " << el.fs; 35 if(el.element_aperture->getType()!=NONE) { 36 os << *(el.element_aperture) << endl; 32 37 } 38 return os; 33 39 } 34 40 -
trunk/Utilities/Hector/src/H_OpticalElement.cc
r239 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_OpticalElement.cc … … 135 142 */ 136 143 137 138 139 void H_OpticalElement::printProperties() const { 140 cout << typestring; 141 cout << name; 142 cout <<"\t at s = " << fs; 143 cout <<"\t length = "<< element_length; 144 if(fk!=0) cout <<"\t strength = " << fk; 145 if(element_aperture->getType()!=NONE) { 146 cout <<"\t aperture type = " << element_aperture->getTypeString(); 147 element_aperture->printProperties(); 148 } 149 150 cout<<endl; 151 if(element_length<0) { if(VERBOSE) cout<<"<H_OpticalElement> ERROR : Interpenetration of elements !"<<endl; } 152 if(element_length==0) { if(VERBOSE) cout<<"<H_OpticalElement> WARNING : 0-length "<< typestring << " !" << endl; } 153 154 return; 144 std::ostream& operator<< (std::ostream& os, const H_OpticalElement& el) { 145 os << el.typestring << el.name << "\t at s = " << el.fs << "\t length = "<< el.element_length; 146 if(el.fk!=0) os <<"\t strength = " << el.fk; 147 if(el.element_aperture->getType()!=NONE) { 148 os << *(el.element_aperture) << endl; 149 } 150 os<<endl; 151 if(el.element_length<0 && VERBOSE) 152 os <<"<H_OpticalElement> ERROR : Interpenetration of elements !"<<endl; 153 else if(el.element_length==0 && VERBOSE) 154 os <<"<H_OpticalElement> WARNING : 0-length "<< el.typestring << " !" << endl; 155 return os; 155 156 } 156 157 … … 189 190 } 190 191 191 TVectorD H_OpticalElement::getHitPosition( TVectorD init_pos, double energy_loss, double mp,double qp) {192 TVectorD H_OpticalElement::getHitPosition(const TVectorD& init_pos, const double energy_loss, const double mp, const double qp) { 192 193 if(!element_length) { 193 194 // cout<<"O-length element ("<<getName()<<"), should not appear here !"<<endl; … … 196 197 // some declarations 197 198 bool inside = false; 198 double vec[MDIM] = {init_pos[INDEX_X]/URAD,tan(init_pos[INDEX_TX]/URAD),init_pos[INDEX_Y]/URAD,tan(init_pos[INDEX_TY]/URAD),-energy_loss,1}; 199 double vec[MDIM] = {init_pos[INDEX_X]/URAD, tan(init_pos[INDEX_TX]/URAD), 200 init_pos[INDEX_Y]/URAD, tan(init_pos[INDEX_TY]/URAD), 201 -energy_loss, 1}; 199 202 TMatrixD mat_init(1,MDIM,vec); 200 203 TMatrixD mat_min(1,MDIM,vec); … … 253 256 mat_min[0][1] = mat_min[0][1] + tan(temp_el->getTX()); 254 257 mat_min[0][2] = mat_min[0][2] + temp_el->getY(); 255 258 mat_min[0][3] = mat_min[0][3] + tan(temp_el->getTY()); 256 259 mat_min[0][4] = min_pos + init_pos[4]; 257 260 // getting vector at max_pos (for second boundary) : 258 261 temp_el->setLength(max_pos); 259 262 mat_max[0][0] = mat_init[0][0] - temp_el->getX(); 260 261 262 263 264 265 266 267 263 mat_max[0][1] = mat_init[0][1] - tan(temp_el->getTX()); 264 mat_max[0][2] = mat_init[0][2] - temp_el->getY(); 265 mat_max[0][3] = mat_init[0][3] - tan(temp_el->getTY()); 266 mat_max *= temp_el->getMatrix(energy_loss,mp,qp); 267 mat_max[0][0] = mat_max[0][0] + temp_el->getX(); 268 mat_max[0][1] = mat_max[0][1] + tan(temp_el->getTX()); 269 mat_max[0][2] = mat_max[0][2] + temp_el->getY(); 270 mat_max[0][3] = mat_max[0][3] + tan(temp_el->getTY()); 268 271 mat_max[0][4] = max_pos + init_pos[4]; 269 272 } 270 273 // getting vector in the middle (for estimate) : 271 274 temp_el->setLength((max_pos+min_pos)/2.); 272 273 274 275 276 277 278 279 280 275 mat_stop[0][0] = mat_init[0][0] - temp_el->getX(); 276 mat_stop[0][1] = mat_init[0][1] - tan(temp_el->getTX()); 277 mat_stop[0][2] = mat_init[0][2] - temp_el->getY(); 278 mat_stop[0][3] = mat_init[0][3] - tan(temp_el->getTY()); 279 mat_stop *= temp_el->getMatrix(energy_loss,mp,qp); 280 mat_stop[0][0] = mat_stop[0][0] + temp_el->getX(); 281 mat_stop[0][1] = mat_stop[0][1] + tan(temp_el->getTX()); 282 mat_stop[0][2] = mat_stop[0][2] + temp_el->getY(); 283 mat_stop[0][3] = mat_stop[0][3] + tan(temp_el->getTY()); 281 284 mat_stop[0][4] = (max_pos+min_pos)/2. + init_pos[4]; 282 285 283 284 285 286 287 288 289 286 double xys[LENGTH_VEC]; 287 xys[INDEX_X]= mat_stop[0][0]*URAD; 288 xys[INDEX_TX]= atan(mat_stop[0][1])*URAD; 289 xys[INDEX_Y]= mat_stop[0][2]*URAD; 290 xys[INDEX_TY]= atan(mat_stop[0][3])*URAD; 291 xys[INDEX_S]= mat_stop[0][4] ; 292 TVectorD temp_vec(LENGTH_VEC,xys); 290 293 291 294 if(precision_estimate) { … … 297 300 cout<<" - "<<fabs(((mat_min[0][0]<mat_max[0][0])?(mat_stop[0][0]-mat_min[0][0])*URAD:(mat_stop[0][0]-mat_max[0][0])*URAD))<<" µm"<<endl; 298 301 cout<<"\t hit point y : "<<mat_stop[0][2]*URAD; 299 300 301 302 303 302 cout<<" + "<<fabs(((mat_min[0][0]<mat_max[0][2])?(mat_max[0][2]-mat_stop[0][2])*URAD:(mat_min[0][2]-mat_stop[0][2])*URAD)); 303 cout<<" - "<<fabs(((mat_min[0][0]<mat_max[0][2])?(mat_stop[0][2]-mat_min[0][2])*URAD:(mat_stop[0][2]-mat_max[0][2])*URAD))<<" µm"<<endl; 304 cout<<"\t hit point tx : "<<mat_stop[0][1]*URAD; 305 cout<<" + "<<fabs(((mat_min[0][0]<mat_max[0][1])?(mat_max[0][1]-mat_stop[0][1])*URAD:(mat_min[0][1]-mat_stop[0][1])*URAD)); 306 cout<<" - "<<fabs(((mat_min[0][0]<mat_max[0][1])?(mat_stop[0][1]-mat_min[0][1])*URAD:(mat_stop[0][1]-mat_max[0][1])*URAD))<<" µrad"<<endl; 304 307 cout<<"\t hit point ty : "<<mat_stop[0][3]*URAD; 305 306 308 cout<<" + "<<fabs(((mat_min[0][0]<mat_max[0][3])?(mat_max[0][3]-mat_stop[0][3])*URAD:(mat_min[0][3]-mat_stop[0][3])*URAD)); 309 cout<<" - "<<fabs(((mat_min[0][0]<mat_max[0][3])?(mat_stop[0][3]-mat_min[0][3])*URAD:(mat_stop[0][3]-mat_max[0][3])*URAD))<<" µrad"<<endl; 307 310 308 311 } -
trunk/Utilities/Hector/src/H_Parameters.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 ///\file H_Parameters.cc -
trunk/Utilities/Hector/src/H_Quadrupole.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_Quadrupole.cc … … 24 31 } 25 32 26 void H_Quadrupole::printProperties() const{ 27 cout << typestring; 28 cout << name; 29 cout << "\t at s = " << fs; 30 cout << "\t length = " << element_length; 31 cout << "\t k1 = " << fk; 32 cout<<endl; 33 if(element_aperture->getType()!=NONE) { 34 cout <<"\t aperture type = " << element_aperture->getTypeString(); 35 element_aperture->printProperties(); 33 std::ostream& operator<< (std::ostream& os, const H_Quadrupole& el) { 34 os << el.typestring << el.name << "\t at s = " << el.fs << "\t length = " << el.element_length << "\t k1 = " << el.fk <<endl; 35 if(el.element_aperture->getType()!=NONE) { 36 os << *(el.element_aperture) << endl; 36 37 } 37 38 38 if(element_length<0) { if(VERBOSE) cout<<"<H_Quadrupole> ERROR : Interpenetration of elements !"<<endl; } 39 if(element_length==0) { if(VERBOSE) cout<<"<H_Quadrupole> WARNING : 0-length "<< typestring << " !" << endl; } 39 if(el.element_length<0 && VERBOSE) os<<"<H_Quadrupole> ERROR : Interpenetration of elements !"<<endl; 40 else if(el.element_length==0 && VERBOSE) os<<"<H_Quadrupole> WARNING : 0-length "<< el.typestring << " !" << endl; 41 return os; 40 42 } -
trunk/Utilities/Hector/src/H_RecRPObject.cc
r3 r281 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 */ 11 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 12 18 13 19 /// \file H_RecRPObject.cc … … 41 47 l_1(new TF1("l_1","[0] + [1]*x + [2]*x*x ",emin,emax)), 42 48 l_2(new TF1("l_2","[0] + [1]*x + [2]*x*x ",emin,emax)) 43 { 44 // emax = -1; /* GeV */ 45 } 46 47 H_RecRPObject::H_RecRPObject(float ss1, float ss2, H_AbstractBeamLine* beam) : emin(0), emax(-1), x1(0), x2(0), y1(0), y2(0), s1(ss1), s2(ss2), 49 {} 50 51 H_RecRPObject::H_RecRPObject(const float ss1, const float ss2, const H_AbstractBeamLine* beam) : emin(0), emax(-1), x1(0), x2(0), y1(0), y2(0), s1(ss1), s2(ss2), 48 52 txip(NOT_YET_COMPUTED), tyip(NOT_YET_COMPUTED), energy(NOT_YET_COMPUTED), q2(NOT_YET_COMPUTED), pt(NOT_YET_COMPUTED), 49 thebeam(beam ),53 thebeam(beam->clone()), 50 54 f_1(new TF1("f_1","[0] + [1]*x + [2]*x*x ",emin,emax)), 51 55 f_2(new TF1("f_2","[0] + [1]*x + [2]*x*x ",emin,emax)), … … 58 62 l_1(new TF1("l_1","[0] + [1]*x + [2]*x*x ",emin,emax)), 59 63 l_2(new TF1("l_2","[0] + [1]*x + [2]*x*x ",emin,emax)) 60 { 61 if(ss1==ss2) cout<<"<H_RecRPObject> WARNING : detectors are on same position"<<endl; 62 // emax = -1; /* GeV */ 64 {if(ss1==ss2) cout<<"<H_RecRPObject> WARNING : detectors are on same position"<<endl; 65 } 66 67 H_RecRPObject::H_RecRPObject(const H_RecRPObject& r): 68 emin(r.emin), emax(r.emax), x1(r.x1), x2(r.x2), y1(r.y1), y2(r.y2), s1(r.s1), s2(r.s2), 69 txip(r.txip), tyip(r.tyip), energy(r.energy), q2(r.q2), pt(r.pt), 70 //thebeam(r.thebeam->clone()), 71 thebeam(new H_AbstractBeamLine(*(r.thebeam))), 72 f_1(new TF1(*(r.f_1))), f_2(new TF1(*(r.f_2))), g_1(new TF1(*(r.g_1))), g_2(new TF1(*(r.g_2))), 73 d_1(new TF1(*(r.d_1))), d_2(new TF1(*(r.d_2))), k_1(new TF1(*(r.k_1))), k_2(new TF1(*(r.k_2))), 74 l_1(new TF1(*(r.l_1))), l_2(new TF1(*(r.l_2))) 75 {} 76 77 H_RecRPObject& H_RecRPObject::operator=(const H_RecRPObject& r) { 78 if (this == &r) return *this; 79 emin = r.emin, emax = r.emax; 80 x1 = r.x1; x2 = r.x2; 81 y1 = r.y1; y2 = r.y2; 82 s1 = r.s1; s2 = r.s2; 83 txip= r.txip; tyip=r.tyip; 84 energy= r.energy; q2= r.q2; pt= r.pt; 85 //thebeam = r.thebeam->clone(); 86 thebeam = new H_AbstractBeamLine(*(r.thebeam)); 87 f_1 = new TF1(*(r.f_1)); 88 f_2 = new TF1(*(r.f_2)); 89 g_1 = new TF1(*(r.g_1)); 90 g_2 = new TF1(*(r.g_2)); 91 d_1 = new TF1(*(r.d_1)); 92 d_2 = new TF1(*(r.d_2)); 93 k_1 = new TF1(*(r.k_1)); 94 k_2 = new TF1(*(r.k_2)); 95 l_1 = new TF1(*(r.l_1)); 96 l_2 = new TF1(*(r.l_2)); 97 return *this; 63 98 } 64 99 … … 308 343 return pt; 309 344 } 345 346 std::ostream& operator<< (std::ostream& os, const H_RecRPObject& rp) { 347 os << "e_min=" << rp.emin << "\t e_max= " << rp.emax << endl; 348 os << "x1=" << rp.x1 << "\t x2= " << rp.x2 << "\t y1=" << rp.y1 << "\t y2=" << rp.y2 349 << "\t s1=" << rp.s1 << "\t s2=" << rp.s2 << endl; 350 os << "txip=" << rp.txip << "\t tyip=" << rp.tyip << "\t energy=" << rp.energy << "\t q2=" << rp.q2 << "\t pt=" << rp.pt << endl; 351 return os; 352 } -
trunk/Utilities/Hector/src/H_RectEllipticAperture.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_RectEllipticAperture.cc … … 29 36 /// @param l, h, L, H are the geometrical parameters of the rect-ellipse shape 30 37 /// @param posx, posy defines the (x,y) of the center of the shape 31 type= RECTELLIPSE;32 38 } 33 39 … … 127 133 } 128 134 129 void H_RectEllipticAperture::printProperties() const{130 cout << "Aperture shape:" << getTypeString() << ", parameters " <<x1<<", "<<x2<<", "<<x3<<", "<<x4<< endl;131 cout << " \t Center : "<<fx<<", "<<fy<<endl;132 return ;135 std::ostream& operator<< (std::ostream& os, const H_RectEllipticAperture& ap) { 136 os << "Aperture shape:" << ap.aptypestring << ", parameters " << ap.x1 <<", "<< ap.x2 <<", "<< ap.x3 <<", "<< ap.x4 << endl; 137 os << " \t Center : " << ap.fx <<", "<< ap.fy <<endl; 138 return os; 133 139 } -
trunk/Utilities/Hector/src/H_RectangularAperture.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_RectangularAperture.cc … … 48 55 return; 49 56 } 50 void H_RectangularAperture::printProperties() const { 51 cout << "Aperture shape:" << getTypeString() << ", rectangle Sides : "<<x1<<", "<<x2<<endl; 52 cout << " \t Center : " << fx << "," << fy << endl; 53 return; 57 58 std::ostream& operator<< (std::ostream& os, const H_RectangularAperture& ap) { 59 os << "Aperture shape:" << ap.aptypestring << ", rectangle sides : " << ap. x1 <<", " << ap.x2 <<endl; 60 os << " \t Center : " << ap.fx << "," << ap.fy << endl; 61 return os; 54 62 } 63 -
trunk/Utilities/Hector/src/H_RectangularCollimator.cc
r216 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_RectangularCollimator.cc … … 36 43 } 37 44 38 void H_RectangularCollimator::printProperties() const { 39 cout << typestring << name; 40 cout << "\t\t at s = " << fs; 41 cout << "\t length = " << element_length; 42 cout<<endl; 43 if(element_aperture->getType()!=NONE) { 44 cout <<"\t aperture type = " << element_aperture->getTypeString(); 45 element_aperture->printProperties(); 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; 46 49 } 47 50 48 if(element_length<0) { if(VERBOSE) cout<<"<H_RectangularCollimator> ERROR : Interpenetration of elements !"<<endl; } 49 if(element_length==0) { if(VERBOSE) cout<<"<H_RectangularCollimator> WARNING : 0-length "<< name << " !" << endl; } 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; 50 54 } 51 55 -
trunk/Utilities/Hector/src/H_RectangularDipole.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_RectangularDipole.cc -
trunk/Utilities/Hector/src/H_RomanPot.cc
r232 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_RomanPot.cc … … 39 46 } 40 47 41 void H_RomanPot::printProperties() const { 42 cout << typestring << name; 43 cout << "\t\t at s = " << fs; 44 if(element_aperture->getType()!=NONE) { 45 cout <<"\t aperture type = " << element_aperture->getTypeString(); 46 element_aperture->printProperties(); 47 } 48 49 cout<<endl; 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; 50 54 } 51 55 -
trunk/Utilities/Hector/src/H_SectorDipole.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_SectorDipole.cc -
trunk/Utilities/Hector/src/H_TransportMatrices.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_TransportMatrices.cc … … 29 36 30 37 extern double omega(const double k, const double l) { 31 // [l] = [m] and [k] = [1/m ï¿œ] for quadrupoles38 // [l] = [m] and [k] = [1/m^2] for quadrupoles 32 39 // [omega] = [1] 33 40 return sqrt(fabs(k))*l; … … 35 42 36 43 extern double radius(const double k) { 37 // [k] = [1/m ï¿œ] for quadrupoles44 // [k] = [1/m^2] for quadrupoles 38 45 // [k] = [1/m] for dipoles 39 46 // [radius(k)] = [m] -
trunk/Utilities/Hector/src/H_VerticalKicker.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_VerticalKicker.cc -
trunk/Utilities/Hector/src/H_VerticalQuadrupole.cc
r3 r281 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 */ 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 11 18 12 19 /// \file H_VerticalQuadrupole.cc
Note:
See TracChangeset
for help on using the changeset viewer.