|
ATLAS Offline Software
|
#include <LArWheelSliceSolid.h>
|
| LArWheelSliceSolid (const G4String &name, pos_t pos, type_t type, size_t slice, G4int zside=1, const LArWheelCalculator *calc=0, const EMECData *emecData=0) |
|
| LArWheelSliceSolid (const G4String &name, const EMECData *emecData) |
|
virtual | ~LArWheelSliceSolid () |
|
EInside | Inside (const G4ThreeVector &) const |
|
G4double | DistanceToIn (const G4ThreeVector &, const G4ThreeVector &) const |
|
G4double | DistanceToIn (const G4ThreeVector &) const |
|
G4double | DistanceToOut (const G4ThreeVector &, const G4ThreeVector &, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const |
|
G4double | DistanceToOut (const G4ThreeVector &) const |
|
G4ThreeVector | SurfaceNormal (const G4ThreeVector &) const |
|
G4bool | CalculateExtent (const EAxis, const G4VoxelLimits &, const G4AffineTransform &, G4double &, G4double &) const |
|
G4GeometryType | GetEntityType () const |
|
void | DescribeYourselfTo (G4VGraphicsScene &) const |
|
G4VisExtent | GetExtent () const |
|
G4Polyhedron * | CreatePolyhedron () const |
|
virtual std::ostream & | StreamInfo (std::ostream &os) const |
|
G4ThreeVector | GetPointOnSurface (void) const |
|
G4double | GetCubicVolume (void) |
|
G4double | GetSurfaceArea (void) |
|
const G4VSolid * | GetBoundingShape (void) const |
|
const LArWheelCalculator * | GetCalculator (void) const |
|
bool | msgLvl (const MSG::Level lvl) const |
| Test the output level. More...
|
|
MsgStream & | msg () const |
| The standard message stream. More...
|
|
MsgStream & | msg (const MSG::Level lvl) const |
| The standard message stream. More...
|
|
void | setLevel (MSG::Level lvl) |
| Change the current logging level. More...
|
|
|
void | inner_solid_init (const G4String &, size_t slice) |
|
void | outer_solid_init (const G4String &, size_t slice) |
|
void | fill_zsect (std::vector< G4double > &, G4double zMid=0.) const |
|
virtual G4double | distance_to_in (G4ThreeVector &, const G4ThreeVector &, int) const |
|
G4double | in_iteration_process (const G4ThreeVector &, G4double, G4ThreeVector &, int) const |
|
G4double | search_for_nearest_point (const G4ThreeVector &, const G4double, const G4ThreeVector &, int) const |
|
G4bool | search_for_most_remoted_point (const G4ThreeVector &, const G4ThreeVector &, G4ThreeVector &, const int) const |
|
G4double | out_iteration_process (const G4ThreeVector &, G4ThreeVector &, const int) const |
|
EInside | Inside_accordion (const G4ThreeVector &) const |
|
void | get_point_on_accordion_surface (G4ThreeVector &) const |
|
void | get_point_on_polycone_surface (G4ThreeVector &) const |
|
void | get_point_on_flat_surface (G4ThreeVector &) const |
|
void | set_failover_point (G4ThreeVector &p, const char *m=0) const |
|
G4double | get_area_on_polycone (void) const |
|
G4double | get_area_on_face (void) const |
|
G4double | get_area_on_side (void) const |
|
G4double | get_area_at_r (G4double r) const |
|
G4double | get_length_at_r (G4double r) const |
|
void | test (void) |
|
void | clean_tests (void) |
|
void | init_tests (void) |
|
G4String | TypeStr (void) const |
|
void | createSolid (const G4String &name, G4int zside, size_t slice, const EMECData *emecData) |
|
void | check_slice (size_t size, size_t slice) const |
|
void | initMessaging () const |
| Initialize our message level and MessageSvc. More...
|
|
Definition at line 42 of file LArWheelSliceSolid.h.
◆ pos_t
◆ type_t
◆ LArWheelSliceSolid() [1/2]
◆ LArWheelSliceSolid() [2/2]
LArWheelSliceSolid::LArWheelSliceSolid |
( |
const G4String & |
name, |
|
|
const EMECData * |
emecData |
|
) |
| |
Definition at line 62 of file LArWheelSliceSolidInit.cxx.
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()
◆ ~LArWheelSliceSolid()
virtual LArWheelSliceSolid::~LArWheelSliceSolid |
( |
| ) |
|
|
inlinevirtual |
◆ CalculateExtent()
G4bool LArWheelSliceSolid::CalculateExtent |
( |
const EAxis |
a, |
|
|
const G4VoxelLimits & |
vl, |
|
|
const G4AffineTransform & |
t, |
|
|
G4double & |
p, |
|
|
G4double & |
q |
|
) |
| const |
◆ check_slice()
void LArWheelSliceSolid::check_slice |
( |
size_t |
size, |
|
|
size_t |
slice |
|
) |
| const |
|
inlineprivate |
Definition at line 183 of file LArWheelSliceSolidInit.cxx.
187 "LArWheelSliceSolid",
"WrongSlice", FatalException,
188 std::string(
"Constructor: Slice number too big: " + GetName()).c_str()
◆ clean_tests()
void LArWheelSliceSolid::clean_tests |
( |
void |
| ) |
|
|
private |
◆ CreatePolyhedron()
G4Polyhedron * LArWheelSliceSolid::CreatePolyhedron |
( |
| ) |
const |
◆ createSolid()
void LArWheelSliceSolid::createSolid |
( |
const G4String & |
name, |
|
|
G4int |
zside, |
|
|
size_t |
slice, |
|
|
const EMECData * |
emecData |
|
) |
| |
|
private |
Definition at line 104 of file LArWheelSliceSolidInit.cxx.
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");
145 static bool first =
true;
147 std::cout <<
"The LArWheelSliceSolid build "
148 << __DATE__ <<
" " << __TIME__ << std::endl
149 <<
"LArWheelSliceSolid verbosity level is "
163 #ifndef PORTABLE_LAR_SHAPE
175 #ifdef DEBUG_LARWHEELSLICESOLID
178 <<
", Zmax = " <<
m_Zmax << std::endl
179 << GetName() << std::endl;
◆ DescribeYourselfTo()
void LArWheelSliceSolid::DescribeYourselfTo |
( |
G4VGraphicsScene & |
scene | ) |
const |
◆ distance_to_in()
G4double LArWheelSliceSolid::distance_to_in |
( |
G4ThreeVector & |
p, |
|
|
const G4ThreeVector & |
v, |
|
|
int |
p_fan |
|
) |
| const |
|
privatevirtual |
Definition at line 121 of file LArWheelSliceSolidDisToIn.cxx.
123 LWSDBG(4, std::cout <<
"dti: " << MSG_VECTOR(
p) <<
" "
124 << MSG_VECTOR(
v) << std::endl);
129 if(
v.x() >= 0.)
return kInfinity;
130 const G4double
b = (
m_Xmax -
p.x()) /
v.x();
131 const G4double
y2 =
p.y() +
v.y() *
b;
132 const G4double z2 =
p.z() +
v.z() *
b;
136 if(
v.x() <= 0.)
return kInfinity;
137 const G4double
b = (
m_Xmin -
p.x()) /
v.x();
138 const G4double
y2 =
p.y() +
v.y() *
b;
139 const G4double z2 =
p.z() +
v.z() *
b;
146 LWSDBG(5, std::cout <<
"dti corrected: " << MSG_VECTOR(
p) << std::endl);
150 LWSDBG(5, std::cout <<
"hit fan dist_p=" << dist_p <<
", m_FHTminusT=" <<
m_FHTminusT << std::endl);
157 LWSDBG(5, std::cout <<
"dti exit point: " << MSG_VECTOR(
q) <<
" "
158 << dist_q << std::endl);
159 G4double
dd = kInfinity;
160 if(dist_p * dist_q < 0.){
166 }
else if(
dd < kInfinity){
◆ DistanceToIn() [1/2]
G4double LArWheelSliceSolid::DistanceToIn |
( |
const G4ThreeVector & |
inputP | ) |
const |
Definition at line 15 of file LArWheelSliceSolidDisToIn.cxx.
17 LWSDBG(1, std::cout <<
TypeStr() <<
" DisToIn" << MSG_VECTOR(inputP) << std::endl);
22 LWSDBG(2, std::cout <<
"Outside BS" << std::endl);
25 G4ThreeVector
p(inputP);
34 const G4double
d = fabs(
GetCalculator()->DistanceToTheNearestFan(
p, p_fan));
37 LWSDBG(2, std::cout <<
"dti result = " <<
result << std::endl);
40 LWSDBG(2, std::cout <<
"already inside, return 0" << MSG_VECTOR(
p) << std::endl);
◆ DistanceToIn() [2/2]
G4double LArWheelSliceSolid::DistanceToIn |
( |
const G4ThreeVector & |
inputP, |
|
|
const G4ThreeVector & |
inputV |
|
) |
| const |
Definition at line 44 of file LArWheelSliceSolidDisToIn.cxx.
47 LWSDBG(1, std::cout <<
TypeStr() <<
" DisToIn" << MSG_VECTOR(inputP)
48 << MSG_VECTOR(inputV) << std::endl);
52 G4ThreeVector
p(inputP);
53 if(inside_BS == kOutside) {
56 LWSDBG(2, std::cout <<
"Infinity distance to m_BoundingShape"
57 << MSG_VECTOR(inputP) << MSG_VECTOR(inputV)
63 LWSDBG(2, std::cout <<
"shift" << MSG_VECTOR(inputP) << std::endl);
66 const G4double
phi0 =
p.phi();
70 LWSDBG(2, std::cout <<
"already inside fan" << MSG_VECTOR(
p) << std::endl);
72 if(inside_BS == kSurface) {
73 LWSDBG(2, std::cout <<
"On BS surface" << std::endl);
78 G4ThreeVector
v(inputV);
84 #ifdef DEBUG_LARWHEELSLICESOLID
87 std::cout << MSG_VECTOR(inputP)
88 <<
" " << MSG_VECTOR(inputV) << std::endl;
90 std::cout <<
"dti: " <<
d0 <<
", DTI: " <<
distance << std::endl;
96 std::cout <<
"DTI hit at dist. " <<
distance <<
", point "
97 << MSG_VECTOR(
p2) <<
", "
100 std::cout <<
"got infinity from dti" << std::endl;
103 #ifdef LWS_HARD_TEST_DTI
104 if(test_dti(inputP, inputV,
distance)){
106 std::cout <<
TypeStr() <<
" DisToIn" << MSG_VECTOR(inputP)
107 << MSG_VECTOR(inputV) << std::endl;
111 std::cout <<
TypeStr() <<
" DisToIn" << MSG_VECTOR(inputP)
112 << MSG_VECTOR(inputV) <<
" " <<
distance << std::endl;
114 #endif // ifdef LWS_HARD_TEST_DTI
116 #endif // ifdef DEBUG_LARWHEELSLICESOLID
◆ DistanceToOut() [1/2]
G4double LArWheelSliceSolid::DistanceToOut |
( |
const G4ThreeVector & |
inputP | ) |
const |
Definition at line 10 of file LArWheelSliceSolidDisToOut.cxx.
12 LWSDBG(1, std::cout <<
TypeStr() <<
" DisToOut" << MSG_VECTOR(inputP) << std::endl);
14 LWSDBG(2, std::cout <<
"DistanceToOut(p):"
15 <<
" point " << MSG_VECTOR(inputP)
16 <<
" is not inside of the m_BoundingShape."
20 G4ThreeVector
p(inputP);
24 LWSDBG(2, std::cout <<
"already not inside " << MSG_VECTOR(
p) << std::endl);
28 LWSDBG(2, std::cout <<
"dto " <<
d <<
" " <<
d0 << std::endl);
◆ DistanceToOut() [2/2]
G4double LArWheelSliceSolid::DistanceToOut |
( |
const G4ThreeVector & |
inputP, |
|
|
const G4ThreeVector & |
inputV, |
|
|
const G4bool |
calcNorm = false , |
|
|
G4bool * |
validNorm = 0 , |
|
|
G4ThreeVector * |
n = 0 |
|
) |
| const |
Definition at line 33 of file LArWheelSliceSolidDisToOut.cxx.
39 LWSDBG(1, std::cout <<
TypeStr() <<
" DisToOut" << MSG_VECTOR(inputP)
40 << MSG_VECTOR(inputV) << std::endl);
43 if(inside_BS == kOutside){
44 LWSDBG(2, std::cout <<
"DistanceToOut(p):"
45 <<
" point " << MSG_VECTOR(inputP)
46 <<
" is outside of m_BoundingShape." << std::endl);
47 if(calcNorm) *validNorm =
false;
52 G4ThreeVector
p(inputP);
54 const G4double adtnf_p = fabs(
GetCalculator()->DistanceToTheNearestFan(
p, p_fan));
56 LWSDBG(2, std::cout <<
"DistanceToOut(p, v): point "
58 <<
" is outside of solid." << std::endl);
59 if(calcNorm) *validNorm =
false;
63 G4ThreeVector
v(inputV);
64 const G4double
phi0 =
p.phi() - inputP.phi();
68 LWSDBG(4, std::cout <<
"dto: " << MSG_VECTOR(
p) <<
" "
69 << MSG_VECTOR(
v) << std::endl);
74 inputP, inputV, calcNorm, validNorm, sn
78 LWSDBG(5, std::cout <<
"dto exit point too low " << MSG_VECTOR(
q) << std::endl);
80 q.setX(
p.x() +
v.x() *
dy);
82 q.setZ(
p.z() +
v.z() *
dy);
84 LWSDBG(5, std::cout <<
"dto exit point " << MSG_VECTOR(
q) << std::endl);
89 LWSDBG(5, std::cout <<
"q=" << MSG_VECTOR(
q)
90 <<
" outside fan cur distance="
103 LWSDBG(5, std::cout <<
"At end_dto distance=" <<
distance << std::endl);
104 if(calcNorm &&
distance < dto_bs) *validNorm =
false;
106 #ifdef DEBUG_LARWHEELSLICESOLID
108 std::cout <<
"DTO: " <<
distance <<
" ";
110 std::cout << *validNorm <<
" " << MSG_VECTOR((*sn));
112 std::cout <<
"Norm is not valid";
114 std::cout << std::endl;
116 G4ThreeVector
p2 = inputP + inputV *
distance;
118 std::cout <<
"DTO hit at " << MSG_VECTOR(
p2) <<
", "
122 #ifdef LWS_HARD_TEST_DTO
123 if(test_dto(inputP, inputV,
distance)){
125 std::cout <<
TypeStr() <<
" DisToOut" << MSG_VECTOR(inputP)
126 << MSG_VECTOR(inputV) << std::endl;
◆ fill_zsect()
void LArWheelSliceSolid::fill_zsect |
( |
std::vector< G4double > & |
zsect, |
|
|
G4double |
zMid = 0. |
|
) |
| const |
|
private |
Definition at line 263 of file LArWheelSliceSolidInit.cxx.
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);
◆ get_area_at_r()
G4double LArWheelSliceSolid::get_area_at_r |
( |
G4double |
r | ) |
const |
|
private |
Definition at line 509 of file LArWheelSliceSolidTests.cxx.
514 G4ThreeVector(0.,
r,
m_Zmin), G4ThreeVector(0., 0., 1.)
517 G4ThreeVector(0.,
r,
m_Zmax), G4ThreeVector(0., 0., -1.)
◆ get_area_on_face()
G4double LArWheelSliceSolid::get_area_on_face |
( |
void |
| ) |
const |
|
private |
◆ get_area_on_polycone()
G4double LArWheelSliceSolid::get_area_on_polycone |
( |
void |
| ) |
const |
|
private |
◆ get_area_on_side()
G4double LArWheelSliceSolid::get_area_on_side |
( |
void |
| ) |
const |
|
private |
◆ get_length_at_r()
G4double LArWheelSliceSolid::get_length_at_r |
( |
G4double |
r | ) |
const |
|
private |
Definition at line 346 of file LArWheelSliceSolidTests.cxx.
351 G4ThreeVector(0.,
r, -
m_Zmin), G4ThreeVector(0., 0., 1.)
355 G4ThreeVector(0.,
r,
m_Zmax), G4ThreeVector(0., 0., -1.)
◆ get_point_on_accordion_surface()
void LArWheelSliceSolid::get_point_on_accordion_surface |
( |
G4ThreeVector & |
p | ) |
const |
|
private |
Definition at line 101 of file LArWheelSliceSolidTests.cxx.
108 p[1] = rnd->Uniform(rmin, rmax);
110 G4double dphi =
p.phi();
116 if(
d < 0.)
side = -1;
117 if(
d >= 0.)
side = 1;
125 G4ThreeVector D =
p; D[2] = 0.;
137 G4ThreeVector
B =
p + D *
d1;
138 G4double dphi =
B.phi();
154 G4ThreeVector D1 = (
p -
B).
unit();
◆ get_point_on_flat_surface()
void LArWheelSliceSolid::get_point_on_flat_surface |
( |
G4ThreeVector & |
p | ) |
const |
|
private |
◆ get_point_on_polycone_surface()
void LArWheelSliceSolid::get_point_on_polycone_surface |
( |
G4ThreeVector & |
p | ) |
const |
|
private |
Definition at line 165 of file LArWheelSliceSolidTests.cxx.
170 const bool inner = rnd->Uniform() > 0.5?
true:
false;
172 p[0] = 0.;
p[1] = inner? rmin: rmax;
p[2] =
z;
174 G4double dphi =
p.phi();
179 const G4double
r =
p[1];
181 G4ThreeVector A1(0.,
r,
z);
193 G4ThreeVector A2(0.,
r,
z);
211 G4ThreeVector
d = (A2 - A1).
unit();
223 if(inner)
step *= -2;
233 G4ThreeVector B1(0.,
r +
step,
z);
244 G4ThreeVector B2(0.,
r +
step,
z);
256 if(B1i == A1i || B2i == A1i){
268 G4ThreeVector
d1 = (A1 - B1).
unit();
270 G4ThreeVector
d2 = (A2 - B2).
unit();
273 G4ThreeVector
X = X1;
274 G4double phi1 = X1.phi(), phi2 = X2.phi();
277 G4double phiX = rnd->Uniform(phi1, phi2);
◆ GetBoundingShape()
const G4VSolid* LArWheelSliceSolid::GetBoundingShape |
( |
void |
| ) |
const |
|
inline |
◆ GetCalculator()
◆ GetCubicVolume()
G4double LArWheelSliceSolid::GetCubicVolume |
( |
void |
| ) |
|
◆ GetEntityType()
G4GeometryType LArWheelSliceSolid::GetEntityType |
( |
| ) |
const |
|
inline |
◆ GetExtent()
G4VisExtent LArWheelSliceSolid::GetExtent |
( |
| ) |
const |
◆ GetPointOnSurface()
G4ThreeVector LArWheelSliceSolid::GetPointOnSurface |
( |
void |
| ) |
const |
Definition at line 69 of file LArWheelSliceSolidTests.cxx.
71 if(rnd == 0) rnd =
new TRandom3(0);
72 G4double
r = rnd->Uniform();
73 G4ThreeVector
p(0., 0., 0.);
75 G4double level1 = .980;
76 G4double level2 = .993;
77 const char *
v =
getenv(
"LARWHEELSLICESOLID_TEST_MODE_LEVEL1");
79 const char *v1 =
getenv(
"LARWHEELSLICESOLID_TEST_MODE_LEVEL2");
80 if(v1) level2 =
atof(v1);
83 std::cout <<
"LWS::GPOS " <<
r << std::endl;
88 }
else if(
r <= level2){
94 "LArWheelSliceSolid",
"Rnd generator error",
95 FatalException,
"GetPointOnSurface: Wrong data from rnd generator"
◆ GetSurfaceArea()
G4double LArWheelSliceSolid::GetSurfaceArea |
( |
void |
| ) |
|
Definition at line 367 of file LArWheelSliceSolidTests.cxx.
374 std::cout <<
"get_area_on_polycone: " << a1/
mm2 << std::endl;
380 std::cout <<
"get_area_on_face: " << a2/
mm2 << std::endl;
386 std::cout <<
"get_area_on_side: " << a3/
mm2 << std::endl;
◆ in_iteration_process()
G4double LArWheelSliceSolid::in_iteration_process |
( |
const G4ThreeVector & |
p, |
|
|
G4double |
dist_p, |
|
|
G4ThreeVector & |
B, |
|
|
int |
p_fan |
|
) |
| const |
|
private |
Definition at line 177 of file LArWheelSliceSolidDisToIn.cxx.
181 LWSDBG(6, std::cout <<
"iip from " <<
p <<
" to " <<
B
182 <<
" dir " << (
B -
p).
unit()
188 unsigned int niter = 0;
195 if(dist_c * dist_p < 0. || fabs(dist_c) <
m_FHTminusT){
206 LWSDBG(7, std::cout <<
"iip result in " << niter <<
" = " <<
B
207 <<
" " <<
diff.mag() << std::endl);
◆ init_tests()
void LArWheelSliceSolid::init_tests |
( |
void |
| ) |
|
|
private |
Definition at line 608 of file LArWheelSliceSolidTests.cxx.
613 #ifdef DEBUG_LARWHEELSLICESOLID
615 std::cout <<
"LArWheelSliceSolid::init_tests: put " <<
this
638 (GetName() +
"_f_length").c_str(), &fcn_length,
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ inner_solid_init()
void LArWheelSliceSolid::inner_solid_init |
( |
const G4String & |
bs_name, |
|
|
size_t |
slice |
|
) |
| |
|
private |
Definition at line 193 of file LArWheelSliceSolidInit.cxx.
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;
◆ Inside()
EInside LArWheelSliceSolid::Inside |
( |
const G4ThreeVector & |
inputP | ) |
const |
Definition at line 15 of file LArWheelSliceSolid.cxx.
17 LWSDBG(10, std::cout << std::setprecision(25));
18 LWSDBG(1, std::cout <<
TypeStr() <<
" Inside " << MSG_VECTOR(inputP) << std::endl);
20 if(inside_BS == kOutside){
21 LWSDBG(2, std::cout <<
"outside BS" << std::endl);
24 G4ThreeVector
p(inputP);
26 const G4double
d = fabs(
GetCalculator()->DistanceToTheNearestFan(
p, p_fan));
28 LWSDBG(2, std::cout <<
"outside fan d=" <<
d <<
", m_FHTplusT=" <<
m_FHTplusT << std::endl);
32 LWSDBG(2, std::cout <<
"inside fan d=" <<
d <<
", m_FHTminusT=" <<
m_FHTminusT <<
", inside_BS=" <<
inside(inside_BS) << std::endl);
35 LWSDBG(2, std::cout <<
"surface" << std::endl);
◆ Inside_accordion()
EInside LArWheelSliceSolid::Inside_accordion |
( |
const G4ThreeVector & |
p | ) |
const |
|
private |
◆ msg() [1/2]
MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
◆ msg() [2/2]
MsgStream & AthMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
180 {
return msg() << lvl; }
◆ msgLvl()
bool AthMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
◆ out_iteration_process()
G4double LArWheelSliceSolid::out_iteration_process |
( |
const G4ThreeVector & |
p, |
|
|
G4ThreeVector & |
B, |
|
|
const int |
p_fan |
|
) |
| const |
|
private |
◆ outer_solid_init()
void LArWheelSliceSolid::outer_solid_init |
( |
const G4String & |
bs_name, |
|
|
size_t |
slice |
|
) |
| |
|
private |
Definition at line 227 of file LArWheelSliceSolidInit.cxx.
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;
◆ search_for_most_remoted_point()
G4bool LArWheelSliceSolid::search_for_most_remoted_point |
( |
const G4ThreeVector & |
a, |
|
|
const G4ThreeVector & |
b, |
|
|
G4ThreeVector & |
C, |
|
|
const int |
p_fan |
|
) |
| const |
|
private |
◆ search_for_nearest_point()
G4double LArWheelSliceSolid::search_for_nearest_point |
( |
const G4ThreeVector & |
p_in, |
|
|
const G4double |
dist_p_in, |
|
|
const G4ThreeVector & |
p_out, |
|
|
int |
p_fan |
|
) |
| const |
|
private |
Definition at line 213 of file LArWheelSliceSolidDisToIn.cxx.
218 LWSDBG(6, std::cout <<
"sfnp " << MSG_VECTOR(p_in) <<
" "
219 << MSG_VECTOR(p_out) << std::endl);
227 G4double
sign = dist_p_in < 0.? -1. : 1.;
230 unsigned long niter = 0;
235 if(dist_c *
sign <= 0.){
236 LWSDBG(7, std::cout <<
"sfnp0 " << dist_c << std::endl);
243 if(d_prime < 0.)
A =
C;
250 LWSDBG(7, std::cout <<
"sfnp1 " << dist_c << std::endl);
254 if(dist_p_in *
sign < dist_c *
sign){
259 if(dist_p_out *
sign < dist_c *
sign)
C = p_out;
261 LWSDBG(7, std::cout <<
"sfnp2 " << dist_p_out << std::endl);
◆ set_failover_point()
void LArWheelSliceSolid::set_failover_point |
( |
G4ThreeVector & |
p, |
|
|
const char * |
m = 0 |
|
) |
| const |
|
private |
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ StreamInfo()
virtual std::ostream& LArWheelSliceSolid::StreamInfo |
( |
std::ostream & |
os | ) |
const |
|
inlinevirtual |
◆ SurfaceNormal()
G4ThreeVector LArWheelSliceSolid::SurfaceNormal |
( |
const G4ThreeVector & |
inputP | ) |
const |
Definition at line 39 of file LArWheelSliceSolid.cxx.
41 LWSDBG(1, std::cout <<
TypeStr() <<
" SurfaceNormal" << MSG_VECTOR(inputP) << std::endl);
43 if(inside_BS != kInside){
44 LWSDBG(2, std::cout <<
"not inside BS" << std::endl);
47 G4ThreeVector
p( inputP );
51 d.rotateZ(inputP.phi() -
p.phi());
52 LWSDBG(4, std::cout <<
"npnf" << MSG_VECTOR(
d) << std::endl);
54 LWSDBG(2, std::cout <<
"sn " << MSG_VECTOR(
p.unit()) << std::endl);
◆ test()
void LArWheelSliceSolid::test |
( |
void |
| ) |
|
|
private |
Definition at line 397 of file LArWheelSliceSolidTests.cxx.
399 boost::io::ios_all_saver ias(std::cout);
400 const char *on =
getenv(
"LARWHEELSLICESOLID_TEST");
402 std::string test_mode = on;
404 std::cout <<
"============| LArWheelSliceSolid test() routine |=============="
406 std::cout <<
"Solid of type " <<
TypeStr() << std::endl;
407 std::cout.precision(6);
408 std::cout << std::fixed;
409 const char *
prec =
getenv(
"LARWHEELSLICESOLID_TEST_INTPRECISION");
411 std::cout <<
"Int. precision " << IntPrecision << std::endl;
412 std::cout <<
"test mode " << test_mode << std::endl;
414 std::cout <<
"m_Rmin = " <<
m_Rmin <<
" m_Rmax = " <<
m_Rmax << std::endl
415 <<
"m_Zmin = " <<
m_Zmin <<
" m_Zmax = " <<
m_Zmax << std::endl;
420 if(test_mode.find(
"root") != std::string::npos){
421 F =
new TFile(
"LArWheelSliceSolid_test.root",
"UPDATE");
422 T =
new TNtupleD(GetName(), GetName(),
"x:y:z");
425 const int Nmax(1000000000);
426 char *NN =
getenv(
"LARWHEELSLICESOLID_TEST_NPOINTS");
430 N = strtol(NN, &endptr, 0);
431 if (endptr[0] !=
'\0') {
432 throw std::invalid_argument(
"Could not convert string to int: " + std::string(NN));
436 std::cout <<
"Number of points from LARWHEELSLICESOLID_TEST_NPOINTS environment variable ("<<
N<<
") is too large. Using " << Nmax <<
" instead." << std::endl;
440 std::cout <<
"Number of points from LARWHEELSLICESOLID_TEST_NPOINTS environment variable ("<<
N<<
") is negative!!. Using 0 instead." << std::endl;
443 if(test_mode.find(
"points") == std::string::npos){
446 std::cout <<
N <<
" points" << std::endl;
448 for(
int i = 0;
i <
N; ++
i){
453 std::cout <<
i <<
" "
454 << (ii == kInside?
"inside":
"outside")
458 if(
T)
T->Fill(
p[0],
p[1],
p[2]);
467 if(test_mode.find(
"volume") != std::string::npos){
469 std::cout <<
"GetCubicVolume: " << cv/
CLHEP::mm3 <<
" mm^3" << std::endl;
472 if(test_mode.find(
"area") != std::string::npos){
474 std::cout <<
"GetSurfaceArea: " << sa/
CLHEP::mm2 <<
" mm^2" << std::endl;
477 std::cout <<
"======= end of ArWheelSolid test() routine ============="
480 if(test_mode.find(
"once") != std::string::npos)
exit(0);
◆ TypeStr()
G4String LArWheelSliceSolid::TypeStr |
( |
void |
| ) |
const |
|
private |
Definition at line 67 of file LArWheelSliceSolid.cxx.
73 case Absorber: ret =
"LArInnerAbsorberWheel";
break;
74 case Electrode: ret =
"LArInnerElectrodWheel";
break;
75 case Glue: ret =
"LArInnerGlueWheel";
break;
76 case Lead: ret =
"LArInnerLeadWheel";
break;
81 case Absorber: ret =
"LArOuterAbsorberWheel";
break;
82 case Electrode: ret =
"LArOuterElectrodWheel";
break;
83 case Glue: ret =
"LArOuterGlueWheel";
break;
84 case Lead: ret =
"LArOuterLeadWheel";
break;
◆ LArWheelSliceSolid_fcn_area
double LArWheelSliceSolid_fcn_area |
( |
double * |
x, |
|
|
double * |
p |
|
) |
| |
|
friend |
Definition at line 528 of file LArWheelSliceSolidTests.cxx.
530 const double &
z =
x[0];
531 const double &
r =
p[0];
532 const double &
index =
p[1];
534 G4ThreeVector
a(0.,
r,
z);
535 double b = solid[
index]->GetCalculator()->AmplitudeOfSurface(
a, -1, 121)
536 - solid[
index]->GetCalculator()->AmplitudeOfSurface(
a, 1, 121);
◆ LArWheelSliceSolid_fcn_area_on_pc
double LArWheelSliceSolid_fcn_area_on_pc |
( |
double * |
x, |
|
|
double * |
p |
|
) |
| |
|
friend |
Definition at line 548 of file LArWheelSliceSolidTests.cxx.
550 const double &
z =
x[0];
551 const double &
index =
p[0];
557 G4ThreeVector
a(0., rmin,
z);
558 result += solid[
index]->GetCalculator()->AmplitudeOfSurface(
a, -1, 232)
559 - solid[
index]->GetCalculator()->AmplitudeOfSurface(
a, 1, 232);
561 result += solid[
index]->GetCalculator()->AmplitudeOfSurface(
a, -1, 343)
562 - solid[
index]->GetCalculator()->AmplitudeOfSurface(
a, 1, 343);
◆ LArWheelSliceSolid_fcn_side_area
double LArWheelSliceSolid_fcn_side_area |
( |
double * |
x, |
|
|
double * |
p |
|
) |
| |
|
friend |
◆ LArWheelSliceSolid_fcn_vol
double LArWheelSliceSolid_fcn_vol |
( |
double * |
x, |
|
|
double * |
p |
|
) |
| |
|
friend |
◆ LArWheelSliceSolid_get_dl
double LArWheelSliceSolid_get_dl |
( |
double * |
x, |
|
|
double * |
par, |
|
|
G4int |
side |
|
) |
| |
|
friend |
Definition at line 568 of file LArWheelSliceSolidTests.cxx.
570 const double &
z =
x[0];
571 const double &
r =
par[0];
574 const double h = 0.001;
577 G4ThreeVector
p(0.,
r,
z +
h);
578 G4double D1 = solid[
index]->GetCalculator()->AmplitudeOfSurface(
p,
side, 5665);
580 D1 -= solid[
index]->GetCalculator()->AmplitudeOfSurface(
p,
side, 5665);
584 G4double D2 = solid[
index]->GetCalculator()->AmplitudeOfSurface(
p,
side, 5665);
586 D2 -= solid[
index]->GetCalculator()->AmplitudeOfSurface(
p,
side, 5665);
589 G4double D = (D2 * 4 - D1) / 3.;
590 G4double
dl = sqrt(1 + D * D);
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_BoundingShape
G4VSolid* LArWheelSliceSolid::m_BoundingShape {} |
|
private |
◆ m_Calculator
◆ m_f_area
TF1* LArWheelSliceSolid::m_f_area |
|
protected |
◆ m_f_area_on_pc
TF1 * LArWheelSliceSolid::m_f_area_on_pc |
|
protected |
◆ m_f_length
TF1 * LArWheelSliceSolid::m_f_length |
|
protected |
◆ m_f_side_area
TF1 * LArWheelSliceSolid::m_f_side_area |
|
protected |
◆ m_f_vol
TF1 * LArWheelSliceSolid::m_f_vol |
|
protected |
◆ m_FanHalfThickness
G4double LArWheelSliceSolid::m_FanHalfThickness {} |
|
private |
◆ m_FHTminusT
G4double LArWheelSliceSolid::m_FHTminusT {} |
|
private |
◆ m_FHTplusT
G4double LArWheelSliceSolid::m_FHTplusT {} |
|
private |
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_Pos
pos_t LArWheelSliceSolid::m_Pos {} |
|
private |
◆ m_Rmax
G4double LArWheelSliceSolid::m_Rmax {} |
|
private |
◆ m_Rmin
G4double LArWheelSliceSolid::m_Rmin {} |
|
private |
◆ m_test_index
double LArWheelSliceSolid::m_test_index |
|
protected |
◆ m_Type
type_t LArWheelSliceSolid::m_Type {} |
|
private |
◆ m_Xmax
G4double LArWheelSliceSolid::m_Xmax {} |
|
private |
◆ m_Xmin
G4double LArWheelSliceSolid::m_Xmin {} |
|
private |
◆ m_Ymin
G4double LArWheelSliceSolid::m_Ymin {} |
|
private |
◆ m_Zmax
G4double LArWheelSliceSolid::m_Zmax {} |
|
private |
◆ m_Zmin
G4double LArWheelSliceSolid::m_Zmin {} |
|
private |
◆ s_AngularTolerance
const G4double LArWheelSliceSolid::s_AngularTolerance = G4GeometryTolerance::GetInstance()->GetAngularTolerance() / 2 |
|
staticprivate |
◆ s_IterationPrecision
const G4double LArWheelSliceSolid::s_IterationPrecision = 0.001*CLHEP::mm |
|
staticprivate |
◆ s_IterationPrecision2
◆ s_IterationsLimit
const unsigned int LArWheelSliceSolid::s_IterationsLimit = 50 |
|
staticprivate |
◆ s_Tolerance
const G4double LArWheelSliceSolid::s_Tolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance() / 2 |
|
staticprivate |
The documentation for this class was generated from the following files:
G4double get_area_on_face(void) const
static const G4double s_Tolerance
std::atomic< MSG::Level > m_lvl
Current logging level.
double GetStraightStartSection() const
const LArWheelCalculator * GetCalculator(void) const
G4bool search_for_most_remoted_point(const G4ThreeVector &, const G4ThreeVector &, G4ThreeVector &, const int) const
G4ThreeVector GetPointOnSurface(void) const
G4String TypeStr(void) const
double GetFanHalfThickness(LArG4::LArWheelCalculator_t) const
G4double in_iteration_process(const G4ThreeVector &, G4double, G4ThreeVector &, int) const
virtual LArG4::LArWheelCalculator_t type() const
int GetNumberOfHalfWaves() const
G4double get_area_on_side(void) const
virtual G4double distance_to_in(G4ThreeVector &, const G4ThreeVector &, int) const
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
IMessageSvc * getMessageSvc(bool quiet=false)
G4double search_for_nearest_point(const G4ThreeVector &, const G4double, const G4ThreeVector &, int) const
AthMessaging()
Default constructor:
void get_point_on_flat_surface(G4ThreeVector &) const
void check_slice(size_t size, size_t slice) const
static const unsigned int s_IterationsLimit
double GetWheelInnerRadius(std::array< double, 2 > &rInner) const
void outer_solid_init(const G4String &, size_t slice)
void get_point_on_polycone_surface(G4ThreeVector &) const
int GetNumberOfFans() const
double GetWheelThickness() const
G4double out_iteration_process(const G4ThreeVector &, G4ThreeVector &, const int) const
void get_point_on_accordion_surface(G4ThreeVector &) const
void createSolid(const G4String &name, G4int zside, size_t slice, const EMECData *emecData)
MsgStream & msg() const
The standard message stream.
void GetWheelOuterRadius(std::array< double, 2 > &rOuter) const
double atof(std::string_view str)
Converts a string into a double / float.
G4double GetCubicVolume(void)
friend double LArWheelSliceSolid_fcn_area_on_pc(double *, double *)
static const G4double s_IterationPrecision2
G4double GetSurfaceArea(void)
G4VSolid * m_BoundingShape
double GetHalfWaveLength() const
void set_failover_point(G4ThreeVector &p, const char *m=0) const
void inner_solid_init(const G4String &, size_t slice)
double AmplitudeOfSurface(const CLHEP::Hep3Vector &P, int side, int fan_number) const
friend double LArWheelSliceSolid_fcn_side_area(double *, double *)
double DistanceToTheNearestFan(CLHEP::Hep3Vector &p, int &out_fan_number) const
Determines the nearest to the input point fan.
static const G4double s_IterationPrecision
std::string getenv(const std::string &variableName)
get an environment variable
CLHEP::Hep3Vector NearestPointOnNeutralFibre(const CLHEP::Hep3Vector &p, int fan_number) const
const LArWheelCalculator * m_Calculator
friend double LArWheelSliceSolid_fcn_area(double *, double *)
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
std::string m_nm
Message source name.
double GetFanStepOnPhi() const
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
double DistanceToTheNeutralFibre(const CLHEP::Hep3Vector &p, int fan_number) const
Calculates aproximate, probably underestimate, distance to the neutral fibre of the vertical fan.
friend double LArWheelSliceSolid_fcn_vol(double *, double *)
G4double m_FanHalfThickness
void initMessaging() const
Initialize our message level and MessageSvc.
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Scalar mag() const
mag method
G4double get_area_on_polycone(void) const
EInside Inside(const G4ThreeVector &) const
void fill_zsect(std::vector< G4double > &, G4double zMid=0.) const