Import Geant4 10.7.0 source tree
This commit is contained in:
@@ -23,55 +23,33 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// File: G4PersistencyManager.hh
|
||||
// G4PersistencyManager
|
||||
//
|
||||
// History:
|
||||
// 01.07.17 Youhei Morita Initial creation (with "fadsclass")
|
||||
|
||||
#ifndef PERSISTENCY_MANAGER_HH
|
||||
#define PERSISTENCY_MANAGER_HH 1
|
||||
|
||||
#include "G4Event.hh"
|
||||
|
||||
#include "G4VMCTruthIO.hh"
|
||||
#include "G4HCIOcatalog.hh"
|
||||
#include "G4DCIOcatalog.hh"
|
||||
#include "G4VPEventIO.hh"
|
||||
#include "G4VPHitIO.hh"
|
||||
#include "G4VPDigitIO.hh"
|
||||
#include "G4VTransactionManager.hh"
|
||||
#include <string>
|
||||
|
||||
class G4PersistencyCenter;
|
||||
|
||||
// Class inherited:
|
||||
#include "G4VPersistencyManager.hh"
|
||||
|
||||
// Class Description:
|
||||
// Manager base class to handle event store and retrieve operation.
|
||||
// Actual persistency implementation should be handled with
|
||||
// derived classes.
|
||||
//
|
||||
// Each persistency package should implement derived classes of
|
||||
// G4VHepMCIO, G4VMCTruthIO, G4VPHitIO, G4VPDigitIO, G4VPEventIO.
|
||||
// Concreate G4PersistencyManager should implement the methods
|
||||
// HepMCIO(), MCTruthIO(), HitIO(), DigitIO() and EventIO() to
|
||||
// return the pointers of the above classes.
|
||||
// G4PersistencyManager handles the sequence of the storing and
|
||||
// retrieving of the persistent object of each type, along with
|
||||
// the transaction handling.
|
||||
//
|
||||
// Retrieving a HepMC event:
|
||||
//
|
||||
//
|
||||
// Manager base class to handle event store and retrieve operation.
|
||||
// Actual persistency implementation should be handled with derived classes.
|
||||
//
|
||||
// Each persistency package should implement derived classes of
|
||||
// G4VHepMCIO, G4VMCTruthIO, G4VPHitIO, G4VPDigitIO, G4VPEventIO.
|
||||
// Concreate G4PersistencyManager should implement the methods
|
||||
// HepMCIO(), MCTruthIO(), HitIO(), DigitIO() and EventIO() to
|
||||
// return the pointers of the above classes.
|
||||
// G4PersistencyManager handles the sequence of the storing and
|
||||
// retrieving of the persistent object of each type, along with
|
||||
// the transaction handling.
|
||||
//
|
||||
// Retrieving a HepMC event:
|
||||
//
|
||||
// G4PersistencyManager::Retrieve( HepMC::GenEvent*& )
|
||||
// |
|
||||
// | ... StartRead() ...
|
||||
// |
|
||||
// | ... Commit() ...
|
||||
// V
|
||||
//
|
||||
// Storing a Geant4 event:
|
||||
//
|
||||
//
|
||||
// Storing a Geant4 event:
|
||||
//
|
||||
// G4PersistencyManager::Store( G4Pevent* )
|
||||
// |
|
||||
// | ... StartUpdate() ...
|
||||
@@ -86,9 +64,9 @@ class G4PersistencyCenter;
|
||||
// |
|
||||
// | ... Commit() ...
|
||||
// V
|
||||
//
|
||||
// Retrieving a Geant event:
|
||||
//
|
||||
//
|
||||
// Retrieving a Geant4 event:
|
||||
//
|
||||
// G4PersistencyManager::Retrieve( event )
|
||||
// |
|
||||
// | ... StartRead() ...
|
||||
@@ -97,97 +75,116 @@ class G4PersistencyCenter;
|
||||
// |
|
||||
// | ... Commit() ...
|
||||
// V
|
||||
//
|
||||
// Hit collection and digit collection of each detector component
|
||||
// should be handled by detector specific I/O manager, which
|
||||
// should be registered to the G4PersistencyCenter with
|
||||
// AddHCIOmanager() and AddDCIOmanager(). Usually this is done
|
||||
// through a command
|
||||
//
|
||||
//
|
||||
// Hit collection and digit collection of each detector component
|
||||
// should be handled by detector specific I/O manager, which
|
||||
// should be registered to the G4PersistencyCenter with
|
||||
// AddHCIOmanager() and AddDCIOmanager(). Usually this is done
|
||||
// through a command
|
||||
//
|
||||
// /Persistency/Store/Using/HitIO <detector_io_manager_name>
|
||||
//
|
||||
// which is handled by G4PersistencyCenterMessenger.
|
||||
//
|
||||
// A static template declaration of G4HCIOentryT<class> must be
|
||||
// implementated for each I/O manager.
|
||||
//
|
||||
// which is handled by G4PersistencyCenterMessenger.
|
||||
//
|
||||
// A static template declaration of G4HCIOentryT<class> must be
|
||||
// implementated for each I/O manager.
|
||||
|
||||
class G4PersistencyManager
|
||||
: public G4VPersistencyManager
|
||||
// Author: Youhei Morita, 17.07.2001
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4PERSISTENCYMANAGER_HH
|
||||
#define G4PERSISTENCYMANAGER_HH 1
|
||||
|
||||
#include "G4Event.hh"
|
||||
|
||||
#include "G4VMCTruthIO.hh"
|
||||
#include "G4HCIOcatalog.hh"
|
||||
#include "G4DCIOcatalog.hh"
|
||||
#include "G4VPEventIO.hh"
|
||||
#include "G4VPHitIO.hh"
|
||||
#include "G4VPDigitIO.hh"
|
||||
#include "G4VTransactionManager.hh"
|
||||
#include "G4VPersistencyManager.hh"
|
||||
|
||||
class G4PersistencyCenter;
|
||||
|
||||
class G4PersistencyManager : public G4VPersistencyManager
|
||||
{
|
||||
friend class G4PersistencyCenter;
|
||||
friend class G4PersistencyCenter;
|
||||
|
||||
public: // With description
|
||||
G4PersistencyManager(G4PersistencyCenter* pc, std::string n);
|
||||
public:
|
||||
|
||||
G4PersistencyManager(G4PersistencyCenter* pc, const G4String& n);
|
||||
// Constructor
|
||||
|
||||
virtual ~G4PersistencyManager();
|
||||
virtual ~G4PersistencyManager();
|
||||
// Destructor
|
||||
|
||||
public: // With description
|
||||
virtual G4PersistencyManager* Create() {return 0;};
|
||||
// Create a new persistency manager. To be used by G4PersistencyManagerT<>.
|
||||
virtual G4PersistencyManager* Create() { return nullptr; }
|
||||
// Create a new persistency manager.
|
||||
// To be used by G4PersistencyManagerT<>
|
||||
|
||||
std::string GetName() {return nameMgr;};
|
||||
const G4String& GetName() { return nameMgr; }
|
||||
// Get the name of persistency manager
|
||||
|
||||
virtual G4VPEventIO* EventIO() { return 0; };
|
||||
virtual G4VPEventIO* EventIO() { return nullptr; }
|
||||
// Returns the current event I/O handling manager
|
||||
// Each derived class should return the pointer of actual manager.
|
||||
// Each derived class should return the pointer of actual manager
|
||||
|
||||
virtual G4VPHitIO* HitIO() { return 0; };
|
||||
virtual G4VPHitIO* HitIO() { return nullptr; }
|
||||
// Returns the current hit I/O handling manager
|
||||
// Each derived class should return the pointer of actual manager.
|
||||
// Each derived class should return the pointer of actual manager
|
||||
|
||||
virtual G4VPDigitIO* DigitIO() { return 0; };
|
||||
virtual G4VPDigitIO* DigitIO() { return nullptr; }
|
||||
// Returns the current digit I/O handling manager
|
||||
// Each derived class should return the pointer of actual manager.
|
||||
// Each derived class should return the pointer of actual manager
|
||||
|
||||
virtual G4VMCTruthIO* MCTruthIO() { return 0; };
|
||||
virtual G4VMCTruthIO* MCTruthIO() { return nullptr; }
|
||||
// Returns the current MCTruth I/O handling manager
|
||||
// Each derived class should return the pointer of actual manager.
|
||||
// Each derived class should return the pointer of actual manager
|
||||
|
||||
virtual G4VTransactionManager* TransactionManager() { return 0; };
|
||||
virtual G4VTransactionManager* TransactionManager() { return nullptr; }
|
||||
// Returns the current transaction manager
|
||||
// Each derived class should return the pointer of actual manager.
|
||||
// Each derived class should return the pointer of actual manager
|
||||
|
||||
virtual void Initialize() {};
|
||||
virtual void Initialize() {}
|
||||
// Initialize the persistency package.
|
||||
// Each derived class should implement the acutal initialization sequence.
|
||||
// Each derived class should implement the acutal initialization sequence
|
||||
|
||||
void SetVerboseLevel(int v);
|
||||
// Set verbose level.
|
||||
void SetVerboseLevel(G4int v);
|
||||
// Set verbose level
|
||||
|
||||
G4bool Store(const G4Event* evt);
|
||||
G4bool Store(const G4Event* evt);
|
||||
// Store the G4Event and its associated objects
|
||||
|
||||
G4bool Retrieve(G4Event*& evt);
|
||||
G4bool Retrieve(G4Event*& evt);
|
||||
// Retrieve the G4Event and its associated objects
|
||||
|
||||
G4bool Store(const G4Run*) {return false;};
|
||||
// not used
|
||||
G4bool Store(const G4Run*) { return false; }
|
||||
// Not used
|
||||
|
||||
G4bool Retrieve(G4Run*&) {return false;};
|
||||
// not used
|
||||
G4bool Retrieve(G4Run*&) { return false; }
|
||||
// Not used
|
||||
|
||||
G4bool Store(const G4VPhysicalVolume*) {return false;};
|
||||
// not used
|
||||
G4bool Store(const G4VPhysicalVolume*) { return false; }
|
||||
// Not used
|
||||
|
||||
G4bool Retrieve(G4VPhysicalVolume*&) {return false;};
|
||||
// not used
|
||||
G4bool Retrieve(G4VPhysicalVolume*&) { return false; }
|
||||
// Not used
|
||||
|
||||
protected:
|
||||
static G4PersistencyManager* GetPersistencyManager();
|
||||
protected:
|
||||
|
||||
static G4PersistencyManager* GetPersistencyManager();
|
||||
// Get the instance of persistency manager
|
||||
|
||||
protected:
|
||||
G4PersistencyCenter* f_pc;
|
||||
int m_verbose;
|
||||
protected:
|
||||
|
||||
private:
|
||||
std::string nameMgr;
|
||||
G4bool f_is_initialized;
|
||||
G4PersistencyCenter* f_pc = nullptr;
|
||||
G4int m_verbose = 0;
|
||||
|
||||
}; // End of class G4PersistencyManager
|
||||
private:
|
||||
|
||||
G4String nameMgr;
|
||||
G4bool f_is_initialized = false;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user