Fork me on GitHub

source: svn/trunk/Utilities/Hector/src/H_RectangularCollimator.cc@ 12

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

first commit

File size: 2.0 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_RectangularCollimator.cc
13/// \brief R-Collimators for the LHC beamline.
14
15// local #includes
16#include "H_RectangularCollimator.h"
17#include "H_TransportMatrices.h"
18
19void H_RectangularCollimator::init() {
20 // must be in public section
21 setTypeString();
22 setMatrix(0,MP,QP);
23 return;
24}
25
26H_RectangularCollimator::H_RectangularCollimator(const double s, const double l) :H_Drift(s,l){
27 type = RCOLLIMATOR;
28 init();
29 return;
30}
31
32H_RectangularCollimator::H_RectangularCollimator(const string nameE, const double s, const double l) :H_Drift(nameE,s,l){
33 type = RCOLLIMATOR;
34 init();
35 return;
36}
37
38void 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();
46 }
47
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; }
50}
51
52void H_RectangularCollimator::setMatrix(const float eloss, const float p_mass, const float p_charge) {
53 element_mat = driftmat(element_length);
54 return ;
55}
56
57H_RectangularCollimator* H_RectangularCollimator::clone() const {
58 H_RectangularCollimator* temp_coll = new H_RectangularCollimator(name,fs,element_length);
59 temp_coll->setAperture(element_aperture);
60 temp_coll->setX(xpos);
61 temp_coll->setY(ypos);
62 temp_coll->setTX(txpos);
63 temp_coll->setTY(typos);
64 temp_coll->setBetaX(betax);
65 temp_coll->setBetaY(betay);
66 return temp_coll;
67}
68
Note: See TracBrowser for help on using the repository browser.