ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
LArWheelSolid Class Reference

#include <LArWheelSolid.h>

Inheritance diagram for LArWheelSolid:
Collaboration diagram for LArWheelSolid:

Public Member Functions

 LArWheelSolid (const G4String &name, LArWheelSolid_t type, G4int zside=1, LArWheelCalculator *calc=0, const EMECData *emecData=0)
 
virtual ~LArWheelSolid ()
 
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
 
const G4VSolid * GetBoundingShape (void) const
 
const LArWheelCalculatorGetCalculator (void) const
 
LArWheelSolid_t GetType (void) const
 
G4ThreeVector GetPointOnSurface (void) const
 
G4double GetCubicVolume (void)
 
G4double GetSurfaceArea (void)
 
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...
 

Protected Attributes

TF1 * m_f_area
 
TF1 * m_f_vol
 
TF1 * m_f_area_on_pc
 
TF1 * m_f_length
 
TF1 * m_f_side_area
 
double m_test_index
 

Private Types

enum  FanBoundExit_t {
  NoCross, ExitAtInner, ExitAtOuter, ExitAtFront,
  ExitAtBack, ExitAtSide
}
 

Private Member Functions

void inner_solid_init (const G4String &)
 
void outer_solid_init (const G4String &)
 
void set_phi_size (void)
 
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
 
FanBoundExit_t find_exit_point (const G4ThreeVector &p, const G4ThreeVector &v, G4ThreeVector &q) const
 
G4bool fs_cross_lower (const G4ThreeVector &p, const G4ThreeVector &v, G4ThreeVector &q) const
 
G4bool fs_cross_upper (const G4ThreeVector &p, const G4ThreeVector &v, G4ThreeVector &q) const
 
G4bool check_D (G4double &b, G4double A, G4double B, G4double C, G4bool) const
 
G4int select_section (const G4double &Z) 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)
 
void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

G4bool m_IsOuter
 
const LArWheelSolid_t m_Type
 
LArWheelCalculatorm_Calculator
 
G4double m_FanHalfThickness
 
G4double m_FHTplusT
 
G4double m_FHTminusT
 
G4double m_FanPhiAmplitude
 
G4double m_MinPhi
 
G4double m_MaxPhi
 
const G4double m_PhiPosition
 
G4VSolid * m_BoundingShape
 
std::vector< G4double > m_Zsect
 
G4int m_Zsect_start_search
 
LArFanSectionsm_fs
 
G4double m_Zmid
 
G4double m_Ymin
 
G4double m_Zmin
 
G4double m_Zmax
 
G4double m_Rmin
 
G4double m_Rmax
 
G4double m_Ymid
 
std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Static Private Attributes

static const G4double s_Tolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance() / 2
 
static const G4double s_AngularTolerance = G4GeometryTolerance::GetInstance()->GetAngularTolerance() / 2
 
static const G4double s_IterationPrecision = 0.001*CLHEP::mm
 
static const G4double s_IterationPrecision2 = s_IterationPrecision * s_IterationPrecision
 
static const unsigned int s_IterationsLimit = 50
 

Friends

double LArWheelSolid_fcn_area (double *, double *)
 
double LArWheelSolid_fcn_vol (double *, double *)
 
double LArWheelSolid_fcn_area_on_pc (double *, double *)
 
double LArWheelSolid_get_dl (double *, double *, G4int)
 
double LArWheelSolid_fcn_side_area (double *, double *)
 

Detailed Description

Definition at line 90 of file LArWheelSolid.h.

Member Enumeration Documentation

◆ FanBoundExit_t

Enumerator
NoCross 
ExitAtInner 
ExitAtOuter 
ExitAtFront 
ExitAtBack 
ExitAtSide 

Definition at line 189 of file LArWheelSolid.h.

Constructor & Destructor Documentation

◆ LArWheelSolid()

LArWheelSolid::LArWheelSolid ( const G4String &  name,
LArWheelSolid_t  type,
G4int  zside = 1,
LArWheelCalculator calc = 0,
const EMECData emecData = 0 
)

Definition at line 32 of file LArWheelSolidInit.cxx.

37  : G4VSolid(name)
38 #ifndef PORTABLE_LAR_SHAPE
39  , AthMessaging("LArWheelSolid")
40 #endif
42 {
43 #ifndef PORTABLE_LAR_SHAPE
44 #ifdef LARWHEELSOLID_USE_FANBOUND
45  ATH_MSG_INFO ( "compiled with G4 FanBound" );
46 #else
47  ATH_MSG_INFO ( "compiled with private find_exit_point" );
48 #endif
49 #endif
50 
52  switch(m_Type){
53  case InnerAbsorberWheel:
54  calc_type = LArG4::InnerAbsorberWheel;
55  break;
56  case OuterAbsorberWheel:
57  calc_type = LArG4::OuterAbsorberWheel;
58  break;
59  case InnerElectrodWheel:
60  calc_type = LArG4::InnerElectrodWheel;
61  break;
62  case OuterElectrodWheel:
63  calc_type = LArG4::OuterElectrodWheel;
64  break;
66  calc_type = LArG4::InnerAbsorberModule;
67  break;
69  calc_type = LArG4::OuterAbsorberModule;
70  break;
72  calc_type = LArG4::InnerElectrodModule;
73  break;
75  calc_type = LArG4::OuterElectrodModule;
76  break;
77  case InnerGlueWheel:
78  calc_type = LArG4::InnerGlueWheel;
79  break;
80  case OuterGlueWheel:
81  calc_type = LArG4::OuterGlueWheel;
82  break;
83  case InnerLeadWheel:
84  calc_type = LArG4::InnerLeadWheel;
85  break;
86  case OuterLeadWheel:
87  calc_type = LArG4::OuterLeadWheel;
88  break;
89  case InnerAbsorberCone:
90  calc_type = LArG4::InnerAbsorberWheel;
91  break;
92  case InnerElectrodCone:
93  calc_type = LArG4::InnerElectrodWheel;
94  break;
95  case InnerGlueCone:
96  calc_type = LArG4::InnerGlueWheel;
97  break;
98  case InnerLeadCone:
99  calc_type = LArG4::InnerLeadWheel;
100  break;
102  calc_type = LArG4::OuterAbsorberWheel;
103  break;
105  calc_type = LArG4::OuterElectrodWheel;
106  break;
107  case OuterGlueFrontCone:
108  calc_type = LArG4::OuterGlueWheel;
109  break;
110  case OuterLeadFrontCone:
111  calc_type = LArG4::OuterLeadWheel;
112  break;
114  calc_type = LArG4::OuterAbsorberWheel;
115  break;
117  calc_type = LArG4::OuterElectrodWheel;
118  break;
119  case OuterGlueBackCone:
120  calc_type = LArG4::OuterGlueWheel;
121  break;
122  case OuterLeadBackCone:
123  calc_type = LArG4::OuterLeadWheel;
124  break;
125  default:
126  G4Exception("LArWheelSolid", "UnknownSolidType", FatalException,
127  "Constructor: unknown LArWheelSolid_t");
128  }
129 
130  if(m_Calculator == 0) m_Calculator = new LArWheelCalculator(*emecData,calc_type, zside);
131 
132  const G4String bs_name = name + "-Bounding";
133 #ifdef DEBUG_LARWHEELSOLID
134  const char *venv = getenv("LARWHEELSOLID_VERBOSE");
135  if(venv) Verbose = atoi(venv);
136  std::cout << "The LArWheelSolid build " << __DATE__ << " " << __TIME__
137  << std::endl;
138  std::cout << "LArWheelSolid verbosity level is " << Verbose << std::endl;
139 #endif
140 
141  // Initialize code that depends on wheel type:
145  switch(m_Type){
146  case InnerAbsorberWheel:
147  case InnerElectrodWheel:
148  case InnerAbsorberModule:
149  case InnerElectrodModule:
150  case InnerGlueWheel:
151  case InnerLeadWheel:
152  case InnerAbsorberCone:
153  case InnerElectrodCone:
154  case InnerGlueCone:
155  case InnerLeadCone:
156  inner_solid_init(bs_name);
157  break;
158  case OuterAbsorberWheel:
159  case OuterElectrodWheel:
160  case OuterAbsorberModule:
161  case OuterElectrodModule:
162  case OuterGlueWheel:
163  case OuterLeadWheel:
166  case OuterGlueFrontCone:
167  case OuterLeadFrontCone:
170  case OuterGlueBackCone:
171  case OuterLeadBackCone:
172  outer_solid_init(bs_name);
173  break;
174  default:
175  G4Exception("LArWheelSolid", "UnknownSolidType", FatalException,
176  "Constructor: unknown LArWheelSolid_t");
177  }
178 
179  m_Zsect_start_search = (m_Zsect.size() - 1) - 1;
180 #ifndef PORTABLE_LAR_SHAPE
181  init_tests();
182  test(); // activated by env. variable
183  clean_tests();
184 #endif
185 
186 #ifdef DEBUG_LARWHEELSOLID
187  m_fs->print();
188  std::cout << "Limits: (" << m_Zsect.size() << ")" << std::endl;
189  for(size_t i = 0; i < m_Zsect.size(); ++ i){
190  std::cout << i << " " << m_Zsect[i] << std::endl;
191  }
192 #endif
193 #ifndef PORTABLE_LAR_SHAPE
194  ATH_MSG_DEBUG ( "solid of type "
196  << " initialized" );
197 #endif
198 }

◆ ~LArWheelSolid()

LArWheelSolid::~LArWheelSolid ( )
virtual

Definition at line 200 of file LArWheelSolidInit.cxx.

201 {
202  if(m_fs) delete m_fs;
203 }

Member Function Documentation

◆ CalculateExtent()

G4bool LArWheelSolid::CalculateExtent ( const EAxis  a,
const G4VoxelLimits &  vl,
const G4AffineTransform &  t,
G4double &  p,
G4double &  q 
) const

Definition at line 58 of file LArWheelSolid.cxx.

61 {
62  return m_BoundingShape->CalculateExtent(a, vl, t, p, q);
63 }

◆ check_D()

G4bool LArWheelSolid::check_D ( G4double &  b,
G4double  A,
G4double  B,
G4double  C,
G4bool  out 
) const
private

Definition at line 41 of file LArFanSection.cxx.

44 {
45  // G4bool out is to be set true if the point is surface-outside
46  // then have to discard first intersection
47 
48  const G4double D = B*B - A*C;
49  LWSDBG(8, std::cout << "check D=" << D << " out=" << out << std::endl);
50  if(D < 0.) return false;
51  G4double t2 = 0.;
52  if(A == 0) {
53  if(B == 0) {
54  LWSDBG(8, std::cout << "Case A=B=0" << std::endl);
55  return false;
56  }
57  t1= -C / (2 * B);
58  LWSDBG(8, std::cout << "t1=" << t1 << " - only one solution" << std::endl);
59  t2 = t1;
60  } else {
61  const G4double D1 = sqrt(D);
62  const G4double inv_A = 1.0 / A;
63  t1 = (-B + D1) * inv_A;
64  t2 = (-B - D1) * inv_A;
65  LWSDBG(8, std::cout << "t1=" << t1 << " t2=" << t2 << std::endl);
66  }
67 
68  if(t1 > 0.){
69  if(t2 > 0.){
70  if(out){
71  if(t2 > t1) t1 = t2;
72  } else {
73  if(t2 < t1) t1 = t2;
74  }
75  } else if(t2 < 0.){
76  if(out) return false;
77  } else { // answer is t1
78  }
79  } else if(t1 < 0.){
80  if(t2 > 0.){
81  if(out) return false;
82  t1 = t2;
83  } else if(t2 < 0.){
84  return false;
85  } else {
86  return false;
87  }
88  } else {
89  if(t2 > 0.){
90  t1 = t2;
91  } else if(t2 < 0.){
92  return false;
93  } else {
94  return false;
95  }
96  }
97  return true;
98 }

◆ clean_tests()

void LArWheelSolid::clean_tests ( void  )
private

Definition at line 486 of file LArWheelSolidTests.cxx.

486  {
487  if(m_f_area) {
488  delete m_f_area;
489  m_f_area = 0;
490  }
491  if(m_f_vol) {
492  delete m_f_vol;
493  m_f_vol = 0;
494  }
495 
496  if(m_f_area_on_pc) {
497  delete m_f_area_on_pc;
498  m_f_area_on_pc = 0;
499  }
500 
501  if(m_f_length) {
502  delete m_f_length;
503  m_f_length = 0;
504  }
505  if(m_f_side_area) {
506  delete m_f_side_area;
507  m_f_side_area = 0;
508  }
509 }

◆ CreatePolyhedron()

G4Polyhedron * LArWheelSolid::CreatePolyhedron ( ) const

Definition at line 156 of file LArWheelSolid.cxx.

157 {
158  return m_BoundingShape->CreatePolyhedron();
159 }

◆ DescribeYourselfTo()

void LArWheelSolid::DescribeYourselfTo ( G4VGraphicsScene &  scene) const

Definition at line 146 of file LArWheelSolid.cxx.

147 {
148  scene.AddSolid(*this);
149 }

◆ distance_to_in()

G4double LArWheelSolid::distance_to_in ( G4ThreeVector &  p,
const G4ThreeVector &  v,
int  p_fan 
) const
privatevirtual

Definition at line 216 of file LArWheelSolidDisToIn.cxx.

