Fork me on GitHub

source: svn/trunk/Utilities/Hector/src/H_Drift.cc@ 168

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

first commit

File size: 1.5 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_Drift.cc
13/// \brief Class aiming at simulating LHC beam drift.
14
15// local includes
16#include "H_Drift.h"
17#include "H_TransportMatrices.h"
18
19
20void H_Drift::init() {
21 // must be in public section
22 element_mat.ResizeTo(MDIM,MDIM);
23 setTypeString();
24 setMatrix(0,MP,QP);
25 return;
26}
27
28void 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();
36 }
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; }
39}
40
41void H_Drift::setMatrix(const float eloss, const float p_mass, const float p_charge) {
42 element_mat = driftmat(element_length);
43 return ;
44}
45
46H_Drift* H_Drift::clone() const {
47 H_Drift* temp_drift = new H_Drift(name,fs,element_length);
48 temp_drift->setX(xpos);
49 temp_drift->setY(ypos);
50 temp_drift->setTX(txpos);
51 temp_drift->setTY(typos);
52 temp_drift->setBetaX(betax);
53 temp_drift->setBetaY(betay);
54 return temp_drift;
55}
56
Note: See TracBrowser for help on using the repository browser.