Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
@@ -1,147 +0,0 @@
// 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 1.1 1999/01/07 16:10:55 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
// 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
@@ -1,20 +0,0 @@
//
// 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 */
@@ -1,20 +0,0 @@
//
// 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 */
@@ -1,20 +0,0 @@
//
// 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 */
@@ -1,103 +1,134 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4PersistencyManager.hh,v 1.1 1999/01/07 16:10:56 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
// 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
// $Id: G4PersistencyManager.hh,v 1.14.2.1 1999/12/07 20:50:14 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// 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
// 99.10.22 Y.Morita Allow constructor with the name of Boot file
// 99.11.12 Y.Morita Splitted classes into separate objects
#ifndef G4PERSISTENCYMANAGER_HH
#define G4PERSISTENCYMANAGER_HH 1
#include "globals.hh"
#include "G4VPersistencyManager.hh"
#include "G4DatabaseTypes.hh"
#include "G4PersistentEventMan.hh"
#include "G4PersistentRunMan.hh"
#include "G4PersistentGeomMan.hh"
#include "HepODBMS/odbms/HepODBMS.h"
////#include "HepODBMS/clustering/HepContainerHint.h"
#include "HepODBMS/clustering/HepDbApplication.h"
// forward declarations
class G4PersistentHitMan;
class G4PersistentDigitMan;
class G4PersistentEventMan;
class G4PersistentRunMan;
class G4PersistentGeomMan;
class G4PersistencyMessenger;
class G4TransactionManager;
class HepDbApplication;
// Class Description:
// 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.
class G4PersistencyManager
: public G4VPersistencyManager
{
public:
friend class G4PersistencyMessenger;
public: // With description
static G4PersistencyManager* GetPersistencyManager();
// Return pointer to singleton instance of the class.
// An instance is created if it does not exist.
static G4PersistencyManager* get_PersistencyManagerIfExist();
// Return pointer to singleton instance of the class.
protected:
// use GetPersistencyManager() instead
G4PersistencyManager();
public:
~G4PersistencyManager();
private:
HepDbApplication* dbApp;
static G4PersistencyManager* f_PersistencyManager;
G4int f_verboseLevel;
// static HepRef(NamedNode) namedRoot;
// static NamedObjectTree*
private:
static G4PersistencyManager * f_PersistencyManager;
public:
public: // With description
G4bool Store(const G4Event* anEvent);
// stores anEvent and the associated objects into database.
G4bool Store(const G4Run* aRun);
// stores aRun and the associated objects into database.
G4bool Store(const G4VPhysicalVolume* aWorld);
// stores the world volume and the entire geometry informaion.
G4bool Retrieve(G4Event*& anEvent);
// retrieves anEvent and the associated objects from database.
G4bool Retrieve(G4Run*& aRun);
// retrieves aRun and the associated objects from database.
G4bool Retrieve(G4VPhysicalVolume*& aWorld);
// retrieves the world volume and the entire geometry informaion.
protected:
// protected interface (delegated to TransactionManager)
HepDbApplication* DbApp();
protected:
// interface with PersistencyMessenger (delegated to TransactionManager)
G4bool SelectDB(ETypeOfDB dbtype, G4String dbname, G4bool updateMode);
G4String DBName(ETypeOfDB dbtype);
G4String ContainerName(ETypeOfDB dbtype);
HepDatabaseRef DBref(ETypeOfDB dbtype);
HepContainerRef ContainerRef(ETypeOfDB dbtype);
G4String DBContainerName(ETypeOfDB dbtype);
public: // With description
G4bool StartTransaction( ETypeOfDB dbtype,
ETransactionMode dbmode,
G4bool isSustained);
// start an database transaction.
// ETypeOfDB: kEventDB, kRunDB, kGeomDB
// ETransactionMode: kUpdate, kRead
// isSustained = true : transaction is sustained
// false : transaction is atomic
// See G4DatabaseTypes.hh for the definition.
G4bool Commit(ETypeOfDB dbtype, G4bool isSustained);
// commit the database transaction.
G4bool Abort(ETypeOfDB dbtype, G4bool isSustained);
// abort the database transaction.
private:
// interface with PersistencyMessenger
void SetVerboseLevel(G4int vl);
inline G4int GetVerboseLevel()
{ return f_verboseLevel; };
inline G4TransactionManager* GetTransactionManager()
{ return f_transactionMan; };
// Utility Classes
private:
G4PersistentEventMan f_pEventMan;
G4PersistentRunMan f_pRunMan;
G4PersistentGeomMan f_pGeomMan;
G4PersistentHitMan* f_pHitMan;
G4PersistentDigitMan* f_pDigitMan;
G4PersistentEventMan* f_pEventMan;
G4PersistentRunMan* f_pRunMan;
G4PersistentGeomMan* f_pGeomMan;
G4PersistencyMessenger* f_persMessenger;
G4TransactionManager* f_transactionMan;
};
#endif
@@ -0,0 +1,62 @@
// 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: G4PersistencyMessenger.hh,v 1.4 1999/11/26 11:19:39 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// GEANT 4 class header file
// class description:
//
// This is a messenger class for G4PersistencyManager.
// Implemented commands are following;
//
// Commands :
// /db/verbose * Set the Verbose level of G4PersistencyManager.
// /db/run * Set the name of the Run Database
// /db/event * Set the name of the Event Database
// /db/geometry * Set the name of the Geometry Database
//
#ifndef G4PersistencyMessenger_h
#define G4PersistencyMessenger_h 1
class G4PersistencyManager;
class G4UIdirectory;
class G4UIcmdWithoutParameter;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
class G4UIcmdWithABool;
class G4UIcommand;
#include "G4UImessenger.hh"
#include "globals.hh"
class G4PersistencyMessenger: public G4UImessenger
{
public:
G4PersistencyMessenger(G4PersistencyManager* persistencyMgr);
~G4PersistencyMessenger();
public:
void SetNewValue(G4UIcommand* command,G4String newValues);
G4String GetCurrentValue(G4UIcommand* command);
private:
G4PersistencyManager* persistencyManager;
private: //commands
G4UIdirectory* persistencyDirectory;
G4UIcmdWithAnInteger* verboseCmd;
G4UIcmdWithAString* runDbCmd;
G4UIcmdWithAString* eventDbCmd;
G4UIcmdWithAString* geomDbCmd;
};
#endif
@@ -1,70 +0,0 @@
// 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 1.1 1999/01/07 16:10:56 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
// 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
@@ -1,111 +0,0 @@
// 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 1.1 1999/01/07 16:10:56 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
// 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
@@ -1,68 +0,0 @@
// 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 1.1 1999/01/07 16:10:56 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
// 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
@@ -1,29 +0,0 @@
// 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 1.1 1999/01/07 16:10:57 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// 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 */
@@ -0,0 +1,133 @@
// 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: G4TransactionManager.hh,v 1.5.2.1 1999/12/07 20:50:14 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// class description:
//
// This is a class for handling database transaction
// for G4PersistencyManager.
//
// Member functions:
// =================
// G4TransactionManager();
// ~G4TransactionManager();
//
// History:
// 99.11.25 Y.Morita Initial version
#ifndef G4TransactionManager_HH
#define G4TransactionManager_HH 1
#include "globals.hh"
#include "G4VPersistentSubMan.hh"
// forward declarations
class G4PersistentRunMan;
class G4PersistentEventMan;
class G4PersistentHitMan;
class G4PersistentDigitMan;
class G4PersistentGeomMan;
#include "HepODBMS/clustering/HepDbApplication.h"
#include "G4DatabaseTypes.hh"
class G4TransactionManager
: public G4VPersistentSubMan
{
friend class G4PersistencyManager;
protected:
G4TransactionManager(G4PersistentRunMan* runMan,
G4PersistentEventMan* eventMan,
G4PersistentHitMan* hitMan,
G4PersistentDigitMan* digitMan,
G4PersistentGeomMan* geomMan);
~G4TransactionManager();
private:
HepDbApplication* f_dbApp;
G4bool f_isSustained;
ETypeOfDB f_whichDB;
ETransactionMode f_transactionMode;
ETypeOfDB f_currentDB;
HepDatabaseRef f_RunDB;
HepDatabaseRef f_EventDB;
HepDatabaseRef f_HitDB;
HepDatabaseRef f_DigitDB;
HepDatabaseRef f_GeomDB;
G4String f_RunDBName;
G4String f_EventDBName;
G4String f_HitDBName;
G4String f_DigitDBName;
G4String f_GeomDBName;
HepContainerRef f_RunContainer;
HepContainerRef f_EventContainer;
HepContainerRef f_HitContainer;
HepContainerRef f_DigitContainer;
HepContainerRef f_GeomContainer;
const G4String f_RunContainerName;
const G4String f_EventContainerName;
const G4String f_HitContainerName;
const G4String f_DigitContainerName;
const G4String f_GeomContainerName;
private:
// interface with PersistencyManager
inline HepDbApplication* DbApp()
{ return f_dbApp; }
G4bool StartTransaction( ETypeOfDB dbtype,
ETransactionMode dbmode,
G4bool isSustained);
G4bool Commit(ETypeOfDB dbtype, G4bool isSustained);
G4bool Abort(ETypeOfDB dbtype, G4bool isSustained);
inline G4bool SustainedMode()
{ return f_isSustained; }
private:
// interface with PersistencyManager
G4bool SelectDB(ETypeOfDB dbtype, G4String dbname, G4bool updateMode);
G4String DBName(ETypeOfDB dbtype);
G4String ContainerName(ETypeOfDB dbtype);
HepDatabaseRef DBref(ETypeOfDB dbtype);
HepContainerRef ContainerRef(ETypeOfDB dbtype);
G4String DBContainerName(ETypeOfDB dbtype);
private:
// for internal use
ESustainedState CheckState(ETypeOfDB dbtype, G4bool isSustained);
G4bool DoStart(ETypeOfDB dbtype,
ETransactionMode dbmode,
G4bool isSustained);
void SetDBName(ETypeOfDB dbtype, G4String dbname);
void SetDB(ETypeOfDB dbtype, HepDatabaseRef aDB);
void SetContainer(ETypeOfDB dbtype, HepContainerRef aCont);
void SendDB(ETypeOfDB dbtype);
void SendContainer(ETypeOfDB dbtype);
// Utility Classes
private:
G4PersistentRunMan* f_pRunMan;
G4PersistentEventMan* f_pEventMan;
G4PersistentHitMan* f_pHitMan;
G4PersistentDigitMan* f_pDigitMan;
G4PersistentGeomMan* f_pGeomMan;
};
#endif