217 {
218  LWSDBG(4, std::cout << "dti: " << MSG_VECTOR(p) << " "
219  << MSG_VECTOR(v) << std::endl);
220 
221  G4double distance = 0.;
222 #ifdef LARWHEELSOLID_USE_FANBOUND
223  if(FanBound->Inside(p) == kOutside) {
224  const G4double d = FanBound->DistanceToIn(p, v);
225  p += v * d;
226  distance += d;
227  }
228 #else
229  if(p.x() > m_fs->xmax) {
230  if(v.x() >= 0.) return kInfinity;
231  const G4double b = (m_fs->xmax - p.x()) / v.x();
232  const G4double y2 = p.y() + v.y() * b;
233  const G4double z2 = p.z() + v.z() * b;
234  p.set(m_fs->xmax, y2, z2);
235  distance += b;
236  } else if(p.x() < m_fs->xmin) {
237  if(v.x() <= 0.) return kInfinity;
238  const G4double b = (m_fs->xmin - p.x()) / v.x();
239  const G4double y2 = p.y() + v.y() * b;
240  const G4double z2 = p.z() + v.z() * b;
241  p.set(m_fs->xmin, y2, z2);
242  distance += b;
243  }
244 #endif
245 
246 // here p is on surface of or inside the "FanBound",
247 // distance corrected, misses are accounted for
248  LWSDBG(5, std::cout << "dti corrected: " << MSG_VECTOR(p) << std::endl);
249 
250  G4double dist_p = GetCalculator()->DistanceToTheNeutralFibre(p, p_fan);
251  if(fabs(dist_p) < m_FHTminusT) {
252  LWSDBG(5, std::cout << "hit fan dist_p=" << dist_p << ", m_FHTminusT=" << m_FHTminusT << std::endl);
253  return distance;
254  }
255 
256 #ifdef CHECK_DIRTONORM_ANGLE_ON_SURFACE
257  if(fabs(dist_p) > m_FHTplusT) {
258  LWSDBG(5, std::cout << "outside fan dist_p=" << dist_p << ", m_FHTplusT=" << m_FHTplusT << std::endl);
259  } else {
260  LWSDBG(5, std::cout << "on fan surface dist_p=" << dist_p << ", m_FHTplusT=" << m_FHTplusT << ", m_FHTminusT=" << m_FHTminusT << std::endl);
261 
262  const G4ThreeVector d = GetCalculator()->NearestPointOnNeutralFibre(p, p_fan);
263  // check dot product between normal and v
264  if ( (p-d).cosTheta(v) < -AngularTolerance ) {
265  // direction "v" definitely pointing inside
266  // return 0.0, it should be in "distance"
267  return distance;
268  }
269  }
270 #endif
271 
272  G4ThreeVector q;
273 #ifdef LARWHEELSOLID_USE_FANBOUND
274  q = p + v * FanBound->DistanceToOut(p, v);
275 #else
276  find_exit_point(p, v, q);
277 #endif
278 
279  G4int start = select_section(p.z());
280  G4int stop = select_section(q.z());
281  G4int step = -1;
282  if(stop > start) { step = 1; start ++; stop ++; }
283  LWSDBG(5, std::cout << "dti sections " << start << " " << stop
284  << " " << step << std::endl);
285  G4ThreeVector p1;
286  for(G4int i = start; i != stop; i += step){
287 // v.z() can't be 0, otherwise start == stop, so the exit point could be only
288 // at z border of the fan section
289  const G4double d1 = (m_Zsect[i] - p.z()) / v.z();
290  const G4double x1 = p.x() + v.x() * d1, y1 = p.y() + v.y() * d1;
291  p1.set(x1, y1, m_Zsect[i]);
292  G4double dist_p1 = GetCalculator()->DistanceToTheNeutralFibre(p1, p_fan);
293  LWSDBG(5, std::cout << i << ">" << p << " " << dist_p << " "
294  << p1 << " " << dist_p1 << std::endl);
295  G4double dd = kInfinity;
296  if(dist_p * dist_p1 < 0.){// it certanly cross current half-wave
297  dd = in_iteration_process(p, dist_p, p1, p_fan);
298  }
299  G4double d2 = search_for_nearest_point(p, dist_p, p1, p_fan);
300  LWSDBG(6, std::cout << i << "> dd=" << dd << ", d2=" << d2 << ", distance=" << distance << std::endl);
301  if(d2 < kInfinity){
302  return distance + d2; // this half-wave is intersected
303  } else if(dd < kInfinity){
304  return distance + dd;
305  }
306  distance += d1;
307  p.set(x1, y1, m_Zsect[i]);
308  dist_p = dist_p1;
309  }
310 
311  G4double dist_q = GetCalculator()->DistanceToTheNeutralFibre(q, p_fan);
312  LWSDBG(5, std::cout << "dti exit point: " << MSG_VECTOR(q) << " "
313  << dist_q << std::endl);
314  G4double dd = kInfinity;
315  if(dist_p * dist_q < 0.){// it certanly cross current half-wave
316  dd = in_iteration_process(p, dist_p, q, p_fan);
317  }
318  G4double d2 = search_for_nearest_point(p, dist_p, q, p_fan);
319  if(d2 < kInfinity){
320  return distance + d2; // this half-wave is intersected
321  } else if(dd < kInfinity){
322  return distance + dd;
323  }
324  return kInfinity;
325 }

◆ DistanceToIn() [1/2]

G4double LArWheelSolid::DistanceToIn ( const G4ThreeVector &  inputP) const

Definition at line 17 of file LArWheelSolidDisToIn.cxx.

18 {
19  LWSDBG(1, std::cout << TypeStr() << " DisToIn" << MSG_VECTOR(inputP) << std::endl);
20  if(m_BoundingShape->Inside(inputP) == kOutside) {
21  // here is an approximation - for the point outside m_BoundingShape
22  // the solid looks like a m_BoundingShape
23  // it's okay since the result could be underestimated
24  LWSDBG(2, std::cout << "Outside BS" << std::endl);
25  return m_BoundingShape->DistanceToIn(inputP);
26  }
27  G4ThreeVector p(inputP);
28 
29  //
30  // DistanceToTheNearestFan:
31  // rotates point p to the localFan coordinates and returns fan number to out_fan_number parameter
32  // returns distance to fan as result
33  //
34 
35  int p_fan = 0;
36  const G4double d = fabs(GetCalculator()->DistanceToTheNearestFan(p, p_fan));
37  if(d > m_FHTplusT){
38  const G4double result = d - m_FanHalfThickness;
39  LWSDBG(2, std::cout << "dti result = " << result << std::endl);
40  return result;
41  }
42  LWSDBG(2, std::cout << "already inside, return 0" << MSG_VECTOR(p) << std::endl);
43  return 0.;
44 }

◆ DistanceToIn() [2/2]

G4double LArWheelSolid::DistanceToIn ( const G4ThreeVector &  inputP,
const G4ThreeVector &  inputV 
) const

Definition at line 46 of file LArWheelSolidDisToIn.cxx.

48 {
49  LWSDBG(1, std::cout << TypeStr() << " DisToIn" << MSG_VECTOR(inputP)
50  << MSG_VECTOR(inputV) << std::endl);
51 
52  G4double distance = 0.;
53  const EInside inside_BS = m_BoundingShape->Inside(inputP);
54  G4ThreeVector p(inputP);
55  if(inside_BS == kOutside) {
56  distance = m_BoundingShape->DistanceToIn(inputP, inputV);
57  if(distance == kInfinity) {
58  LWSDBG(2, std::cout << "Infinity distance to m_BoundingShape" << MSG_VECTOR(inputP) << MSG_VECTOR(inputV) << std::endl);
59  return kInfinity;
60  }
61  p += inputV * distance;
62  assert(m_BoundingShape->Inside(p) != kOutside);
63  LWSDBG(2, std::cout << "shift" << MSG_VECTOR(inputP) << std::endl);
64  }
65 
66  const G4double phi0 = p.phi();
67  int p_fan = 0;
68  const G4double d = GetCalculator()->DistanceToTheNearestFan(p, p_fan);
69  if(fabs(d) < m_FHTminusT){
70  LWSDBG(2, std::cout << "already inside fan" << MSG_VECTOR(p) << std::endl);
71  // if initial point is on BS surface and inside fan volume it is a real surface
72  if(inside_BS == kSurface) {
73  LWSDBG(2, std::cout << "On BS surface" << std::endl);
74  return m_BoundingShape->DistanceToIn(inputP, inputV);
75  }
76  return distance;
77  }
78  G4ThreeVector v(inputV);
79  v.rotateZ(p.phi() - phi0);
80 
81  const G4double d0 = distance_to_in(p, v, p_fan);
82  distance += d0;
83 
84 #ifdef DEBUG_LARWHEELSOLID
85  if(Verbose > 2){
86  if(Verbose > 3){
87  std::cout << MSG_VECTOR(inputP)
88  << " " << MSG_VECTOR(inputV) << std::endl;
89  }
90  std::cout << "dti: " << d0 << ", DTI: " << distance << std::endl;
91  }
92  if(Verbose > 3){
93  if(d0 < kInfinity){
94  G4ThreeVector p2 = inputP + inputV*distance;
95  EInside i = Inside(p2);
96  std::cout << "DTI hit at dist. " << distance << ", point "
97  << MSG_VECTOR(p2) << ", "
98  << inside(i) << std::endl;
99  } else {
100  std::cout << "got infinity from dti" << std::endl;
101  }
102  }
103 #ifdef LWS_HARD_TEST_DTI
104  if(test_dti(inputP, inputV, distance)){
105  if(Verbose == 1){
106  std::cout << TypeStr() << " DisToIn" << MSG_VECTOR(inputP)
107  << MSG_VECTOR(inputV) << std::endl;
108  }
109  }
110  if(Verbose == 1){
111  std::cout << TypeStr() << " DisToIn" << MSG_VECTOR(inputP)
112  << MSG_VECTOR(inputV) << " " << distance << std::endl;
113  }
114 #endif // ifdef LWS_HARD_TEST_DTI
115 
116 #endif // ifdef DEBUG_LARWHEELSOLID
117 
118  return distance;
119 }

◆ DistanceToOut() [1/2]

G4double LArWheelSolid::DistanceToOut ( const G4ThreeVector &  inputP) const

Definition at line 11 of file LArWheelSolidDisToOut.cxx.

12 {
13  LWSDBG(1, std::cout << TypeStr() << " DisToOut" << MSG_VECTOR(inputP) << std::endl);
14  if(m_BoundingShape->Inside(inputP) != kInside){
15  LWSDBG(2, std::cout << "DistanceToOut(p):"
16  << " point " << MSG_VECTOR(inputP)
17  << " is not inside of the m_BoundingShape."
18  << std::endl);
19  return 0.;
20  }
21  G4ThreeVector p( inputP );
22  int p_fan = 0;
23  const G4double d = m_FanHalfThickness - fabs(GetCalculator()->DistanceToTheNearestFan(p, p_fan));
24  if(d < s_Tolerance){
25  LWSDBG(2, std::cout << "already not inside " << MSG_VECTOR(p) << std::endl);
26  return 0.;
27  }
28  const G4double d0 = m_BoundingShape->DistanceToOut(inputP);
29  LWSDBG(2, std::cout << "dto " << d << " " << d0 << std::endl);
30  if(d > d0) return d0;
31  else return d;
32 }

◆ DistanceToOut() [2/2]

G4double LArWheelSolid::DistanceToOut ( const G4ThreeVector &  inputP,
const G4ThreeVector &  inputV,
const G4bool  calcNorm = false,
G4bool *  validNorm = 0,
G4ThreeVector *  n = 0 
) const

Definition at line 34 of file LArWheelSolidDisToOut.cxx.

