Implements details of distance calculation to parts of the LAr endcap with sagging taken into account.
More...
#include <DistanceCalculatorSaggingOn.h>
Implements details of distance calculation to parts of the LAr endcap with sagging taken into account.
Definition at line 18 of file DistanceCalculatorSaggingOn.h.
◆ parent
◆ DistanceCalculatorSaggingOn()
LArWheelCalculator_Impl::DistanceCalculatorSaggingOn::DistanceCalculatorSaggingOn |
( |
const std::string & |
saggingOptions, |
|
|
LArWheelCalculator * |
lwc |
|
) |
| |
◆ AmplitudeOfSurface()
double LArWheelCalculator_Impl::DistanceCalculatorSaggingOn::AmplitudeOfSurface |
( |
const CLHEP::Hep3Vector & |
P, |
|
|
int |
side, |
|
|
int |
fan_number |
|
) |
| const |
|
virtual |
◆ DistanceToTheNeutralFibre()
double LArWheelCalculator_Impl::DistanceCalculatorSaggingOn::DistanceToTheNeutralFibre |
( |
const CLHEP::Hep3Vector & |
p, |
|
|
int |
fan_number |
|
) |
| const |
|
virtual |
◆ DistanceToTheNeutralFibre_ref()
double LArWheelCalculator_Impl::DistanceCalculatorSaggingOff::DistanceToTheNeutralFibre_ref |
( |
const CLHEP::Hep3Vector & |
p, |
|
|
int |
fan_number |
|
) |
| const |
|
virtualinherited |
Definition at line 147 of file DistanceCalculatorSaggingOff.cxx.
153 #ifdef LWC_PARAM_ANGLE //old variant
156 double cos_a = scalpha.cs, sin_a = scalpha.sn;
157 #else // parameterized sine
159 lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
163 if(
z >
lwc()->m_QuarterWaveLength){
169 if(nhwave == 0) sin_a = - sin_a;
170 double z_prime =
z * cos_a +
x * sin_a;
171 const double x_prime =
z * sin_a -
x * cos_a;
172 if(z_prime > straight_part){
173 const double dz = z_prime - straight_part;
182 z_prime += straight_part;
186 const double &dz = z_prime;
204 const double tan_beta = sin_a/(1.0 + cos_a);
206 if(
z < - local_straight_section &&
207 (
x <
lwc()->m_FanFoldRadius ||
208 x < -
lwc()->m_StraightStartSection *
z / local_straight_section / tan_beta ))
213 const double z_prime =
z * cos_a +
x * sin_a;
214 const double x_prime =
x * cos_a -
z * sin_a;
215 if (z_prime < local_straight_section) {
216 const double dz = local_straight_section - z_prime;
221 const double straight_part =
223 if (z_prime <= straight_part) {
224 return sqw? x_prime: (-x_prime);
226 const double dz = straight_part - z_prime;
◆ get_sagging()
double LArWheelCalculator_Impl::DistanceCalculatorSaggingOn::get_sagging |
( |
const CLHEP::Hep3Vector & |
P, |
|
|
int |
fan_number |
|
) |
| const |
|
private |
Definition at line 136 of file DistanceCalculatorSaggingOn.cxx.
138 std::cout <<
"get_sagging: MFN = " << fan_number << std::endl;
150 double R = P.r() /
mm;
165 printf(
"get_sagging: (%6.3f, %6.3f, %6.3f) %6.3f;"
166 " sp %6.4f %6.4f; dx %6.3f; %.6f\n", P.x()/
mm, P.y()/
mm, P.z()/
mm,
◆ init_sagging_parameters()
void LArWheelCalculator_Impl::DistanceCalculatorSaggingOn::init_sagging_parameters |
( |
| ) |
|
|
private |
Definition at line 36 of file DistanceCalculatorSaggingOn.cxx.
40 #ifndef PORTABLE_LAR_SHAPE
41 ISvcLocator* svcLocator = Gaudi::svcLocator();
45 throw std::runtime_error(
"LArWheelCalculator constructor: \
46 cannot initialze message service");
48 MsgStream
msg(
msgSvc,
"LArWheelCalculator_Impl::DistanceCalculatorSaggingOn");
50 PortableMsgStream
msg(
"LArWheelCalculator_Impl::DistanceCalculatorSaggingOn");
55 if(sagging_opt_value.substr(0, 4) ==
"file"){
56 std::string sag_file = sagging_opt_value.substr(5);
58 <<
"geting sagging parameters from file "
59 << sag_file <<
" ..." <<
endmsg;
60 FILE *
F = fopen(sag_file.c_str(),
"r");
63 <<
"cannot open EMEC sagging parameters file "
66 throw std::runtime_error(
"LArWheelCalculator: read sagging parameters from file");
69 double p0, p1, p2,
p3, p4;
71 fscanf(F,
"%80d %80d %80d %80d %80le %80le %80le %80le %80le",
72 &
s, &
w, &
t, &
n, &p0, &p1, &p2, &
p3, &p4) == 9)
74 if(
s ==
lwc()->m_AtlasZside &&
75 ((
w == 0 &&
lwc()->m_isInner) || (
w == 1 && !
lwc()->m_isInner)) &&
76 ((
t == 0 && !
lwc()->m_isElectrode) || (
t == 1 &&
lwc()->m_isElectrode)) &&
77 (
n >= 0 &&
n <
lwc()->m_NumberOfFans))
85 <<
"sagging for " <<
s <<
" " <<
w <<
" " <<
t
86 <<
" " <<
n <<
": " << p0 <<
" " << p1 <<
" "
93 if(sscanf(sagging_opt_value.c_str(),
"%80le %80le %80le %80le", &
a, &
b, &
c, &
d) != 4){
96 <<
" for EMEC sagging parameters: "
97 << sagging_opt_value <<
", defaults are used" <<
endmsg;
◆ lwc()
◆ NearestPointOnNeutralFibre()
CLHEP::Hep3Vector LArWheelCalculator_Impl::DistanceCalculatorSaggingOn::NearestPointOnNeutralFibre |
( |
const CLHEP::Hep3Vector & |
p, |
|
|
int |
fan_number |
|
) |
| const |
|
virtual |
◆ NearestPointOnNeutralFibre_ref()
CLHEP::Hep3Vector LArWheelCalculator_Impl::DistanceCalculatorSaggingOff::NearestPointOnNeutralFibre_ref |
( |
const CLHEP::Hep3Vector & |
p, |
|
|
int |
fan_number |
|
) |
| const |
|
virtualinherited |
Definition at line 325 of file DistanceCalculatorSaggingOff.cxx.
332 #ifdef LWC_PARAM_ANGLE //old variant
335 double cos_a = scalpha.cs, sin_a = scalpha.sn;
336 #else // parameterized sine
338 lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
342 if(
z >
lwc()->m_QuarterWaveLength){
347 const double straight_part =
350 if(nhwave == 0) sin_a = - sin_a;
351 const double z_prime =
z * cos_a +
x * sin_a;
352 if(z_prime > straight_part){
353 const double x_prime =
x * cos_a -
z * sin_a;
354 const double dz = straight_part - z_prime;
355 double a1 =
atan(fabs(dz / (x_prime +
lwc()->m_FanFoldRadius)));
358 result.set(
x1*cos_a - z1*sin_a,
y, z1*cos_a + z1*sin_a);
360 }
else if(z_prime > -straight_part){
361 result.set(-z_prime * sin_a,
y, z_prime*cos_a + zshift);
364 const double x_prime =
x * cos_a -
z * sin_a;
365 const double dz = straight_part + z_prime;
366 double a1 =
atan(fabs(dz / (x_prime +
lwc()->m_FanFoldRadius)));
369 result.set(
x1*cos_a - z1*sin_a,
y, z1*cos_a + z1*sin_a);
381 const double tan_beta = sin_a / (1.0 + cos_a);
383 if(
z < - local_straight_section &&
384 (
x <
lwc()->m_FanFoldRadius ||
385 x < -
lwc()->m_StraightStartSection *
z / local_straight_section / tan_beta))
390 const double z_prime =
z * cos_a +
x * sin_a;
391 const double x_prime =
x * cos_a -
z * sin_a;
392 if(z_prime < local_straight_section) {
393 double a = fabs(
atan((local_straight_section - z_prime) / (x_prime -
lwc()->m_FanFoldRadius)));
394 result.set(
lwc()->m_FanFoldRadius * (1 -
cos(
a)),
y, local_straight_section -
lwc()->m_FanFoldRadius *
sin(
a));
397 if(z_prime <= straight_part) {
400 double a = fabs(
atan((straight_part - z_prime) / (x_prime +
lwc()->m_FanFoldRadius)) );
401 result.set(
lwc()->m_FanFoldRadius * (
cos(
a) - 1),
y, straight_part +
lwc()->m_FanFoldRadius *
sin(
a));
404 result.rotateY(asin(sin_a));
◆ m_EndQuarterWave
double LArWheelCalculator_Impl::DistanceCalculatorSaggingOff::m_EndQuarterWave |
|
privateinherited |
◆ m_lwc
◆ m_sagging_parameter
std::vector<std::vector<double> > LArWheelCalculator_Impl::DistanceCalculatorSaggingOn::m_sagging_parameter |
|
private |
◆ m_saggingOptions
std::string LArWheelCalculator_Impl::DistanceCalculatorSaggingOn::m_saggingOptions |
|
private |
The documentation for this class was generated from the following files: