Fork me on GitHub

source: svn/trunk/Utilities/Hector/src/H_VerticalQuadrupole.cc@ 239

Last change on this file since 239 was 3, checked in by Xavier Rouby, 16 years ago

first commit

File size: 1.3 KB
Line 
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
12/// \file H_VerticalQuadrupole.cc
13/// \brief Vertically focussing quadrupoles
14
15// local #includes
16#include "H_VerticalQuadrupole.h"
17
18void H_VerticalQuadrupole::setMatrix(const float eloss, const float p_mass, const float p_charge) {
19 if (fk<0) { if(VERBOSE) cout<<"<H_VerticalQuadrupole> ERROR : k1 should be > 0 for H_VerticalQuadrupole (" << name << ")!"<<endl; }
20 if (fk !=0 ) element_mat = vquadmat(element_length,fk,eloss, p_mass,p_charge);
21 else {
22 element_mat = driftmat(element_length);
23 if(VERBOSE) cout<<"<H_VerticalQuadrupole> WARNING : k1= 0, drift-like quadrupole (" << name << ") !" << endl;
24 }
25 return ;
26}
27
28H_VerticalQuadrupole* H_VerticalQuadrupole::clone() const {
29 H_VerticalQuadrupole* temp_quad = new H_VerticalQuadrupole(name,fs,fk,element_length);
30 temp_quad->setAperture(element_aperture);
31 temp_quad->setX(xpos);
32 temp_quad->setY(ypos);
33 temp_quad->setTX(txpos);
34 temp_quad->setTY(typos);
35 temp_quad->setBetaX(betax);
36 temp_quad->setBetaY(betay);
37 return temp_quad;
38}
Note: See TracBrowser for help on using the repository browser.