39 {
40  LWSDBG(1, std::cout << TypeStr() << " DisToOut" << MSG_VECTOR(inputP)
41  << MSG_VECTOR(inputV) << std::endl);
42 
43  const EInside inside_BS = m_BoundingShape->Inside(inputP);
44  if(inside_BS == kOutside){
45  LWSDBG(2, std::cout << "DistanceToOut(p):"
46  << " point " << MSG_VECTOR(inputP)
47  << " is outside of m_BoundingShape." << std::endl);
48  if(calcNorm) *validNorm = false;
49  return 0.;
50  }
51 
52  // If here inside or on surface of BS
53  G4ThreeVector p(inputP);
54  int p_fan = 0;
55  const G4double adtnf_p = fabs(GetCalculator()->DistanceToTheNearestFan(p, p_fan));
56  if(adtnf_p >= m_FHTplusT) {
57  LWSDBG(2, std::cout << "DistanceToOut(p, v): point "
58  << MSG_VECTOR(inputP)
59  << " is outside of solid." << std::endl);
60  if(calcNorm) *validNorm = false;
61  return 0.;
62  }
63 
64  G4ThreeVector v(inputV);
65  const G4double phi0 = p.phi() - inputP.phi();
66  v.rotateZ(phi0);
67 
68 #ifdef CHECK_DIRTONORM_ANGLE_ON_SURFACE
69  if(adtnf_p < FHTminusT) {
70  LWSDBG(5, std::cout << "inside fan point " << MSG_VECTOR(inputP) << ", FHTminusT=" << FHTminusT << std::endl);
71  } else {
72  LWSDBG(5, std::cout << "on fan surface adtnf_p=" << adtnf_p << ", m_FHTplusT=" << m_FHTplusT << ", FHTminusT=" << FHTminusT << std::endl);
73 
74  const G4ThreeVector d = GetCalculator()->NearestPointOnNeutralFibre(p, p_fan);
75  // check dot product between normal and v
76  if ( (p-d).cosTheta(v) > AngularTolerance ) {
77  // direction "v" definitely pointing outside
78  // return 0.0
79  return 0.;
80  }
81  }
82 #endif
83 
84 // former distance_to_out starts here
85  LWSDBG(4, std::cout << "dto: " << MSG_VECTOR(p) << " "
86  << MSG_VECTOR(v) << std::endl);
87 
88  G4ThreeVector q(p);
89 #ifdef LARWHEELSOLID_USE_BS_DTO
90  const G4double dto_bs = m_BoundingShape->DistanceToOut(
91  inputP, inputV, calcNorm, validNorm, sn
92  );
93  q = p + v * dto_bs;
94  if(q.y() < m_Ymin){
95  LWSDBG(5, std::cout << "dto exit point too low " << MSG_VECTOR(q) << std::endl);
96  const G4double dy = (m_Ymin - p.y()) / v.y();
97  q.setX(p.x() + v.x() * dy);
98  q.setY(m_Ymin);
99  q.setZ(p.z() + v.z() * dy);
100  }
101 #else
103  LWSDBG(5, std::cout << "dto exit " << exit << std::endl);
104 #endif
105  LWSDBG(5, std::cout << "dto exit point " << MSG_VECTOR(q) << std::endl);
106 
107  G4double distance = 0.;
108  G4int start = select_section(p.z());
109  G4int stop = select_section(q.z());
110  G4int step = -1;
111  if(stop > start){ step = 1; start ++; stop ++; }
112  LWSDBG(5, std::cout << "dto sections " << start << " " << stop << " " << step << std::endl);
113 
114  G4double tmp;
115  G4ThreeVector p1, C;
116 
117  for(G4int i = start; i != stop; i += step){
118  const G4double d1 = (m_Zsect[i] - p.z()) / v.z();
119 // v.z() can't be 0, otherwise start == stop, so the exit point could be only
120 // at z border of the fan section
121  LWSDBG(5, std::cout << "at " << i << " dist to zsec = " << d1 << std::endl);
122  const G4double x1 = p.x() + v.x() * d1, y1 = p.y() + v.y() * d1;
123  p1.set(x1, y1, m_Zsect[i]);
124  const G4double dd = fabs(GetCalculator()->DistanceToTheNeutralFibre(p1, p_fan));
125  if(dd > m_FHTplusT){
126  tmp = out_iteration_process(p, p1, p_fan);
127  //while(search_for_most_remoted_point(p, out_section, C)){
128  if(search_for_most_remoted_point(p, p1, C, p_fan)){
129  tmp = out_iteration_process(p, C, p_fan);
130  }
131  distance += tmp;
132 #ifndef LARWHEELSOLID_USE_BS_DTO
133  exit = NoCross;
134 #endif
135  goto end_dto;
136  }
137  if(search_for_most_remoted_point(p, p1, C, p_fan)){
138  distance += out_iteration_process(p, C, p_fan);
139 #ifndef LARWHEELSOLID_USE_BS_DTO
140  exit = NoCross;
141 #endif
142  goto end_dto;
143  }
144  distance += d1;
145  p.set(x1, y1, m_Zsect[i]);
146  }
147 
148  if(fabs(GetCalculator()->DistanceToTheNeutralFibre(q, p_fan)) > m_FHTplusT){
149  LWSDBG(5, std::cout << "q=" << MSG_VECTOR(q) << " outside fan cur distance=" << distance << ", m_FHTplusT=" << m_FHTplusT << std::endl);
150  tmp = out_iteration_process(p, q, p_fan);
151 #ifndef LARWHEELSOLID_USE_BS_DTO
152  exit = NoCross;
153 #endif
154  } else {
155  tmp = (q - p).mag();
156  }
157  //while(search_for_most_remoted_point(out, out1, C, p_fan)){
158  if(search_for_most_remoted_point(p, q, C, p_fan)){
159  tmp = out_iteration_process(p, C, p_fan);
160 #ifndef LARWHEELSOLID_USE_BS_DTO
161  exit = NoCross;
162 #endif
163  }
164  distance += tmp;
165 // former distance_to_out ends here
166  end_dto:
167  LWSDBG(5, std::cout << "At end_dto distance=" << distance << std::endl);
168 #ifdef LARWHEELSOLID_USE_BS_DTO
169  if(calcNorm && distance < dto_bs) *validNorm = false;
170 #else
171  if(calcNorm){
172  LWSDBG(5, std::cout << "dto calc norm " << exit << std::endl);
173  switch(exit){
174  case ExitAtBack:
175  sn->set(0., 0., 1.);
176  *validNorm = true;
177  break;
178  case ExitAtFront:
179  sn->set(0., 0., -1.);
180  *validNorm = true;
181  break;
182  case ExitAtOuter:
183  q.rotateZ(-phi0);
184  sn->set(q.x(), q.y(), 0.);
185  if(q.z() <= m_Zmid) sn->setZ(- q.perp() * m_fs->Amax);
186  sn->setMag(1.0);
187  *validNorm = true;
188  break;
189  default:
190  *validNorm = false;
191  break;
192  }
193  }
194 #endif
195 
196 #ifdef DEBUG_LARWHEELSOLID
197  if(Verbose > 2){
198  std::cout << "DTO: " << distance << " ";
199  if (*validNorm) {
200  std::cout << *validNorm << " " << MSG_VECTOR((*sn));
201  } else {
202  std::cout << "Norm is not valid";
203  }
204  std::cout << std::endl;
205  if(Verbose > 3){
206  G4ThreeVector p2 = inputP + inputV * distance;
207  EInside i = Inside(p2);
208  std::cout << "DTO hit at " << MSG_VECTOR(p2) << ", "
209  << inside(i) << std::endl;
210  }
211  }
212 #ifdef LWS_HARD_TEST_DTO
213  if(test_dto(inputP, inputV, distance)){
214  if(Verbose == 1){
215  std::cout << TypeStr() << " DisToOut" << MSG_VECTOR(inputP)
216  << MSG_VECTOR(inputV) << std::endl;
217  }
218  }
219 #endif
220 #endif
221  return distance;
222 }

◆ find_exit_point()

LArWheelSolid::FanBoundExit_t LArWheelSolid::find_exit_point ( const G4ThreeVector &  p,
const G4ThreeVector &  v,
G4ThreeVector &  q 
) const
private

Definition at line 216 of file LArFanSection.cxx.

219 {
220  LWSDBG(6, std::cout << "in fep p" << MSG_VECTOR(p)<< ", v"<< MSG_VECTOR(v) << ", q" << MSG_VECTOR(q) << std::endl);
221 
222 /* by construction, cannot have true from both upper and lower */
223 /* the only problem is the points on surface but "slightly outside" */
224 /* fs_cross_* account for (x, z) range */
225 // lower has to be checked first, since outer might find more distant
226 // intersection in the acceptable (x, z) range
227  if(fs_cross_lower(p, v, q)) return ExitAtInner;
228  LWSDBG(6, std::cout << "after fs_cross_lower q" << MSG_VECTOR(q) << std::endl);
229  if(fs_cross_upper(p, v, q)) return ExitAtOuter;
230  LWSDBG(6, std::cout << "after fs_cross_upper q" << MSG_VECTOR(q) << std::endl);
231 
233  G4double d;
234  if(v.x() > 0.) d = (m_fs->xmax - p.x()) / v.x();
235  else if(v.x() < 0.) d = (m_fs->xmin - p.x()) / v.x();
236  else d = kInfinity;
237 
238  G4double dz;
239  FanBoundExit_t resultz = NoCross;
240  if(v.z() > 0.){
241  dz = (m_Zsect.back() - p.z()) / v.z();
242  resultz = ExitAtBack;
243  } else if(v.z() < 0.){
244  dz = (m_Zsect.front() - p.z()) / v.z();
245  resultz = ExitAtFront;
246  } else {
247  dz = kInfinity;
248  }
249  if(d > dz){
250  d = dz;
251  result = resultz;
252  }
253  q = p + v * d;
254  LWSDBG(7, std::cout << "fep side " << d << " " << result << " q" << MSG_VECTOR(q) << std::endl);
255  const G4double out_distlower = m_fs->Amin*q.z() + m_fs->Bmin - q.perp(); // > 0 - below lower cone
256  LWSDBG(7, std::cout << "fep out_distlower(q)=" << out_distlower << " Tolerance=" << s_Tolerance << std::endl);
257  if (out_distlower >= 0.0) {
258  // side intersection point is below lower cone
259  // initial point p was at exit boundary
260  q = p;
261  return NoCross;
262  }
263 
264  if (m_IsOuter && q.z() >= m_Zmid && q.z() <= m_Zsect.back()+s_Tolerance && q.perp2() >= m_fs->Cflat2) {
265  // outside of upper cylinder
266  q = p;
267  return NoCross;
268  }
269  const G4double out_distupper = m_fs->Amax*q.z() + m_fs->Bmax - q.perp(); // < 0 - above upper cone
270  LWSDBG(7, std::cout << "fep out_distupper(q)=" << out_distupper << " Tolerance=" << s_Tolerance << std::endl);
271  if (out_distupper <= 0.0) {
272  // side intersection point is above upper cone
273  // initial point p was at exit boundary
274  q = p;
275  return NoCross;
276  }
277  assert((q - p).mag() < kInfinity);
278  return result;
279 }

◆ fs_cross_lower()

bool LArWheelSolid::fs_cross_lower ( const G4ThreeVector &  p,
const G4ThreeVector &  v,
G4ThreeVector &  q 
) const
private

Definition at line 103 of file LArFanSection.cxx.

106 {
107  LWSDBG(7, std::cout << "fcl" << std::endl);
108  const G4double A = v.perp2() - m_fs->Amin2*v.z()*v.z();
109  const G4double B = p.x()*v.x() + p.y()*v.y()
110  - m_fs->Amin2*p.z()*v.z() - m_fs->ABmin*v.z();
111  const G4double C = p.perp2() - m_fs->Amin2*p.z()*p.z()
112  - 2.*m_fs->ABmin*p.z() - m_fs->Bmin2;
113 
114  G4double t1(0.0);
115  const G4double out_dist = m_fs->Amin*p.z() + m_fs->Bmin - p.perp();
116  LWSDBG(8, std::cout << "fcl out_dist(p)=" << out_dist << " Tolerance=" << s_Tolerance << std::endl);
117  const G4bool out = out_dist >= 0.0;
118  if(check_D(t1, A, B, C, out)){
119  const G4double zz1 = p.z() + v.z() * t1;
120  if(zz1 < m_Zsect.front() || zz1 > m_Zsect.back()){
121  LWSDBG(8, std::cout << "fcl out on Z " << zz1 << std::endl);
122  return false;
123  }
124  const G4double xx1 = p.x() + v.x() * t1;
125  if(xx1 < m_fs->xmin || xx1 > m_fs->xmax){
126  LWSDBG(8, std::cout << "fcl out on X " << xx1 << std::endl);
127  return false;
128  }
129  if(out_dist == 0.){ // entry point is exactly on the cone
130  // here we got t1 > 0 from check_D, founded point seems to be in x and z ranges
131  // if the track leaves the surface, then the entry is the intersection,
132  // and the distance is 0
133  // if the track is on the surface, then there is no lower cone intersection
134 
135  // estimate deviation of the track from the surface
136  // (exact calculations are too complicated)
137  const G4double xx2 = p.x() + v.x() * t1 * 0.5;
138  const G4double yy2 = p.y() + v.y() * t1 * 0.5;
139  const G4double dev = fabs(sqrt(xx2 *xx2 + yy2*yy2)
140  - m_fs->Amin*(p.z() + zz1)*0.5
141  - m_fs->Bmin);
142  if(dev < s_Tolerance){
143  LWSDBG(8, std::cout << "fcl on the surface" << std::endl);
144  return false;
145  } else {
146  LWSDBG(8, std::cout << "fcl out = in" << std::endl);
147  q = p;
148  return true;
149  }
150  }
151  q.setX(xx1);
152  q.setY(p.y() + v.y() * t1);
153  q.setZ(zz1);
154  LWSDBG(8, std::cout << "fcl got " << t1 << std::endl);
155  return true;
156  }
157  LWSDBG(8, std::cout << "fcl no intersection" << std::endl);
158  return false;
159 }

◆ fs_cross_upper()

bool LArWheelSolid::fs_cross_upper ( const G4ThreeVector &  p,
const G4ThreeVector &  v,
G4ThreeVector &  q 
) const
private

Definition at line 165 of file LArFanSection.cxx.

168 {
169  LWSDBG(7, std::cout << "fcu" << std::endl);
170  G4double A = v.perp2();
171  G4double B = p.x()*v.x() + p.y()*v.y();
172  G4double C = p.perp2();
173 
174  if(m_IsOuter){
175  const G4double &Af = A, &Bf = B;
176  const G4double Cf = C - m_fs->Cflat2;
177 
178  G4double b1;
179  if(check_D(b1, Af, Bf, Cf, Cf >= 0.)){
180  const G4double zz1 = p.z() + v.z() * b1;
181  if(zz1 >= m_Zmid && zz1 <= m_Zsect.back()){
182  const G4double xx1 = p.x() + v.x() * b1;
183  if(xx1 < m_fs->xmin || xx1 > m_fs->xmax) return false;
184  q.setX(xx1);
185  q.setY(p.y() + v.y() * b1);
186  q.setZ(zz1);
187  return true;
188  }
189  }
190  LWSDBG(8, std::cout << "fcu no cyl intersection" << std::endl);
191  }
192 
193  A -= m_fs->Amax2*v.z()*v.z();
194  B -= m_fs->Amax2*p.z()*v.z() + m_fs->ABmax*v.z();
195  C -= m_fs->Amax2*p.z()*p.z() + 2.*m_fs->ABmax*p.z() + m_fs->Bmax2;
196 
197  G4double t1;
198  const G4bool out = m_fs->Amax*p.z() + m_fs->Bmax <= p.perp();
199  if(check_D(t1, A, B, C, out)){
200  const G4double zz1 = p.z() + v.z() * t1;
201  LWSDBG(8, std::cout << "fcu z = " << zz1 << ", lim: (" << m_Zsect.front() << ", " << m_Zmid << ")" << std::endl);
202  if(zz1 < m_Zsect.front() || zz1 > m_Zmid) return false;
203  const G4double xx1 = p.x() + v.x() * t1;
204  LWSDBG(8, std::cout << "fcu x = " << xx1 << ", lim: (" << m_fs->xmin << ", " << m_fs->xmax << ")" << std::endl);
205  if(xx1 < m_fs->xmin || xx1 > m_fs->xmax) return false;
206  q.setX(xx1);
207  q.setY(p.y() + v.y() * t1);
208  q.setZ(zz1);
209  return true;
210  }
211  LWSDBG(8, std::cout << "fcu no cone intersection" << std::endl);
212  return false;
213 }

◆ get_area_at_r()

G4double LArWheelSolid::get_area_at_r ( G4double  r) const
private

Definition at line 511 of file LArWheelSolidTests.cxx.

512 {
513  m_f_area->SetParameter(0, r);
514 
515  double zmin = m_BoundingShape->DistanceToIn(
516  G4ThreeVector(0., r, m_Zmin), G4ThreeVector(0., 0., 1.)
517  );
518  double zmax = m_BoundingShape->DistanceToIn(
519  G4ThreeVector(0., r, m_Zmax), G4ThreeVector(0., 0., -1.)
520  );
521  zmax = m_Zmax - zmax;
522 
523  double result = m_f_area->Integral(zmin, zmax);
524 
525  return result;
526 }

◆ get_area_on_face()

G4double LArWheelSolid::get_area_on_face ( void  ) const
private

