9 #ifndef PORTABLE_LAR_SHAPE
20 #include "GaudiKernel/Bootstrap.h"
21 #include "GaudiKernel/ISvcLocator.h"
22 #include "GaudiKernel/IMessageSvc.h"
26 #include "CLHEP/Units/PhysicalConstants.h"
27 #ifndef PORTABLE_LAR_SHAPE
30 #include "G4GeometryTolerance.hh"
36 #ifdef DEBUG_LARWHEELSLICESOLID
37 G4int LArWheelSliceSolid::Verbose = 0;
54 #ifndef PORTABLE_LAR_SHAPE
64 #ifndef PORTABLE_LAR_SHAPE
72 "LArWheelSliceSolid",
"NoPos", FatalException,
73 (std::string(
"Constructor: can't get Inner/Outer from ") +
name).c_str()
81 "LArWheelSliceSolid",
"NoType", FatalException,
82 (std::string(
"Constructor: can't get Type from ") +
name).c_str()
85 size_t s =
name.find(
"Slice");
87 if(G4String::npos !=
s){
90 "LArWheelSliceSolid",
"NoSlice", FatalException,
91 (std::string(
"Constructor: can't get Slice from ") +
name).c_str()
95 if(
name.find(
"::Pos::") != G4String::npos) zside = 1;
96 else if(
name.find(
"::Neg::") != G4String::npos) zside = -1;
98 "LArWheelSliceSolid",
"NoSide", FatalException,
99 (std::string(
"Constructor: can't get zSide from ") +
name).c_str()
106 #ifndef PORTABLE_LAR_SHAPE
135 "LArWheelSliceSolid",
"WrongCalculatorType", FatalException,
136 "Constructor: external LArWheelCalculator of wrong type provided"
140 const G4String bs_name =
name +
"-Bounding";
142 #ifdef DEBUG_LARWHEELSLICESOLID
143 const char *venv =
getenv(
"LARWHEELSLICESOLID_VERBOSE");
144 if(venv) Verbose =
atoi(venv);
145 static bool first =
true;
147 std::cout <<
"The LArWheelSliceSolid build "
148 << __DATE__ <<
" " << __TIME__ << std::endl
149 <<
"LArWheelSliceSolid verbosity level is "
150 << Verbose << std::endl;
163 #ifndef PORTABLE_LAR_SHAPE
175 #ifdef DEBUG_LARWHEELSLICESOLID
178 <<
", Zmax = " <<
m_Zmax << std::endl
179 << GetName() << std::endl;
187 "LArWheelSliceSolid",
"WrongSlice", FatalException,
188 std::string(
"Constructor: Slice number too big: " + GetName()).c_str()
195 std::array<G4double,2> zPlane{}, rInner{}, rOuter{};
200 std::vector<G4double> zsect;
206 const G4double ainn = (rInner[1] - rInner[0]) / (zPlane[1] - zPlane[0]);
207 const G4double aout = (rOuter[1] - rOuter[0]) / (zPlane[1] - zPlane[0]);
208 const G4double R1inn = ainn * (
m_Zmin - zPlane[0]) + rInner[0];
209 const G4double R1out = aout * (
m_Zmin - zPlane[0]) + rOuter[0];
210 const G4double R2inn = ainn * (
m_Zmax - zPlane[0]) + rInner[0];
211 const G4double R2out = aout * (
m_Zmax - zPlane[0]) + rOuter[0];
214 bs_name +
"Cone",
m_Zmin,
m_Zmax, R1inn, R1out, R2inn, R2out
217 const G4double FanPhiAmplitude = 0.065;
229 std::array<G4double,3> zPlane{}, rInner{}, rOuter{};
234 std::vector<G4double> zsect;
240 const size_t i =
m_Zmax > zPlane[1]? 1: 0;
241 const G4double dz = zPlane[
i + 1] - zPlane[
i];
242 const G4double ainn = (rInner[
i + 1] - rInner[
i]) / dz;
243 const G4double aout = (rOuter[
i + 1] - rOuter[
i]) / dz;
244 const G4double R1inn = ainn * (
m_Zmin - zPlane[
i]) + rInner[
i];
245 const G4double R1out = aout * (
m_Zmin - zPlane[
i]) + rOuter[
i];
246 const G4double R2inn = ainn * (
m_Zmax - zPlane[
i]) + rInner[
i];
247 const G4double R2out = aout * (
m_Zmax - zPlane[
i]) + rOuter[
i];
250 bs_name +
"Cone",
m_Zmin,
m_Zmax, R1inn, R1out, R2inn, R2out
253 const G4double FanPhiAmplitude = 0.02;
271 zsect.push_back(sss + half_wave_length * 0.25);
272 for(G4int
i = 2;
i < num_fs;
i ++){
273 const G4double zi = half_wave_length * (
i - 1) + sss;
274 if(
m_Pos ==
Outer && zsect.back() < zMid && zi > zMid){
275 zsect.push_back(zMid);
279 zsect.push_back(wheel_thickness - sss - half_wave_length * 0.25);
280 zsect.push_back(wheel_thickness);