Fork me on GitHub

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

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

new Hector version

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