Definition at line 333 of file LArWheelSolidTests.cxx.

334 {
335  G4double result = 0.;
336  G4double rmin, rmax;
337  get_r(m_BoundingShape, m_Zmin, rmin, rmax);
338  result += rmax - rmin;
339  get_r(m_BoundingShape, m_Zmax, rmin, rmax);
340  result += rmax - rmin;
342  return result;
343 }

◆ get_area_on_polycone()

G4double LArWheelSolid::get_area_on_polycone ( void  ) const
private

Definition at line 328 of file LArWheelSolidTests.cxx.

329 {
330  return m_f_area_on_pc->Integral(m_Zmin, m_Zmax);
331 }

◆ get_area_on_side()

G4double LArWheelSolid::get_area_on_side ( void  ) const
private

Definition at line 361 of file LArWheelSolidTests.cxx.

362 {
363  return m_f_side_area->Integral(m_Rmin, m_Rmax, IntPrecision);
364 }

◆ get_length_at_r()

G4double LArWheelSolid::get_length_at_r ( G4double  r) const
private

Definition at line 345 of file LArWheelSolidTests.cxx.

346 {
347  m_f_length->SetParameter(0, r);
348 
349  double zmin = m_BoundingShape->DistanceToIn(
350  G4ThreeVector(0., r, -m_Zmin), G4ThreeVector(0., 0., 1.)
351  );
352  zmin -= m_Zmin * 2.;
353  double zmax = m_BoundingShape->DistanceToIn(
354  G4ThreeVector(0., r, m_Zmax), G4ThreeVector(0., 0., -1.)
355  );
356  zmax = m_Zmax - zmax;
357  double result = m_f_length->Integral(zmin, zmax);
358  return result;
359 }

◆ get_point_on_accordion_surface()

void LArWheelSolid::get_point_on_accordion_surface ( G4ThreeVector &  p) const
private

Definition at line 99 of file LArWheelSolidTests.cxx.

100 {
101  p[0] = 0.;
102  p[1] = 0.;
103  p[2] = rnd->Uniform(m_Zmin, m_Zmax);
104 
105  G4double rmin, rmax;
106  get_r(m_BoundingShape, p[2], rmin, rmax);
107 
108  p[1] = rnd->Uniform(rmin, rmax);
109  p.setPhi(rnd->Uniform(m_MinPhi, m_MaxPhi));
110  G4double dphi = p.phi();
111  int p_fan = 0;
112  G4double d = GetCalculator()->DistanceToTheNearestFan(p, p_fan);
113  dphi -= p.phi();
114 
115  G4int side = 0;
116  if(d < 0.) side = -1;
117  if(d >= 0.) side = 1;
118 
119  G4double a = GetCalculator()->AmplitudeOfSurface(p, side, p_fan);
120  p[0] = a;
121 
122  p.rotateZ(dphi);
123 
124  if(m_BoundingShape->Inside(p) == kOutside){
125  G4ThreeVector D = p; D[2] = 0.;
126  G4double d1 = m_BoundingShape->DistanceToIn(p, D);
127  if(d1 > 10.*CLHEP::m){
128  D *= -1;
129  d1 = m_BoundingShape->DistanceToIn(p, D);
130  }
131  if(d1 > 10.*CLHEP::m){
132  set_failover_point(p, "acc fail0");
133  return;
134  }
135  d1 *= 2.;
136 
137  G4ThreeVector B = p + D * d1;
138  G4double dphi = B.phi();
139  int B_fan = 0;
141  dphi -= B.phi();
142 
143  B[0] = GetCalculator()->AmplitudeOfSurface(B, side, B_fan);
144  B.rotateZ(dphi);
145  EInside Bi = m_BoundingShape->Inside(B);
146  if(Bi == kSurface){
147  p = B;
148  return;
149  }
150  if(Bi == kOutside){
151  set_failover_point(p, "acc fail1");
152  return;
153  }
154  G4ThreeVector D1 = (p - B).unit();
155  G4ThreeVector X = B + D1 * m_BoundingShape->DistanceToOut(B, D1);
156  if(Inside(X) == kSurface){
157  p = X;
158  } else { // failed
159  set_failover_point(p, "acc fail2");
160  return;
161  }
162  }
163 }

◆ get_point_on_flat_surface()

void LArWheelSolid::get_point_on_flat_surface ( G4ThreeVector &  p) const
private

Definition at line 288 of file LArWheelSolidTests.cxx.

289 {
290  p[0] = 0.;
291  p[1] = 0.;
292  p[2] = rnd->Uniform() > 0.5? m_Zmin: m_Zmax;
293 
294  G4double rmin, rmax;
295  get_r(m_BoundingShape, p[2], rmin, rmax);
296 
297  p[1] = rnd->Uniform(rmin, rmax);
298  p.setPhi(rnd->Uniform(m_MinPhi, m_MaxPhi));
299  G4double dphi = p.phi();
300  int p_fan = 0;
302  dphi -= p.phi();
303 
304  p[0] = rnd->Uniform(
305  GetCalculator()->AmplitudeOfSurface(p, -1, p_fan),
306  GetCalculator()->AmplitudeOfSurface(p, 1, p_fan)
307  );
308 
309  p.rotateZ(dphi);
310 
311  if(m_BoundingShape->Inside(p) != kSurface){
312  set_failover_point(p, "flat fail");
313  }
314 }

◆ get_point_on_polycone_surface()

void LArWheelSolid::get_point_on_polycone_surface ( G4ThreeVector &  p) const
private

Definition at line 165 of file LArWheelSolidTests.cxx.

166 {
167  const G4double z = rnd->Uniform(m_Zmin, m_Zmax);
168  G4double rmin, rmax;
169  get_r(m_BoundingShape, z, rmin, rmax);
170  const bool inner = rnd->Uniform() > 0.5? true: false;
171 
172  p[0] = 0.; p[1] = inner? rmin: rmax; p[2] = z;
173  p.setPhi(rnd->Uniform(m_MinPhi, m_MaxPhi));
174  G4double dphi = p.phi();
175  int p_fan = 0;
177  dphi -= p.phi();
178 
179  const G4double r = p[1];
180 
181  G4ThreeVector A1(0., r, z);
182  A1[0] = GetCalculator()->AmplitudeOfSurface(A1, -1, p_fan);
183  A1.rotateZ(dphi);
184  EInside A1i = m_BoundingShape->Inside(A1);
185  // EInside A1a = Inside_accordion(A1);
186  //std::cout << "A1: " << A1i << " " << A1a << std::endl;
187  if(A1i == kSurface){
188  //std::cout << "got A1" << std::endl;
189  p = A1;
190  return;
191  }
192 
193  G4ThreeVector A2(0., r, z);
194  A2[0] = GetCalculator()->AmplitudeOfSurface(A2, 1, p_fan);
195  A2.rotateZ(dphi);
196  EInside A2i = m_BoundingShape->Inside(A2);
197  // EInside A2a = Inside_accordion(A2);
198  //std::cout << "A2: " << A2i << " " << A2a << std::endl;
199  if(A2i == kSurface){
200  //std::cout << "got A2" << std::endl;
201  p = A2;
202  return;
203  }
204 
205  if(A1i != A2i){
206  if(A2i == kOutside){
207  std::swap(A1, A2);
208  std::swap(A1i, A2i);
209  }
210  // here A1 is outside BP, A2 is inside BP
211  G4ThreeVector d = (A2 - A1).unit();
212  p = A1 + d * m_BoundingShape->DistanceToIn(A1, d);
213  //std::cout << "got A1<->A2" << std::endl;
214  return;
215  }
216  // here A1i == A2i
217 
218  G4double step;
219  if(A1i == kInside){
220  G4double d1 = m_BoundingShape->DistanceToOut(A1);
221  G4double d2 = m_BoundingShape->DistanceToOut(A2);
222  step = d1 > d2? d1 : d2;
223  if(inner) step *= -2;
224  else step *= 2;
225  } else {
226  G4double d1 = m_BoundingShape->DistanceToIn(A1);
227  G4double d2 = m_BoundingShape->DistanceToIn(A2);
228  step = d1 > d2? d1 : d2;
229  if(inner) step *= 2;
230  else step *= -2;
231  }
232 
233  G4ThreeVector B1(0., r + step, z);
234  B1[0] = GetCalculator()->AmplitudeOfSurface(B1, -1, p_fan);
235  B1.rotateZ(dphi);
236  EInside B1i = m_BoundingShape->Inside(B1);
237  // EInside B1a = Inside_accordion(B1);
238  //std::cout << "B1: " << B1i << " " << B1a << std::endl;
239  if(B1i == kSurface){
240  //std::cout << "got B1" << std::endl;
241  p = B1;
242  return;
243  }
244  G4ThreeVector B2(0., r + step, z);
245  B2[0] = GetCalculator()->AmplitudeOfSurface(B2, 1, p_fan);
246  B2.rotateZ(dphi);
247  EInside B2i = m_BoundingShape->Inside(B2);
248  // EInside B2a = Inside_accordion(B2);
249  //std::cout << "B2: " << B2i << " " << B2a << std::endl;
250  if(B2i == kSurface){
251  //std::cout << "got B2" << std::endl;
252  p = B2;
253  return;
254  }
255 
256  if(B1i == A1i || B2i == A1i){ // failed
257  set_failover_point(p, "pol fail1");
258  return;
259  }
260  if(A1i == kInside){
261  std::swap(A1, B1);
262  std::swap(A2, B2);
263  std::swap(A1i, B1i);
264  std::swap(A2i, B2i);
265  }
266  // here A* outside, B* inside, all on accordion surface
267 
268  G4ThreeVector d1 = (A1 - B1).unit();
269  G4ThreeVector X1 = B1 + d1 * m_BoundingShape->DistanceToOut(B1, d1);
270  G4ThreeVector d2 = (A2 - B2).unit();
271  G4ThreeVector X2 = B2 + d2 * m_BoundingShape->DistanceToOut(B2, d2);
272 
273  G4ThreeVector X = X1;
274  G4double phi1 = X1.phi(), phi2 = X2.phi();
275  // X1 corresponds to side = -, X2 to side = +
276  if(phi1 > 0. && phi2 < 0.) phi2 += CLHEP::twopi;
277  G4double phiX = rnd->Uniform(phi1, phi2);
278  if(phiX > CLHEP::pi) phiX -= CLHEP::twopi;
279  X.setPhi(phiX);
280 
281  if(Inside(X) == kSurface){
282  p = X;
283  } else { // failed
284  set_failover_point(p, "pol fail2");
285  }
286 }

◆ GetBoundingShape()

const G4VSolid* LArWheelSolid::GetBoundingShape ( void  ) const
inline

Definition at line 129 of file LArWheelSolid.h.

129 { return m_BoundingShape; }

◆ GetCalculator()

const LArWheelCalculator* LArWheelSolid::GetCalculator ( void  ) const
inline

Definition at line 130 of file LArWheelSolid.h.

130 { return m_Calculator; }

◆ GetCubicVolume()

G4double LArWheelSolid::GetCubicVolume ( void  )

Definition at line 316 of file LArWheelSolidTests.cxx.

317 {
318  // sagging ignored, effect should be negligible
319  double result = m_f_vol->Integral(m_Rmin, m_Rmax, IntPrecision)
320 
321 #ifndef LOCAL_DEBUG
323 #endif
324  ;
325  return result;
326 }

◆ GetEntityType()

G4GeometryType LArWheelSolid::GetEntityType ( ) const

Definition at line 65 of file LArWheelSolid.cxx.

66 {
67  switch(m_Type){
68  case InnerAbsorberWheel:
69  return G4String("LArInnerAbsorberWheel");
70  break;
71  case OuterAbsorberWheel:
72  return G4String("LArOuterAbsorberWheel");
73  break;
74  case InnerElectrodWheel:
75  return G4String("LArInnerElecrodWheel");
76  break;
77  case OuterElectrodWheel:
78  return G4String("LArOuterElecrodWheel");
79  break;
81  return G4String("LArInnerAbsorberModule");
82  break;
84  return G4String("LArOuterAbsorberModule");
85  break;
87  return G4String("LArInnerElecrodModule");
88  break;
90  return G4String("LArOuterElecrodModule");
91  break;
92  case InnerGlueWheel:
93  return G4String("LArInnerGlueWheel");
94  break;
95  case OuterGlueWheel:
96  return G4String("LArOuterGlueWheel");
97  break;
98  case InnerLeadWheel:
99  return G4String("LArInnerLeadWheel");
100  break;
101  case OuterLeadWheel:
102  return G4String("LArOuterLeadWheel");
103  break;
104  case InnerAbsorberCone:
105  return G4String("LArInnerAbsorberCone");
106  break;
107  case InnerElectrodCone:
108  return G4String("LArInnerElectrodCone");
109  break;
110  case InnerGlueCone:
111  return G4String("LArInnerGlueCone");
112  break;
113  case InnerLeadCone:
114  return G4String("LArInnerLeadCone");
115  break;
117  return G4String("LArOuterAbsorberFrontCone");
118  break;
120  return G4String("LArOuterElectrodFrontCone");
121  break;
122  case OuterGlueFrontCone:
123  return G4String("LArOuterGlueFrontCone");
124  break;
125  case OuterLeadFrontCone:
126  return G4String("LArOuterLeadFrontCone");
127  break;
129  return G4String("LArOuterAbsorberBackCone");
130  break;
132  return G4String("LArOuterElectrodBackCone");
133  break;
134  case OuterGlueBackCone:
135  return G4String("LArOuterGlueBackCone");
136  break;
137  case OuterLeadBackCone:
138  return G4String("LArOuterLeadBackCone");
139  break;
140  default:
141  G4Exception("LArWheelSolid", "UnknownSolidType", FatalException,"GetEntityType: Unknown LArWheelType.");
142  }
143  return G4String("");
144 }

◆ GetExtent()

G4VisExtent LArWheelSolid::GetExtent ( ) const

Definition at line 151 of file LArWheelSolid.cxx.

152 {
153  return m_BoundingShape->GetExtent();
154 }

◆ GetPointOnSurface()

G4ThreeVector LArWheelSolid::GetPointOnSurface ( void  ) const

Definition at line 66 of file LArWheelSolidTests.cxx.

