Import Geant4 4.0.0 source tree
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GeomTestErrorList.hh,v 1.1 2001/10/17 12:59:53 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// G4GeomTestErrorList
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A list of line segments that are found inside two
|
||||
// separate daughter volumes, indicating a geometry error.
|
||||
//
|
||||
// This class relies on the compiler generated copy constructor
|
||||
// and assignment operator.
|
||||
|
||||
// Author: D.C.Williams, UCSC (davidw@scipp.ucsc.edu)
|
||||
|
||||
#ifndef G4GeomTestErrorList_hh
|
||||
#define G4GeomTestErrorList_hh
|
||||
|
||||
#include "g4std/vector"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4RotationMatrix.hh"
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
|
||||
class G4GeomTestErrorList
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4GeomTestErrorList( const G4VPhysicalVolume *theMother );
|
||||
virtual ~G4GeomTestErrorList();
|
||||
// Constructor and virtual destructor
|
||||
|
||||
void AddError( const G4ThreeVector &s1, const G4ThreeVector &s2 );
|
||||
// Declare a new instance of an error, by specifying
|
||||
// two points in the coordinate system of the mother
|
||||
|
||||
const G4VPhysicalVolume *GetMother() const;
|
||||
// Return pointers to mother volume
|
||||
|
||||
G4int NumError() const;
|
||||
// Return number of errors
|
||||
|
||||
void GetMotherPoints( G4int i, G4ThreeVector &s1, G4ThreeVector &s2 ) const;
|
||||
void GetGlobalPoints( G4int i, G4ThreeVector &s1, G4ThreeVector &s2 ) const;
|
||||
// Return start and end points in various
|
||||
// coordinate systems
|
||||
|
||||
void GetOneDaughtPoints( const G4VPhysicalVolume *daught,
|
||||
G4int i, G4ThreeVector &s1, G4ThreeVector &s2 ) const;
|
||||
// Return start and end points in the coordinate system of a
|
||||
// daughter volume
|
||||
|
||||
private:
|
||||
|
||||
void FindGlobalCoordinateSystem();
|
||||
// Calculate the global coordinate system
|
||||
|
||||
class Segment
|
||||
{
|
||||
public:
|
||||
Segment( const G4ThreeVector &as1, const G4ThreeVector &as2 )
|
||||
: s1(as1), s2(as2) {;}
|
||||
|
||||
const G4ThreeVector &GetS1() const { return s1; }
|
||||
const G4ThreeVector &GetS2() const { return s2; }
|
||||
|
||||
private:
|
||||
G4ThreeVector s1, s2;
|
||||
};
|
||||
G4std::vector<Segment> segments;
|
||||
// List of error segments
|
||||
|
||||
const G4VPhysicalVolume *mother;
|
||||
// Mother volume
|
||||
|
||||
G4ThreeVector globalTranslation;
|
||||
G4RotationMatrix globalRotation;
|
||||
// Global coordinate system with respect to mother
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GeomTestLogger.hh,v 1.2 2001/10/22 13:04:33 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// G4GeomTestLogger
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// Abstract base class that defines the interface of a class that
|
||||
// accepts error reports from the geometry test
|
||||
//
|
||||
|
||||
// Author: D.C.Williams, UCSC (davidw@scipp.ucsc.edu)
|
||||
|
||||
#ifndef G4GeomTestLogger_hh
|
||||
#define G4GeomTestLogger_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
class G4VSolid;
|
||||
class G4GeomTestOverlapList;
|
||||
class G4GeomTestOvershootList;
|
||||
|
||||
class G4GeomTestLogger
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4GeomTestLogger() {;}
|
||||
virtual ~G4GeomTestLogger() {;}
|
||||
// Constructor and virtual destructor
|
||||
|
||||
virtual void SolidProblem( const G4VSolid *solid,
|
||||
const G4String &message,
|
||||
const G4ThreeVector &point ) = 0;
|
||||
// Accept an error from a local calculation of
|
||||
// a solid, probably an inconsistency in geometry
|
||||
|
||||
virtual void NoProblem( const G4String &message ) = 0;
|
||||
// Report a message of no error.
|
||||
|
||||
virtual void OverlappingDaughters( const G4GeomTestOverlapList *) = 0;
|
||||
// Accept an error due to the overlap of two volumes
|
||||
|
||||
virtual void OvershootingDaughter( const G4GeomTestOvershootList *) = 0;
|
||||
// Accept an error due to a daughter sticking outside
|
||||
// a mother volume
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GeomTestOverlapList.hh,v 1.1 2001/10/17 12:59:54 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// G4GeomTestOverlapList
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A list of line segments that are found inside two
|
||||
// separate daughter volumes, indicating a geometry
|
||||
// overlap error.
|
||||
//
|
||||
// This class relies on the compiler generated copy constructor
|
||||
// and assignment operator.
|
||||
|
||||
// Author: D.C.Williams, UCSC (davidw@scipp.ucsc.edu)
|
||||
|
||||
#ifndef G4GeomTestOverlapList_hh
|
||||
#define G4GeomTestOverlapList_hh
|
||||
|
||||
#include "G4GeomTestErrorList.hh"
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
|
||||
class G4GeomTestOverlapList : public G4GeomTestErrorList
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4GeomTestOverlapList();
|
||||
G4GeomTestOverlapList( const G4VPhysicalVolume *theMother,
|
||||
G4int theDaughter1, G4int theDaughter2 );
|
||||
virtual ~G4GeomTestOverlapList();
|
||||
// Constructors and virtual destructor
|
||||
|
||||
G4bool operator==( const G4GeomTestOverlapList &other ) const;
|
||||
G4bool operator< ( const G4GeomTestOverlapList &other ) const;
|
||||
// Comparison operators, based on daughter index numbers
|
||||
|
||||
const G4VPhysicalVolume *GetDaughter1() const;
|
||||
const G4VPhysicalVolume *GetDaughter2() const;
|
||||
G4int GetDaughter1Index() const;
|
||||
G4int GetDaughter2Index() const;
|
||||
// Return pointers to volumes
|
||||
|
||||
void GetDaught1Points( G4int, G4ThreeVector &, G4ThreeVector & ) const;
|
||||
void GetDaught2Points( G4int, G4ThreeVector &, G4ThreeVector & ) const;
|
||||
// Return start and end points in various coordinate systems
|
||||
|
||||
private:
|
||||
|
||||
G4int daughter1, daughter2;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GeomTestOvershootList.hh,v 1.1 2001/10/17 12:59:54 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// G4GeomTestOvershootList
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A list of line segments inside a specific volume daughter
|
||||
// but outside its mother volume, indicating a geometry error
|
||||
|
||||
// Author: D.C.Williams, UCSC (davidw@scipp.ucsc.edu)
|
||||
|
||||
#ifndef G4GeomTestOvershootList_hh
|
||||
#define G4GeomTestOvershootList_hh
|
||||
|
||||
#include "G4GeomTestErrorList.hh"
|
||||
|
||||
class G4GeomTestOvershootList : public G4GeomTestErrorList
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4GeomTestOvershootList();
|
||||
G4GeomTestOvershootList( const G4VPhysicalVolume *theMother,
|
||||
G4int theDaughter );
|
||||
virtual ~G4GeomTestOvershootList();
|
||||
// Constructors and virtual destructor
|
||||
|
||||
G4bool operator==( const G4GeomTestOvershootList &other ) const;
|
||||
G4bool operator< ( const G4GeomTestOvershootList &other ) const;
|
||||
// Comparison operators, based on daughter index
|
||||
|
||||
const G4VPhysicalVolume *GetDaughter() const;
|
||||
G4int GetDaughterIndex() const;
|
||||
// Return pointers to volumes
|
||||
|
||||
void GetDaughtPoints( G4int i, G4ThreeVector &s1, G4ThreeVector &s2 ) const;
|
||||
// Return start and end points in various
|
||||
// coordinate systems
|
||||
|
||||
private:
|
||||
|
||||
G4int daughter;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GeomTestPoint.hh,v 1.1 2001/10/17 12:59:54 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// G4GeomTestPoint
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A point on a line segment intersecting a solid, used
|
||||
// for geometry tests
|
||||
|
||||
// Author: D.C.Williams, UCSC (davidw@scipp.ucsc.edu)
|
||||
|
||||
#ifndef G4GeomTestPoint_hh
|
||||
#define G4GeomTestPoint_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
class G4VSolid;
|
||||
|
||||
class G4GeomTestPoint
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4GeomTestPoint();
|
||||
G4GeomTestPoint( const G4GeomTestPoint &other );
|
||||
G4GeomTestPoint( const G4ThreeVector &thePoint,
|
||||
G4double theS,
|
||||
G4bool isEntering );
|
||||
virtual ~G4GeomTestPoint();
|
||||
// Constructors and virtual destructor
|
||||
|
||||
G4bool operator==( const G4GeomTestPoint &other ) const;
|
||||
G4bool operator< ( const G4GeomTestPoint &other ) const;
|
||||
G4bool operator<=( const G4GeomTestPoint &other ) const;
|
||||
// Operators
|
||||
|
||||
virtual const G4ThreeVector &GetPosition() const;
|
||||
virtual G4double GetDistance() const;
|
||||
virtual G4bool Entering() const;
|
||||
// Accessors
|
||||
|
||||
protected:
|
||||
|
||||
G4ThreeVector p;
|
||||
G4double s;
|
||||
G4bool entering;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GeomTestSegment.hh,v 1.1 2001/10/17 12:59:55 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// G4GeomTestSegment
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// Locate all points on a line that intersect a solid,
|
||||
// and return them in no particular order
|
||||
|
||||
// Author: D.C.Williams, UCSC (davidw@scipp.ucsc.edu)
|
||||
|
||||
#ifndef G4GeomTestSegment_hh
|
||||
#define G4GeomTestSegment_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4GeomTestPoint.hh"
|
||||
|
||||
#include "g4std/vector"
|
||||
|
||||
class G4VSolid;
|
||||
class G4GeomTestLogger;
|
||||
|
||||
class G4GeomTestSegment
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4GeomTestSegment( const G4VSolid *theSolid,
|
||||
const G4ThreeVector &theP,
|
||||
const G4ThreeVector &theV,
|
||||
G4GeomTestLogger *logger );
|
||||
// Constructor
|
||||
|
||||
const G4VSolid *GetSolid() const;
|
||||
const G4ThreeVector &GetP() const;
|
||||
const G4ThreeVector &GetV() const;
|
||||
const G4GeomTestPoint &GetPoint( G4int i ) const;
|
||||
G4int GetNumberPoints() const;
|
||||
// Accessors
|
||||
|
||||
private:
|
||||
|
||||
void FindPoints( G4GeomTestLogger *logger );
|
||||
void FindSomePoints( G4GeomTestLogger *logger, G4bool forward );
|
||||
void PatchInconsistencies( G4GeomTestLogger *logger );
|
||||
|
||||
const G4VSolid * solid;
|
||||
const G4ThreeVector p0,v;
|
||||
|
||||
G4std::vector<G4GeomTestPoint> points;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,109 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GeomTestStreamLogger.hh,v 1.2 2001/10/22 13:04:39 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// G4GeomTestStreamLogger
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A G4GeomTestLogger that outputs to a stream.
|
||||
|
||||
// Author: D.C.Williams, UCSC (davidw@scipp.ucsc.edu)
|
||||
|
||||
#ifndef G4GeomTestStreamLogger_hh
|
||||
#define G4GeomTestStreamLogger_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4GeomTestLogger.hh"
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
|
||||
class G4GeomTestStreamLogger : public G4GeomTestLogger
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4GeomTestStreamLogger( G4std::ostream &o,
|
||||
G4int theMaxPointsPerError=20 );
|
||||
virtual ~G4GeomTestStreamLogger() {;}
|
||||
// Constructors and virtual destructor
|
||||
|
||||
virtual void SolidProblem( const G4VSolid *solid,
|
||||
const G4String &message,
|
||||
const G4ThreeVector &point );
|
||||
virtual void OverlappingDaughters( const G4GeomTestOverlapList *list );
|
||||
virtual void OvershootingDaughter( const G4GeomTestOvershootList *list );
|
||||
virtual void NoProblem ( const G4String &message );
|
||||
|
||||
protected:
|
||||
|
||||
void PrintSegmentListHeader();
|
||||
void PrintSegmentListElement( const G4ThreeVector &s1,
|
||||
const G4ThreeVector &s2 );
|
||||
// Format aides
|
||||
|
||||
const char *IsAre(G4int n);
|
||||
|
||||
public: // Solaris 7 insists on these guys being public
|
||||
|
||||
class PrintPos
|
||||
{
|
||||
public:
|
||||
PrintPos(const G4ThreeVector pos, G4bool useUnit=true )
|
||||
: p(pos), unit(useUnit) {;}
|
||||
|
||||
void Print( G4std::ostream & ) const;
|
||||
|
||||
private:
|
||||
G4ThreeVector p;
|
||||
G4bool unit;
|
||||
};
|
||||
|
||||
class VolumeNameAndCopy
|
||||
{
|
||||
public:
|
||||
VolumeNameAndCopy( const G4VPhysicalVolume *theVolume )
|
||||
: volume(theVolume) {;}
|
||||
|
||||
void Print( G4std::ostream & ) const;
|
||||
|
||||
private:
|
||||
const G4VPhysicalVolume *volume;
|
||||
};
|
||||
|
||||
friend G4std::ostream &operator<<( G4std::ostream &,
|
||||
const G4GeomTestStreamLogger::PrintPos & );
|
||||
friend G4std::ostream &operator<<( G4std::ostream &,
|
||||
const G4GeomTestStreamLogger::VolumeNameAndCopy & );
|
||||
|
||||
protected:
|
||||
|
||||
G4std::ostream &out;
|
||||
G4int maxPointsPerError;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,73 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GeomTestVolPoint.hh,v 1.1 2001/10/17 12:59:56 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// G4GeomTestVolPoint
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A point on a line segment intersecting a physical solid, used
|
||||
// for geometry tests.
|
||||
// A negative daughter index indicates the mother volume itself.
|
||||
|
||||
// Author: D.C.Williams, UCSC (davidw@scipp.ucsc.edu)
|
||||
|
||||
#ifndef G4GeomTestVolPoint_hh
|
||||
#define G4GeomTestVolPoint_hh
|
||||
|
||||
#include "G4GeomTestPoint.hh"
|
||||
#include "G4RotationMatrix.hh"
|
||||
|
||||
class G4GeomTestVolPoint : public G4GeomTestPoint
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4GeomTestVolPoint();
|
||||
G4GeomTestVolPoint( const G4ThreeVector &thePoint,
|
||||
G4double theS,
|
||||
G4bool isEntering,
|
||||
G4int theDaughterIndex );
|
||||
G4GeomTestVolPoint( const G4GeomTestPoint &base,
|
||||
G4int theDaughterIndex );
|
||||
G4GeomTestVolPoint( const G4GeomTestPoint &base,
|
||||
G4int theDaughterIndex,
|
||||
const G4ThreeVector &translation,
|
||||
const G4RotationMatrix *rotation=0 );
|
||||
G4GeomTestVolPoint( const G4GeomTestVolPoint &other );
|
||||
virtual ~G4GeomTestVolPoint();
|
||||
// Constructors and virtual destructor
|
||||
|
||||
G4int GetDaughterIndex() const;
|
||||
// Accessors
|
||||
|
||||
protected:
|
||||
|
||||
G4int daughterIndex;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,154 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GeomTestVolume.hh,v 1.2 2001/10/22 10:41:34 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// G4GeomTestVolume
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// Checks for inconsistencies in the geometric boundaries of a physical
|
||||
// volume and the boundaries of all its immediate daughters.
|
||||
|
||||
// Author: D.C.Williams, UCSC (davidw@scipp.ucsc.edu)
|
||||
|
||||
#ifndef G4GeomTestVolume_hh
|
||||
#define G4GeomTestVolume_hh
|
||||
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4VisExtent.hh"
|
||||
#include "G4GeomTestOverlapList.hh"
|
||||
#include "G4GeomTestOvershootList.hh"
|
||||
|
||||
#include "g4std/map"
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
class G4GeomTestLogger;
|
||||
|
||||
class G4GeomTestVolume
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4GeomTestVolume( const G4VPhysicalVolume *theTarget,
|
||||
G4GeomTestLogger *theLogger,
|
||||
G4double theTolerance=1E-4*mm );
|
||||
~G4GeomTestVolume();
|
||||
// Constructor and destructor
|
||||
|
||||
G4double GetTolerance() const;
|
||||
void SetTolerance(G4double tolerance);
|
||||
// Get/Set error tolerance (default set to 1E-4*mm)
|
||||
|
||||
void TestCartGridXYZ( G4int nx=100, G4int ny=100, G4int nz=100 );
|
||||
void TestCartGridX( G4int ny=100, G4int nz=100 );
|
||||
void TestCartGridY( G4int nz=100, G4int nx=100 );
|
||||
void TestCartGridZ( G4int nx=100, G4int ny=100 );
|
||||
// Test using a grid of lines parallel to a cartesian axis
|
||||
|
||||
void TestRecursiveCartGrid( G4int nx=100, G4int ny=100, G4int nz=100 );
|
||||
// Test using a grid, recursively, to all daughters,
|
||||
// and their daughters, and their daughters, etc.
|
||||
// Be careful: this could take a long, long time
|
||||
|
||||
void TestCylinder( G4int nPhi=90, G4int nZ=50, G4int nRho=50,
|
||||
G4double fracZ=0.8, G4double fracRho=0.8,
|
||||
G4bool usePhi=false );
|
||||
// Test using a set of lines in a cylindrical
|
||||
// pattern of gradually increasing mesh size
|
||||
// nPhi = Number lines per phi
|
||||
// nZ = Number of z points
|
||||
// nRho = Number of rho points
|
||||
// fracZ = Fraction scale for points along z
|
||||
// fracRho = Fraction scale for points along rho
|
||||
// usePhi = Include phi set of lines
|
||||
// Define a set of rho values such that:
|
||||
// rho0 = Size of volume
|
||||
// rho1 = frac*rho0
|
||||
// rho2 = frac*rho1
|
||||
// ... etc
|
||||
// And define a set of z values
|
||||
// z0 = z size of volume
|
||||
// z1 = fracZ*z0
|
||||
// z2 = fracZ*z1
|
||||
// .... etc
|
||||
// And define a set of nPhi phi values, evenly
|
||||
// distributed in phi
|
||||
//
|
||||
// Three sets of lines are tested:
|
||||
// * Imagine the set of lines parallel to the z axis
|
||||
// through each rho point, at a phi angle taken the
|
||||
// set of phi angles
|
||||
// * Imagine the set of lines running perpendicular
|
||||
// to the z axis and through a point on the z axis
|
||||
// at +/- each z point and at an angle taken from the
|
||||
// set of phi values
|
||||
// * If usePhi==true, now take each pair of lines from the
|
||||
// above two sets and imagine the line through the
|
||||
// intersection and perpendicular to both
|
||||
|
||||
void TestCartGrid( const G4ThreeVector &g1,
|
||||
const G4ThreeVector &g2,
|
||||
const G4ThreeVector &v,
|
||||
G4int n1,
|
||||
G4int n2 );
|
||||
// Test using a grid of parallel lines
|
||||
// g1 = First grid axis
|
||||
// g2 = Second grid axis
|
||||
// v = Direction of lines
|
||||
// n1 = Number of grid points along g1
|
||||
// n2 = Number of grid points along g2
|
||||
// The spread of the grid points are automatically calculated
|
||||
// based on the extent of the solid
|
||||
|
||||
void TestOneLine( const G4ThreeVector &p, const G4ThreeVector &v );
|
||||
// Test using a single line, specified by a point and direction,
|
||||
// in the coordinate system of the target volume
|
||||
|
||||
void ReportErrors();
|
||||
// Tabulate and report all errors so far encountered
|
||||
|
||||
void ClearErrors();
|
||||
// Clear list of errors
|
||||
|
||||
protected:
|
||||
|
||||
const G4VPhysicalVolume *target; // Target volume
|
||||
G4GeomTestLogger *logger; // Error logger
|
||||
G4double tolerance; // Error tolerance
|
||||
G4VisExtent extent; // Geometric extent of volume
|
||||
|
||||
G4std::map<G4long,G4GeomTestOverlapList> overlaps;
|
||||
// A list of overlap errors, keyed by the
|
||||
// daughter1*numDaughter+daughter2, where daughter1
|
||||
// is the smaller of the two daughter indices
|
||||
|
||||
G4std::map<G4long,G4GeomTestOvershootList> overshoots;
|
||||
// A list of overshoot errors, keyed by the
|
||||
// daughter number
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user