Import Geant4 5.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:57:27 +02:00
parent 330b82b769
commit 37fff30d2e
5733 changed files with 263867 additions and 74574 deletions
@@ -0,0 +1,77 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * 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: G4DigitRootIO.hh,v 1.4 2002/12/13 14:45:41 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// File: G4DigitRootIO.hh
//
// History:
// '02.5.7 Youhei Morita Initial creation
#ifndef DIGIT_ROOT_IO_HH
#define DIGIT_ROOT_IO_HH 1
#include "G4DCofThisEvent.hh"
#include "G4PersistencyCenter.hh"
#include "G4RootIOManager.hh"
#include "G4DCIOcatalog.hh"
// Class inherited:
#include "G4VPDigitIO.hh"
// Class Description:
// Manager class to store and retrieve Digit objects.
//
// This is a singleton class and should be constructed only
// by GetDigitRootIO().
class G4DigitRootIO
: public G4VPDigitIO
{
public: // With description
G4DigitRootIO();
// Constructor
virtual ~G4DigitRootIO();
// Destructor
public: // With description
static G4DigitRootIO* GetDigitRootIO();
// Construct a new singleton G4DigitRootIO object if it does not exist.
bool Store(const G4DCofThisEvent* dcevt);
// Store digit collections.
// Concrete class of RootVDigitsCollectionIO must be registered
// with G4VPDigitIO::AddDCIOmanager() before calling this method.
bool Retrieve(G4DCofThisEvent*& dcevt);
// Retrieve digit collections
// Concrete class of RootVDigitsCollectionIO must be registered
// with G4VPDigitIO::AddDCIOmanager() before calling this method.
// Also a pointer of persistent digit collection must be set with
// SetCurrentPDCofThisEvent().
}; // End of class G4DigitRootIO
#endif
@@ -0,0 +1,83 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * 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: G4EventRootIO.hh,v 1.3 2002/12/13 14:45:41 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// File: G4EventRootIO.hh
//
// History:
// '02.5.7 Youhei Morita Initial creation
#ifndef EVENT_ROOT_IO_HH
#define EVENT_ROOT_IO_HH 1
#include "G4Event.hh"
#include "G4PersistencyCenter.hh"
#include "G4RootIOManager.hh"
#include "G4HitRootIO.hh"
#include "G4DigitRootIO.hh"
#include "G4HepMCRootIO.hh"
#include "G4MCTruthRootIO.hh"
#include "G4RootEvent.hh"
// Class inherited:
#include "G4VPEventIO.hh"
// Class Description:
// Manager class to store and retrieve G4Event objects
class G4EventRootIO
: public G4VPEventIO
{
public: // With description
G4EventRootIO( G4PersistencyManager* pc );
// Constructor
virtual ~G4EventRootIO(){};
// Destructor
public: // With description
// G4bool Store( HepMC::GenEvent* hepevt, G4MCTEvent* mctevt, const G4Event* g4evt);
G4bool Store( HepMC::GenEvent* hepevt, const G4Event* g4evt);
// Store a FADS event.
G4bool Store( const G4Event* anEvent );
// Store a Geant4 event.
G4bool Retrieve( G4Pevent*& anEvent );
// Retrieve a FADS event.
G4bool Retrieve( G4Event*& anEvent );
// Retrieve a Geant4 event.
private:
G4PersistencyManager* f_pc;
G4HepMCRootIO* f_hepmcio;
G4MCTruthRootIO* f_mctruthio;
G4HitRootIO* f_PHCMan;
G4DigitRootIO* f_PDCMan;
}; // End of class G4EventRootIO
#endif
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * 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: G4HepMCRootIO.hh,v 1.3 2002/12/13 14:45:41 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// File: G4HepMCRootIO.hh
//
// History:
// '02.5.7 Youhei Morita Initial creation
#ifndef HEPMC_ROOT_IO_HH
#define HEPMC_ROOT_IO_HH 1
#include "CLHEP/HepMC/GenEvent.h"
#include "CLHEP/HepMC/GenParticle.h"
#include "G4PersistencyCenter.hh"
#include "G4RootIOManager.hh"
// Class inherited:
#include "G4VHepMCIO.hh"
// Class Description:
// Concreate class for storing and retrieving HepMC events.
class G4HepMCRootIO
: public G4VHepMCIO
{
public: // With description
G4HepMCRootIO() {};
// Constructor
virtual ~G4HepMCRootIO() {};
// Destructor
public: // With description
bool Store(HepMC::GenEvent* evt);
// Method for storing HepMC GenEvent.
bool Retrieve(HepMC::GenEvent*& evt, int id=-1);
// Method for retrieving HepMC GenEvent.
int LastEventID() { return m_lastid; };
// returns the last event ID.
private:
HepMC::GenEvent* f_lastevt;
int m_lastid;
}; // End of class G4HepMCRootIO
#endif
@@ -0,0 +1,75 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * 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: G4HitRootIO.hh,v 1.4 2002/12/13 14:45:41 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// File: G4HitRootIO.hh
//
// History:
// '02.5.7 Youhei Morita Initial creation
#ifndef HIT_ROOT_IO_HH
#define HIT_ROOT_IO_HH 1
#include "G4HCofThisEvent.hh"
#include "G4PersistencyCenter.hh"
#include "G4RootIOManager.hh"
#include "G4HCIOcatalog.hh"
// Class inherited:
#include "G4VPHitIO.hh"
// Class Description:
// Manager class to store and retrieve Hit objects.
//
// This is a singleton class and should be constructed only
// by GetHitRootIO().
class G4HitRootIO
: public G4VPHitIO
{
public: // With description
G4HitRootIO();
// Constructor
virtual ~G4HitRootIO();
// Destructor
public: // With description
static G4HitRootIO* GetHitRootIO();
// Construct a new singleton G4HitRootIO object if it does not exist.
bool Store(const G4HCofThisEvent* hcevt);
// Store hit collections.
// Concrete class of G4VPHitsCollectionIO must be registered
// with G4VPHitIO::AddHCIOmanager() before calling this method.
bool Retrieve(G4HCofThisEvent*& hcevt);
// Retrieve hit collections
// Concrete class of G4VPHitsCollectionIO must be registered
// with G4VPHitIO::AddHCIOmanager() before calling this method.
}; // End of class G4HitRootIO
#endif
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * 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: G4MCTruthRootIO.hh,v 1.4 2002/12/13 14:45:41 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// File: G4MCTruthRootIO.hh
//
// History:
// '02.5.7 Youhei Morita Initial creation
#ifndef MCTRUTH_ROOT_IO_HH
#define MCTRUTH_ROOT_IO_HH 1
// Class inherited:
#include "G4VMCTruthIO.hh"
// Class Description:
// Concreate class for storing and retrieving MCTruth events.
class G4MCTruthRootIO
: public G4VMCTruthIO
{
public: // With description
G4MCTruthRootIO() {};
// Constructor
virtual ~G4MCTruthRootIO() {};
// Destructor
public: // With description
virtual bool Store(G4MCTEvent* mctevent);
// Method for storing MCTruth Event.
virtual bool Retrieve(G4MCTEvent* & mctevent);
// Method for retrieving MCTruth GenEvent.
static G4MCTruthRootIO* GetMCTruthRootIO();
// method #3: GetMCTruthRootIO()
private:
static G4MCTruthRootIO* thePointer;
}; // End of class G4MCTruthRootIO
#endif
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * 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: G4RootEvent.hh,v 1.3 2002/12/13 14:45:41 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// File: G4RootEvent.hh
//
// History:
// '02.5.7 Youhei Morita Initial creation
#ifndef ROOT_FADS_EVENT_HH
#define ROOT_FADS_EVENT_HH 1
class G4Event;
class GenEvent;
class G4MCTEvent;
class G4Pevent;
// Class inherited:
#include "TObject.h"
// Class Description:
// FADS persistent event object.
//
// This class has pointers to HepMCGenEvent, MCTruth and G4Event.
class G4RootEvent
: public TObject
{
public: // With description
G4RootEvent() {};
// Constructor
virtual ~G4RootEvent();
// Destructor
public: // With description
int GetEventID() { return m_id; };
// returns the event ID.
G4Pevent* MakeTransientObject();
// Make transient G4Pevent from G4RootEvent
private:
int m_id;
ClassDef (G4RootEvent,1)
}; // End of class G4RootEvent
#endif
@@ -0,0 +1,106 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * 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: G4RootIOManager.hh,v 1.3 2002/12/13 14:45:41 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// File: G4RootIOManager.hh
//
// History:
// '02.5.7 Youhei Morita Initial creation
#ifndef ROOT_IO_MANAGER_HH
#define ROOT_IO_MANAGER_HH 1
#include "G4Event.hh"
#include "G4Run.hh"
#include "G4VPhysicalVolume.hh"
#include <string>
#include <map>
class G4VPHitIO;
class G4VPDigitIO;
class VPHepMCIO;
class VPMCTruthIO;
class G4RootTransManager;
class G4HitRootIO;
class G4DigitRootIO;
class G4EventRootIO;
class G4HepMCRootIO;
class G4MCTruthRootIO;
// Class inherited:
#include "G4PersistencyManager.hh"
// Class Description:
// Implementation of G4PersistencyManager with ROOT I/O package
class G4RootIOManager
: public G4PersistencyManager
{
friend class G4RootTransManager;
public: // With description
G4RootIOManager(G4PersistencyCenter* pc, std::string n);
// Constructor
virtual ~G4RootIOManager();
// Destructor
public: // With description
G4VPHitIO* HitIO() { return (G4VPHitIO*) f_G4HitRootIO; };
// returns the hit I/O handling manager.
G4VPDigitIO* DigitIO() { return (G4VPDigitIO*) f_G4DigitRootIO; };
// returns the digit I/O handling manager.
G4VPEventIO* EventIO() { return (G4VPEventIO*) f_G4EventRootIO; };
// returns the event I/O handling manager.
G4VHepMCIO* HepMCIO() { return (G4VHepMCIO*) f_G4HepMCRootIO; };
// returns the HepMC event I/O handling manager.
G4VMCTruthIO* MCTruthIO() { return (G4VMCTruthIO*) f_G4MCTruthRootIO; };
// returns the HepMC event I/O handling manager.
G4VTransactionManager* TransactionManager() { return (G4VTransactionManager*) f_G4RootTransManager; };
// returns the event I/O handling manager.
void Initialize();
// Initialize the ROOT I/O package.
private:
G4PersistencyManager* Create() {return 0;};
// Dummy in this class (used by PersistentManagerT).
private:
G4RootTransManager* f_G4RootTransManager;
G4HitRootIO* f_G4HitRootIO;
G4DigitRootIO* f_G4DigitRootIO;
G4EventRootIO* f_G4EventRootIO;
G4HepMCRootIO* f_G4HepMCRootIO;
G4MCTruthRootIO* f_G4MCTruthRootIO;
}; // End of class G4RootIOManager
#endif
@@ -0,0 +1,131 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * 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: G4RootTransManager.hh,v 1.3 2002/12/13 14:45:41 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// File: G4RootTransManager.hh
//
// History:
// '02.5.7 Youhei Morita Initial creation
#ifndef ROOT_TRANS_MANAGER_HH
#define ROOT_TRANS_MANAGER_HH 1
#include <string>
#include <map>
class G4RootIOManager;
class TFile;
class TTree;
typedef std::map<std::string,TFile*,std::less<std::string> > RootFileCatalog;
// Class inherited:
#include "G4VTransactionManager.hh"
// Class Description:
// Implementation of transaction manager with HepODBMS persistency package
class G4RootTransManager
: public G4VTransactionManager
{
public: // With description
G4RootTransManager();
// Constructor
virtual ~G4RootTransManager() {};
// Destructor
public: // With description
bool SelectReadFile(std::string obj, std::string file);
// Select the input file for type "obj" and sets the container ref.
bool SelectWriteFile(std::string obj, std::string file);
// Select the output file for type "obj" and sets the container ref.
bool StartUpdate() {return true;};
// Start the database update transaction. Dummy in ROOT I/O.
bool StartRead() {return true;};
// Start the database read transaction. Dummy in ROOT I/O.
void Commit();
// Commit the changes to the ROOT I/O files.
void Abort() {};
// Abort the transaction. Dummy in ROOT I/O.
TFile* LastReadFile() { return f_lastreadfile; };
// returns the pointer of the last read file
TFile* LastWriteFile() { return f_lastwritefile; };
// returns the pointer of the last read file
TTree* LastReadTree() { return f_lastreadtree; };
// returns the pointer of the last read tree
TTree* LastWriteTree() { return f_lastwritetree; };
// returns the pointer of the last read tree
void Initialize();
// Initialize the ROOT I/O file map.
int BufferSize();
// Returns the ROOT I/O buffer size.
int SplitLevel() { return f_split; };
// Returns the ROOT I/O split level.
int CompressionLevel() { return f_comp; };
// Returns the ROOT I/O compression level.
void SetBufferSize(int buf) { f_bufsize = buf; };
// Sets the ROOT I/O buffer size.
void SetSplitLevel(int s) { f_split = s; };
// Sets the ROOT I/O split level.
void SetCompressionLevel(int c) { f_comp = c; };
// Sets the ROOT I/O compression level.
private:
TFile* LookUp(string file, string mode);
// Returns the Root file pointer to the object type and file name.
// Opens a new file if the access is for the first time.
private:
RootFileCatalog f_catalog;
TFile* f_lastreadfile;
TFile* f_lastwritefile;
TTree* f_lastreadtree;
TTree* f_lastwritetree;
std::string f_treeName;
std::string f_treeDesc;
int f_bufsize;
int f_split;
int f_comp;
}; // End of class G4RootTransManager
#endif