Import Geant4 2.0.0 source tree
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
# $Id: GNUmakefile,v 1.1 2000/05/11 10:09:07 morita Exp $
|
||||
|
||||
name := G4pspecsolids
|
||||
G4ODBMS := true
|
||||
G4ODBMS_INSTALLATION := true
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../../../..
|
||||
endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
G4OODDLX_BOOT := $(G4TMPSCHEMA_BOOT)
|
||||
|
||||
CPPFLAGS += \
|
||||
-Iinclude \
|
||||
-I$(G4SCHEMA_HEADER_DIR) \
|
||||
-I$(G4TMP)/$(G4SYSTEM)/G4pgeomGlobal \
|
||||
-I$(G4TMP)/$(G4SYSTEM)/G4pcsg \
|
||||
-I$(G4BASE)/persistency/global/include \
|
||||
-I$(G4BASE)/persistency/geometry/global/include \
|
||||
-I$(G4BASE)/graphics_reps/include \
|
||||
-I$(G4BASE)/global/management/include \
|
||||
-I$(G4BASE)/global/HEPRandom/include \
|
||||
-I$(G4BASE)/global/HEPGeometry/include \
|
||||
-I$(G4BASE)/geometry/management/include \
|
||||
-I$(G4BASE)/geometry/magneticfield/include \
|
||||
-I$(G4BASE)/geometry/volumes/include \
|
||||
-I$(G4BASE)/geometry/solids/CSG/include \
|
||||
-I$(G4BASE)/geometry/solids/specific/include
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
include $(G4INSTALL)/config/G4ODBMS_BUILD.gmk
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Explicit DDL dependencies:
|
||||
|
||||
##$(G4SCHEMA_HEADER_DIR)/G4PBox.hh: $(G4SCHEMA_HEADER_DIR)/G4PCSGSolid.hh
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
// 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: G4PHype.ddl,v 1.1 2000/05/11 10:10:11 morita Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// class G4PHype
|
||||
//
|
||||
// History:
|
||||
// 19.06.98 A.Kimura Converted G4Hype.hh
|
||||
|
||||
#ifndef G4PHYPE_DDL
|
||||
#define G4PHYPE_DDL
|
||||
|
||||
#include "G4PersistentSchema.hh"
|
||||
#include "G4PCSGSolid.hh"
|
||||
|
||||
class G4VSolid;
|
||||
class G4Hype;
|
||||
|
||||
class G4PHype : public G4PCSGSolid {
|
||||
public:
|
||||
|
||||
G4PHype(const G4Hype* theHype);
|
||||
virtual ~G4PHype();
|
||||
|
||||
G4VSolid* MakeTransientObject() const;
|
||||
|
||||
virtual G4GeometryType GetEntityType() const {return G4String("G4Hype");}
|
||||
|
||||
protected:
|
||||
// values of hype radius at a given Z
|
||||
G4double HypeInnerRadius2(double zVal) const {
|
||||
return (tanInnerStereo2*zVal*zVal+innerRadius2);
|
||||
}
|
||||
G4double HypeOuterRadius2(double zVal) const {
|
||||
return (tanOuterStereo2*zVal*zVal+outerRadius2);
|
||||
}
|
||||
|
||||
G4double innerRadius; // variable names are quite self explanative
|
||||
G4double outerRadius;
|
||||
G4double halfLenZ;
|
||||
G4double innerStereo;
|
||||
G4double outerStereo;
|
||||
|
||||
// precalculated parameters, squared quantities
|
||||
G4double tanInnerStereo2; // squared tan of Inner Stereo angle
|
||||
G4double tanOuterStereo2; // squared tan of Outer Stereo angle
|
||||
G4double innerRadius2; // squared Inner Radius
|
||||
G4double outerRadius2; // squared Outer Radius
|
||||
G4double endInnerRadius2; // squared endcap Inner Radius
|
||||
G4double endOuterRadius2; // squared endcap Outer Radius
|
||||
G4double endInnerRadius; // endcap Inner Radius
|
||||
G4double endOuterRadius; // endcap Outer Radius
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
// 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: G4PHype.cc,v 1.1 2000/05/11 10:10:16 morita Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// class G4PHype
|
||||
//
|
||||
// History:
|
||||
// 19.06.98 A.Kimura Converted G4PHype.cc
|
||||
|
||||
#include "G4VSolid.hh"
|
||||
#include "G4PHype.hh"
|
||||
#include "G4Hype.hh"
|
||||
|
||||
// Constructor - check parameters, and fills protected data members
|
||||
G4PHype::G4PHype(const G4Hype* theHype)
|
||||
: G4PCSGSolid(theHype->GetName())
|
||||
{
|
||||
|
||||
const G4double newInnerRadius = theHype->GetInnerRadius();
|
||||
const G4double newOuterRadius = theHype->GetOuterRadius();
|
||||
const G4double newInnerStereo = theHype->GetOuterStereo();
|
||||
const G4double newOuterStereo = theHype->GetInnerStereo();
|
||||
const G4double newHalfLenZ = theHype->GetZHalfLength();
|
||||
|
||||
// Check z-len
|
||||
if (newHalfLenZ>0) {
|
||||
halfLenZ=newHalfLenZ;
|
||||
} else {
|
||||
G4Exception("Error in G4PHype::G4PHype - invalid z half-length");
|
||||
}
|
||||
|
||||
// Check radii
|
||||
if (newInnerRadius>=0 && newOuterRadius>=0) {
|
||||
if (newInnerRadius < newOuterRadius) {
|
||||
innerRadius=newInnerRadius;
|
||||
outerRadius=newOuterRadius;
|
||||
} else { // swapping radii (:-)
|
||||
innerRadius=newOuterRadius;
|
||||
outerRadius=newInnerRadius;
|
||||
}
|
||||
} else {
|
||||
G4Exception("Error in G4PHype::G4PHype - invalid radii");
|
||||
}
|
||||
|
||||
innerStereo=newInnerStereo;
|
||||
outerStereo=newOuterStereo;
|
||||
|
||||
// init of precalculated quantities
|
||||
tanInnerStereo2 = tan(innerStereo)*tan(innerStereo);
|
||||
tanOuterStereo2 = tan(outerStereo)*tan(outerStereo);
|
||||
innerRadius2 = innerRadius*innerRadius;
|
||||
outerRadius2 = outerRadius*outerRadius;
|
||||
endInnerRadius2 = HypeInnerRadius2(halfLenZ);
|
||||
endOuterRadius2 = HypeOuterRadius2(halfLenZ);
|
||||
endInnerRadius = sqrt(endInnerRadius2);
|
||||
endOuterRadius = sqrt(endOuterRadius2);
|
||||
}
|
||||
|
||||
// Destructor
|
||||
G4PHype::~G4PHype()
|
||||
{;}
|
||||
|
||||
// make a transient object
|
||||
G4VSolid* G4PHype::MakeTransientObject() const {
|
||||
G4VSolid* transientObject = new G4Hype(GetName(),
|
||||
innerRadius,
|
||||
outerRadius,
|
||||
innerStereo,
|
||||
outerStereo,
|
||||
halfLenZ);
|
||||
return transientObject;
|
||||
}
|
||||
Reference in New Issue
Block a user