67 {
68  if(rnd == 0){
69  rnd = new TRandom3(0);
70  }
71 
72  G4double r = rnd->Uniform();
73 
74  G4ThreeVector p(0., 0., 0.);
75 
76  G4double level1 = .980;
77  G4double level2 = .993;
78  const char *v = getenv("LARWHEELSOLID_TEST_MODE_LEVEL1");
79  if(v) level1 = atof(v);
80  const char *v1 = getenv("LARWHEELSOLID_TEST_MODE_LEVEL2");
81  if(v1) level2 = atof(v1);
82 
83 #if LOCAL_DEBUG > 1
84  std::cout << "LWS::GPOS " << r << std::endl;
85 #endif
86 
87  if(r <= level1){
89  } else if(r <= level2){
91  } else if(r <= 1.){
93  } else {
94  G4Exception("LArWheelSolid", "Rnd generator error", FatalException, "GetPointOnSurface: Wrong data from rnd generator");
95  }
96  return p;
97 }

◆ GetSurfaceArea()

G4double LArWheelSolid::GetSurfaceArea ( void  )

Definition at line 366 of file LArWheelSolidTests.cxx.

367 {
368  double result = 0.;
369 
370  double a1 = get_area_on_polycone();
371  result += a1;
372 #ifdef LOCAL_DEBUG
373  std::cout << "get_area_on_polycone: " << a1/mm2 << std::endl;
374 #endif
375 
376  double a2 = get_area_on_face();
377  result += a2;
378 #ifdef LOCAL_DEBUG
379  std::cout << "get_area_on_face: " << a2/mm2 << std::endl;
380 #endif
381 
382  double a3 = get_area_on_side();
383  result += a3;
384 #ifdef LOCAL_DEBUG
385  std::cout << "get_area_on_side: " << a3/mm2 << std::endl;
386 #endif
387 
388  // sagging ignored, effect should be negligible
389  return result
390 #ifndef LOCAL_DEBUG
392 #endif
393  ;
394 }

◆ GetType()

LArWheelSolid_t LArWheelSolid::GetType ( void  ) const
inline

Definition at line 131 of file LArWheelSolid.h.

131 { return m_Type; }

◆ in_iteration_process()

G4double LArWheelSolid::in_iteration_process ( const G4ThreeVector &  p,
G4double  dist_p,
G4ThreeVector &  B,
int  p_fan 
) const
private

Definition at line 126 of file LArWheelSolidDisToIn.cxx.

129 {
130  LWSDBG(6, std::cout << "iip from " << p << " to " << B
131  << " dir " << (B - p).unit()
132  << std::endl);
133 
134  G4ThreeVector A, C, diff;
135  A = p;
136  G4double dist_c;
137  unsigned int niter = 0;
138  // assert(fabs(GetCalculator()->DistanceToTheNeutralFibre(A)) > m_FHTplusT);
139  // assert(GetCalculator()->DistanceToTheNeutralFibre(A) == dist_p);
140  do {
141  C = A + B;
142  C *= 0.5;
143  dist_c = GetCalculator()->DistanceToTheNeutralFibre(C, p_fan);
144  if(dist_c * dist_p < 0. || fabs(dist_c) < m_FHTminusT){
145  B = C;
146  } else {
147  A = C;
148  }
149  niter ++;
150  diff = A - B;
151  } while(diff.mag2() > s_IterationPrecision2 && niter < s_IterationsLimit);
152  assert(niter < s_IterationsLimit);
153  assert(fabs(GetCalculator()->DistanceToTheNeutralFibre(B, p_fan)) < m_FHTplusT);
154  diff = p - B;
155  LWSDBG(7, std::cout << "iip result in " << niter << " = " << B
156  << " " << diff.mag() << std::endl);
157  return diff.mag();
158 }

◆ init_tests()

void LArWheelSolid::init_tests ( void  )
private

Definition at line 610 of file LArWheelSolidTests.cxx.

611 {
612  m_test_index = double(solid.size());
613  solid[m_test_index] = this;
614 
615 #ifdef DEBUG_LARWHEELSOLID
616  std::cout << "LArWheelSolid::init_tests: put " << this
617  << " with index " << m_test_index << std::endl;
618 #endif
619 
620  m_f_area = new TF1(
621  (GetName() + "_f_area").c_str(), &LArWheelSolid_fcn_area,
622  m_Zmin, m_Zmax, 2
623  );
624  m_f_area->FixParameter(1, m_test_index);
625 
626  m_f_vol = new TF1(
627  (GetName() + "_f_vol").c_str(), &LArWheelSolid_fcn_vol,
628  m_Rmin, m_Rmax, 1
629  );
630  m_f_vol->FixParameter(0, m_test_index);
631 
632  m_f_area_on_pc = new TF1(
633  (GetName() + "_f_area_pc").c_str(), &LArWheelSolid_fcn_area_on_pc,
634  m_Zmin, m_Zmax, 1
635  );
636  m_f_area_on_pc->FixParameter(0, m_test_index);
637 
638  m_f_length = new TF1(
639  (GetName() + "_f_length").c_str(), &fcn_length,
640  m_Zmin, m_Zmax, 2
641  );
642  m_f_length->FixParameter(1, m_test_index);
643 
644  m_f_side_area = new TF1(
645  (GetName() + "_f_side_area").c_str(), &LArWheelSolid_fcn_side_area,
646  m_Rmin, m_Rmax, 1
647  );
648  m_f_side_area->FixParameter(0, m_test_index);
649 }

◆ 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.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ inner_solid_init()

void LArWheelSolid::inner_solid_init ( const G4String &  bs_name)
private

Definition at line 206 of file LArWheelSolidInit.cxx.

207 {
208  m_IsOuter = false;
209  m_FanPhiAmplitude = 0.065; // internal technical constant, should not go in DB
210  set_phi_size();
211 
212  std::array<G4double,2> zPlane{}, rInner{}, rOuter{};
213  zPlane[1] = GetCalculator()->GetWheelThickness();
214  G4double wheel_thickness = zPlane[1] - zPlane[0];
217  const G4double phi_min = m_PhiPosition - m_FanPhiAmplitude
218  - GetCalculator()->GetFanStepOnPhi() * 2;
219 
220  m_Zmin = zPlane[0]; m_Zmax = zPlane[1];
221  m_Rmin = rInner[0]; m_Rmax = rOuter[1];
222  m_Ymin = m_Rmin * 0.9;
223  m_Zmid = zPlane[1];
224  m_Ymid = (rInner[0] + rOuter[1]) * 0.5;
225 
228  || m_Type == InnerGlueCone
229  || m_Type == InnerLeadCone
230  ){
232  bs_name + "Cone", zPlane[0], zPlane[1],
233  rInner[0], rOuter[0], rInner[1], rOuter[1]
234  );
235  } else {
236  m_BoundingShape = new G4Polycone(
237  bs_name + "Polycone", m_MinPhi, m_MaxPhi - m_MinPhi,
238  2, zPlane.data(), rInner.data(), rOuter.data()
239  );
240  }
241 #ifdef LARWHEELSOLID_USE_FANBOUND
242  const G4double phi_size = (m_FanPhiAmplitude + GetCalculator()->GetFanStepOnPhi() * 2) * 2;
243  FanBound = new G4Polycone(bs_name + "ofFan", phi_min, phi_size,
244  2, zPlane, rInner, rOuter);
245 #endif
246 #ifndef PORTABLE_LAR_SHAPE
247  ATH_MSG_INFO(m_BoundingShape->GetName() + " is the m_BoundingShape");
248 #endif
249 
250  const G4double half_wave_length = GetCalculator()->GetHalfWaveLength();
251  const G4double sss = GetCalculator()->GetStraightStartSection();
252  m_Zsect.push_back(0.);
253  m_Zsect.push_back(sss + half_wave_length * 0.25);
254  const G4int num_fs = GetCalculator()->GetNumberOfHalfWaves() + 1;
255  for(G4int i = 2; i < num_fs; i ++){
256  const G4double zi = half_wave_length * (i - 1) + sss;
257 #if LARWHEELSOLID_ZSECT_MULT > 1
258  for(G4int j = LARWHEELSOLID_ZSECT_MULT - 1; j > 0; -- j){
259  m_Zsect.push_back(zi - half_wave_length * j / LARWHEELSOLID_ZSECT_MULT);
260  }
261 #endif
262  m_Zsect.push_back(zi);
263  }
264  m_Zsect.push_back(wheel_thickness - m_Zsect[1]);
265  m_Zsect.push_back(wheel_thickness - m_Zsect[0]);
266 
267  m_fs = new LArFanSections(
268  rInner[0], rInner[1], rOuter[0], rOuter[1],
269  m_Rmax*cos(phi_min), m_Zsect.front(), m_Zsect.back()
270  );
271 }

◆ Inside()

EInside LArWheelSolid::Inside ( const G4ThreeVector &  inputP) const

Definition at line 15 of file LArWheelSolid.cxx.

16 {
17  LWSDBG(10, std::cout << std::setprecision(25));
18  LWSDBG(1, std::cout << TypeStr() << " Inside " << MSG_VECTOR(inputP) << std::endl);
19  const EInside inside_BS = m_BoundingShape->Inside(inputP);
20  if(inside_BS == kOutside){
21  LWSDBG(2, std::cout << "outside BS" << std::endl);
22  return kOutside;
23  }
24  G4ThreeVector p( inputP );
25  int p_fan = 0;
26  const G4double d = fabs(GetCalculator()->DistanceToTheNearestFan(p, p_fan));
27  if(d > m_FHTplusT){
28  LWSDBG(2, std::cout << "outside fan d=" << d << ", m_FHTplusT=" << m_FHTplusT << std::endl);
29  return kOutside;
30  }
31  if(d < m_FHTminusT){
32  LWSDBG(2, std::cout << "inside fan d=" << d << ", m_FHTminusT=" << m_FHTminusT << ", inside_BS=" << inside(inside_BS) << std::endl);
33  return inside_BS;
34  }
35  LWSDBG(2, std::cout << "surface" << std::endl);
36  return kSurface;
37 }

◆ Inside_accordion()

EInside LArWheelSolid::Inside_accordion ( const G4ThreeVector &  p) const
private

Definition at line 29 of file LArWheelSolidTests.cxx.

30 {
31  G4ThreeVector p1 = p;
32  int p1_fan = 0;
33  G4double d = m_FanHalfThickness - fabs(GetCalculator()->DistanceToTheNearestFan(p1, p1_fan));
34  if(d > s_Tolerance) return kInside;
35  if(d > -s_Tolerance) return kSurface;
36  return kOutside;
37 }

◆ 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.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ 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
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152 {
153  if (!m_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ out_iteration_process()

G4double LArWheelSolid::out_iteration_process ( const G4ThreeVector &  p,
G4ThreeVector &  B,
const int  p_fan 
) const
private

Definition at line 229 of file LArWheelSolidDisToOut.cxx.

231 {
232  LWSDBG(6, std::cout << "oip: " << p << " " << B);
233  assert(fabs(GetCalculator()->DistanceToTheNeutralFibre(p, p_fan)) < m_FHTplusT);
234  assert(fabs(GetCalculator()->DistanceToTheNeutralFibre(B, p_fan)) > m_FHTminusT);
235  G4ThreeVector A(p), C, diff;
236  unsigned int niter = 0;
237  do {
238  C = A + B;
239  C *= 0.5;
240  if(fabs(GetCalculator()->DistanceToTheNeutralFibre(C, p_fan)) < m_FHTplusT){
241  A = C;
242  } else {
243  B = C;
244  }
245  niter ++;
246  diff = A - B;
247  } while(diff.mag2() > s_IterationPrecision2 && niter < s_IterationsLimit);
248  assert(fabs(GetCalculator()->DistanceToTheNeutralFibre(B, p_fan)) > m_FHTplusT);
249  assert(niter < s_IterationsLimit);
250  diff = p - B;
251  LWSDBG(7, std::cout << " -> " << B << " " << diff.mag());
252  LWSDBG(6, std::cout << std::endl);
253  return diff.mag();
254 }

◆ outer_solid_init()

void LArWheelSolid::outer_solid_init ( const G4String &  bs_name)
private

Definition at line 274 of file LArWheelSolidInit.cxx.

275 {
276  m_IsOuter = true;
277  m_FanPhiAmplitude = 0.02; // internal technical constant, should not go in DB
278  set_phi_size();
279 
280  std::array<G4double,3> zPlane{}, rInner{}, rOuter{};
281  zPlane[2] = GetCalculator()->GetWheelThickness();
282  G4double wheel_thickness = zPlane[2] - zPlane[0];
283  zPlane[1] = GetCalculator()->GetWheelInnerRadius(rInner);
285  const G4double phi_min =
288 
289  m_Zmid = zPlane[1];
290  m_Ymid = (rInner[0] + rOuter[2]) * 0.5;
291 
292  bool hasFrontSections = false;
293  bool hasBackSections = false;
298  ){
299  m_Zmin = zPlane[0]; m_Zmax = zPlane[1];
300  m_Rmin = rInner[0]; m_Rmax = rOuter[1];
302  bs_name + "FrontCone", zPlane[0], zPlane[1],
303  rInner[0], rOuter[0], rInner[1], rOuter[1]
304  );
305  hasFrontSections = true;
306  } else if(m_Type == OuterAbsorberBackCone
310  ){
311  m_Zmin = zPlane[1]; m_Zmax = zPlane[2];
312  m_Rmin = rInner[1]; m_Rmax = rOuter[2];
314  bs_name + "BackCone", zPlane[1], zPlane[2],
315  rInner[1], rOuter[1], rInner[2], rOuter[2]
316  );
317  hasBackSections = true;
318  } else {
319  m_Zmin = zPlane[0]; m_Zmax = zPlane[2];
320  m_Rmin = rInner[0]; m_Rmax = rOuter[2];
321  m_BoundingShape = new G4Polycone(
322  bs_name + "Polycone", m_MinPhi, m_MaxPhi - m_MinPhi,
323  3, zPlane.data(), rInner.data(), rOuter.data()
324  );
325  hasFrontSections = true;
326  hasBackSections = true;
327  }
328 
329  m_Ymin = m_Rmin * 0.9;
330 
331 #ifdef LARWHEELSOLID_USE_FANBOUND
332  const G4double phi_size = (m_FanPhiAmplitude + GetCalculator()->GetFanStepOnPhi() * 2) * 2;
333  FanBound = new G4Polycone(bs_name + "ofFan", phi_min, phi_size,
334  3, zPlane, rInner, rOuter);
335 #endif
336 #ifndef PORTABLE_LAR_SHAPE
337  ATH_MSG_INFO(m_BoundingShape->GetName() + " is the m_BoundingShape");
338 #endif
339  const G4double half_wave_length = GetCalculator()->GetHalfWaveLength();
340  const G4double sss = GetCalculator()->GetStraightStartSection();
341 
342  if(hasFrontSections){
343  m_Zsect.push_back(0.);
344  m_Zsect.push_back(sss + half_wave_length * 0.25);
345  } else {
346  m_Zsect.push_back(m_Zmid);
347  }
348  const G4int num_fs = GetCalculator()->GetNumberOfHalfWaves() + 1;
349 
350  for(G4int i = 2; i < num_fs; i ++){
351  const G4double zi = half_wave_length * (i - 1) + sss;
352 #if LARWHEELSOLID_ZSECT_MULT > 1
353  for(G4int j = LARWHEELSOLID_ZSECT_MULT - 1; j > 0; -- j){
354  G4double zj = zi - half_wave_length * j / LARWHEELSOLID_ZSECT_MULT;
355  if(hasFrontSections && hasBackSections
356  && m_Zsect.back() < m_Zmid && zj >= m_Zmid){
357  m_Zsect.push_back(m_Zmid);
358  }
359  if((zj < m_Zmid && hasFrontSections)
360  || (zj > m_Zmid && hasBackSections)){
361  m_Zsect.push_back(zj);
362  }
363  }
364 #endif
365  if(hasFrontSections && hasBackSections
366  && m_Zsect.back() < m_Zmid && zi >= m_Zmid){
367  m_Zsect.push_back(m_Zmid);
368  }
369  if((zi < m_Zmid && hasFrontSections)
370  || (zi > m_Zmid && hasBackSections)){
371  m_Zsect.push_back(zi);
372  }
373  }
374  if(hasBackSections){
375  m_Zsect.push_back(wheel_thickness - sss - half_wave_length * 0.25);
376  m_Zsect.push_back(wheel_thickness);
377  } else {
378  m_Zsect.push_back(m_Zmid);
379  }
380 
381  m_fs = new LArFanSections(
382  rInner[0], rInner[1], rOuter[0], rOuter[1],
383  m_Rmax*cos(phi_min), m_Zsect.front(), m_Zmid
384  );
385 }

