Fork me on GitHub

source: svn/trunk/Utilities/Hector/src/H_Aperture.cc@ 633

Last change on this file since 633 was 437, checked in by Xavier Rouby, 15 years ago

cleaning for avoiding some harmless compilation warning

File size: 3.8 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_Aperture.cc
20/// \brief Classes aiming at simulating the aperture of the LHC beamline elements.
21
22// C++ #includes
23#include <iostream>
24
25// local #includes
26#include "H_Aperture.h"
27using namespace std;
28
29H_Aperture::H_Aperture() :
30 type_(NONE), x1(0), x2(0), x3(0), x4(0), fx(0), fy(0), aptypestring(getApertureString()) {
31}
32
33H_Aperture::H_Aperture(const int dtype, const float size1, const float size2, const float size3, const float size4, const float posx, const float posy) :
34 type_(dtype), x1(size1), x2(size2), x3(size3), x4(size4), fx(posx), fy(posy), aptypestring(getApertureString()) {
35 /// @param dtype defines the aperture shape
36 /// @param size1, size2, size3, size4 are the geometrical sizes (length/width or great/small radii) in m
37 /// @param posx, posy are the (x,y) coordinates of the center of the aperture [m]
38}
39
40H_Aperture::H_Aperture(const H_Aperture& ap) :
41 type_(ap.type_), x1(ap.x1), x2(ap.x2), x3(ap.x3), x4(ap.x4), fx(ap.fx), fy(ap.fy), aptypestring(ap.aptypestring) {
42}
43
44H_Aperture& H_Aperture::operator=(const H_Aperture& ap) {
45 if(this==&ap) return *this;
46 type_ = ap.type_;
47 x1 = ap.x1;
48 x2 = ap.x2;
49 x3 = ap.x3;
50 x4 = ap.x4;
51 fx = ap.fx;
52 fy = ap.fy;
53 aptypestring = ap.aptypestring;
54 return *this;
55}
56
57std::ostream& operator<< (std::ostream& os, const H_Aperture& ap) {
58 os << "Aperture shape:" << ap.aptypestring << ", parameters "<<ap.x1<<", "<<ap.x2<<", "<<ap.x3<<", "<<ap.x4<<endl;
59 os << " \t Center : " << ap.fx << "," << ap.fy << endl;
60 return os;
61}
62
63void H_Aperture::printProperties() const {
64 cout << *this;
65 return;
66}
67
68void H_Aperture::setPosition(const float posx, const float posy) {
69 /// @param posx, posy are the (x,y) coordinates of the center of the apertures [m]
70 // posx, posy, fx, fy = [m]
71 fx = posx;
72 fy = posy;
73 return;
74}
75
76bool H_Aperture::isInside(const float , const float ) const {
77 /// @param x, y are the (x,y) coordinates of the proton, in [m]
78 //cout << "aperture::isInside" << endl;
79 return false;
80}
81
82
83/*void H_Aperture::setApertureString() {
84 switch (type_) {
85 case NONE: aptypestring = NONENAME; break;
86 case RECTANGULAR: aptypestring = RECTANGULARNAME; break;
87 case ELLIPTIC: aptypestring = ELLIPTICNAME; break;
88 case CIRCULAR: aptypestring = CIRCULARNAME; break;
89 case RECTELLIPSE: aptypestring = RECTELLIPSENAME; break;
90 default: aptypestring = NONENAME; break;
91 }
92}
93*/
94
95const string H_Aperture::getApertureString() const {
96 string str;
97 switch (type_) {
98 case NONE: str = NONENAME; break;
99 case RECTANGULAR: str = RECTANGULARNAME; break;
100 case ELLIPTIC: str = ELLIPTICNAME; break;
101 case CIRCULAR: str = CIRCULARNAME; break;
102 case RECTELLIPSE: str = RECTELLIPSENAME; break;
103 default: str = NONENAME; break;
104 }
105 return str;
106}
107
Note: See TracBrowser for help on using the repository browser.