Import Geant4 0.0.0 source tree
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
|
||||
name := G4pvol
|
||||
G4ODBMS := true
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../../..
|
||||
endif
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
# $(G4TMPDIR) will be overriden in common.gmk later.
|
||||
G4TMPDIR := $(G4TMP)/$(G4SYSTEM)/$(name)
|
||||
|
||||
CPPFLAGS += \
|
||||
-Iinclude \
|
||||
-I$(G4TMPDIR) \
|
||||
-I../management/include \
|
||||
-I$(G4TMP)/$(G4SYSTEM)/G4pgeomn \
|
||||
-I$(G4INSTALL)/source/persistency/management/include \
|
||||
-I$(G4INSTALL)/source/run/include \
|
||||
-I$(G4INSTALL)/source/global/management/include \
|
||||
-I$(G4INSTALL)/source/global/HEPRandom/include \
|
||||
-I$(G4INSTALL)/source/global/HEPGeometry/include \
|
||||
-I$(G4INSTALL)/source/geometry/management/include \
|
||||
-I$(G4INSTALL)/source/geometry/magneticfield/include \
|
||||
-I$(G4INSTALL)/source/geometry/volumes/include \
|
||||
-I$(G4INSTALL)/source/geometry/solids/CSG/include \
|
||||
-I$(G4INSTALL)/source/materials/include \
|
||||
-I$(G4INSTALL)/source/graphics_reps/include
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
include $(G4INSTALL)/config/G4ODBMS_BUILD.gmk
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4PLogicalVolume.ddl,v 2.3 1998/07/12 03:01:31 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// class G4PLogicalVolume
|
||||
// P-verson of the class G4LogicalVolume
|
||||
// Takashi.Sasaki@kek.jp
|
||||
#ifndef G4PLOGICALVOLUME_DDL
|
||||
#define G4PLOGICALVOLUME_DDL 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4PersistentTypes.hh"
|
||||
#include "HepODBMS/odbms/HepODBMS.h"
|
||||
|
||||
#include "G4PVSolid.hh"
|
||||
|
||||
// Forward declarations
|
||||
class G4VPhysicalVolume;
|
||||
class G4LogicalVolume;
|
||||
class G4VSolid;
|
||||
|
||||
#include "G4PVPhysicalVolume.hh"
|
||||
#include "G4PVPhysVolRefVArray.hh"
|
||||
|
||||
class G4PLogicalVolume: public HepPersObj
|
||||
{
|
||||
public:
|
||||
G4PLogicalVolume( const G4LogicalVolume* aLogicalVolume,
|
||||
HepRef(G4PVSolid) persSolid);
|
||||
~G4PLogicalVolume();
|
||||
|
||||
G4LogicalVolume* MakeTransientObject(G4VSolid* aSolid);
|
||||
|
||||
HepRef(G4PVSolid) GetSolid();
|
||||
void SetSolid( HepRef(G4PVSolid) pSolid );
|
||||
|
||||
public:
|
||||
G4int GetNoDaughters() const;
|
||||
HepRef(G4PVPhysicalVolume) GetDaughter(const G4int i) const;
|
||||
void AddDaughter(HepRef(G4PVPhysicalVolume) p);
|
||||
G4bool IsDaughter(const HepRef(G4PVPhysicalVolume) p) const;
|
||||
void RemoveDaughter(const HepRef(G4PVPhysicalVolume) p);
|
||||
|
||||
private:
|
||||
G4PVPhysVolRefVArray fDaughters;
|
||||
// G4MagneticField* fMagneticField;
|
||||
// G4Material* fMaterial;
|
||||
G4PString fName;
|
||||
// G4VSensitiveDetector *fSensitiveDetector;
|
||||
ooRef(G4PVSolid) fSolid;
|
||||
// G4UserLimits* fUserLimits;
|
||||
// G4SmartVoxelHeader* fVoxel;
|
||||
// const G4VisAttributes* fVisAttributes;
|
||||
// G4FastSimulationManager* fFastSimulationManager;
|
||||
// G4bool fIsEnvelope;
|
||||
|
||||
G4Pint NoOfDaughters;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,154 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: G4PLogicalVolume.cc,v 2.3 1998/07/15 07:08:59 morita Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// Takashi.Sasaki@kek.jp
|
||||
|
||||
#include "G4VSolid.hh"
|
||||
#include "G4PVSolid.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4PLogicalVolume.hh"
|
||||
#include "G4PVPhysicalVolume.hh"
|
||||
#include "HepODBMS/clustering/HepClustering.h"
|
||||
|
||||
implement(HepRefVArray,G4PVPhysicalVolume)
|
||||
|
||||
G4PLogicalVolume::G4PLogicalVolume(
|
||||
const G4LogicalVolume* aLogicalVolume,
|
||||
HepRef(G4PVSolid) persSolid)
|
||||
: NoOfDaughters(0)
|
||||
{
|
||||
// Construct persistent logical volume based on the information of
|
||||
// the transient logical volume aLogicalVolume.
|
||||
// It assumes a persistent persSolid has already been created.
|
||||
// Note that daughter volumes will be set by G4PersistencyManager.
|
||||
|
||||
fName = aLogicalVolume->GetName();
|
||||
// *fSensitiveDetector = LogicalVolume->GetSensitiveDetector();
|
||||
fSolid = persSolid;
|
||||
// *fUserLimits = LogicalVolume->GetUserLimits();
|
||||
// *fVoxel = LogicalVolume->GetVoxelHeader();
|
||||
// *fVisAttributes = LogivalVolume->GetVisAttributes();
|
||||
// *fFastSimulationManager = LogicalVolume->GetFastSimulationManager();
|
||||
// *fIsEnvelops = LogicalVolume->GetIsEnvelope();
|
||||
|
||||
}
|
||||
|
||||
G4PLogicalVolume::~G4PLogicalVolume()
|
||||
{
|
||||
// ~G4PLogicalVolume() deletes the persistent Logical Volume permanently
|
||||
// from the database (as well as from the memory).
|
||||
|
||||
// need to de-reference HepRef's in persistent Physics Volume here.
|
||||
// ....
|
||||
|
||||
HepRef(G4PLogicalVolume) aVol = ooThis();
|
||||
|
||||
HepDelete(aVol);
|
||||
}
|
||||
|
||||
|
||||
//#include "G4MagneticField.hh"
|
||||
//#include "G4Material.hh"
|
||||
//#include "G4VSensitiveDetector.hh"
|
||||
//#include "G4VSolid.hh"
|
||||
//#include "G4UserLimits.hh"
|
||||
//#include "G4SmartVoxelHeader.hh"
|
||||
//#include "G4VisAttributes.hh"
|
||||
//#include "G4FastSimulationManager.hh"
|
||||
|
||||
class G4MagneticField;
|
||||
class G4Material;
|
||||
class G4VSensitiveDetector;
|
||||
class G4VSolid;
|
||||
class G4UserLimits;
|
||||
class G4SmartVoxelHeader;
|
||||
class G4VisAttributes;
|
||||
class G4FastSimulationManager;
|
||||
|
||||
G4LogicalVolume* G4PLogicalVolume::MakeTransientObject(G4VSolid* theSolid)
|
||||
{
|
||||
// These are null poineters temporaly
|
||||
G4Material* fMaterial = NULL;
|
||||
G4SmartVoxelHeader* fVoxel = NULL;
|
||||
const G4VisAttributes* fVisAttributes = NULL;
|
||||
|
||||
// G4LogicalVolume(G4VSolid *pSolid, G4Material *pMaterial,
|
||||
// const G4String& name,
|
||||
// G4MagneticField *pField=0,
|
||||
// G4VSensitiveDetector *pSDetector=0,
|
||||
// G4UserLimits *pULimits=0);
|
||||
|
||||
//--------- Material definition ---------
|
||||
//
|
||||
// G4double a, iz, z, density;
|
||||
//
|
||||
// a = 207.19*g/mole;
|
||||
// density = 11.35*g/cm3;
|
||||
// G4Material* Pb = new G4Material(name="Lead", z=82., a, density);
|
||||
//
|
||||
// G4LogicalVolume* testvolume = new G4LogicalVolume(
|
||||
// theSolid, Pb, fName, 0, 0, 0);
|
||||
//
|
||||
//--------- Material definition ---------
|
||||
|
||||
G4String name;
|
||||
G4LogicalVolume* aLogicalVolume = new G4LogicalVolume(
|
||||
theSolid, fMaterial, name=fName, 0, 0, 0);
|
||||
|
||||
// if ( aLogicalVolume )
|
||||
// aLogicalVume->SetVisAttributes(*fVisAttributes);
|
||||
|
||||
return aLogicalVolume;
|
||||
}
|
||||
//////////////////////////
|
||||
|
||||
G4int G4PLogicalVolume::GetNoDaughters() const
|
||||
{
|
||||
// return fDaughters.entries();
|
||||
return NoOfDaughters;
|
||||
}
|
||||
|
||||
HepRef(G4PVPhysicalVolume) G4PLogicalVolume::GetDaughter(const G4int i) const
|
||||
{
|
||||
return fDaughters[i-1];
|
||||
}
|
||||
|
||||
void G4PLogicalVolume::AddDaughter(HepRef(G4PVPhysicalVolume) p)
|
||||
{
|
||||
fDaughters.insert(p);
|
||||
NoOfDaughters++;
|
||||
}
|
||||
|
||||
G4bool G4PLogicalVolume::IsDaughter(const HepRef(G4PVPhysicalVolume) p) const
|
||||
{
|
||||
for ( G4int i=0; i<NoOfDaughters; i++)
|
||||
if ( fDaughters[i-1] == p )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void G4PLogicalVolume::RemoveDaughter(const HepRef(G4PVPhysicalVolume) p)
|
||||
{
|
||||
for ( G4int i=0; i<NoOfDaughters; i++)
|
||||
if ( fDaughters[i-1] == p )
|
||||
fDaughters.removeAt(i);
|
||||
}
|
||||
|
||||
HepRef(G4PVSolid) G4PLogicalVolume::GetSolid()
|
||||
{
|
||||
return fSolid;
|
||||
}
|
||||
|
||||
void G4PLogicalVolume::SetSolid(HepRef(G4PVSolid) pSolid)
|
||||
{
|
||||
fSolid = pSolid;
|
||||
}
|
||||
Reference in New Issue
Block a user