Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4Polycone.cc
이 파일의 문서화 페이지로 가기
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4Polycone.cc 104316 2017-05-24 13:04:23Z gcosmo $
28 //
29 //
30 // --------------------------------------------------------------------
31 // GEANT 4 class source file
32 //
33 //
34 // G4Polycone.cc
35 //
36 // Implementation of a CSG polycone
37 //
38 // --------------------------------------------------------------------
39 
40 #include "G4Polycone.hh"
41 
42 #if !defined(G4GEOM_USE_UPOLYCONE)
43 
44 #include "G4PolyconeSide.hh"
45 #include "G4PolyPhiFace.hh"
46 
47 #include "G4GeomTools.hh"
48 #include "G4VoxelLimits.hh"
49 #include "G4AffineTransform.hh"
50 #include "G4BoundingEnvelope.hh"
51 
52 #include "Randomize.hh"
53 
54 #include "G4EnclosingCylinder.hh"
55 #include "G4ReduciblePolygon.hh"
56 #include "G4VPVParameterisation.hh"
57 
58 using namespace CLHEP;
59 
60 //
61 // Constructor (GEANT3 style parameters)
62 //
64  G4double phiStart,
65  G4double phiTotal,
66  G4int numZPlanes,
67  const G4double zPlane[],
68  const G4double rInner[],
69  const G4double rOuter[] )
70  : G4VCSGfaceted( name )
71 {
72  //
73  // Some historical ugliness
74  //
76 
77  original_parameters->Start_angle = phiStart;
79  original_parameters->Num_z_planes = numZPlanes;
80  original_parameters->Z_values = new G4double[numZPlanes];
81  original_parameters->Rmin = new G4double[numZPlanes];
82  original_parameters->Rmax = new G4double[numZPlanes];
83 
84  G4int i;
85  for (i=0; i<numZPlanes; i++)
86  {
87  if(rInner[i]>rOuter[i])
88  {
89  DumpInfo();
90  std::ostringstream message;
91  message << "Cannot create a Polycone with rInner > rOuter for the same Z"
92  << G4endl
93  << " rInner > rOuter for the same Z !" << G4endl
94  << " rMin[" << i << "] = " << rInner[i]
95  << " -- rMax[" << i << "] = " << rOuter[i];
96  G4Exception("G4Polycone::G4Polycone()", "GeomSolids0002",
97  FatalErrorInArgument, message);
98  }
99  if (( i < numZPlanes-1) && ( zPlane[i] == zPlane[i+1] ))
100  {
101  if( (rInner[i] > rOuter[i+1])
102  ||(rInner[i+1] > rOuter[i]) )
103  {
104  DumpInfo();
105  std::ostringstream message;
106  message << "Cannot create a Polycone with no contiguous segments."
107  << G4endl
108  << " Segments are not contiguous !" << G4endl
109  << " rMin[" << i << "] = " << rInner[i]
110  << " -- rMax[" << i+1 << "] = " << rOuter[i+1] << G4endl
111  << " rMin[" << i+1 << "] = " << rInner[i+1]
112  << " -- rMax[" << i << "] = " << rOuter[i];
113  G4Exception("G4Polycone::G4Polycone()", "GeomSolids0002",
114  FatalErrorInArgument, message);
115  }
116  }
117  original_parameters->Z_values[i] = zPlane[i];
118  original_parameters->Rmin[i] = rInner[i];
119  original_parameters->Rmax[i] = rOuter[i];
120  }
121 
122  //
123  // Build RZ polygon using special PCON/PGON GEANT3 constructor
124  //
125  G4ReduciblePolygon *rz =
126  new G4ReduciblePolygon( rInner, rOuter, zPlane, numZPlanes );
127 
128  //
129  // Do the real work
130  //
131  Create( phiStart, phiTotal, rz );
132 
133  delete rz;
134 }
135 
136 
137 //
138 // Constructor (generic parameters)
139 //
141  G4double phiStart,
142  G4double phiTotal,
143  G4int numRZ,
144  const G4double r[],
145  const G4double z[] )
146  : G4VCSGfaceted( name )
147 {
148 
149  G4ReduciblePolygon *rz = new G4ReduciblePolygon( r, z, numRZ );
150 
151  Create( phiStart, phiTotal, rz );
152 
153  // Set original_parameters struct for consistency
154  //
155 
156  G4bool convertible=SetOriginalParameters(rz);
157 
158  if(!convertible)
159  {
160  std::ostringstream message;
161  message << "Polycone " << GetName() << "cannot be converted" << G4endl
162  << "to Polycone with (Rmin,Rmaz,Z) parameters!";
163  G4Exception("G4Polycone::G4Polycone()", "GeomSolids0002",
164  FatalException, message, "Use G4GenericPolycone instead!");
165  }
166  else
167  {
168  G4cout << "INFO: Converting polycone " << GetName() << G4endl
169  << "to optimized polycone with (Rmin,Rmaz,Z) parameters !"
170  << G4endl;
171  }
172  delete rz;
173 }
174 
175 
176 // Create
177 //
178 // Generic create routine, called by each constructor after
179 // conversion of arguments
180 //
182  G4double phiTotal,
183  G4ReduciblePolygon *rz )
184 {
185  //
186  // Perform checks of rz values
187  //
188  if (rz->Amin() < 0.0)
189  {
190  std::ostringstream message;
191  message << "Illegal input parameters - " << GetName() << G4endl
192  << " All R values must be >= 0 !";
193  G4Exception("G4Polycone::Create()", "GeomSolids0002",
194  FatalErrorInArgument, message);
195  }
196 
197  G4double rzArea = rz->Area();
198  if (rzArea < -kCarTolerance)
199  {
200  rz->ReverseOrder();
201  }
202  else if (rzArea < kCarTolerance)
203  {
204  std::ostringstream message;
205  message << "Illegal input parameters - " << GetName() << G4endl
206  << " R/Z cross section is zero or near zero: " << rzArea;
207  G4Exception("G4Polycone::Create()", "GeomSolids0002",
208  FatalErrorInArgument, message);
209  }
210 
212  || (!rz->RemoveRedundantVertices( kCarTolerance )) )
213  {
214  std::ostringstream message;
215  message << "Illegal input parameters - " << GetName() << G4endl
216  << " Too few unique R/Z values !";
217  G4Exception("G4Polycone::Create()", "GeomSolids0002",
218  FatalErrorInArgument, message);
219  }
220 
221  if (rz->CrossesItself(1/kInfinity))
222  {
223  std::ostringstream message;
224  message << "Illegal input parameters - " << GetName() << G4endl
225  << " R/Z segments cross !";
226  G4Exception("G4Polycone::Create()", "GeomSolids0002",
227  FatalErrorInArgument, message);
228  }
229 
230  numCorner = rz->NumVertices();
231 
232  //
233  // Phi opening? Account for some possible roundoff, and interpret
234  // nonsense value as representing no phi opening
235  //
236  if (phiTotal <= 0 || phiTotal > twopi-1E-10)
237  {
238  phiIsOpen = false;
239  startPhi = 0;
240  endPhi = twopi;
241  }
242  else
243  {
244  phiIsOpen = true;
245 
246  //
247  // Convert phi into our convention
248  //
249  startPhi = phiStart;
250  while( startPhi < 0 ) // Loop checking, 13.08.2015, G.Cosmo
251  startPhi += twopi;
252 
253  endPhi = phiStart+phiTotal;
254  while( endPhi < startPhi ) // Loop checking, 13.08.2015, G.Cosmo
255  endPhi += twopi;
256  }
257 
258  //
259  // Allocate corner array.
260  //
262 
263  //
264  // Copy corners
265  //
266  G4ReduciblePolygonIterator iterRZ(rz);
267 
268  G4PolyconeSideRZ *next = corners;
269  iterRZ.Begin();
270  do // Loop checking, 13.08.2015, G.Cosmo
271  {
272  next->r = iterRZ.GetA();
273  next->z = iterRZ.GetB();
274  } while( ++next, iterRZ.Next() );
275 
276  //
277  // Allocate face pointer array
278  //
280  faces = new G4VCSGface*[numFace];
281 
282  //
283  // Construct conical faces
284  //
285  // But! Don't construct a face if both points are at zero radius!
286  //
287  G4PolyconeSideRZ *corner = corners,
288  *prev = corners + numCorner-1,
289  *nextNext;
290  G4VCSGface **face = faces;
291  do // Loop checking, 13.08.2015, G.Cosmo
292  {
293  next = corner+1;
294  if (next >= corners+numCorner) next = corners;
295  nextNext = next+1;
296  if (nextNext >= corners+numCorner) nextNext = corners;
297 
298  if (corner->r < 1/kInfinity && next->r < 1/kInfinity) continue;
299 
300  //
301  // We must decide here if we can dare declare one of our faces
302  // as having a "valid" normal (i.e. allBehind = true). This
303  // is never possible if the face faces "inward" in r.
304  //
305  G4bool allBehind;
306  if (corner->z > next->z)
307  {
308  allBehind = false;
309  }
310  else
311  {
312  //
313  // Otherwise, it is only true if the line passing
314  // through the two points of the segment do not
315  // split the r/z cross section
316  //
317  allBehind = !rz->BisectedBy( corner->r, corner->z,
318  next->r, next->z, kCarTolerance );
319  }
320 
321  *face++ = new G4PolyconeSide( prev, corner, next, nextNext,
322  startPhi, endPhi-startPhi, phiIsOpen, allBehind );
323  } while( prev=corner, corner=next, corner > corners );
324 
325  if (phiIsOpen)
326  {
327  //
328  // Construct phi open edges
329  //
330  *face++ = new G4PolyPhiFace( rz, startPhi, 0, endPhi );
331  *face++ = new G4PolyPhiFace( rz, endPhi, 0, startPhi );
332  }
333 
334  //
335  // We might have dropped a face or two: recalculate numFace
336  //
337  numFace = face-faces;
338 
339  //
340  // Make enclosingCylinder
341  //
343  new G4EnclosingCylinder( rz, phiIsOpen, phiStart, phiTotal );
344 }
345 
346 
347 //
348 // Fake default constructor - sets only member data and allocates memory
349 // for usage restricted to object persistency.
350 //
352  : G4VCSGfaceted(a), startPhi(0.), endPhi(0.), phiIsOpen(false),
353  numCorner(0), corners(0),original_parameters(0),
354  enclosingCylinder(0)
355 {
356 }
357 
358 
359 //
360 // Destructor
361 //
363 {
364  delete [] corners;
365  delete original_parameters;
366  delete enclosingCylinder;
367 }
368 
369 
370 //
371 // Copy constructor
372 //
374  : G4VCSGfaceted( source )
375 {
376  CopyStuff( source );
377 }
378 
379 
380 //
381 // Assignment operator
382 //
384 {
385  if (this == &source) return *this;
386 
387  G4VCSGfaceted::operator=( source );
388 
389  delete [] corners;
391 
392  delete enclosingCylinder;
393 
394  CopyStuff( source );
395 
396  return *this;
397 }
398 
399 
400 //
401 // CopyStuff
402 //
403 void G4Polycone::CopyStuff( const G4Polycone &source )
404 {
405  //
406  // Simple stuff
407  //
408  startPhi = source.startPhi;
409  endPhi = source.endPhi;
410  phiIsOpen = source.phiIsOpen;
411  numCorner = source.numCorner;
412 
413  //
414  // The corner array
415  //
417 
418  G4PolyconeSideRZ *corn = corners,
419  *sourceCorn = source.corners;
420  do // Loop checking, 13.08.2015, G.Cosmo
421  {
422  *corn = *sourceCorn;
423  } while( ++sourceCorn, ++corn < corners+numCorner );
424 
425  //
426  // Original parameters
427  //
428  if (source.original_parameters)
429  {
432  }
433 
434  //
435  // Enclosing cylinder
436  //
438 
439  fRebuildPolyhedron = false;
440  fpPolyhedron = 0;
441 }
442 
443 
444 //
445 // Reset
446 //
448 {
449  //
450  // Clear old setup
451  //
453  delete [] corners;
454  delete enclosingCylinder;
455 
456  //
457  // Rebuild polycone
458  //
459  G4ReduciblePolygon *rz =
466  delete rz;
467 
468  return 0;
469 }
470 
471 
472 //
473 // Inside
474 //
475 // This is an override of G4VCSGfaceted::Inside, created in order
476 // to speed things up by first checking with G4EnclosingCylinder.
477 //
479 {
480  //
481  // Quick test
482  //
483  if (enclosingCylinder->MustBeOutside(p)) return kOutside;
484 
485  //
486  // Long answer
487  //
488  return G4VCSGfaceted::Inside(p);
489 }
490 
491 
492 //
493 // DistanceToIn
494 //
495 // This is an override of G4VCSGfaceted::Inside, created in order
496 // to speed things up by first checking with G4EnclosingCylinder.
497 //
499  const G4ThreeVector &v ) const
500 {
501  //
502  // Quick test
503  //
504  if (enclosingCylinder->ShouldMiss(p,v))
505  return kInfinity;
506 
507  //
508  // Long answer
509  //
510  return G4VCSGfaceted::DistanceToIn( p, v );
511 }
512 
513 
514 //
515 // DistanceToIn
516 //
518 {
519  return G4VCSGfaceted::DistanceToIn(p);
520 }
521 
523 //
524 // Get bounding box
525 
527  G4ThreeVector& pMax) const
528 {
529  G4double rmin = kInfinity, rmax = -kInfinity;
530  G4double zmin = kInfinity, zmax = -kInfinity;
531 
532  for (G4int i=0; i<GetNumRZCorner(); ++i)
533  {
534  G4PolyconeSideRZ corner = GetCorner(i);
535  if (corner.r < rmin) rmin = corner.r;
536  if (corner.r > rmax) rmax = corner.r;
537  if (corner.z < zmin) zmin = corner.z;
538  if (corner.z > zmax) zmax = corner.z;
539  }
540 
541  if (IsOpen())
542  {
543  G4TwoVector vmin,vmax;
544  G4GeomTools::DiskExtent(rmin,rmax,
547  vmin,vmax);
548  pMin.set(vmin.x(),vmin.y(),zmin);
549  pMax.set(vmax.x(),vmax.y(),zmax);
550  }
551  else
552  {
553  pMin.set(-rmax,-rmax, zmin);
554  pMax.set( rmax, rmax, zmax);
555  }
556 
557  // Check correctness of the bounding box
558  //
559  if (pMin.x() >= pMax.x() || pMin.y() >= pMax.y() || pMin.z() >= pMax.z())
560  {
561  std::ostringstream message;
562  message << "Bad bounding box (min >= max) for solid: "
563  << GetName() << " !"
564  << "\npMin = " << pMin
565  << "\npMax = " << pMax;
566  G4Exception("G4Polycone::BoundingLimits()", "GeomMgt0001",
567  JustWarning, message);
568  DumpInfo();
569  }
570 }
571 
573 //
574 // Calculate extent under transform and specified limit
575 
577  const G4VoxelLimits& pVoxelLimit,
578  const G4AffineTransform& pTransform,
579  G4double& pMin, G4double& pMax) const
580 {
581  G4ThreeVector bmin, bmax;
582  G4bool exist;
583 
584  // Check bounding box (bbox)
585  //
586  BoundingLimits(bmin,bmax);
587  G4BoundingEnvelope bbox(bmin,bmax);
588 #ifdef G4BBOX_EXTENT
589  if (true) return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
590 #endif
591  if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
592  {
593  return exist = (pMin < pMax) ? true : false;
594  }
595 
596  // To find the extent, RZ contour of the polycone is subdivided
597  // in triangles. The extent is calculated as cumulative extent of
598  // all sub-polycones formed by rotation of triangles around Z
599  //
600  G4TwoVectorList contourRZ;
601  G4TwoVectorList triangles;
602  std::vector<G4int> iout;
603  G4double eminlim = pVoxelLimit.GetMinExtent(pAxis);
604  G4double emaxlim = pVoxelLimit.GetMaxExtent(pAxis);
605 
606  // get RZ contour, ensure anticlockwise order of corners
607  for (G4int i=0; i<GetNumRZCorner(); ++i)
608  {
609  G4PolyconeSideRZ corner = GetCorner(i);
610  contourRZ.push_back(G4TwoVector(corner.r,corner.z));
611  }
613  G4double area = G4GeomTools::PolygonArea(contourRZ);
614  if (area < 0.) std::reverse(contourRZ.begin(),contourRZ.end());
615 
616  // triangulate RZ countour
617  if (!G4GeomTools::TriangulatePolygon(contourRZ,triangles))
618  {
619  std::ostringstream message;
620  message << "Triangulation of RZ contour has failed for solid: "
621  << GetName() << " !"
622  << "\nExtent has been calculated using boundary box";
623  G4Exception("G4Polycone::CalculateExtent()",
624  "GeomMgt1002", JustWarning, message);
625  return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
626  }
627 
628  // set trigonometric values
629  const G4int NSTEPS = 24; // number of steps for whole circle
630  G4double astep = twopi/NSTEPS; // max angle for one step
631 
632  G4double sphi = GetStartPhi();
633  G4double ephi = GetEndPhi();
634  G4double dphi = IsOpen() ? ephi-sphi : twopi;
635  G4int ksteps = (dphi <= astep) ? 1 : (G4int)((dphi-deg)/astep) + 1;
636  G4double ang = dphi/ksteps;
637 
638  G4double sinHalf = std::sin(0.5*ang);
639  G4double cosHalf = std::cos(0.5*ang);
640  G4double sinStep = 2.*sinHalf*cosHalf;
641  G4double cosStep = 1. - 2.*sinHalf*sinHalf;
642 
643  G4double sinStart = GetSinStartPhi();
644  G4double cosStart = GetCosStartPhi();
645  G4double sinEnd = GetSinEndPhi();
646  G4double cosEnd = GetCosEndPhi();
647 
648  // define vectors and arrays
649  std::vector<const G4ThreeVectorList *> polygons;
650  polygons.resize(ksteps+2);
651  G4ThreeVectorList pols[NSTEPS+2];
652  for (G4int k=0; k<ksteps+2; ++k) pols[k].resize(6);
653  for (G4int k=0; k<ksteps+2; ++k) polygons[k] = &pols[k];
654  G4double r0[6],z0[6]; // contour with original edges of triangle
655  G4double r1[6]; // shifted radii of external edges of triangle
656 
657  // main loop along triangles
658  pMin = kInfinity;
659  pMax =-kInfinity;
660  G4int ntria = triangles.size()/3;
661  for (G4int i=0; i<ntria; ++i)
662  {
663  G4int i3 = i*3;
664  for (G4int k=0; k<3; ++k)
665  {
666  G4int e0 = i3+k, e1 = (k<2) ? e0+1 : i3;
667  G4int k2 = k*2;
668  // set contour with original edges of triangle
669  r0[k2+0] = triangles[e0].x(); z0[k2+0] = triangles[e0].y();
670  r0[k2+1] = triangles[e1].x(); z0[k2+1] = triangles[e1].y();
671  // set shifted radii
672  r1[k2+0] = r0[k2+0];
673  r1[k2+1] = r0[k2+1];
674  if (z0[k2+1] - z0[k2+0] <= 0) continue;
675  r1[k2+0] /= cosHalf;
676  r1[k2+1] /= cosHalf;
677  }
678 
679  // rotate countour, set sequence of 6-sided polygons
680  G4double sinCur = sinStart*cosHalf + cosStart*sinHalf;
681  G4double cosCur = cosStart*cosHalf - sinStart*sinHalf;
682  for (G4int j=0; j<6; ++j) pols[0][j].set(r0[j]*cosStart,r0[j]*sinStart,z0[j]);
683  for (G4int k=1; k<ksteps+1; ++k)
684  {
685  for (G4int j=0; j<6; ++j) pols[k][j].set(r1[j]*cosCur,r1[j]*sinCur,z0[j]);
686  G4double sinTmp = sinCur;
687  sinCur = sinCur*cosStep + cosCur*sinStep;
688  cosCur = cosCur*cosStep - sinTmp*sinStep;
689  }
690  for (G4int j=0; j<6; ++j) pols[ksteps+1][j].set(r0[j]*cosEnd,r0[j]*sinEnd,z0[j]);
691 
692  // set sub-envelope and adjust extent
693  G4double emin,emax;
694  G4BoundingEnvelope benv(polygons);
695  if (!benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,emin,emax)) continue;
696  if (emin < pMin) pMin = emin;
697  if (emax > pMax) pMax = emax;
698  if (eminlim > pMin && emaxlim < pMax) return true; // max possible extent
699  }
700  return (pMin < pMax);
701 }
702 
703 //
704 // ComputeDimensions
705 //
707  const G4int n,
708  const G4VPhysicalVolume* pRep )
709 {
710  p->ComputeDimensions(*this,n,pRep);
711 }
712 
713 //
714 // GetEntityType
715 //
717 {
718  return G4String("G4Polycone");
719 }
720 
721 //
722 // Make a clone of the object
723 //
725 {
726  return new G4Polycone(*this);
727 }
728 
729 //
730 // Stream object contents to an output stream
731 //
732 std::ostream& G4Polycone::StreamInfo( std::ostream& os ) const
733 {
734  G4int oldprc = os.precision(16);
735  os << "-----------------------------------------------------------\n"
736  << " *** Dump for solid - " << GetName() << " ***\n"
737  << " ===================================================\n"
738  << " Solid type: G4Polycone\n"
739  << " Parameters: \n"
740  << " starting phi angle : " << startPhi/degree << " degrees \n"
741  << " ending phi angle : " << endPhi/degree << " degrees \n";
742  G4int i=0;
743 
745  os << " number of Z planes: " << numPlanes << "\n"
746  << " Z values: \n";
747  for (i=0; i<numPlanes; i++)
748  {
749  os << " Z plane " << i << ": "
750  << original_parameters->Z_values[i] << "\n";
751  }
752  os << " Tangent distances to inner surface (Rmin): \n";
753  for (i=0; i<numPlanes; i++)
754  {
755  os << " Z plane " << i << ": "
756  << original_parameters->Rmin[i] << "\n";
757  }
758  os << " Tangent distances to outer surface (Rmax): \n";
759  for (i=0; i<numPlanes; i++)
760  {
761  os << " Z plane " << i << ": "
762  << original_parameters->Rmax[i] << "\n";
763  }
764 
765  os << " number of RZ points: " << numCorner << "\n"
766  << " RZ values (corners): \n";
767  for (i=0; i<numCorner; i++)
768  {
769  os << " "
770  << corners[i].r << ", " << corners[i].z << "\n";
771  }
772  os << "-----------------------------------------------------------\n";
773  os.precision(oldprc);
774 
775  return os;
776 }
777 
778 
779 //
780 // GetPointOnCone
781 //
782 // Auxiliary method for Get Point On Surface
783 //
785  G4double fRmin2, G4double fRmax2,
786  G4double zOne, G4double zTwo,
787  G4double& totArea) const
788 {
789  // declare working variables
790  //
791  G4double Aone, Atwo, Afive, phi, zRand, fDPhi, cosu, sinu;
792  G4double rRand1, rmin, rmax, chose, rone, rtwo, qone, qtwo;
793  G4double fDz=(zTwo-zOne)/2., afDz=std::fabs(fDz);
794  G4ThreeVector point, offset=G4ThreeVector(0.,0.,0.5*(zTwo+zOne));
795  fDPhi = endPhi - startPhi;
796  rone = (fRmax1-fRmax2)/(2.*fDz);
797  rtwo = (fRmin1-fRmin2)/(2.*fDz);
798  if(fRmax1==fRmax2){qone=0.;}
799  else
800  {
801  qone = fDz*(fRmax1+fRmax2)/(fRmax1-fRmax2);
802  }
803  if(fRmin1==fRmin2){qtwo=0.;}
804  else
805  {
806  qtwo = fDz*(fRmin1+fRmin2)/(fRmin1-fRmin2);
807  }
808  Aone = 0.5*fDPhi*(fRmax2 + fRmax1)*(sqr(fRmin1-fRmin2)+sqr(zTwo-zOne));
809  Atwo = 0.5*fDPhi*(fRmin2 + fRmin1)*(sqr(fRmax1-fRmax2)+sqr(zTwo-zOne));
810  Afive = fDz*(fRmax1-fRmin1+fRmax2-fRmin2);
811  totArea = Aone+Atwo+2.*Afive;
812 
813  phi = G4RandFlat::shoot(startPhi,endPhi);
814  cosu = std::cos(phi);
815  sinu = std::sin(phi);
816 
817 
818  if( (startPhi == 0) && (endPhi == twopi) ) { Afive = 0; }
819  chose = G4RandFlat::shoot(0.,Aone+Atwo+2.*Afive);
820  if( (chose >= 0) && (chose < Aone) )
821  {
822  if(fRmax1 != fRmax2)
823  {
824  zRand = G4RandFlat::shoot(-1.*afDz,afDz);
825  point = G4ThreeVector (rone*cosu*(qone-zRand),
826  rone*sinu*(qone-zRand), zRand);
827  }
828  else
829  {
830  point = G4ThreeVector(fRmax1*cosu, fRmax1*sinu,
831  G4RandFlat::shoot(-1.*afDz,afDz));
832 
833  }
834  }
835  else if(chose >= Aone && chose < Aone + Atwo)
836  {
837  if(fRmin1 != fRmin2)
838  {
839  zRand = G4RandFlat::shoot(-1.*afDz,afDz);
840  point = G4ThreeVector (rtwo*cosu*(qtwo-zRand),
841  rtwo*sinu*(qtwo-zRand), zRand);
842 
843  }
844  else
845  {
846  point = G4ThreeVector(fRmin1*cosu, fRmin1*sinu,
847  G4RandFlat::shoot(-1.*afDz,afDz));
848  }
849  }
850  else if( (chose >= Aone + Atwo + Afive) && (chose < Aone + Atwo + 2.*Afive) )
851  {
852  zRand = G4RandFlat::shoot(-1.*afDz,afDz);
853  rmin = fRmin2-((zRand-fDz)/(2.*fDz))*(fRmin1-fRmin2);
854  rmax = fRmax2-((zRand-fDz)/(2.*fDz))*(fRmax1-fRmax2);
855  rRand1 = std::sqrt(G4RandFlat::shoot()*(sqr(rmax)-sqr(rmin))+sqr(rmin));
856  point = G4ThreeVector (rRand1*std::cos(startPhi),
857  rRand1*std::sin(startPhi), zRand);
858  }
859  else
860  {
861  zRand = G4RandFlat::shoot(-1.*afDz,afDz);
862  rmin = fRmin2-((zRand-fDz)/(2.*fDz))*(fRmin1-fRmin2);
863  rmax = fRmax2-((zRand-fDz)/(2.*fDz))*(fRmax1-fRmax2);
864  rRand1 = std::sqrt(G4RandFlat::shoot()*(sqr(rmax)-sqr(rmin))+sqr(rmin));
865  point = G4ThreeVector (rRand1*std::cos(endPhi),
866  rRand1*std::sin(endPhi), zRand);
867 
868  }
869 
870  return point+offset;
871 }
872 
873 
874 //
875 // GetPointOnTubs
876 //
877 // Auxiliary method for GetPoint On Surface
878 //
880  G4double zOne, G4double zTwo,
881  G4double& totArea) const
882 {
883  G4double xRand,yRand,zRand,phi,cosphi,sinphi,chose,
884  aOne,aTwo,aFou,rRand,fDz,fSPhi,fDPhi;
885  fDz = std::fabs(0.5*(zTwo-zOne));
886  fSPhi = startPhi;
887  fDPhi = endPhi-startPhi;
888 
889  aOne = 2.*fDz*fDPhi*fRMax;
890  aTwo = 2.*fDz*fDPhi*fRMin;
891  aFou = 2.*fDz*(fRMax-fRMin);
892  totArea = aOne+aTwo+2.*aFou;
893  phi = G4RandFlat::shoot(startPhi,endPhi);
894  cosphi = std::cos(phi);
895  sinphi = std::sin(phi);
896  rRand = fRMin + (fRMax-fRMin)*std::sqrt(G4RandFlat::shoot());
897 
898  if(startPhi == 0 && endPhi == twopi)
899  aFou = 0;
900 
901  chose = G4RandFlat::shoot(0.,aOne+aTwo+2.*aFou);
902  if( (chose >= 0) && (chose < aOne) )
903  {
904  xRand = fRMax*cosphi;
905  yRand = fRMax*sinphi;
906  zRand = G4RandFlat::shoot(-1.*fDz,fDz);
907  return G4ThreeVector(xRand, yRand, zRand+0.5*(zTwo+zOne));
908  }
909  else if( (chose >= aOne) && (chose < aOne + aTwo) )
910  {
911  xRand = fRMin*cosphi;
912  yRand = fRMin*sinphi;
913  zRand = G4RandFlat::shoot(-1.*fDz,fDz);
914  return G4ThreeVector(xRand, yRand, zRand+0.5*(zTwo+zOne));
915  }
916  else if( (chose >= aOne+aTwo) && (chose <aOne+aTwo+aFou) )
917  {
918  xRand = rRand*std::cos(fSPhi+fDPhi);
919  yRand = rRand*std::sin(fSPhi+fDPhi);
920  zRand = G4RandFlat::shoot(-1.*fDz,fDz);
921  return G4ThreeVector(xRand, yRand, zRand+0.5*(zTwo+zOne));
922  }
923 
924  // else
925 
926  xRand = rRand*std::cos(fSPhi+fDPhi);
927  yRand = rRand*std::sin(fSPhi+fDPhi);
928  zRand = G4RandFlat::shoot(-1.*fDz,fDz);
929  return G4ThreeVector(xRand, yRand, zRand+0.5*(zTwo+zOne));
930 }
931 
932 
933 //
934 // GetPointOnRing
935 //
936 // Auxiliary method for GetPoint On Surface
937 //
939  G4double fRMin2,G4double fRMax2,
940  G4double zOne) const
941 {
942  G4double xRand,yRand,phi,cosphi,sinphi,rRand1,rRand2,A1,Atot,rCh;
944  cosphi = std::cos(phi);
945  sinphi = std::sin(phi);
946 
947  if(fRMin1==fRMin2)
948  {
949  rRand1 = fRMin1; A1=0.;
950  }
951  else
952  {
953  rRand1 = G4RandFlat::shoot(fRMin1,fRMin2);
954  A1=std::fabs(fRMin2*fRMin2-fRMin1*fRMin1);
955  }
956  if(fRMax1==fRMax2)
957  {
958  rRand2=fRMax1; Atot=A1;
959  }
960  else
961  {
962  rRand2 = G4RandFlat::shoot(fRMax1,fRMax2);
963  Atot = A1+std::fabs(fRMax2*fRMax2-fRMax1*fRMax1);
964  }
965  rCh = G4RandFlat::shoot(0.,Atot);
966 
967  if(rCh>A1) { rRand1=rRand2; }
968 
969  xRand = rRand1*cosphi;
970  yRand = rRand1*sinphi;
971 
972  return G4ThreeVector(xRand, yRand, zOne);
973 }
974 
975 
976 //
977 // GetPointOnCut
978 //
979 // Auxiliary method for Get Point On Surface
980 //
982  G4double fRMin2, G4double fRMax2,
983  G4double zOne, G4double zTwo,
984  G4double& totArea) const
985 { if(zOne==zTwo)
986  {
987  return GetPointOnRing(fRMin1, fRMax1,fRMin2,fRMax2,zOne);
988  }
989  if( (fRMin1 == fRMin2) && (fRMax1 == fRMax2) )
990  {
991  return GetPointOnTubs(fRMin1, fRMax1,zOne,zTwo,totArea);
992  }
993  return GetPointOnCone(fRMin1,fRMax1,fRMin2,fRMax2,zOne,zTwo,totArea);
994 }
995 
996 
997 //
998 // GetPointOnSurface
999 //
1001 {
1002  G4double Area=0,totArea=0,Achose1=0,Achose2=0,phi,cosphi,sinphi,rRand;
1003  G4int i=0;
1004  G4int numPlanes = original_parameters->Num_z_planes;
1005 
1007  cosphi = std::cos(phi);
1008  sinphi = std::sin(phi);
1009 
1010  rRand = original_parameters->Rmin[0] +
1012  * std::sqrt(G4RandFlat::shoot()) );
1013 
1014  std::vector<G4double> areas; // (numPlanes+1);
1015  std::vector<G4ThreeVector> points; // (numPlanes-1);
1016 
1017  areas.push_back(pi*(sqr(original_parameters->Rmax[0])
1018  -sqr(original_parameters->Rmin[0])));
1019 
1020  for(i=0; i<numPlanes-1; i++)
1021  {
1023  * std::sqrt(sqr(original_parameters->Rmin[i]
1024  -original_parameters->Rmin[i+1])+
1027 
1028  Area += (original_parameters->Rmax[i]+original_parameters->Rmax[i+1])
1029  * std::sqrt(sqr(original_parameters->Rmax[i]
1030  -original_parameters->Rmax[i+1])+
1033 
1034  Area *= 0.5*(endPhi-startPhi);
1035 
1036  if(startPhi==0.&& endPhi == twopi)
1037  {
1038  Area += std::fabs(original_parameters->Z_values[i+1]
1041  +original_parameters->Rmax[i+1]
1043  -original_parameters->Rmin[i+1]);
1044  }
1045  areas.push_back(Area);
1046  totArea += Area;
1047  }
1048 
1049  areas.push_back(pi*(sqr(original_parameters->Rmax[numPlanes-1])-
1050  sqr(original_parameters->Rmin[numPlanes-1])));
1051 
1052  totArea += (areas[0]+areas[numPlanes]);
1053  G4double chose = G4RandFlat::shoot(0.,totArea);
1054 
1055  if( (chose>=0.) && (chose<areas[0]) )
1056  {
1057  return G4ThreeVector(rRand*cosphi, rRand*sinphi,
1059  }
1060 
1061  for (i=0; i<numPlanes-1; i++)
1062  {
1063  Achose1 += areas[i];
1064  Achose2 = (Achose1+areas[i+1]);
1065  if(chose>=Achose1 && chose<Achose2)
1066  {
1069  original_parameters->Rmin[i+1],
1070  original_parameters->Rmax[i+1],
1072  original_parameters->Z_values[i+1], Area);
1073  }
1074  }
1075 
1076  rRand = original_parameters->Rmin[numPlanes-1] +
1077  ( (original_parameters->Rmax[numPlanes-1]-original_parameters->Rmin[numPlanes-1])
1078  * std::sqrt(G4RandFlat::shoot()) );
1079 
1080  return G4ThreeVector(rRand*cosphi,rRand*sinphi,
1081  original_parameters->Z_values[numPlanes-1]);
1082 
1083 }
1084 
1085 //
1086 // CreatePolyhedron
1087 //
1089 {
1090  //
1091  // This has to be fixed in visualization. Fake it for the moment.
1092  //
1093 
1100 }
1101 
1103 {
1104  G4int numPlanes = (G4int)numCorner;
1105  G4bool isConvertible=true;
1106  G4double Zmax=rz->Bmax();
1107  rz->StartWithZMin();
1108 
1109  // Prepare vectors for storage
1110  //
1111  std::vector<G4double> Z;
1112  std::vector<G4double> Rmin;
1113  std::vector<G4double> Rmax;
1114 
1115  G4int countPlanes=1;
1116  G4int icurr=0;
1117  G4int icurl=0;
1118 
1119  // first plane Z=Z[0]
1120  //
1121  Z.push_back(corners[0].z);
1122  G4double Zprev=Z[0];
1123  if (Zprev == corners[1].z)
1124  {
1125  Rmin.push_back(corners[0].r);
1126  Rmax.push_back (corners[1].r);icurr=1;
1127  }
1128  else if (Zprev == corners[numPlanes-1].z)
1129  {
1130  Rmin.push_back(corners[numPlanes-1].r);
1131  Rmax.push_back (corners[0].r);
1132  icurl=numPlanes-1;
1133  }
1134  else
1135  {
1136  Rmin.push_back(corners[0].r);
1137  Rmax.push_back (corners[0].r);
1138  }
1139 
1140  // next planes until last
1141  //
1142  G4int inextr=0, inextl=0;
1143  for (G4int i=0; i < numPlanes-2; i++)
1144  {
1145  inextr=1+icurr;
1146  inextl=(icurl <= 0)? numPlanes-1 : icurl-1;
1147 
1148  if((corners[inextr].z >= Zmax) & (corners[inextl].z >= Zmax)) { break; }
1149 
1150  G4double Zleft = corners[inextl].z;
1151  G4double Zright = corners[inextr].z;
1152  if(Zright > Zleft) // Next plane will be Zleft
1153  {
1154  Z.push_back(Zleft);
1155  countPlanes++;
1156  G4double difZr=corners[inextr].z - corners[icurr].z;
1157  G4double difZl=corners[inextl].z - corners[icurl].z;
1158 
1159  if(std::fabs(difZl) < kCarTolerance)
1160  {
1161  if(std::fabs(difZr) < kCarTolerance)
1162  {
1163  Rmin.push_back(corners[inextl].r);
1164  Rmax.push_back(corners[icurr].r);
1165  }
1166  else
1167  {
1168  Rmin.push_back(corners[inextl].r);
1169  Rmax.push_back(corners[icurr].r + (Zleft-corners[icurr].z)/difZr
1170  *(corners[inextr].r - corners[icurr].r));
1171  }
1172  }
1173  else if (difZl >= kCarTolerance)
1174  {
1175  if(std::fabs(difZr) < kCarTolerance)
1176  {
1177  Rmin.push_back(corners[icurl].r);
1178  Rmax.push_back(corners[icurr].r);
1179  }
1180  else
1181  {
1182  Rmin.push_back(corners[icurl].r);
1183  Rmax.push_back(corners[icurr].r + (Zleft-corners[icurr].z)/difZr
1184  *(corners[inextr].r - corners[icurr].r));
1185  }
1186  }
1187  else
1188  {
1189  isConvertible=false; break;
1190  }
1191  icurl=(icurl == 0)? numPlanes-1 : icurl-1;
1192  }
1193  else if(std::fabs(Zright-Zleft)<kCarTolerance) // Zright=Zleft
1194  {
1195  Z.push_back(Zleft);
1196  countPlanes++;
1197  icurr++;
1198 
1199  icurl=(icurl == 0)? numPlanes-1 : icurl-1;
1200 
1201  Rmin.push_back(corners[inextl].r);
1202  Rmax.push_back(corners[inextr].r);
1203  }
1204  else // Zright<Zleft
1205  {
1206  Z.push_back(Zright);
1207  countPlanes++;
1208 
1209  G4double difZr=corners[inextr].z - corners[icurr].z;
1210  G4double difZl=corners[inextl].z - corners[icurl].z;
1211  if(std::fabs(difZr) < kCarTolerance)
1212  {
1213  if(std::fabs(difZl) < kCarTolerance)
1214  {
1215  Rmax.push_back(corners[inextr].r);
1216  Rmin.push_back(corners[icurr].r);
1217  }
1218  else
1219  {
1220  Rmin.push_back(corners[icurl].r + (Zright-corners[icurl].z)/difZl
1221  *(corners[inextl].r - corners[icurl].r));
1222  Rmax.push_back(corners[inextr].r);
1223  }
1224  icurr++;
1225  } // plate
1226  else if (difZr >= kCarTolerance)
1227  {
1228  if(std::fabs(difZl) < kCarTolerance)
1229  {
1230  Rmax.push_back(corners[inextr].r);
1231  Rmin.push_back (corners[icurr].r);
1232  }
1233  else
1234  {
1235  Rmax.push_back(corners[inextr].r);
1236  Rmin.push_back (corners[icurl].r+(Zright-corners[icurl].z)/difZl
1237  * (corners[inextl].r - corners[icurl].r));
1238  }
1239  icurr++;
1240  }
1241  else
1242  {
1243  isConvertible=false; break;
1244  }
1245  }
1246  } // end for loop
1247 
1248  // last plane Z=Zmax
1249  //
1250  Z.push_back(Zmax);
1251  countPlanes++;
1252  inextr=1+icurr;
1253  inextl=(icurl <= 0)? numPlanes-1 : icurl-1;
1254 
1255  Rmax.push_back(corners[inextr].r);
1256  Rmin.push_back(corners[inextl].r);
1257 
1258  // Set original parameters Rmin,Rmax,Z
1259  //
1260  if(isConvertible)
1261  {
1263  original_parameters->Z_values = new G4double[countPlanes];
1264  original_parameters->Rmin = new G4double[countPlanes];
1265  original_parameters->Rmax = new G4double[countPlanes];
1266 
1267  for(G4int j=0; j < countPlanes; j++)
1268  {
1269  original_parameters->Z_values[j] = Z[j];
1270  original_parameters->Rmax[j] = Rmax[j];
1271  original_parameters->Rmin[j] = Rmin[j];
1272  }
1275  original_parameters->Num_z_planes = countPlanes;
1276 
1277  }
1278  else // Set parameters(r,z) with Rmin==0 as convention
1279  {
1280 #ifdef G4SPECSDEBUG
1281  std::ostringstream message;
1282  message << "Polycone " << GetName() << G4endl
1283  << "cannot be converted to Polycone with (Rmin,Rmaz,Z) parameters!";
1284  G4Exception("G4Polycone::SetOriginalParameters()", "GeomSolids0002",
1285  JustWarning, message);
1286 #endif
1288  original_parameters->Z_values = new G4double[numPlanes];
1289  original_parameters->Rmin = new G4double[numPlanes];
1290  original_parameters->Rmax = new G4double[numPlanes];
1291 
1292  for(G4int j=0; j < numPlanes; j++)
1293  {
1295  original_parameters->Rmax[j] = corners[j].r;
1296  original_parameters->Rmin[j] = 0.0;
1297  }
1300  original_parameters->Num_z_planes = numPlanes;
1301  }
1302  return isConvertible;
1303 }
1304 
1305 #endif
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimits, const G4Transform3D &pTransform3D, G4double &pMin, G4double &pMax) const
G4PolyconeSideRZ GetCorner(G4int index) const
void set(double x, double y, double z)
const XML_Char * name
Definition: expat.h:151
static G4bool TriangulatePolygon(const G4TwoVectorList &polygon, G4TwoVectorList &result)
Definition: G4GeomTools.cc:199
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const
Definition: G4Polycone.cc:526
CLHEP::Hep3Vector G4ThreeVector
G4double GetMaxExtent(const EAxis pAxis) const
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
G4bool IsOpen() const
G4double startPhi
Definition: G4Polycone.hh:193
void SetOriginalParameters(G4PolyconeHistorical *pars)
static const G4double kInfinity
Definition: geomdefs.hh:42
virtual ~G4Polycone()
Definition: G4Polycone.cc:362
G4Polycone(const G4String &name, G4double phiStart, G4double phiTotal, G4int numZPlanes, const G4double zPlane[], const G4double rInner[], const G4double rOuter[])
Definition: G4Polycone.cc:63
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
#define G4endl
Definition: G4ios.hh:61
const char * p
Definition: xmltok.h:285
CLHEP::Hep2Vector G4TwoVector
Definition: G4TwoVector.hh:42
Double_t z
void message(RunManager *runmanager)
Definition: ts_scorers.cc:72
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const
Definition: G4Polycone.cc:576
double z() const
static const G4double emax
void CopyStuff(const G4Polycone &source)
Definition: G4Polycone.cc:403
G4bool BisectedBy(G4double a1, G4double b1, G4double a2, G4double b2, G4double tolerance)
G4bool ShouldMiss(const G4ThreeVector &p, const G4ThreeVector &v) const
static G4bool DiskExtent(G4double rmin, G4double rmax, G4double startPhi, G4double delPhi, G4TwoVector &pmin, G4TwoVector &pmax)
Definition: G4GeomTools.cc:396
G4double GetSinStartPhi() const
G4bool MustBeOutside(const G4ThreeVector &p) const
virtual EInside Inside(const G4ThreeVector &p) const
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4Polycone.cc:706
int Zmax
Float_t Z
G4bool BoundingBoxVsVoxelLimits(const EAxis pAxis, const G4VoxelLimits &pVoxelLimits, const G4Transform3D &pTransform3D, G4double &pMin, G4double &pMax) const
G4EnclosingCylinder * enclosingCylinder
Definition: G4Polycone.hh:202
G4ThreeVector GetPointOnCut(G4double fRMin1, G4double fRMax1, G4double fRMin2, G4double fRMax2, G4double zOne, G4double zTwo, G4double &totArea) const
Definition: G4Polycone.cc:981
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
std::vector< G4ThreeVector > G4ThreeVectorList
G4double endPhi
Definition: G4Polycone.hh:194
G4double GetMinExtent(const EAxis pAxis) const
G4double GetCosStartPhi() const
double x() const
static constexpr double deg
Definition: G4SIunits.hh:152
G4int GetNumRZCorner() const
G4bool RemoveDuplicateVertices(G4double tolerance)
G4ThreeVector GetPointOnRing(G4double fRMin, G4double fRMax, G4double fRMin2, G4double fRMax2, G4double zOne) const
Definition: G4Polycone.cc:938
G4VSolid * Clone() const
Definition: G4Polycone.cc:724
G4double kCarTolerance
Definition: G4VSolid.hh:307
G4Polyhedron * CreatePolyhedron() const
Definition: G4Polycone.cc:1088
static constexpr double twopi
Definition: G4SIunits.hh:76
void Create(G4double phiStart, G4double phiTotal, G4ReduciblePolygon *rz)
Definition: G4Polycone.cc:181
G4ThreeVector GetPointOnSurface() const
Definition: G4Polycone.cc:1000
std::ostream & StreamInfo(std::ostream &os) const
Definition: G4Polycone.cc:732
G4double Amin() const
G4bool CrossesItself(G4double tolerance)
ThreeVector shoot(const G4int Ap, const G4int Af)
G4bool Reset()
Definition: G4Polycone.cc:447
G4VCSGface ** faces
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
Definition: G4Polycone.cc:498
G4double GetEndPhi() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.hh:65
int G4int
Definition: G4Types.hh:78
EInside
Definition: geomdefs.hh:58
G4int NumVertices() const
EInside Inside(const G4ThreeVector &p) const
Definition: G4Polycone.cc:478
std::vector< G4TwoVector > G4TwoVectorList
Definition: G4GeomTools.hh:50
G4double GetStartPhi() const
G4bool RemoveRedundantVertices(G4double tolerance)
EAxis
Definition: geomdefs.hh:54
G4VCSGfaceted & operator=(const G4VCSGfaceted &source)
G4Polycone & operator=(const G4Polycone &source)
Definition: G4Polycone.cc:383
G4String GetName() const
void DumpInfo() const
double y() const
G4PolyconeHistorical * original_parameters
Definition: G4Polycone.hh:198
static constexpr double degree
Definition: G4SIunits.hh:144
G4GLOB_DLL std::ostream G4cout
double x() const
static void RemoveRedundantVertices(G4TwoVectorList &polygon, std::vector< G4int > &iout, G4double tolerance=0)
Definition: G4GeomTools.cc:311
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
G4ThreeVector GetPointOnCone(G4double fRmin1, G4double fRmax1, G4double fRmin2, G4double fRmax2, G4double zOne, G4double zTwo, G4double &totArea) const
Definition: G4Polycone.cc:784
Char_t n[5]
T sqr(const T &x)
Definition: templates.hh:145
static constexpr double pi
Definition: G4SIunits.hh:75
double y() const
G4ThreeVector GetPointOnTubs(G4double fRMin, G4double fRMax, G4double zOne, G4double zTwo, G4double &totArea) const
Definition: G4Polycone.cc:879
G4GeometryType GetEntityType() const
Definition: G4Polycone.cc:716
G4double Bmax() const
G4PolyconeSideRZ * corners
Definition: G4Polycone.hh:197
G4double GetCosEndPhi() const
G4bool fRebuildPolyhedron
G4double GetSinEndPhi() const
G4bool phiIsOpen
Definition: G4Polycone.hh:195
G4Polyhedron * fpPolyhedron
G4int numCorner
Definition: G4Polycone.hh:196
static G4double PolygonArea(const G4TwoVectorList &polygon)
Definition: G4GeomTools.cc:82