Import Geant4 5.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:28:22 +02:00
parent fbd4999cf7
commit 4aea781e80
5454 changed files with 223141 additions and 67347 deletions
+15 -1
View File
@@ -1,5 +1,5 @@
$Id: History,v 1.36 2003/03/25 17:02:01 gcosmo Exp $
$Id: History,v 1.39 2003/06/12 12:47:50 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -20,6 +20,20 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Jun 12, 2003 G.Cosmo geom-bool-V05-01-02
- G4ReflectionFactory:
o Made public accessors: GetConstituentLV(), GetReflectedLV(),
IsConstituent() and IsReflected().
o Added accessor GetReflectedVolumesMap() to access list of
reflected volumes.
May 22, 2003 G.Cosmo geom-bool-V05-01-01
- Implementations for Set/GetScalePrecision() in G4ReflectionFactory
missing! Now fixed.
May 12, 2003 G.Cosmo geom-bool-V05-01-00
- Added set/get methods for scale precision in G4ReflectionFactory.
Mar 25, 2003 G.Cosmo geom-bool-V05-00-01
- Fixed trivial strict pedantic warnings in G4ReflectedSolid.cc and
G4ReflectionFactory.cc.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4BooleanSolid.hh,v 1.6 2002/10/28 11:36:28 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4BooleanSolid.hh,v 1.7 2003/06/16 16:53:10 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
//
// class G4BooleanSolid
@@ -79,7 +79,7 @@ class G4BooleanSolid : public G4VSolid
virtual G4GeometryType GetEntityType() const;
G4std::ostream& StreamInfo(G4std::ostream& os) const;
std::ostream& StreamInfo(std::ostream& os) const;
protected:
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4DisplacedSolid.hh,v 1.13 2002/10/29 14:13:53 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4DisplacedSolid.hh,v 1.14 2003/06/16 16:53:11 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
//
// class G4DisplacedSolid
@@ -134,7 +134,7 @@ class G4DisplacedSolid : public G4VSolid
void SetObjectTranslation(const G4ThreeVector&);
// Get/Set the rotation/translation, as applied to the object.
G4std::ostream& StreamInfo(G4std::ostream& os) const;
std::ostream& StreamInfo(std::ostream& os) const;
public: // without description
@@ -22,7 +22,7 @@
//
//
// $Id: G4IntersectionSolid.hh,v 1.6 2002/10/28 11:36:28 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
//
// class G4IntersectionSolid
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ReflectedSolid.hh,v 1.6 2002/10/28 11:36:28 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4ReflectedSolid.hh,v 1.7 2003/06/16 16:53:12 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
//
// class G4ReflectedSolid
@@ -107,7 +107,7 @@ class G4ReflectedSolid : public G4VSolid
void SetDirectTransform3D(G4Transform3D&);
// Accessors methods.
G4std::ostream& StreamInfo(G4std::ostream& os) const;
std::ostream& StreamInfo(std::ostream& os) const;
public: // without description
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ReflectionFactory.hh,v 1.2 2003/01/27 10:43:30 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4ReflectionFactory.hh,v 1.5 2003/06/16 16:53:13 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
//
// class G4Reflection
@@ -67,20 +67,20 @@
#include "globals.hh"
#include "geomdefs.hh"
#include "g4std/map"
#include <map>
class G4VPhysicalVolume;
class G4LogicalVolume;
class G4VSolid;
typedef G4std::pair<G4VPhysicalVolume*,
typedef std::pair<G4VPhysicalVolume*,
G4VPhysicalVolume*> G4PhysicalVolumesPair;
typedef std::map<G4LogicalVolume*, G4LogicalVolume*,
std::less<G4LogicalVolume*> > G4ReflectedVolumesMap;
class G4ReflectionFactory
{
typedef G4std::map<G4LogicalVolume*, G4LogicalVolume*,
G4std::less<G4LogicalVolume*> > LogicalVolumesMap;
typedef LogicalVolumesMap::const_iterator LogicalVolumesMapIterator;
typedef G4ReflectedVolumesMap::const_iterator LogicalVolumesMapIterator;
public: // with description
@@ -125,7 +125,32 @@ class G4ReflectionFactory
G4String GetVolumesNameExtension() const;
// Returns the name extension for the reflected solids
// and logical volumes.
void SetScalePrecision(G4double scaleValue);
G4double GetScalePrecision() const;
// Sets/gets precision factor for the scale consistency check
// The default value is set to 10*kCarTolerance.
G4LogicalVolume* GetConstituentLV(G4LogicalVolume* reflLV) const;
// Returns the consituent volume of the given reflected volume,
// 0 if the given reflected volume was not found.
G4LogicalVolume* GetReflectedLV(G4LogicalVolume* lv) const;
// Returns the reflected volume of the given consituent volume,
// 0 if the given volume was not reflected.
G4bool IsConstituent(G4LogicalVolume* lv) const;
// Returns true if the given volume has been already reflected
// (is in the map of constituent volumes).
G4bool IsReflected(G4LogicalVolume* lv) const;
// Returns true if the given volume is a reflected volume
// (is in the map reflected volumes).
const G4ReflectedVolumesMap& GetReflectedVolumesMap() const;
// Returns a handle to the internal map of volumes which have
// been reflected, after that placement or replication is performed.
protected:
G4ReflectionFactory();
@@ -161,26 +186,10 @@ class G4ReflectionFactory
// Should copy and transform daughter of PVReplica type of
// a constituent volume into a reflected volume.
G4LogicalVolume* GetConstituentLV(G4LogicalVolume* reflLV) const;
// Returns the consituent volume of the given reflected volume,
// 0 if the given reflected volume was not found.
G4LogicalVolume* GetReflectedLV(G4LogicalVolume* lv) const;
// Returns the reflected volume of the given consituent volume,
// 0 if the given volume was not reflected.
G4bool IsConstituent(G4LogicalVolume* lv) const;
// Returns true if the given volume has been already reflected
// (is in the map of constituent volumes).
G4bool IsReflected(G4LogicalVolume* lv) const;
// Returns true if the given volume is a reflected volume
// (is in the map reflected volumes).
G4bool IsReflection(const G4Scale3D& scale) const;
// Returns true if the scale is negative, false otherwise.
void CheckScale(const G4Scale3D& scale) const;
void CheckScale(const G4Scale3D& scale) const;
// Checks if scale correspond to fScale, if not gives exception.
void PrintConstituentLVMap();
@@ -191,11 +200,12 @@ class G4ReflectionFactory
static G4ReflectionFactory* fInstance;
static const G4String fDefaultNameExtension;
static const G4Scale3D fScale;
G4double fScalePrecision;
G4int fVerboseLevel;
G4String fNameExtension;
LogicalVolumesMap fConstituentLVMap;
LogicalVolumesMap fReflectedLVMap;
G4ReflectedVolumesMap fConstituentLVMap;
G4ReflectedVolumesMap fReflectedLVMap;
};
#endif
@@ -22,7 +22,7 @@
//
//
// $Id: G4SubtractionSolid.hh,v 1.6 2002/10/28 11:36:28 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
//
// class G4SubtractionSolid
@@ -22,7 +22,7 @@
//
//
// $Id: G4UnionSolid.hh,v 1.7 2002/10/28 11:36:28 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
//
// class G4UnionSolid
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4BooleanSolid.cc,v 1.8 2002/10/29 14:15:52 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4BooleanSolid.cc,v 1.9 2003/06/16 16:53:14 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
// Implementation for the abstract base class for solids created by boolean
// operations between other solids
@@ -155,7 +155,7 @@ G4GeometryType G4BooleanSolid::GetEntityType() const
//
// Stream object contents to an output stream
G4std::ostream& G4BooleanSolid::StreamInfo(G4std::ostream& os) const
std::ostream& G4BooleanSolid::StreamInfo(std::ostream& os) const
{
os << "-----------------------------------------------------------\n"
<< " *** Dump for Boolean solid - " << GetName() << " ***\n"
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4DisplacedSolid.cc,v 1.16 2002/10/29 14:13:53 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4DisplacedSolid.cc,v 1.17 2003/06/16 16:53:15 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
// Implementation for G4DisplacedSolid class for boolean
// operations between other solids
@@ -325,7 +325,7 @@ G4DisplacedSolid::ComputeDimensions( G4VPVParameterisation*,
//
// Stream object contents to an output stream
G4std::ostream& G4DisplacedSolid::StreamInfo(G4std::ostream& os) const
std::ostream& G4DisplacedSolid::StreamInfo(std::ostream& os) const
{
os << "-----------------------------------------------------------\n"
<< " *** Dump for Displaced solid - " << GetName() << " ***\n"
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4IntersectionSolid.cc,v 1.18 2002/10/28 11:36:29 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4IntersectionSolid.cc,v 1.19 2003/06/16 16:53:16 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
// Implementation of methods for the class G4IntersectionSolid
//
@@ -112,8 +112,8 @@ G4IntersectionSolid::CalculateExtent(const EAxis pAxis,
->CalculateExtent( pAxis, pVoxelLimit, pTransform, minB, maxB);
if(retA && retB)
{
pMin = G4std::max( minA, minB ) ;
pMax = G4std::min( maxA, maxB ) ;
pMin = std::max( minA, minB ) ;
pMax = std::min( maxA, maxB ) ;
out = true ;
}
else out = false ;
@@ -421,7 +421,7 @@ G4IntersectionSolid::DistanceToIn( const G4ThreeVector& p) const
}
else
{
dist = G4std::min(fPtrSolidA->DistanceToIn(p),
dist = std::min(fPtrSolidA->DistanceToIn(p),
fPtrSolidB->DistanceToIn(p) ) ;
}
}
@@ -468,7 +468,7 @@ G4IntersectionSolid::DistanceToOut( const G4ThreeVector& p,
G4double distA = fPtrSolidA->DistanceToOut(p,v,calcNorm,&validNormA,&nA) ;
G4double distB = fPtrSolidB->DistanceToOut(p,v,calcNorm,&validNormB,&nB) ;
G4double dist = G4std::min(distA,distB) ;
G4double dist = std::min(distA,distB) ;
if( calcNorm )
{
@@ -508,7 +508,7 @@ G4IntersectionSolid::DistanceToOut( const G4ThreeVector& p ) const
}
#endif
return G4std::min(fPtrSolidA->DistanceToOut(p),
return std::min(fPtrSolidA->DistanceToOut(p),
fPtrSolidB->DistanceToOut(p) ) ;
}
@@ -21,9 +21,9 @@
// ********************************************************************
//
//
// $Id: G4ReflectedSolid.cc,v 1.10 2003/03/25 17:03:03 gcosmo Exp $
// $Id: G4ReflectedSolid.cc,v 1.11 2003/06/16 16:53:17 gunter Exp $
//
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
// Implementation for G4ReflectedSolid class for boolean
// operations between other solids
@@ -484,7 +484,7 @@ G4ReflectedSolid::ComputeDimensions( G4VPVParameterisation*,
//
// Stream object contents to an output stream
G4std::ostream& G4ReflectedSolid::StreamInfo(G4std::ostream& os) const
std::ostream& G4ReflectedSolid::StreamInfo(std::ostream& os) const
{
os << "-----------------------------------------------------------\n"
<< " *** Dump for Reflected solid - " << GetName() << " ***\n"
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ReflectionFactory.cc,v 1.6 2003/03/25 17:03:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4ReflectionFactory.cc,v 1.9 2003/06/12 12:47:33 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
// Author: Ivana Hrivnacova, 16.10.2001 (Ivana.Hrivnacova@cern.ch)
@@ -82,6 +82,7 @@ G4ReflectionFactory::G4ReflectionFactory()
// Protected singleton constructor.
// ---
fScalePrecision = 10.*kCarTolerance;
fInstance = this;
}
@@ -543,6 +544,14 @@ G4bool G4ReflectionFactory::IsReflection(const G4Scale3D& scale) const
//_____________________________________________________________________________
const G4ReflectedVolumesMap&
G4ReflectionFactory::GetReflectedVolumesMap() const
{
return fReflectedLVMap;
}
//_____________________________________________________________________________
void G4ReflectionFactory::PrintConstituentLVMap()
{
// temporary - for debugging purpose
@@ -571,7 +580,7 @@ void G4ReflectionFactory::CheckScale(const G4Scale3D& scale) const
for (G4int j=0; j<4; j++)
diff += abs(scale(i,j) - fScale(i,j));
if (diff > kCarTolerance*10.)
if (diff > fScalePrecision)
{
G4cout << "ERROR - G4ReflectionFactory::CheckScale()" << G4endl
<< " Unexpected scale. Difference: " << diff << G4endl;
@@ -583,6 +592,20 @@ void G4ReflectionFactory::CheckScale(const G4Scale3D& scale) const
//_____________________________________________________________________________
void G4ReflectionFactory::SetScalePrecision(G4double scaleValue)
{
fScalePrecision = scaleValue;
}
//_____________________________________________________________________________
G4double G4ReflectionFactory::GetScalePrecision() const
{
return fScalePrecision;
}
//_____________________________________________________________________________
void G4ReflectionFactory::SetVerboseLevel(G4int verboseLevel)
{
fVerboseLevel = verboseLevel;
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4SubtractionSolid.cc,v 1.17 2002/10/28 11:36:29 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4SubtractionSolid.cc,v 1.18 2003/06/16 16:53:18 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
// Implementation of methods for the class G4IntersectionSolid
//
@@ -401,7 +401,7 @@ G4SubtractionSolid::DistanceToOut( const G4ThreeVector& p ) const
}
else
{
dist= G4std::min(fPtrSolidA->DistanceToOut(p),
dist= std::min(fPtrSolidA->DistanceToOut(p),
fPtrSolidB->DistanceToIn(p) ) ;
}
return dist;
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4UnionSolid.cc,v 1.21 2002/10/28 11:36:29 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4UnionSolid.cc,v 1.22 2003/06/16 16:53:19 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
// Implementation of methods for the class G4IntersectionSolid
//
@@ -118,8 +118,8 @@ G4UnionSolid::CalculateExtent( const EAxis pAxis,
pTransform, minB, maxB);
if( touchesA || touchesB )
{
pMin = G4std::min( minA, minB );
pMax = G4std::max( maxA, maxB );
pMin = std::min( minA, minB );
pMax = std::max( maxA, maxB );
out = true ;
}
else out = false ;
@@ -230,7 +230,7 @@ G4UnionSolid::DistanceToIn( const G4ThreeVector& p,
}
#endif
return G4std::min(fPtrSolidA->DistanceToIn(p,v),
return std::min(fPtrSolidA->DistanceToIn(p,v),
fPtrSolidB->DistanceToIn(p,v) ) ;
}
@@ -257,7 +257,7 @@ G4UnionSolid::DistanceToIn( const G4ThreeVector& p) const
#endif
G4double distA = fPtrSolidA->DistanceToIn(p) ;
G4double distB = fPtrSolidB->DistanceToIn(p) ;
G4double safety = G4std::min(distA,distB) ;
G4double safety = std::min(distA,distB) ;
if(safety < 0.0) safety = 0.0 ;
return safety ;
}
@@ -385,7 +385,7 @@ G4UnionSolid::DistanceToOut( const G4ThreeVector& p ) const
(positionA == kInside && positionB == kSurface ) ||
(positionA == kSurface && positionB == kInside ) )
{
distout= G4std::max(fPtrSolidA->DistanceToOut(p),
distout= std::max(fPtrSolidA->DistanceToOut(p),
fPtrSolidB->DistanceToOut(p) ) ;
}
else