Fork me on GitHub

source: svn/trunk/Utilities/Hector/src/H_RomanPot.cc@ 437

Last change on this file since 437 was 281, checked in by Xavier Rouby, 15 years ago

new Hector version

File size: 2.4 KB
Line 
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 * * * * * * * * * * * * * * * * * * * * * * * * * * * */
18
19/// \file H_RomanPot.cc
20/// \brief Roman pot class
21
22// local #includes
23#include "H_RomanPot.h"
24#include "H_RectangularAperture.h"
25#include "H_TransportMatrices.h"
26
27void H_RomanPot::init() {
28 // must be in public section
29 setTypeString();
30 setMatrix(0,MP,QP);
31 return;
32}
33
34H_RomanPot::H_RomanPot(const double s, const double app) :H_Drift(s,RP_LENGTH){
35 type = RP;
36 init();
37 if(element_aperture) delete element_aperture;
38 element_aperture = new H_RectangularAperture(app,RP_HEIGHT,0,0);
39}
40
41H_RomanPot::H_RomanPot(const string& nameE, const double s, const double app) :H_Drift(nameE,s,RP_LENGTH){
42 type = RP;
43 init();
44 if(element_aperture) delete element_aperture;
45 element_aperture = new H_RectangularAperture(app,RP_HEIGHT,0,0);
46}
47
48std::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;
54}
55
56void H_RomanPot::setMatrix(const float eloss, const float p_mass, const float p_charge) {
57 element_mat = driftmat(0);
58 return ;
59}
60
61H_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 TracBrowser for help on using the repository browser.