Import Geant4 0.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-01 15:25:35 +02:00
parent 54d6b71f95
commit b97f8d0df7
3237 changed files with 807095 additions and 0 deletions
@@ -0,0 +1,147 @@
// 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: G4PGeometryObjectMap.ddl,v 2.5 1998/07/14 14:12:35 morita Exp $
// GEANT4 tag $Name: geant4-00 $
//
// class G4PGeometryObjectMap
//
// A Class responsible for keeping track of the geometry object map.
//
// This class is persistent-capable.
//
// Member functions:
// =================
// G4PGeometryObjectMap( G4PString theGeometryName );
// ~G4PGeometryObjectMap();
//
// protected:
// G4PVPhysicalVolume* LookUp( G4VPhysicalVolume* aPhysVol );
// void Add( const G4VPhysicalVolume* aPhysVol,
// const G4PVPhysicalVolume* persPhysVol );
// G4PLogicalVolume* LookUp(G4LogicalVolume* aLogVol);
// void Add( const G4LogicalVolume* aLogVol,
// const G4PLogicalVolume* persLogVol );
// G4PVSolid* LookUp(G4VSolid* aSolid);
// void Add( const G4VSolid* aSolid,
// const G4PVSolid* persSolid );
// G4int GetNoSolids();
// G4VSolid* GetSolid(G4int n);
// G4PVSolid* GetPSolid(G4int n);
//
// Note:
// =====
// This class contains RWTPtrVector of the transient classes.
// As a result, ooddlx compiler will issue warnings as follows, but it's okay.
// The value of RWTPtrVector is used only in transient case
// in this class, and you can safely ignore these warnings.
// ----
// "include/G4PGeometryObjectMap.ddl", line xxx: warning: persistent-capable
// class member type is a problem
// The type of base class RWPtrVector is a problem
// The type of member RWPtrVector::array_ is pointer
// The type of base class RWTPtrVector<G4VPhysicalVolume > is a
// problem
// The type of base class RWPtrVector is a problem
// G4PhysVolRefVArray transPhysVolPtrs;
// ^
// ----
//
//
// History:
// 98.06.20 Y.Morita Initial version
#ifndef G4PGeometryObjectMap_h
#define G4PGeometryObjectMap_h 1
#include <rw/tpordvec.h>
#include "globals.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4VSolid.hh"
#include "G4PersistentTypes.hh"
#include "HepODBMS/odbms/HepODBMS.h"
#include "G4PVPhysicalVolume.hh"
#include "G4PVPhysVolRefVArray.hh"
#include "G4PLogicalVolume.hh"
#include "G4PLogVolRefVArray.hh"
#include "G4PVSolid.hh"
#include "G4PVSolidRefVArray.hh"
typedef RWTPtrVector<G4VPhysicalVolume> G4VPhysVolRefVArray;
typedef RWTPtrVector<G4LogicalVolume> G4LogVolRefVArray;
typedef RWTPtrVector<G4VSolid> G4VSolidRefVArray;
class G4PGeometryObjectMap
: public HepPersObj
{
public:
G4PGeometryObjectMap();
G4PGeometryObjectMap( const G4String theGeometryName );
~G4PGeometryObjectMap();
// template cannot be used in class scope!!
// template<class T_IN, class T_OUT> T_OUT LookUp( const T_IN aGeomObj );
HepRef(G4PVPhysicalVolume) LookUp( G4VPhysicalVolume* aPhysVol );
G4VPhysicalVolume* LookUp( HepRef(G4PVPhysicalVolume) aPhysVol );
HepRef(G4PLogicalVolume) LookUp( G4LogicalVolume* aLogVol);
G4LogicalVolume* LookUp( HepRef(G4PLogicalVolume) aLogVol);
HepRef(G4PVSolid) LookUp( G4VSolid* aSolid);
G4VSolid* LookUp( HepRef(G4PVSolid) persSolid);
void Add( G4VPhysicalVolume* aPhysVol,
HepRef(G4PVPhysicalVolume) persPhysVol );
void Add( HepRef(G4PVPhysicalVolume) persPhysVol,
G4VPhysicalVolume* aPhysVol );
void Add( G4LogicalVolume* aLogVol,
HepRef(G4PLogicalVolume) persLogVol );
void Add( HepRef(G4PLogicalVolume) persLogVol,
G4LogicalVolume* aLogVol );
void Add( G4VSolid* aSolid,
HepRef(G4PVSolid) persSolid );
void Add( HepRef(G4PVSolid) persSolid,
G4VSolid* aSolid );
inline void SetWorldVolume( const HepRef(G4PVPhysicalVolume) aWorld )
{ thePersistentWorldVolume = aWorld; }
inline HepRef(G4PVPhysicalVolume) GetWorldVolume()
{ return thePersistentWorldVolume; }
inline G4int GetNoPhysVol() const { return noPhysVol; }
inline G4int GetNoLogVol() const { return noLogVol; }
inline G4int GetNoSolids() const { return noSolids; }
G4VSolid* GetSolid(G4int n);
HepRef(G4PVSolid) GetPSolid(G4int n);
void InitTransientMap();
private:
// World Volume of this Geometry object tree
ooRef(G4PVPhysicalVolume) thePersistentWorldVolume;
// Physics Volume Pointer Array
G4Pint noPhysVol;
G4VPhysVolRefVArray transPhysVolPtrs;
G4PVPhysVolRefVArray persPhysVolPtrs;
// Logical Volume Pointer Array
G4Pint noLogVol;
G4LogVolRefVArray transLogVolPtrs;
G4PLogVolRefVArray persLogVolPtrs;
// Solid Pointer Array
G4Pint noSolids;
G4VSolidRefVArray transSolidPtrs;
G4PVSolidRefVArray persSolidPtrs;
};
#endif
@@ -0,0 +1,20 @@
//
// G4PLogVolRefVArray.hh
//
// HepRefVArray typedefs for Geant4/Persistency category
//
// It is the user's responsibility to include header files
// of classes G4PLogicalVolume.hh _before_ including this file.
//
// History:
// 09.07.98 Y.Morita - Created
#ifndef G4PLOGVOLREFVARRAY_HH
#define G4PLOGVOLREFVARRAY_HH 1
#include "HepODBMS/odbms/HepRefVArray.h"
declare(HepRefVArray,G4PLogicalVolume)
typedef HepRefVArray(G4PLogicalVolume) G4PLogVolRefVArray;
#endif /* G4PLOGVOLREFVARRAY_HH */
@@ -0,0 +1,20 @@
//
// G4PVPhysVolRefVArray.hh
//
// HepRefVArray typedefs for Geant4/Persistency category
//
// It is the user's responsibility to include header files
// of classes G4PVPhysicalVolume.hh _before_ including this file.
//
// History:
// 09.07.98 Y.Morita - Created
#ifndef G4PVPHYSVOLREFVARRAY_HH
#define G4PVPHYSVOLREFVARRAY_HH 1
#include "HepODBMS/odbms/HepRefVArray.h"
declare(HepRefVArray,G4PVPhysicalVolume)
typedef HepRefVArray(G4PVPhysicalVolume) G4PVPhysVolRefVArray;
#endif /* G4PVPHYSVOLREFVARRAY_HH */
@@ -0,0 +1,20 @@
//
// G4PVSolidRefVArray.hh
//
// HepRefVArray typedefs for Geant4/Persistency category
//
// It is the user's responsibility to include header files
// of classes G4PVSolid.hh _before_ including this file.
//
// History:
// 09.07.98 Y.Morita - Created
#ifndef G4PVSOLIDREFVARRAY_HH
#define G4PVSOLIDREFVARRAY_HH 1
#include "HepODBMS/odbms/HepRefVArray.h"
declare(HepRefVArray,G4PVSolid)
typedef HepRefVArray(G4PVSolid) G4PVSolidRefVArray;
#endif /* G4PVSOLIDREFVARRAY_HH */
@@ -0,0 +1,103 @@
// 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: G4PersistencyManager.hh,v 2.5 1998/11/09 17:21:42 morita Exp $
// GEANT4 tag $Name: geant4-00 $
//
// class G4PersistencyManager
//
// A Class responsible for storing and retrieving the run, event,
// Hit and geometry objects into ODBMS using HepODBMS interface.
//
// The class is `singleton', with access via
// G4PersistencyManager::GetPersistencyManager.
//
// This class itself is not persistent-capable.
//
// Member functions:
// =================
// static G4PersistencyManager* GetPersistencyManager();
// static G4PersistencyManager* get_PersistencyManagerIfExist();
// Return ptr to singleton instance of the class.
//
// G4bool Store(const G4Event* anEvent);
// Store anEvent and associated objects into a database.
// G4bool Store(const G4Run* aRun);
// Store aRun and associated objects into a database.
// G4bool Store(const G4VPhysicalVolume* aWorld);
// Store aWorld and entire geometry object tree into a database.
//
// G4bool Retrieve(G4Event*& anEvent);
// Retrieve anEvent and associated objects from a database.
// G4bool Retrieve(G4Run*& aRun);
// Retrieve aRun and associated objects from a database.
// G4bool Retrieve(G4VPhysicalVolume*& aWorld);
// Retrieve aWorld and entire geometry object tree from a database.
//
// Member data:
// ============
// static G4PersistencyManager* fPersistencyManager
// Ptr to the unique instance of class
//
// History:
// 98.01.08 Y.Morita Initial version
// 98.06.20 Y.Morita Implement geometry Store and Retrieve
// 98.10.30 Y.Morita Splitted into event/run/geometry utility classes
#ifndef G4PERSISTENCYMANAGER_HH
#define G4PERSISTENCYMANAGER_HH 1
#include "globals.hh"
#include "G4VPersistencyManager.hh"
#include "G4PersistentEventMan.hh"
#include "G4PersistentRunMan.hh"
#include "G4PersistentGeomMan.hh"
////#include "HepODBMS/clustering/HepContainerHint.h"
#include "HepODBMS/clustering/HepDbApplication.h"
class G4PersistencyManager
: public G4VPersistencyManager
{
public:
static G4PersistencyManager* GetPersistencyManager();
static G4PersistencyManager* get_PersistencyManagerIfExist();
G4PersistencyManager();
public:
~G4PersistencyManager();
private:
HepDbApplication* dbApp;
// static HepRef(NamedNode) namedRoot;
// static NamedObjectTree*
private:
static G4PersistencyManager * f_PersistencyManager;
public:
G4bool Store(const G4Event* anEvent);
G4bool Store(const G4Run* aRun);
G4bool Store(const G4VPhysicalVolume* aWorld);
G4bool Retrieve(G4Event*& anEvent);
G4bool Retrieve(G4Run*& aRun);
G4bool Retrieve(G4VPhysicalVolume*& aWorld);
// Utility Classes
private:
G4PersistentEventMan f_pEventMan;
G4PersistentRunMan f_pRunMan;
G4PersistentGeomMan f_pGeomMan;
};
#endif
@@ -0,0 +1,70 @@
// 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: G4PersistentEventMan.hh,v 2.1 1998/11/09 17:19:04 morita Exp $
// GEANT4 tag $Name: geant4-00 $
//
// class G4PersistentEventMan
//
// A Utility class for storing and retrieving the event objects.
//
// This class is not persistent-capable.
//
// Member functions:
// =================
// G4bool Store(const G4Event* anEvent);
// Store anEvent and associated objects into database.
// G4bool Retrieve(G4Event*& anEvent);
// Retrieve anEvent and associated objects into database.
// G4Bool LocateDB( HepDBApplication* dbApp,
// const G4String eventDBName );
// Create and locate event database and container.
//
// Member data:
// ============
// HepDatabaseRef f_EventDB;
// Reference to the event database.
// HepContainerRef f_EventContainer;
// Reference to the event container in the database.
//
// History:
// 98.10.30 Y.Morita Splited from G4PersistencyManager
#ifndef G4PERSISTENTEVENTMAN_H
#define G4PERSISTENTEVENTMAN_H 1
#include "globals.hh"
#include "HepODBMS/clustering/HepDbApplication.h"
class G4Event;
class G4PersistentEventMan
{
public:
G4PersistentEventMan();
~G4PersistentEventMan();
HepDatabaseRef GetDB();
HepContainerRef GetContainer();
G4bool LocateDB( HepDbApplication* dbApp,
const G4String eventDBName );
private:
HepDatabaseRef f_EventDB;
HepContainerRef f_EventContainer;
public:
G4bool Store( HepDbApplication* dbApp,
const G4Event* anEvent );
G4bool Retrieve( HepDbApplication* dbApp,
G4Event*& anEvent );
};
#endif
@@ -0,0 +1,111 @@
// 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: G4PersistentGeomMan.hh,v 2.2 1998/11/10 18:23:41 morita Exp $
// GEANT4 tag $Name: geant4-00 $
//
// class G4PersistentGeomMan
//
// A Utility class for storing and retrieving the geometry objects.
//
// This class is not persistent-capable.
//
// Member functions:
// =================
//
//
// Member data:
// ============
// static G4PersistentGeomMan* fPersistencyManager
// Ptr to the unique instance of class
//
// History:
// 98.10.30 Y.Morita Splited from G4PersistencyManager
#ifndef G4PERSISTENTGEOMMAN_H
#define G4PERSISTENTGEOMMAN_H 1
#include "globals.hh"
#include "geomdefs.hh"
#include "HepODBMS/clustering/HepDbApplication.h"
#define G4_PHYS_VOLUME_DEPTH_MAX 1000000
class G4VSolid;
class G4PEvent;
class G4VPhysicalVolume;
class G4LogicalVolume;
class G4PVPhysicalVolume;
class G4PLogicalVolume;
class G4PVSolid;
#include "G4PGeometryObjectMap.hh"
class G4PersistentGeomMan
{
public:
G4PersistentGeomMan();
~G4PersistentGeomMan();
private:
HepDatabaseRef f_GeomDB;
HepContainerRef f_GeomContainer;
HepRef(G4PGeometryObjectMap) f_GeomMap;
public:
G4bool Store( HepDbApplication* dbApp,
const G4VPhysicalVolume* aWorld );
G4bool Retrieve( HepDbApplication* dbApp,
G4VPhysicalVolume*& aWorld );
private:
// Characterise `type' of volume - normal/replicated/parameterised
EVolume VolumeType(const G4VPhysicalVolume *pVol) const;
HepRef(G4PVPhysicalVolume) MakePersistentObject (
G4VPhysicalVolume* aPhysVol );
HepRef(G4PLogicalVolume) MakePersistentObject (
G4LogicalVolume* aLogVol );
HepRef(G4PVSolid) MakePersistentObject ( G4VSolid* aSolid );
G4VPhysicalVolume* MakeTransientObject (
HepRef(G4PVPhysicalVolume) aPhysVol,
HepRef(G4PVPhysicalVolume) theMotherVol );
G4LogicalVolume* MakeTransientObject (
HepRef(G4PLogicalVolume) aLogVol,
HepRef(G4PVPhysicalVolume) theMotherVol );
G4VSolid* MakeTransientObject ( HepRef(G4PVSolid) aSolid );
private:
G4int f_nRecursive;
G4int f_tRecursive;
G4PString f_GeomMapScopeName;
};
inline EVolume G4PersistentGeomMan::VolumeType(const G4VPhysicalVolume *pVol) const
{
EVolume type;
EAxis axis;
G4int nReplicas;
G4double width,offset;
G4bool consuming;
if (pVol->IsReplicated())
{
pVol->GetReplicationData(axis,nReplicas,width,offset,consuming);
type=(consuming) ? kReplica : kParameterised;
}
else
{
type=kNormal;
}
return type;
}
#endif
@@ -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: G4PersistentRunMan.hh,v 2.1 1998/11/09 17:19:06 morita Exp $
// GEANT4 tag $Name: geant4-00 $
//
// class G4PersistentRunMan
//
// A Utility class for storing and retrieving the run objects.
//
// This class is not persistent-capable.
//
// Member functions:
// =================
// G4bool Store(const G4Run* aRun);
// Store aRun and associated objects into database.
// G4bool Retrieve(G4Run*& aRun);
// Retrieve aRun and associated objects into database.
// G4Bool LocateDB( HepDbApplication* dbApp,
// const G4String runDBName );
// Create and locate run database and container.
//
// Member data:
// ============
// HepDatabaseRef f_RunDB;
// Reference to the run database.
// HepContainerRef f_RunContainer;
// Reference to the run container in the database.
//
// History:
// 98.10.30 Y.Morita Splited from G4PersistencyManager
#ifndef G4PERSISTENTRUNMAN_H
#define G4PERSISTENTRUNMAN_H 1
#include "globals.hh"
#include "HepODBMS/clustering/HepDbApplication.h"
class G4Run;
class G4PersistentRunMan
{
public:
G4PersistentRunMan();
~G4PersistentRunMan();
HepDatabaseRef GetDB();
HepContainerRef GetContainer();
G4bool LocateDB( HepDbApplication* dbApp,
const G4String runDBName );
private:
HepDatabaseRef f_RunDB;
HepContainerRef f_RunContainer;
public:
G4bool Store( HepDbApplication* dbApp, const G4Run* aRun);
G4bool Retrieve( HepDbApplication* dbApp, G4Run*& aRun );
};
#endif
@@ -0,0 +1,29 @@
// 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: G4PersistentTypes.hh,v 2.0 1998/07/02 16:13:43 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// Persistent-capable typedefs for Geant4/Persistency category
//
// History:
// 15.06.98 Y.Morita - Created
#ifndef G4_PERSISTENT_TYPES_HH
#define G4_PERSISTENT_TYPES_HH
// Typedefs to decouple from library classes
#include <HepODBMS/odbms/HepODBMS.h>
typedef d_String G4PString;
typedef d_Double G4Pdouble;
typedef d_Float G4Pfloat;
typedef d_Long G4Pint;
typedef d_Long G4Plong;
#endif /* G4_PERSISTENT_TYPES_HH */