[3c40083] | 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 | */
|
---|
[5b822e5] | 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 |
|
---|
| 19 | void H_RectangularCollimator::init() {
|
---|
| 20 | // must be in public section
|
---|
| 21 | setTypeString();
|
---|
| 22 | setMatrix(0,MP,QP);
|
---|
| 23 | return;
|
---|
| 24 | }
|
---|
| 25 |
|
---|
[3c40083] | 26 | H_RectangularCollimator::H_RectangularCollimator(const double s, const double l) :H_OpticalElement(RCOLLIMATOR,s,0.,l){
|
---|
| 27 | init();
|
---|
[5b822e5] | 28 | return;
|
---|
| 29 | }
|
---|
| 30 |
|
---|
[3c40083] | 31 | H_RectangularCollimator::H_RectangularCollimator(const string nameE, const double s, const double l) :H_OpticalElement(nameE,RCOLLIMATOR,s,0.,l){
|
---|
| 32 | init();
|
---|
[5b822e5] | 33 | return;
|
---|
| 34 | }
|
---|
| 35 |
|
---|
[3c40083] | 36 | void H_RectangularCollimator::printProperties() const {
|
---|
| 37 | cout << typestring << name;
|
---|
| 38 | cout << "\t\t at s = " << fs;
|
---|
| 39 | cout << "\t length = " << element_length;
|
---|
| 40 | cout<<endl;
|
---|
| 41 | if(element_aperture->getType()!=NONE) {
|
---|
| 42 | cout <<"\t aperture type = " << element_aperture->getTypeString();
|
---|
| 43 | element_aperture->printProperties();
|
---|
[5b822e5] | 44 | }
|
---|
| 45 |
|
---|
[3c40083] | 46 | if(element_length<0) { if(VERBOSE) cout<<"\t ERROR : Interpenetration of elements !"<<endl; }
|
---|
| 47 | if(element_length==0) { if(VERBOSE) cout<<"\t WARNING : 0-length "<< name << " !" << endl; }
|
---|
[5b822e5] | 48 | }
|
---|
| 49 |
|
---|
[3c40083] | 50 | void H_RectangularCollimator::setMatrix(const float eloss, const float p_mass, const float p_charge) const {
|
---|
| 51 | // cout<<"\t WARNING : H_RectangularCollimator matrices not yet implemented ! " << endl;
|
---|
| 52 | *element_mat = driftmat(element_length);
|
---|
[5b822e5] | 53 | return ;
|
---|
| 54 | }
|
---|