ATLAS Offline Software
Loading...
Searching...
No Matches
ForwardRegionProperties.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7ForwardRegionProperties::ForwardRegionProperties( const std::string& type, const std::string& name, const IInterface* parent )
8: base_class( type, name, parent )
9{
10 m_Config.clear();
11 declareProperty("twissFileB1",m_Config.twissFileB1="");
12 declareProperty("twissFileB2",m_Config.twissFileB2="");
13 declareProperty("momentum",m_Config.momentum = 0);
14
15 declareProperty("pointQ1Start", m_Config.pointQ1Start);
16 declareProperty("pointQ2aStart", m_Config.pointQ2aStart);
17 declareProperty("pointQ2bStart", m_Config.pointQ2bStart);
18 declareProperty("pointQ3Start", m_Config.pointQ3Start);
19 declareProperty("pointQ4Start", m_Config.pointQ4Start);
20 declareProperty("pointQ5Start", m_Config.pointQ5Start);
21 declareProperty("pointQ6Start", m_Config.pointQ6Start);
22 declareProperty("pointQ7aStart", m_Config.pointQ7aStart);
23 declareProperty("pointQ7bStart", m_Config.pointQ7bStart);
24 declareProperty("pointD1aStart", m_Config.pointD1aStart);
25 declareProperty("pointD1bStart", m_Config.pointD1bStart);
26 declareProperty("pointD1cStart", m_Config.pointD1cStart);
27 declareProperty("pointD1dStart", m_Config.pointD1dStart);
28 declareProperty("pointD1eStart", m_Config.pointD1eStart);
29 declareProperty("pointD1fStart", m_Config.pointD1fStart);
30 declareProperty("pointD2Start", m_Config.pointD2Start);
31
32 declareProperty("pointQ1End", m_Config.pointQ1End);
33 declareProperty("pointQ2aEnd", m_Config.pointQ2aEnd);
34 declareProperty("pointQ2bEnd", m_Config.pointQ2bEnd);
35 declareProperty("pointQ3End", m_Config.pointQ3End);
36 declareProperty("pointQ4End", m_Config.pointQ4End);
37 declareProperty("pointQ5End", m_Config.pointQ5End);
38 declareProperty("pointQ6End", m_Config.pointQ6End);
39 declareProperty("pointQ7aEnd", m_Config.pointQ7aEnd);
40 declareProperty("pointQ7bEnd", m_Config.pointQ7bEnd);
41 declareProperty("pointD1aEnd", m_Config.pointD1aEnd);
42 declareProperty("pointD1bEnd", m_Config.pointD1bEnd);
43 declareProperty("pointD1cEnd", m_Config.pointD1cEnd);
44 declareProperty("pointD1dEnd", m_Config.pointD1dEnd);
45 declareProperty("pointD1eEnd", m_Config.pointD1eEnd);
46 declareProperty("pointD1fEnd", m_Config.pointD1fEnd);
47 declareProperty("pointD2End", m_Config.pointD2End);
48
49 declareProperty("fQ1RotZ", m_Config.fQ1RotZ);
50 declareProperty("fQ2aRotZ", m_Config.fQ2aRotZ);
51 declareProperty("fQ2bRotZ", m_Config.fQ2bRotZ);
52 declareProperty("fQ3RotZ", m_Config.fQ3RotZ);
53 declareProperty("fQ4RotZ", m_Config.fQ4RotZ);
54 declareProperty("fQ5RotZ", m_Config.fQ5RotZ);
55 declareProperty("fQ6RotZ", m_Config.fQ6RotZ);
56 declareProperty("fQ7aRotZ", m_Config.fQ7aRotZ);
57 declareProperty("fQ7bRotZ", m_Config.fQ7bRotZ);
58 declareProperty("fD1aRotZ", m_Config.fD1aRotZ);
59 declareProperty("fD1bRotZ", m_Config.fD1bRotZ);
60 declareProperty("fD1cRotZ", m_Config.fD1cRotZ);
61 declareProperty("fD1dRotZ", m_Config.fD1dRotZ);
62 declareProperty("fD1eRotZ", m_Config.fD1eRotZ);
63 declareProperty("fD1fRotZ", m_Config.fD1fRotZ);
64 declareProperty("fD2RotZ", m_Config.fD2RotZ);
65
66 declareProperty("bUseFLUKAMapsForInnerTriplet", m_Config.bUseFLUKAMapsForInnerTriplet=false);
67
68
69 ATH_MSG_INFO("ForwardRegionProperties created");
70}
71
73
77
78void ForwardRegionProperties::getMagTransforms(const std::string& name, int beam, HepGeom::Point3D<double> & pointMagStart, HepGeom::Point3D<double> & pointMagEnd, double & rotAxis, bool twiss)
79{
80 if(name.find("MagQ1") != std::string::npos || (twiss && name.find("MQXA.1") != std::string::npos))
81 {
82 pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ1Start[(beam-1)*3],m_Config.pointQ1Start[(beam-1)*3+1],m_Config.pointQ1Start[(beam-1)*3+2]);
83 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ1End[(beam-1)*3],m_Config.pointQ1End[(beam-1)*3+1],m_Config.pointQ1End[(beam-1)*3+2]);
84 rotAxis = m_Config.fQ1RotZ[beam-1];
85 }
86 else if(name.find("MagQ2a") != std::string::npos || (twiss && name.find("MQXB.A2") != std::string::npos))
87 {
88 pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ2aStart[(beam-1)*3],m_Config.pointQ2aStart[(beam-1)*3+1],m_Config.pointQ2aStart[(beam-1)*3+2]);
89 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ2aEnd[(beam-1)*3],m_Config.pointQ2aEnd[(beam-1)*3+1],m_Config.pointQ2aEnd[(beam-1)*3+2]);
90 rotAxis = m_Config.fQ2aRotZ[beam-1];
91 }
92 else if(name.find("MagQ2b") != std::string::npos || (twiss && name.find("MQXB.B2") != std::string::npos))
93 {
94 pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ2bStart[(beam-1)*3],m_Config.pointQ2bStart[(beam-1)*3+1],m_Config.pointQ2bStart[(beam-1)*3+2]);
95 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ2bEnd[(beam-1)*3],m_Config.pointQ2bEnd[(beam-1)*3+1],m_Config.pointQ2bEnd[(beam-1)*3+2]);
96 rotAxis = m_Config.fQ2bRotZ[beam-1];
97 }
98 else if(name.find("MagQ3") != std::string::npos || (twiss && name.find("MQXA.3") != std::string::npos))
99 {
100 pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ3Start[(beam-1)*3],m_Config.pointQ3Start[(beam-1)*3+1],m_Config.pointQ3Start[(beam-1)*3+2]);
101 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ3End[(beam-1)*3],m_Config.pointQ3End[(beam-1)*3+1],m_Config.pointQ3End[(beam-1)*3+2]);
102 rotAxis = m_Config.fQ3RotZ[beam-1];
103 }
104 else if(name.find("MagD1a") != std::string::npos || (twiss && name.find("MBXW.A4") != std::string::npos))
105 {
106 pointMagStart = HepGeom::Point3D<double>(m_Config.pointD1aStart[(beam-1)*3],m_Config.pointD1aStart[(beam-1)*3+1],m_Config.pointD1aStart[(beam-1)*3+2]);
107 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointD1aEnd[(beam-1)*3],m_Config.pointD1aEnd[(beam-1)*3+1],m_Config.pointD1aEnd[(beam-1)*3+2]);
108 rotAxis = m_Config.fD1aRotZ[beam-1];
109 }
110 else if(name.find("MagD1b") != std::string::npos || (twiss && name.find("MBXW.B4") != std::string::npos))
111 {
112 pointMagStart = HepGeom::Point3D<double>(m_Config.pointD1bStart[(beam-1)*3],m_Config.pointD1bStart[(beam-1)*3+1],m_Config.pointD1bStart[(beam-1)*3+2]);
113 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointD1bEnd[(beam-1)*3],m_Config.pointD1bEnd[(beam-1)*3+1],m_Config.pointD1bEnd[(beam-1)*3+2]);
114 rotAxis = m_Config.fD1bRotZ[beam-1];
115 }
116 else if(name.find("MagD1c") != std::string::npos || (twiss && name.find("MBXW.C4") != std::string::npos))
117 {
118 pointMagStart = HepGeom::Point3D<double>(m_Config.pointD1cStart[(beam-1)*3],m_Config.pointD1cStart[(beam-1)*3+1],m_Config.pointD1cStart[(beam-1)*3+2]);
119 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointD1cEnd[(beam-1)*3],m_Config.pointD1cEnd[(beam-1)*3+1],m_Config.pointD1cEnd[(beam-1)*3+2]);
120 rotAxis = m_Config.fD1cRotZ[beam-1];
121 }
122 else if(name.find("MagD1d") != std::string::npos || (twiss && name.find("MBXW.D4") != std::string::npos))
123 {
124 pointMagStart = HepGeom::Point3D<double>(m_Config.pointD1dStart[(beam-1)*3],m_Config.pointD1dStart[(beam-1)*3+1],m_Config.pointD1dStart[(beam-1)*3+2]);
125 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointD1dEnd[(beam-1)*3],m_Config.pointD1dEnd[(beam-1)*3+1],m_Config.pointD1dEnd[(beam-1)*3+2]);
126 rotAxis = m_Config.fD1dRotZ[beam-1];
127 }
128 else if(name.find("MagD1e") != std::string::npos || (twiss && name.find("MBXW.E4") != std::string::npos))
129 {
130 pointMagStart = HepGeom::Point3D<double>(m_Config.pointD1eStart[(beam-1)*3],m_Config.pointD1eStart[(beam-1)*3+1],m_Config.pointD1eStart[(beam-1)*3+2]);
131 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointD1eEnd[(beam-1)*3],m_Config.pointD1eEnd[(beam-1)*3+1],m_Config.pointD1eEnd[(beam-1)*3+2]);
132 rotAxis = m_Config.fD1eRotZ[beam-1];
133 }
134 else if(name.find("MagD1f") != std::string::npos || (twiss && name.find("MBXW.F4") != std::string::npos))
135 {
136 pointMagStart = HepGeom::Point3D<double>(m_Config.pointD1fStart[(beam-1)*3],m_Config.pointD1fStart[(beam-1)*3+1],m_Config.pointD1fStart[(beam-1)*3+2]);
137 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointD1fEnd[(beam-1)*3],m_Config.pointD1fEnd[(beam-1)*3+1],m_Config.pointD1fEnd[(beam-1)*3+2]);
138 rotAxis = m_Config.fD1fRotZ[beam-1];
139 }
140 else if(name.find("MagD2") != std::string::npos || (twiss && name.find("MBRC.4") != std::string::npos))
141 {
142 pointMagStart = HepGeom::Point3D<double>(m_Config.pointD2Start[(beam-1)*3],m_Config.pointD2Start[(beam-1)*3+1],m_Config.pointD2Start[(beam-1)*3+2]);
143 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointD2End[(beam-1)*3],m_Config.pointD2End[(beam-1)*3+1],m_Config.pointD2End[(beam-1)*3+2]);
144 rotAxis = m_Config.fD2RotZ[beam-1];
145 }
146 else if(name.find("MagQ4") != std::string::npos || (twiss && name.find("MQY.4") != std::string::npos))
147 {
148 pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ4Start[(beam-1)*3],m_Config.pointQ4Start[(beam-1)*3+1],m_Config.pointQ4Start[(beam-1)*3+2]);
149 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ4End[(beam-1)*3],m_Config.pointQ4End[(beam-1)*3+1],m_Config.pointQ4End[(beam-1)*3+2]);
150 rotAxis = m_Config.fQ4RotZ[beam-1];
151 }
152 else if(name.find("MagQ5") != std::string::npos || (twiss && name.find("MQML.5") != std::string::npos))
153 {
154 pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ5Start[(beam-1)*3],m_Config.pointQ5Start[(beam-1)*3+1],m_Config.pointQ5Start[(beam-1)*3+2]);
155 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ5End[(beam-1)*3],m_Config.pointQ5End[(beam-1)*3+1],m_Config.pointQ5End[(beam-1)*3+2]);
156 rotAxis = m_Config.fQ5RotZ[beam-1];
157 }
158 else if(name.find("MagQ6") != std::string::npos || (twiss && name.find("MQML.6") != std::string::npos))
159 {
160 pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ6Start[(beam-1)*3],m_Config.pointQ6Start[(beam-1)*3+1],m_Config.pointQ6Start[(beam-1)*3+2]);
161 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ6End[(beam-1)*3],m_Config.pointQ6End[(beam-1)*3+1],m_Config.pointQ6End[(beam-1)*3+2]);
162 rotAxis = m_Config.fQ6RotZ[beam-1];
163 }
164 else if(name.find("MagQ7a") != std::string::npos || (twiss && name.find("MQM.A7") != std::string::npos))
165 {
166 pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ7aStart[(beam-1)*3],m_Config.pointQ7aStart[(beam-1)*3+1],m_Config.pointQ7aStart[(beam-1)*3+2]);
167 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ7aEnd[(beam-1)*3],m_Config.pointQ7aEnd[(beam-1)*3+1],m_Config.pointQ7aEnd[(beam-1)*3+2]);
168 rotAxis = m_Config.fQ7aRotZ[beam-1];
169 }
170 else if(name.find("MagQ7b") != std::string::npos || (twiss && name.find("MQM.B7") != std::string::npos))
171 {
172 pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ7bStart[(beam-1)*3],m_Config.pointQ7bStart[(beam-1)*3+1],m_Config.pointQ7bStart[(beam-1)*3+2]);
173 pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ7bEnd[(beam-1)*3],m_Config.pointQ7bEnd[(beam-1)*3+1],m_Config.pointQ7bEnd[(beam-1)*3+2]);
174 rotAxis = m_Config.fQ7bRotZ[beam-1];
175 }
176 else
177 {
178 pointMagStart = HepGeom::Point3D<double>(0,0,0);
179 pointMagEnd = HepGeom::Point3D<double>(0,0,0);
180 rotAxis = 0;
181 }
182}
183
184void ForwardRegionProperties::getMagTransforms(const std::string& name, int beam, HepGeom::Point3D<double> & pointMagStart, HepGeom::Point3D<double> & pointMagEnd, bool twiss)
185{
186 double dummy;
187 getMagTransforms(name, beam, pointMagStart, pointMagEnd, dummy, twiss);
188}
189
190
#define ATH_MSG_INFO(x)
struct _FWDMg_CONFIGURATION * PFWDMg_CONFIGURATION
virtual PFWDMg_CONFIGURATION getConf() override final
void getMagTransforms(const std::string &, int, HepGeom::Point3D< double > &, HepGeom::Point3D< double > &, double &, bool twiss=false) override final
ForwardRegionProperties(const std::string &type, const std::string &name, const IInterface *parent)