Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4GeomTestVolume Class Reference

#include <G4GeomTestVolume.hh>

Public Member Functions

 G4GeomTestVolume (G4VPhysicalVolume *theTarget, G4double theTolerance=0.0, G4int numberOfPoints=10000, G4bool theVerbosity=true)
 
 ~G4GeomTestVolume ()
 
G4double GetTolerance () const
 
void SetTolerance (G4double tolerance)
 
G4int GetResolution () const
 
void SetResolution (G4int points)
 
G4bool GetVerbosity () const
 
void SetVerbosity (G4bool verbosity)
 
G4int GetErrorsThreshold () const
 
void SetErrorsThreshold (G4int max)
 
void TestRecursiveOverlap (G4int sLevel=0, G4int depth=-1)
 

Detailed Description

Definition at line 49 of file G4GeomTestVolume.hh.

Constructor & Destructor Documentation

G4GeomTestVolume::G4GeomTestVolume ( G4VPhysicalVolume theTarget,
G4double  theTolerance = 0.0,
G4int  numberOfPoints = 10000,
G4bool  theVerbosity = true 
)

Definition at line 49 of file G4GeomTestVolume.cc.

53  : target(theTarget), tolerance(theTolerance),
54  resolution(numberOfPoints), maxErr(1), verbosity(theVerbosity)
55 {;}
const XML_Char * target
Definition: expat.h:268
G4GeomTestVolume::~G4GeomTestVolume ( )

Definition at line 60 of file G4GeomTestVolume.cc.

60 {;}

Member Function Documentation

G4int G4GeomTestVolume::GetErrorsThreshold ( ) const

Definition at line 113 of file G4GeomTestVolume.cc.

114 {
115  return maxErr;
116 }
G4int G4GeomTestVolume::GetResolution ( ) const

Definition at line 81 of file G4GeomTestVolume.cc.

82 {
83  return resolution;
84 }
G4double G4GeomTestVolume::GetTolerance ( ) const

Definition at line 65 of file G4GeomTestVolume.cc.

66 {
67  return tolerance;
68 }
G4bool G4GeomTestVolume::GetVerbosity ( ) const

Definition at line 97 of file G4GeomTestVolume.cc.

98 {
99  return verbosity;
100 }
void G4GeomTestVolume::SetErrorsThreshold ( G4int  max)

Definition at line 121 of file G4GeomTestVolume.cc.

122 {
123  maxErr = max;
124 }
T max(const T t1, const T t2)
brief Return the largest of the two arguments

Here is the call graph for this function:

Here is the caller graph for this function:

void G4GeomTestVolume::SetResolution ( G4int  points)

Definition at line 89 of file G4GeomTestVolume.cc.

90 {
91  resolution = np;
92 }

Here is the caller graph for this function:

void G4GeomTestVolume::SetTolerance ( G4double  tolerance)

Definition at line 73 of file G4GeomTestVolume.cc.

74 {
75  tolerance = tol;
76 }

Here is the caller graph for this function:

void G4GeomTestVolume::SetVerbosity ( G4bool  verbosity)

Definition at line 105 of file G4GeomTestVolume.cc.

106 {
107  verbosity = verb;
108 }

Here is the caller graph for this function:

void G4GeomTestVolume::TestRecursiveOverlap ( G4int  sLevel = 0,
G4int  depth = -1 
)

Definition at line 129 of file G4GeomTestVolume.cc.

130 {
131  // If reached requested level of depth (i.e. set to 0), exit.
132  // If not depth specified (i.e. set to -1), visit the whole tree.
133  // If requested initial level of depth is not zero, visit from beginning
134  //
135  if (depth == 0) return;
136  if (depth != -1) depth--;
137  if (slevel != 0) slevel--;
138 
139  //
140  // As long as we reached the requested
141  // initial level of depth, test ourselves
142  //
143  if ( slevel==0 )
144  {
145  target->CheckOverlaps(resolution, tolerance, verbosity, maxErr);
146  }
147 
148  //
149  // Loop over unique daughters
150  //
151  std::set<const G4LogicalVolume *> tested;
152 
153  const G4LogicalVolume *logical = target->GetLogicalVolume();
154  G4int nDaughter = logical->GetNoDaughters();
155  G4int iDaughter;
156  for( iDaughter=0; iDaughter<nDaughter; ++iDaughter )
157  {
158  G4VPhysicalVolume *daughter = logical->GetDaughter(iDaughter);
159 
160  // Tested already?
161  //
162  // const G4LogicalVolume *daughterLogical =
163  // daughter->GetLogicalVolume();
164  // std::pair<std::set<const G4LogicalVolume *>::iterator, G4bool>
165  // there = tested.insert(daughterLogical);
166  // if (!there.second) continue;
167 
168  //
169  // Recurse
170  //
171  G4GeomTestVolume vTest( daughter, tolerance, resolution, verbosity );
172  vTest.SetErrorsThreshold(maxErr);
173  vTest.TestRecursiveOverlap( slevel,depth );
174  }
175 }
const XML_Char * target
Definition: expat.h:268
G4VPhysicalVolume * GetDaughter(const G4int i) const
int G4int
Definition: G4Types.hh:78
G4int GetNoDaughters() const

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: