5 #ifndef PORTABLE_LAR_SHAPE
6 #include "GaudiKernel/MsgStream.h"
7 #include "GaudiKernel/ISvcLocator.h"
8 #include "GaudiKernel/Bootstrap.h"
13 #include "CLHEP/Vector/ThreeVector.h"
20 #include "GeoModelKernel/Units.h"
30 m_saggingOptions(saggingOptions)
40 #ifndef PORTABLE_LAR_SHAPE
41 SmartIF<IMessageSvc>
msgSvc{Gaudi::svcLocator()->service(
"MessageSvc")};
43 throw std::runtime_error(
"LArWheelCalculator constructor: cannot initialze message service");
45 MsgStream
msg(
msgSvc,
"LArWheelCalculator_Impl::DistanceCalculatorSaggingOn");
47 PortableMsgStream
msg(
"LArWheelCalculator_Impl::DistanceCalculatorSaggingOn");
52 if(sagging_opt_value.substr(0, 4) ==
"file"){
53 std::string sag_file = sagging_opt_value.substr(5);
55 <<
"geting sagging parameters from file "
56 << sag_file <<
" ..." <<
endmsg;
57 FILE *
F = fopen(sag_file.c_str(),
"r");
60 <<
"cannot open EMEC sagging parameters file "
63 throw std::runtime_error(
"LArWheelCalculator: read sagging parameters from file");
68 fscanf(
F,
"%80d %80d %80d %80d %80le %80le %80le %80le %80le",
71 if(
s ==
lwc()->m_AtlasZside &&
72 ((
w == 0 &&
lwc()->m_isInner) || (
w == 1 && !
lwc()->m_isInner)) &&
73 ((
t == 0 && !
lwc()->m_isElectrode) || (
t == 1 &&
lwc()->m_isElectrode)) &&
74 (
n >= 0 &&
n <
lwc()->m_NumberOfFans))
82 <<
"sagging for " <<
s <<
" " <<
w <<
" " <<
t
83 <<
" " <<
n <<
": " <<
p0 <<
" " <<
p1 <<
" "
90 if(sscanf(sagging_opt_value.c_str(),
"%80le %80le %80le %80le", &
a, &
b, &
c, &
d) != 4){
93 <<
" for EMEC sagging parameters: "
94 << sagging_opt_value <<
", defaults are used" <<
endmsg;
118 CLHEP::Hep3Vector sagging_corrected(
p.x()+
get_sagging(
p, fan_number),
p.y(),
p.z() );
123 CLHEP::Hep3Vector sagging_corrected(
p.x()+
get_sagging(
p, fan_number),
p.y(),
p.z() );
135 std::cout <<
"get_sagging: MFN = " << fan_number << std::endl;
147 double R =
P.r() /
mm;
162 printf(
"get_sagging: (%6.3f, %6.3f, %6.3f) %6.3f;"
163 " sp %6.4f %6.4f; dx %6.3f; %.6f\n",
P.x()/
mm,
P.y()/
mm,
P.z()/
mm,