◆ search_for_most_remoted_point()

G4bool LArWheelSolid::search_for_most_remoted_point ( const G4ThreeVector &  a,
const G4ThreeVector &  b,
G4ThreeVector &  C,
const int  p_fan 
) const
private

Definition at line 259 of file LArWheelSolidDisToOut.cxx.

262 {
263  LWSDBG(6, std::cout << "sfmrp " << a << " " << b << std::endl);
264  G4ThreeVector diff(b - a);
265 
266  if(diff.mag2() <= s_IterationPrecision2) return false;
267  G4ThreeVector A(a), B(b), l(diff.unit() * s_IterationPrecision);
268  // find the most remoted point on the line AB
269  // and check if it is outside vertical fan
270  // small vector along the segment AB
271  G4double d1, d2;
272  unsigned int niter = 0;
273  // searching for maximum of (GetCalculator()->DistanceToTheNeutralFibre)^2 along AB
274  do {
275  C = A + B;
276  C *= 0.5;
278  if(fabs(d1) > m_FHTplusT){
279  // here out_iteration_process gives the answer
280  LWSDBG(7, std::cout << "sfmrp -> " << C << " " << fabs(d1)
281  << " " << (C - a).unit() << " "
282  << (C - a).mag() << std::endl);
283  return true;
284  }
285  // sign of derivative
286  //d1 = GetCalculator()->DistanceToTheNeutralFibre(C + l);
288  if(d1 * d1 - d2 * d2 > 0.) A = C;
289  else B = C;
290  niter ++;
291  diff = A - B;
292  } while(diff.mag2() > s_IterationPrecision2 && niter < s_IterationsLimit);
293  // the line entirely lies inside fan
294  assert(niter < s_IterationsLimit);
295  return false;
296 }

◆ search_for_nearest_point()

G4double LArWheelSolid::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 162 of file LArWheelSolidDisToIn.cxx.

166 {
167  LWSDBG(6, std::cout << "sfnp " << MSG_VECTOR(p_in) << " "
168  << MSG_VECTOR(p_out) << std::endl);
169 
170  G4ThreeVector A, B, C, l, diff;
171  A = p_in;
172  B = p_out;
173  diff = B - A;
174  l = diff.unit() * s_IterationPrecision;
175  // this is to correctly take the sign of the distance into account
176  G4double sign = dist_p_in < 0.? -1. : 1.;
177  G4double d_prime;
178  G4double dist_c;
179  unsigned long niter = 0;
180  do {
181  C = A + B;
182  C *= 0.5;
183  dist_c = GetCalculator()->DistanceToTheNeutralFibre(C, p_fan);
184  if(dist_c * sign <= 0.){ // we are in coditions for in_iteration_process
185  LWSDBG(7, std::cout << "sfnp0 " << dist_c << std::endl);
186  return in_iteration_process(p_in, dist_p_in, C, p_fan);
187  }
188  // calculate sign of derivative of distance to the neutral fibre
189  // hope this substitution is acceptable
190  diff = C - l;
191  d_prime = (dist_c - GetCalculator()->DistanceToTheNeutralFibre(diff, p_fan)) * sign;
192  if(d_prime < 0.) A = C;
193  else B = C;
194  niter ++;
195  diff = A - B;
196  } while(diff.mag2() > s_IterationPrecision2 && niter < s_IterationsLimit);
197  assert(niter < s_IterationsLimit);
198  if(fabs(dist_c) < m_FHTminusT){
199  LWSDBG(7, std::cout << "sfnp1 " << dist_c << std::endl);
200  return in_iteration_process(p_in, dist_p_in, C, p_fan);
201  }
202  // let's check at p_in and p_out
203  if(dist_p_in * sign < dist_c * sign){
204  C = p_in;
205  dist_c = dist_p_in;
206  }
207  G4double dist_p_out = GetCalculator()->DistanceToTheNeutralFibre(p_out, p_fan);
208  if(dist_p_out *sign < dist_c * sign) C = p_out;
209  if(fabs(dist_p_out) < m_FHTminusT){
210  LWSDBG(7, std::cout << "sfnp2 " << dist_p_out << std::endl);
211  return in_iteration_process(p_in, dist_p_in, C, p_fan);
212  }
213  return kInfinity;
214 }

◆ select_section()

G4int LArWheelSolid::select_section ( const G4double &  Z) const
private

Definition at line 164 of file LArWheelSolid.cxx.

165 {
166  for(G4int i = m_Zsect_start_search; i > 0; -- i){
167  if(Z > m_Zsect[i]) return i;
168  }
169  return 0;
170 }

◆ set_failover_point()

void LArWheelSolid::set_failover_point ( G4ThreeVector &  p,
const char *  m = 0 
) const
private

Definition at line 39 of file LArWheelSolidTests.cxx.

45  {
46  p[0] = 0.; p[1] = m_Rmin; p[2] = m_Zmin;
47  int p_fan = 0;
49 
50 #ifdef LOCAL_DEBUG
51  if(m) std::cout << m << std::endl;
52 #endif
53  }

◆ set_phi_size()

void LArWheelSolid::set_phi_size ( void  )
private

Definition at line 389 of file LArWheelSolidInit.cxx.

390 {
391  if(GetCalculator()->GetisModule()){
394  } else {
395  m_MinPhi = 0.;
397  }
398 }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

◆ StreamInfo()

virtual std::ostream& LArWheelSolid::StreamInfo ( std::ostream &  os) const
inlinevirtual

Definition at line 127 of file LArWheelSolid.h.

127 { return os; }

◆ SurfaceNormal()

G4ThreeVector LArWheelSolid::SurfaceNormal ( const G4ThreeVector &  inputP) const

Definition at line 39 of file LArWheelSolid.cxx.

40 {
41  LWSDBG(1, std::cout << TypeStr() << " SurfaceNormal" << MSG_VECTOR(inputP) << std::endl);
42  EInside inside_BS = m_BoundingShape->Inside(inputP);
43  if(inside_BS != kInside){
44  LWSDBG(2, std::cout << "not inside BS" << std::endl);
45  return m_BoundingShape->SurfaceNormal(inputP);
46  }
47  G4ThreeVector p( inputP );
48  int p_fan = 0;
50  G4ThreeVector d = GetCalculator()->NearestPointOnNeutralFibre(p, p_fan);
51  d.rotateZ(inputP.phi() - p.phi()); // rotate back to initial position
52  LWSDBG(4, std::cout << "npnf" << MSG_VECTOR(d) << std::endl);
53  p = inputP - d;
54  LWSDBG(2, std::cout << "sn " << MSG_VECTOR(p.unit()) << std::endl);
55  return(p.unit());
56 }

◆ test()

void LArWheelSolid::test ( void  )
private

Definition at line 396 of file LArWheelSolidTests.cxx.

397 {
398  boost::io::ios_all_saver ias(std::cout);
399  const char *on = getenv("LARWHEELSOLID_TEST");
400  if(on == 0) return;
401  std::string test_mode = on;
402 
403  std::cout << "============| LArWheelSolid test() routine |=============="
404  << std::endl;
405  std::cout << "Solid of type " << LArWheelSolidTypeString(m_Type)
406  << std::endl;
407  std::cout.precision(6);
408  std::cout << std::fixed;
409  const char *prec = getenv("LARWHEELSOLID_TEST_INTPRECISION");
410  if(prec) IntPrecision = atof(prec);
411  std::cout << "Int. precision " << IntPrecision << std::endl;
412  std::cout << "test mode " << test_mode << std::endl;
413 
414  std::cout << "m_Rmin = " << m_Rmin << " m_Rmax = " << m_Rmax << std::endl
415  << "m_Zmin = " << m_Zmin << " m_Zmax = " << m_Zmax << std::endl;
416 
417  // TFile *F = new TFile("LArWheelSolid_test.root", "RECREATE");
418  TFile *F = 0;
419  TNtupleD *T = 0;
420  if(test_mode.find("root") != std::string::npos){
421  F = new TFile("LArWheelSolid_test.root", "UPDATE");
422  T = new TNtupleD(GetName(), GetName(), "x:y:z");
423  }
424  int N = 1000000;
425  const int Nmax(1000000000);
426  char *NN = getenv("LARWHEELSOLID_TEST_NPOINTS");
427 
428  if(NN) {
429  char *endptr;
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));
433  }
434  }
435  if (Nmax<N) {
436  std::cout << "Number of points from LARWHEELSOLID_TEST_NPOINTS environment variable ("<<N<<") is too large. Using " << Nmax << " instead." << std::endl;
437  N=Nmax;
438  }
439  if (N<0) {
440  std::cout << "Number of points from LARWHEELSOLID_TEST_NPOINTS environment variable ("<<N<<") is negative!!. Using 0 instead." << std::endl;
441  N=0;
442  }
443  if(test_mode.find("points") == std::string::npos){
444  N = 0;
445  } else {
446  std::cout << N << " points" << std::endl;
447  }
448  for(int i = 0; i < N; ++ i){
449  G4ThreeVector p = GetPointOnSurface();
450 #ifdef LOCAL_DEBUG
451  EInside ii = Inside(p);
452  if(ii != kSurface){
453  std::cout << i << " "
454  << (ii == kInside? "inside": "outside")
455  << std::endl;
456  }
457 #endif
458  if(T) T->Fill(p[0], p[1], p[2]);
459  }
460  if(F){
461  T->Write();
462  F->Write();
463  F->Close();
464  delete F;
465  }
466 
467  if(test_mode.find("volume") != std::string::npos){
468  double cv = GetCubicVolume();
469  std::cout << "GetCubicVolume: " << cv/CLHEP::mm3 << " mm^3" << std::endl;
470  }
471 
472  if(test_mode.find("area") != std::string::npos){
473  double sa = GetSurfaceArea();
474  std::cout << "GetSurfaceArea: " << sa/CLHEP::mm2 << " mm^2" << std::endl;
475  }
476 
477  std::cout << "======= end of ArWheelSolid test() routine ============="
478  << std::endl;
479 
480  if(m_Type == OuterAbsorberWheel) {
481  if(test_mode.find("once") != std::string::npos) exit(0); }
482 
483  ias.restore();
484 }

Friends And Related Function Documentation

◆ LArWheelSolid_fcn_area

double LArWheelSolid_fcn_area ( double *  x,
double *  p 
)
friend

Definition at line 530 of file LArWheelSolidTests.cxx.

531 {
532  const double &z = x[0];
533  const double &r = p[0];
534  const double &index = p[1];
535 
536  G4ThreeVector a(0., r, z);
537  double b = solid[index]->GetCalculator()->AmplitudeOfSurface(a, -1, 121) // sagging ignored, effect should be negligible, use arbitrary fan number
538  - solid[index]->GetCalculator()->AmplitudeOfSurface(a, 1, 121);
539  return b;
540 }

◆ LArWheelSolid_fcn_area_on_pc

double LArWheelSolid_fcn_area_on_pc ( double *  x,
double *  p 
)
friend

Definition at line 550 of file LArWheelSolidTests.cxx.

551 {
552  const double &z = x[0];
553  const double &index = p[0];
554 
555  G4double rmin, rmax;
556  get_r(solid[index]->m_BoundingShape, z, rmin, rmax);
557 
558  double result = 0.;
559  G4ThreeVector a(0., rmin, z);
560  result += solid[index]->GetCalculator()->AmplitudeOfSurface(a, -1, 232) // sagging ignored, effect should be negligible, use arbitrary fan number
561  - solid[index]->GetCalculator()->AmplitudeOfSurface(a, 1, 232);
562  a[1] = rmax;
563  result += solid[index]->GetCalculator()->AmplitudeOfSurface(a, -1, 343)
564  - solid[index]->GetCalculator()->AmplitudeOfSurface(a, 1, 343);
565 
566  return result;
567 }

◆ LArWheelSolid_fcn_side_area

double LArWheelSolid_fcn_side_area ( double *  x,
double *  p 
)
friend

Definition at line 602 of file LArWheelSolidTests.cxx.

603 {
604  const double &r = x[0];
605  const double &index = p[0];
606 
607  return solid[index]->get_length_at_r(r);
608 }

◆ LArWheelSolid_fcn_vol

double LArWheelSolid_fcn_vol ( double *  x,
double *  p 
)
friend

Definition at line 542 of file LArWheelSolidTests.cxx.

543 {
544  const double &r = x[0];
545  const double &index = p[0];
546 
547  return solid[index]->get_area_at_r(r);
548 }

◆ LArWheelSolid_get_dl

double LArWheelSolid_get_dl ( double *  x,
double *  par,
G4int  side 
)
friend

Definition at line 570 of file LArWheelSolidTests.cxx.

571 {
572  const double &z = x[0];
573  const double &r = par[0];
574  const double &index = par[1];
575 
576  const double h = 0.001;
577 
578  //check what happens if z+h > m_Zmax etc
579  G4ThreeVector p(0., r, z + h);
580  G4double D1 = solid[index]->GetCalculator()->AmplitudeOfSurface(p, side, 5665); // sagging ignored, effect should be negligible, use arbitrary fan number
581  p[2] = z - h;
582  D1 -= solid[index]->GetCalculator()->AmplitudeOfSurface(p, side, 5665);
583  D1 /= 2 * h;
584 
585  p[2] = z + h / 2;
586  G4double D2 = solid[index]->GetCalculator()->AmplitudeOfSurface(p, side, 5665);
587  p[2] = z - h / 2;
588  D2 -= solid[index]->GetCalculator()->AmplitudeOfSurface(p, side, 5665);
589  D2 /= h;
590 
591  G4double D = (D2 * 4 - D1) / 3.;
592  G4double dl = sqrt(1 + D * D);
593 
594  return dl;
595 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_BoundingShape

G4VSolid* LArWheelSolid::m_BoundingShape
private

Definition at line 154 of file LArWheelSolid.h.

◆ m_Calculator

LArWheelCalculator* LArWheelSolid::m_Calculator
private

Definition at line 148 of file LArWheelSolid.h.

◆ m_f_area

TF1* LArWheelSolid::m_f_area
protected

Definition at line 227 of file LArWheelSolid.h.

◆ m_f_area_on_pc

TF1 * LArWheelSolid::m_f_area_on_pc
protected

Definition at line 227 of file LArWheelSolid.h.

◆ m_f_length

TF1 * LArWheelSolid::m_f_length
protected

Definition at line 227 of file LArWheelSolid.h.

◆ m_f_side_area

TF1 * LArWheelSolid::m_f_side_area
protected

Definition at line 227 of file LArWheelSolid.h.

◆ m_f_vol

TF1 * LArWheelSolid::m_f_vol
protected

Definition at line 227 of file LArWheelSolid.h.

◆ m_FanHalfThickness

G4double LArWheelSolid::m_FanHalfThickness
private

Definition at line 149 of file LArWheelSolid.h.

◆ m_FanPhiAmplitude

G4double LArWheelSolid::m_FanPhiAmplitude
private

Definition at line 150 of file LArWheelSolid.h.

◆ m_FHTminusT

G4double LArWheelSolid::m_FHTminusT
private

Definition at line 149 of file LArWheelSolid.h.

◆ m_FHTplusT

G4double LArWheelSolid::m_FHTplusT
private

Definition at line 149 of file LArWheelSolid.h.

◆ m_fs

LArFanSections* LArWheelSolid::m_fs
private

Definition at line 162 of file LArWheelSolid.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_IsOuter

G4bool LArWheelSolid::m_IsOuter
private

Definition at line 146 of file LArWheelSolid.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_MaxPhi

G4double LArWheelSolid::m_MaxPhi
private

Definition at line 152 of file LArWheelSolid.h.

◆ m_MinPhi

G4double LArWheelSolid::m_MinPhi
private

Definition at line 151 of file LArWheelSolid.h.

◆ 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

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_PhiPosition

const G4double LArWheelSolid::m_PhiPosition
private

Definition at line 153 of file LArWheelSolid.h.

◆ m_Rmax

G4double LArWheelSolid::m_Rmax
private

Definition at line 169 of file LArWheelSolid.h.

◆ m_Rmin

G4double LArWheelSolid::m_Rmin
private

Definition at line 169 of file LArWheelSolid.h.

◆ m_test_index

double LArWheelSolid::m_test_index
protected

Definition at line 229 of file LArWheelSolid.h.

◆ m_Type

const LArWheelSolid_t LArWheelSolid::m_Type
private

Definition at line 147 of file LArWheelSolid.h.

◆ m_Ymid

G4double LArWheelSolid::m_Ymid
private

Definition at line 171 of file LArWheelSolid.h.

◆ m_Ymin

G4double LArWheelSolid::m_Ymin
private

Definition at line 167 of file LArWheelSolid.h.

◆ m_Zmax

G4double LArWheelSolid::m_Zmax
private

Definition at line 169 of file LArWheelSolid.h.

◆ m_Zmid

G4double LArWheelSolid::m_Zmid
private

Definition at line 165 of file LArWheelSolid.h.

◆ m_Zmin

G4double LArWheelSolid::m_Zmin
private

Definition at line 169 of file LArWheelSolid.h.

◆ m_Zsect

std::vector<G4double> LArWheelSolid::m_Zsect
private

Definition at line 159 of file LArWheelSolid.h.

◆ m_Zsect_start_search

G4int LArWheelSolid::m_Zsect_start_search
private

Definition at line 160 of file LArWheelSolid.h.

◆ s_AngularTolerance

const G4double LArWheelSolid::s_AngularTolerance = G4GeometryTolerance::GetInstance()->GetAngularTolerance() / 2
staticprivate

Definition at line 141 of file LArWheelSolid.h.

◆ s_IterationPrecision

const G4double LArWheelSolid::s_IterationPrecision = 0.001*CLHEP::mm
staticprivate

Definition at line 142 of file LArWheelSolid.h.

◆ s_IterationPrecision2

const G4double LArWheelSolid::s_IterationPrecision2 = s_IterationPrecision * s_IterationPrecision
staticprivate

Definition at line 143 of file LArWheelSolid.h.

◆ s_IterationsLimit

const unsigned int LArWheelSolid::s_IterationsLimit = 50
staticprivate

Definition at line 144 of file LArWheelSolid.h.

◆ s_Tolerance

const G4double LArWheelSolid::s_Tolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance() / 2
staticprivate

Definition at line 140 of file LArWheelSolid.h.


The documentation for this class was generated from the following files:
InnerElectrodCone
@ InnerElectrodCone
Definition: LArWheelSolid_type.h:26
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
LArWheelSolid::get_area_on_polycone
G4double get_area_on_polycone(void) const
Definition: LArWheelSolidTests.cxx:328
LArWheelSolid::ExitAtFront
@ ExitAtFront
Definition: LArWheelSolid.h:191
InnerGlueWheel
@ InnerGlueWheel
Definition: LArWheelSolid_type.h:21
beamspotman.r
def r
Definition: beamspotman.py:676
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
LArWheelSolid::m_f_area_on_pc
TF1 * m_f_area_on_pc
Definition: LArWheelSolid.h:227
LArFanSections::Amax2
G4double Amax2
Definition: LArFanSection.h:16
LArWheelSolid::get_point_on_flat_surface
void get_point_on_flat_surface(G4ThreeVector &) const
Definition: LArWheelSolidTests.cxx:288
LArWheelSolid::m_FHTminusT
G4double m_FHTminusT
Definition: LArWheelSolid.h:149
TestSUSYToolsAlg.dl
dl
Definition: TestSUSYToolsAlg.py:81
LArWheelCalculator::GetStraightStartSection
double GetStraightStartSection() const
Definition: LArWheelCalculator.h:82
get_generator_info.result
result
Definition: get_generator_info.py:21
OuterLeadFrontCone
@ OuterLeadFrontCone
Definition: LArWheelSolid_type.h:32
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
LArG4::OuterElectrodWheel
@ OuterElectrodWheel
Definition: LArWheelCalculatorEnums.h:12
LArWheelSolid::search_for_nearest_point
G4double search_for_nearest_point(const G4ThreeVector &, const G4double, const G4ThreeVector &, int) const
Definition: LArWheelSolidDisToIn.cxx:162
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
OuterAbsorberBackCone
@ OuterAbsorberBackCone
Definition: LArWheelSolid_type.h:33
LArWheelSolid::ExitAtOuter
@ ExitAtOuter
Definition: LArWheelSolid.h:190
LArWheelSolid::LArWheelSolid_fcn_side_area
friend double LArWheelSolid_fcn_side_area(double *, double *)
Definition: LArWheelSolidTests.cxx:602
LArWheelSolid::LArWheelSolid_fcn_area_on_pc
friend double LArWheelSolid_fcn_area_on_pc(double *, double *)
Definition: LArWheelSolidTests.cxx:550
LArWheelSolid::s_Tolerance
static const G4double s_Tolerance
Definition: LArWheelSolid.h:140
LArWheelSolid::ExitAtSide
@ ExitAtSide
Definition: LArWheelSolid.h:191
OuterLeadBackCone
@ OuterLeadBackCone
Definition: LArWheelSolid_type.h:36
OuterGlueWheel
@ OuterGlueWheel
Definition: LArWheelSolid_type.h:22
LArG4::InnerAbsorberWheel
@ InnerAbsorberWheel
Definition: LArWheelCalculatorEnums.h:11
PixelAthClusterMonAlgCfg.zmin
zmin
Definition: PixelAthClusterMonAlgCfg.py:169
index
Definition: index.py:1
Monitored::Z
@ Z
Definition: HistogramFillerUtils.h:24
hist_file_dump.d
d
Definition: hist_file_dump.py:137
LArG4::InnerGlueWheel
@ InnerGlueWheel
Definition: LArWheelCalculatorEnums.h:19
LArWheelCalculator::GetFanHalfThickness
double GetFanHalfThickness(LArG4::LArWheelCalculator_t) const
Definition: LArWheelCalculator.cxx:441
InDetAccessor::phi0
@ phi0
Definition: InDetAccessor.h:33
LArWheelSolid::GetPointOnSurface
G4ThreeVector GetPointOnSurface(void) const
Definition: LArWheelSolidTests.cxx:66
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
LArFanSections::print
void print(void) const
Definition: LArFanSection.cxx:11
DMTest::C
C_v1 C
Definition: C.h:26
LArWheelSolid::LArWheelSolid_fcn_area
friend double LArWheelSolid_fcn_area(double *, double *)
Definition: LArWheelSolidTests.cxx:530
LArWheelSolid::m_Rmax
G4double m_Rmax
Definition: LArWheelSolid.h:169
LArWheelSolid::search_for_most_remoted_point
G4bool search_for_most_remoted_point(const G4ThreeVector &, const G4ThreeVector &, G4ThreeVector &, const int) const
Definition: LArWheelSolidDisToOut.cxx:259
LArWheelSolid::get_point_on_accordion_surface
void get_point_on_accordion_surface(G4ThreeVector &) const
Definition: LArWheelSolidTests.cxx:99
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
LArWheelSolid::find_exit_point
FanBoundExit_t find_exit_point(const G4ThreeVector &p, const G4ThreeVector &v, G4ThreeVector &q) const
Definition: LArFanSection.cxx:216
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
LArWheelCalculator::GetNumberOfHalfWaves
int GetNumberOfHalfWaves() const
Definition: LArWheelCalculator.h:91
LArWheelCalculator::LArWheelCalculatorTypeString
static const char * LArWheelCalculatorTypeString(LArG4::LArWheelCalculator_t)
Definition: LArWheelCalculator.cxx:65
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
LArWheelSolid::fs_cross_lower
G4bool fs_cross_lower(const G4ThreeVector &p, const G4ThreeVector &v, G4ThreeVector &q) const
Definition: LArFanSection.cxx:103
LArWheelSolid::m_PhiPosition
const G4double m_PhiPosition
Definition: LArWheelSolid.h:153
mc.diff
diff
Definition: mc.SFGenPy8_MuMu_DD.py:14
LArFanSections::Bmin
G4double Bmin
Definition: LArFanSection.h:15
dq_defect_virtual_defect_validation.d1
d1
Definition: dq_defect_virtual_defect_validation.py:79
LArWheelSolid::set_failover_point
void set_failover_point(G4ThreeVector &p, const char *m=0) const
Definition: LArWheelSolidTests.cxx:39
LArWheelSolid::m_Ymin
G4double m_Ymin
Definition: LArWheelSolid.h:167
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
LArG4::InnerAbsorberModule
@ InnerAbsorberModule
Definition: LArWheelCalculatorEnums.h:13
LArFanSections::Amax
G4double Amax
Definition: LArFanSection.h:14
LArWheelSolid::get_area_on_side
G4double get_area_on_side(void) const
Definition: LArWheelSolidTests.cxx:361
LArG4::OuterElectrodModule
@ OuterElectrodModule
Definition: LArWheelCalculatorEnums.h:14
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
PixelModuleFeMask_create_db.stop
int stop
Definition: PixelModuleFeMask_create_db.py:76
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
LArWheelSolid::m_FHTplusT
G4double m_FHTplusT
Definition: LArWheelSolid.h:149
LArFanSections
Definition: LArFanSection.h:12
InnerElectrodModule
@ InnerElectrodModule
Definition: LArWheelSolid_type.h:19
LArWheelSolid::get_point_on_polycone_surface
void get_point_on_polycone_surface(G4ThreeVector &) const
Definition: LArWheelSolidTests.cxx:165
G4ShiftedCone
Definition: G4ShiftedCone.h:87
LArWheelSolid::GetSurfaceArea
G4double GetSurfaceArea(void)
Definition: LArWheelSolidTests.cxx:366
LArWheelSolid::test
void test(void)
Definition: LArWheelSolidTests.cxx:396
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
x
#define x
InnerElectrodWheel
@ InnerElectrodWheel
Definition: LArWheelSolid_type.h:15
InnerGlueCone
@ InnerGlueCone
Definition: LArWheelSolid_type.h:27
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
OuterElectrodModule
@ OuterElectrodModule
Definition: LArWheelSolid_type.h:20
LArWheelSolid::m_Ymid
G4double m_Ymid
Definition: LArWheelSolid.h:171
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
LArWheelSolid::fs_cross_upper
G4bool fs_cross_upper(const G4ThreeVector &p, const G4ThreeVector &v, G4ThreeVector &q) const
Definition: LArFanSection.cxx:165
pi
#define pi
Definition: TileMuonFitter.cxx:65
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
OuterGlueFrontCone
@ OuterGlueFrontCone
Definition: LArWheelSolid_type.h:31
python.SystemOfUnits.mm3
int mm3
Definition: SystemOfUnits.py:85
TRT::Hit::side
@ side
Definition: HitInfo.h:83
dqt_zlumi_alleff_HIST.A
A
Definition: dqt_zlumi_alleff_HIST.py:110
OuterAbsorberModule
@ OuterAbsorberModule
Definition: LArWheelSolid_type.h:18
LArWheelSolid::GetCalculator
const LArWheelCalculator * GetCalculator(void) const
Definition: LArWheelSolid.h:130
InnerLeadWheel
@ InnerLeadWheel
Definition: LArWheelSolid_type.h:23
LArWheelSolid::m_test_index
double m_test_index
Definition: LArWheelSolid.h:229
LArWheelSolid::m_Calculator
LArWheelCalculator * m_Calculator
Definition: LArWheelSolid.h:148
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
ZDCMsg::Verbose
@ Verbose
Definition: ZDCMsg.h:18
AthMessaging::AthMessaging
AthMessaging()
Default constructor:
OuterElectrodFrontCone
@ OuterElectrodFrontCone
Definition: LArWheelSolid_type.h:30
A
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
LArWheelSolid::LArWheelSolid_fcn_vol
friend double LArWheelSolid_fcn_vol(double *, double *)
Definition: LArWheelSolidTests.cxx:542
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
LArFanSections::ABmax
G4double ABmax
Definition: LArFanSection.h:19
LArWheelCalculator::GetWheelInnerRadius
double GetWheelInnerRadius(std::array< double, 2 > &rInner) const
Definition: LArWheelCalculator.cxx:493
LWSDBG
#define LWSDBG(a, b)
Definition: LArWheelSliceSolid.h:28
lumiFormat.i
int i
Definition: lumiFormat.py:85
xmin
double xmin
Definition: listroot.cxx:60
z
#define z
LArFanSections::Amin
G4double Amin
Definition: LArFanSection.h:14
LArWheelCalculator::GetNumberOfFans
int GetNumberOfFans() const
Definition: LArWheelCalculator.h:92
LArG4::OuterGlueWheel
@ OuterGlueWheel
Definition: LArWheelCalculatorEnums.h:19
extractSporadic.h
list h
Definition: extractSporadic.py:97
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
InnerAbsorberWheel
@ InnerAbsorberWheel
Definition: LArWheelSolid_type.h:13
LArWheelCalculator::GetWheelThickness
double GetWheelThickness() const
Definition: LArWheelCalculator.h:80
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:169
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
LArWheelSolid::m_f_area
TF1 * m_f_area
Definition: LArWheelSolid.h:227
LArFanSections::Bmin2
G4double Bmin2
Definition: LArFanSection.h:17
OuterLeadWheel
@ OuterLeadWheel
Definition: LArWheelSolid_type.h:24
LArG4::InnerElectrodModule
@ InnerElectrodModule
Definition: LArWheelCalculatorEnums.h:14
OuterElectrodBackCone
@ OuterElectrodBackCone
Definition: LArWheelSolid_type.h:34
OuterGlueBackCone
@ OuterGlueBackCone
Definition: LArWheelSolid_type.h:35
LArWheelCalculator
Definition: LArWheelCalculator.h:60
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
InnerLeadCone
@ InnerLeadCone
Definition: LArWheelSolid_type.h:28
LArWheelSolid::check_D
G4bool check_D(G4double &b, G4double A, G4double B, G4double C, G4bool) const
Definition: LArFanSection.cxx:41
LArWheelSolid::m_Zsect
std::vector< G4double > m_Zsect
Definition: LArWheelSolid.h:159
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
LArWheelSolid::Inside
EInside Inside(const G4ThreeVector &) const
Definition: LArWheelSolid.cxx:15
calibdata.exit
exit
Definition: calibdata.py:236
InnerAbsorberModule
@ InnerAbsorberModule
Definition: LArWheelSolid_type.h:17
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
LArG4::InnerLeadWheel
@ InnerLeadWheel
Definition: LArWheelCalculatorEnums.h:20
LArWheelSolid::m_fs
LArFanSections * m_fs
Definition: LArWheelSolid.h:162
LArWheelSolid::m_f_vol
TF1 * m_f_vol
Definition: LArWheelSolid.h:227
LArWheelCalculator::GetWheelOuterRadius
void GetWheelOuterRadius(std::array< double, 2 > &rOuter) const
Definition: LArWheelCalculator.cxx:525
CxxUtils::atof
double atof(std::string_view str)
Converts a string into a double / float.
Definition: Control/CxxUtils/Root/StringUtils.cxx:91
LArWheelSolid::m_Zsect_start_search
G4int m_Zsect_start_search
Definition: LArWheelSolid.h:160
LArWheelSolid::clean_tests
void clean_tests(void)
Definition: LArWheelSolidTests.cxx:486
twopi
constexpr double twopi
Definition: VertexPointEstimator.cxx:16
OuterElectrodWheel
@ OuterElectrodWheel
Definition: LArWheelSolid_type.h:16
python.SystemOfUnits.mm2
int mm2
Definition: SystemOfUnits.py:84
LArWheelSolid::select_section
G4int select_section(const G4double &Z) const
Definition: LArWheelSolid.cxx:164
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
LArFanSections::xmax
G4double xmax
Definition: LArFanSection.h:18
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
LArWheelSolid::m_FanHalfThickness
G4double m_FanHalfThickness
Definition: LArWheelSolid.h:149
LArG4::OuterAbsorberModule
@ OuterAbsorberModule
Definition: LArWheelCalculatorEnums.h:13
dqt_zlumi_alleff_HIST.B
B
Definition: dqt_zlumi_alleff_HIST.py:110
LArWheelSolid::s_IterationPrecision2
static const G4double s_IterationPrecision2
Definition: LArWheelSolid.h:143
LArWheelCalculator::GetHalfWaveLength
double GetHalfWaveLength() const
Definition: LArWheelCalculator.h:96
LArWheelSolid::NoCross
@ NoCross
Definition: LArWheelSolid.h:190
OuterAbsorberFrontCone
@ OuterAbsorberFrontCone
Definition: LArWheelSolid_type.h:29
library_scraper.dd
list dd
Definition: library_scraper.py:46
LArWheelCalculator::AmplitudeOfSurface
double AmplitudeOfSurface(const CLHEP::Hep3Vector &P, int side, int fan_number) const
Definition: LArWheelCalculatorGeometry.cxx:130
LArWheelCalculator::DistanceToTheNearestFan
double DistanceToTheNearestFan(CLHEP::Hep3Vector &p, int &out_fan_number) const
Determines the nearest to the input point fan.
Definition: LArWheelCalculatorGeometry.cxx:90
python.PyAthena.v
v
Definition: PyAthena.py:154
Trk::inside
@ inside
Definition: PropDirection.h:29
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
ALFA_EventTPCnv_Dict::t2
std::vector< ALFA_RawDataContainer_p1 > t2
Definition: ALFA_EventTPCnvDict.h:44
DeMoScan.index
string index
Definition: DeMoScan.py:364
LArWheelSolid::get_area_on_face
G4double get_area_on_face(void) const
Definition: LArWheelSolidTests.cxx:333
a
TList * a
Definition: liststreamerinfos.cxx:10
LArWheelSolid::init_tests
void init_tests(void)
Definition: LArWheelSolidTests.cxx:610
SCT_ConditionsAlgorithms::CoveritySafe::getenv
std::string getenv(const std::string &variableName)
get an environment variable
Definition: SCT_ConditionsUtilities.cxx:17
h
LArWheelCalculator::NearestPointOnNeutralFibre
CLHEP::Hep3Vector NearestPointOnNeutralFibre(const CLHEP::Hep3Vector &p, int fan_number) const
Definition: LArWheelCalculatorGeometry.cxx:113
LArWheelSolid::m_MinPhi
G4double m_MinPhi
Definition: LArWheelSolid.h:151
LArWheelSolid::m_IsOuter
G4bool m_IsOuter
Definition: LArWheelSolid.h:146
LArWheelSolid::m_f_side_area
TF1 * m_f_side_area
Definition: LArWheelSolid.h:227
LArWheelSolid::m_FanPhiAmplitude
G4double m_FanPhiAmplitude
Definition: LArWheelSolid.h:150
LArFanSections::ABmin
G4double ABmin
Definition: LArFanSection.h:19
LArWheelSolid::in_iteration_process
G4double in_iteration_process(const G4ThreeVector &, G4double, G4ThreeVector &, int) const
Definition: LArWheelSolidDisToIn.cxx:126
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition: AmgMatrixBasePlugin.h:21
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
LArWheelSolid::m_Zmin
G4double m_Zmin
Definition: LArWheelSolid.h:169
dq_defect_virtual_defect_validation.d2
d2
Definition: dq_defect_virtual_defect_validation.py:81
F
#define F(x, y, z)
Definition: MD5.cxx:112
LArWheelSolid::set_phi_size
void set_phi_size(void)
Definition: LArWheelSolidInit.cxx:389
LArWheelSolid::m_Rmin
G4double m_Rmin
Definition: LArWheelSolid.h:169
LArFanSections::Bmax2
G4double Bmax2
Definition: LArFanSection.h:17
LArWheelSolid::m_Type
const LArWheelSolid_t m_Type
Definition: LArWheelSolid.h:147
LArWheelSolid::inner_solid_init
void inner_solid_init(const G4String &)
Definition: LArWheelSolidInit.cxx:206
LArWheelCalculator::GetFanStepOnPhi
double GetFanStepOnPhi() const
Definition: LArWheelCalculator.h:95
LArCellBinning.step
step
Definition: LArCellBinning.py:158
extractSporadic.q
list q
Definition: extractSporadic.py:98
LArWheelSolid::m_Zmax
G4double m_Zmax
Definition: LArWheelSolid.h:169
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
InnerAbsorberCone
@ InnerAbsorberCone
Definition: LArWheelSolid_type.h:25
LArWheelSolid::outer_solid_init
void outer_solid_init(const G4String &)
Definition: LArWheelSolidInit.cxx:274
LArWheelSolid::FanBoundExit_t
FanBoundExit_t
Definition: LArWheelSolid.h:189
LArWheelCalculator::DistanceToTheNeutralFibre
double DistanceToTheNeutralFibre(const CLHEP::Hep3Vector &p, int fan_number) const
Calculates aproximate, probably underestimate, distance to the neutral fibre of the vertical fan.
Definition: LArWheelCalculatorGeometry.cxx:108
LArG4::OuterLeadWheel
@ OuterLeadWheel
Definition: LArWheelCalculatorEnums.h:20
jobOptions.prec
prec
Definition: jobOptions.Superchic_UPC_yyMuMu.py:20
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
python.PhysicalConstants.halfpi
float halfpi
Definition: PhysicalConstants.py:51
LArFanSections::Bmax
G4double Bmax
Definition: LArFanSection.h:15
LArWheelSolid::s_IterationPrecision
static const G4double s_IterationPrecision
Definition: LArWheelSolid.h:142
LArG4::OuterAbsorberWheel
@ OuterAbsorberWheel
Definition: LArWheelCalculatorEnums.h:11
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132
LArFanSections::Amin2
G4double Amin2
Definition: LArFanSection.h:16
LArWheelSolid::GetCubicVolume
G4double GetCubicVolume(void)
Definition: LArWheelSolidTests.cxx:316
LArWheelSolid::m_BoundingShape
G4VSolid * m_BoundingShape
Definition: LArWheelSolid.h:154
LArWheelSolid::ExitAtInner
@ ExitAtInner
Definition: LArWheelSolid.h:190
LArWheelSolid::s_IterationsLimit
static const unsigned int s_IterationsLimit
Definition: LArWheelSolid.h:144
beamspotnt.calc
calc
Definition: bin/beamspotnt.py:1252
LArWheelSolid::distance_to_in
virtual G4double distance_to_in(G4ThreeVector &, const G4ThreeVector &, int) const
Definition: LArWheelSolidDisToIn.cxx:216
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
LArG4::InnerElectrodWheel
@ InnerElectrodWheel
Definition: LArWheelCalculatorEnums.h:12
LArFanSections::xmin
G4double xmin
Definition: LArFanSection.h:18
LArWheelSolid::m_Zmid
G4double m_Zmid
Definition: LArWheelSolid.h:165
OuterAbsorberWheel
@ OuterAbsorberWheel
Definition: LArWheelSolid_type.h:14
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:26
LArFanSections::Cflat2
G4double Cflat2
Definition: LArFanSection.h:19
LArWheelSolid::m_MaxPhi
G4double m_MaxPhi
Definition: LArWheelSolid.h:152
LARWHEELSOLID_ZSECT_MULT
#define LARWHEELSOLID_ZSECT_MULT
Definition: LArWheelSolid.h:26
LArWheelSolid::out_iteration_process
G4double out_iteration_process(const G4ThreeVector &, G4ThreeVector &, const int) const
Definition: LArWheelSolidDisToOut.cxx:229
LArWheelSolid::m_f_length
TF1 * m_f_length
Definition: LArWheelSolid.h:227
LArWheelSolidTypeString
const char * LArWheelSolidTypeString(LArWheelSolid_t type)
Definition: LArWheelSolid.h:59
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
LArG4::LArWheelCalculator_t
LArWheelCalculator_t
Definition: LArWheelCalculatorEnums.h:10
LArWheelSolid::ExitAtBack
@ ExitAtBack
Definition: LArWheelSolid.h:191