Import Geant4 11.3.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2024-06-28 13:08:51 +02:00
parent f7b23877ed
commit e58e650b32
5232 changed files with 239416 additions and 244360 deletions
@@ -31,20 +31,19 @@
#ifndef RE02ActionInitialization_H
#define RE02ActionInitialization_H 1
#include "globals.hh"
#include "G4VUserActionInitialization.hh"
#include "globals.hh"
class RE02ActionInitialization : public G4VUserActionInitialization
{
public:
RE02ActionInitialization();//G4bool bParallelWorld);
RE02ActionInitialization(); // G4bool bParallelWorld);
virtual ~RE02ActionInitialization();
virtual void Build() const;
virtual void BuildForMaster() const;
private:
private:
};
#endif
@@ -32,9 +32,9 @@
#ifndef RE02DetectorConstruction_h
#define RE02DetectorConstruction_h 1
#include "globals.hh"
#include "G4VUserDetectorConstruction.hh"
#include "G4MultiFunctionalDetector.hh"
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
class G4Box;
class G4LogicalVolume;
@@ -47,34 +47,34 @@ class G4Material;
/// (Description)
///
/// Detector construction for example RE02.
///
/// [Geometry]
///
/// [Geometry]
/// The world volume is defined as 200 cm x 200 cm x 200 cm box with Air.
/// Water phantom is defined as 200 mm x 200 mm x 400 mm box with Water.
/// The water phantom is divided into 100 segments in x,y plane using
/// replication,
/// and then divided into 200 segments perpendicular to z axis using nested
/// parameterised volume.
/// and then divided into 200 segments perpendicular to z axis using nested
/// parameterised volume.
/// These values are defined at constructor,
/// e.g. the size of water phantom (fPhantomSize), and number of segmentation
/// of water phantom (fNx, fNy, fNz).
///
/// By default, lead plates are inserted into the position of even order
/// By default, lead plates are inserted into the position of even order
/// segments.
/// NIST database is used for materials.
///
///
/// [Scorer]
/// Assignment of G4MultiFunctionalDetector and G4PrimitiveScorer
/// Assignment of G4MultiFunctionalDetector and G4PrimitiveScorer
/// is demonstrated in this example.
/// -------------------------------------------------
/// The collection names of defined Primitives are
/// 0 PhantomSD/totalEDep
/// 0 PhantomSD/totalEDep
/// 1 PhantomSD/protonEDep
/// 2 PhantomSD/protonNStep
/// 3 PhantomSD/chargedPassCellFlux
/// 4 PhantomSD/chargedCellFlux
/// 5 PhantomSD/chargedSurfFlux
/// 4 PhantomSD/chargedCellFlux
/// 5 PhantomSD/chargedSurfFlux
/// 6 PhantomSD/gammaSurfCurr000
/// 7 PhantomSD/gammaSurfCurr001
/// 9 PhantomSD/gammaSurdCurr002
@@ -94,10 +94,10 @@ class G4Material;
/// - const G4ThreeVector& GetPhantomSize() const
/// gets the water phantom size
///
/// - void SetNumberOfSegmentsInPhantom(G4int nx, G4int ny, G4int nz)
/// - void SetNumberOfSegmentsInPhantom(G4int nx, G4int ny, G4int nz)
/// sets the number of segments of the water phantom
///
/// - void GetNumberOfSegmentsInPhantom(G4int& nx, G4int& ny, G4int& nz)
/// - void GetNumberOfSegmentsInPhantom(G4int& nx, G4int& ny, G4int& nz)
/// gets the number of segments of the water phantom
///
/// - void SetLeadSegment(G4bool flag=TRUE)
@@ -109,36 +109,43 @@ class G4Material;
//
class RE02DetectorConstruction : public G4VUserDetectorConstruction
{
public:
// constructor and destructor.
RE02DetectorConstruction();
virtual ~RE02DetectorConstruction();
public:
// constructor and destructor.
RE02DetectorConstruction();
virtual ~RE02DetectorConstruction();
public:
// virtual method from G4VUserDetectorConstruction.
virtual G4VPhysicalVolume* Construct();
virtual void ConstructSDandField();
public:
// virtual method from G4VUserDetectorConstruction.
virtual G4VPhysicalVolume* Construct();
virtual void ConstructSDandField();
public:
// Get/Set Access methods for data members
// Size of Whater Phantom
void SetPhantomSize(G4ThreeVector size) { fPhantomSize=size; }
const G4ThreeVector& GetPhantomSize() const { return fPhantomSize; }
// Number of segments of water phantom
void SetNumberOfSegmentsInPhantom(G4int nx, G4int ny, G4int nz)
{ fNx=nx; fNy=ny; fNz=nz; }
void GetNumberOfSegmentsInPhantom(G4int& nx, G4int& ny, G4int& nz)
const{ nx=fNx; ny = fNy; nz = fNz; }
// Insert Lead plate in water or simple homogeneous water phantom
void SetLeadSegment(G4bool flag=TRUE){ fInsertLead = flag; }
G4bool IsLeadSegment(){ return fInsertLead; }
private:
// Data members
G4ThreeVector fPhantomSize; // Size of Water Phantom
G4int fNx,fNy,fNz; // Number of segmentation of water phantom.
G4bool fInsertLead; // Flag for inserting lead plate in water phantom
G4LogicalVolume* fLVPhantomSens;
public:
// Get/Set Access methods for data members
// Size of Whater Phantom
void SetPhantomSize(G4ThreeVector size) { fPhantomSize = size; }
const G4ThreeVector& GetPhantomSize() const { return fPhantomSize; }
// Number of segments of water phantom
void SetNumberOfSegmentsInPhantom(G4int nx, G4int ny, G4int nz)
{
fNx = nx;
fNy = ny;
fNz = nz;
}
void GetNumberOfSegmentsInPhantom(G4int& nx, G4int& ny, G4int& nz) const
{
nx = fNx;
ny = fNy;
nz = fNz;
}
// Insert Lead plate in water or simple homogeneous water phantom
void SetLeadSegment(G4bool flag = TRUE) { fInsertLead = flag; }
G4bool IsLeadSegment() { return fInsertLead; }
private:
// Data members
G4ThreeVector fPhantomSize; // Size of Water Phantom
G4int fNx, fNy, fNz; // Number of segmentation of water phantom.
G4bool fInsertLead; // Flag for inserting lead plate in water phantom
G4LogicalVolume* fLVPhantomSens;
};
#endif
@@ -28,7 +28,7 @@
//
//
//
#ifndef RE02EventAction_h
#define RE02EventAction_h 1
@@ -47,17 +47,15 @@ class G4Event;
//
class RE02EventAction : public G4UserEventAction
{
public:
RE02EventAction();
~RE02EventAction();
public:
RE02EventAction();
~RE02EventAction();
public:
virtual void BeginOfEventAction(const G4Event*);
virtual void EndOfEventAction(const G4Event*);
public:
virtual void BeginOfEventAction(const G4Event*);
virtual void EndOfEventAction(const G4Event*);
};
//
#endif
@@ -31,10 +31,11 @@
#ifndef RE02NESTEDPARAMETERISATION_HH
#define RE02NESTEDPARAMETERISATION_HH
#include "G4Types.hh"
#include "G4VNestedParameterisation.hh"
#include "G4ThreeVector.hh"
#include "G4Types.hh"
#include "G4VNestedParameterisation.hh"
#include "G4VTouchable.hh"
#include <vector>
class G4VPhysicalVolume;
@@ -82,88 +83,67 @@ class G4Hype;
/// according to copyNo
/// Its position is defined as G4ThreeVector(0.,0.,fpZ[copyNo]).
///
/// - void ComputeDimensions(G4Box &, const G4int,
/// - void ComputeDimensions(G4Box &, const G4int,
/// const G4VPhysicalVolume *) const
/// returns dimensions of this parameterized volume with the physical
/// returns dimensions of this parameterized volume with the physical
/// volume of the 3rd argument.
///
//
class RE02NestedPhantomParameterisation: public G4VNestedParameterisation
class RE02NestedPhantomParameterisation : public G4VNestedParameterisation
{
public: // with description
RE02NestedPhantomParameterisation(const G4ThreeVector& voxelSize,
G4int nz,
RE02NestedPhantomParameterisation(const G4ThreeVector& voxelSize, G4int nz,
std::vector<G4Material*>& mat);
~RE02NestedPhantomParameterisation();
~RE02NestedPhantomParameterisation();
// Methods required in derived classes
// -----------------------------------
G4Material* ComputeMaterial(G4VPhysicalVolume *currentVol,
const G4int repNo,
const G4VTouchable *parentTouch=0
);
// Required method, as it is the reason for this class.
// Must cope with parentTouch=0 for navigator's SetupHierarchy
G4Material* ComputeMaterial(G4VPhysicalVolume* currentVol, const G4int repNo,
const G4VTouchable* parentTouch = 0);
// Required method, as it is the reason for this class.
// Must cope with parentTouch=0 for navigator's SetupHierarchy
G4int GetNumberOfMaterials() const;
G4int GetNumberOfMaterials() const;
G4Material* GetMaterial(G4int idx) const;
// Needed to define materials for instances of Nested Parameterisation
// Current convention: each call should return the materials
// of all instances with the same mother/ancestor volume.
// Needed to define materials for instances of Nested Parameterisation
// Current convention: each call should return the materials
// of all instances with the same mother/ancestor volume.
void ComputeTransformation(const G4int no,
G4VPhysicalVolume *currentPV) const;
void ComputeTransformation(const G4int no, G4VPhysicalVolume* currentPV) const;
// Methods optional in derived classes
// -----------------------------------
// Additional standard Parameterisation methods,
// Additional standard Parameterisation methods,
// which can be optionally defined, in case solid is used.
void ComputeDimensions(G4Box &,
const G4int,
const G4VPhysicalVolume *) const;
void ComputeDimensions(G4Box&, const G4int, const G4VPhysicalVolume*) const;
private: // Dummy declarations to get rid of warnings ...
private: // Dummy declarations to get rid of warnings ...
void ComputeDimensions(G4Trd&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Trap&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Cons&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Sphere&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Orb&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Ellipsoid&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Torus&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Para&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Hype&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Tubs&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Polycone&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Polyhedra&, const G4int, const G4VPhysicalVolume*) const {}
// G4Material* ComputeMaterial(const G4int repNo,
// G4VPhysicalVolume* currentVol,
// const G4VTouchable* parentTouch)
// { return ComputeMaterial( currentVol, repNo, parentTouch ); }
using G4VNestedParameterisation::ComputeMaterial;
void ComputeDimensions (G4Trd&,const G4int,const G4VPhysicalVolume*)
const {}
void ComputeDimensions (G4Trap&,const G4int,const G4VPhysicalVolume*)
const {}
void ComputeDimensions (G4Cons&,const G4int,const G4VPhysicalVolume*)
const {}
void ComputeDimensions (G4Sphere&,const G4int,const G4VPhysicalVolume*)
const {}
void ComputeDimensions (G4Orb&,const G4int,const G4VPhysicalVolume*)
const {}
void ComputeDimensions (G4Ellipsoid&,const G4int,const G4VPhysicalVolume*)
const {}
void ComputeDimensions (G4Torus&,const G4int,const G4VPhysicalVolume*)
const {}
void ComputeDimensions (G4Para&,const G4int,const G4VPhysicalVolume*)
const {}
void ComputeDimensions (G4Hype&,const G4int,const G4VPhysicalVolume*)
const {}
void ComputeDimensions (G4Tubs&,const G4int,const G4VPhysicalVolume*)
const {}
void ComputeDimensions (G4Polycone&,const G4int,const G4VPhysicalVolume*)
const {}
void ComputeDimensions (G4Polyhedra&,const G4int,const G4VPhysicalVolume*)
const {}
// G4Material* ComputeMaterial(const G4int repNo,
// G4VPhysicalVolume* currentVol,
// const G4VTouchable* parentTouch)
// { return ComputeMaterial( currentVol, repNo, parentTouch ); }
using G4VNestedParameterisation::ComputeMaterial;
private:
G4double fdX,fdY,fdZ;
G4int fNz;
//
std::vector<G4double> fpZ;
std::vector<G4Material*> fMat;
private:
G4double fdX, fdY, fdZ;
G4int fNz;
//
std::vector<G4double> fpZ;
std::vector<G4Material*> fMat;
};
#endif
@@ -48,20 +48,19 @@
///
///
// Created: 2005-11-14 Tsukasa ASO, Akinori Kimura.
//
//
///////////////////////////////////////////////////////////////////////////////
class RE02PSCellFlux : public G4PSCellFlux
{
public: // with description
RE02PSCellFlux(G4String name,G4int nx,G4int ny, G4int nz);
virtual ~RE02PSCellFlux();
public: // with description
RE02PSCellFlux(G4String name, G4int nx, G4int ny, G4int nz);
virtual ~RE02PSCellFlux();
protected: // with description
virtual G4int GetIndex(G4Step*);
protected: // with description
virtual G4int GetIndex(G4Step*);
private:
G4int fNx, fNy, fNz;
G4int fNx, fNy, fNz;
};
#endif
@@ -37,20 +37,19 @@
// (Description)
// This is a primitive scorer class for scoring energy deposit.
//
// Created: 2005-11-14 Tsukasa ASO, Akinori Kimura
// Created: 2005-11-14 Tsukasa ASO, Akinori Kimura
///////////////////////////////////////////////////////////////////////////////
class RE02PSEnergyDeposit : public G4PSEnergyDeposit
{
public: // with description
RE02PSEnergyDeposit(G4String name,G4int nx,G4int ny, G4int nz);
virtual ~RE02PSEnergyDeposit();
public: // with description
RE02PSEnergyDeposit(G4String name, G4int nx, G4int ny, G4int nz);
virtual ~RE02PSEnergyDeposit();
protected: // with description
virtual G4int GetIndex(G4Step*);
protected: // with description
virtual G4int GetIndex(G4Step*);
private:
G4int fNx, fNy, fNz;
G4int fNx, fNy, fNz;
};
#endif
@@ -54,16 +54,14 @@
class RE02PSFlatSurfaceCurrent : public G4PSFlatSurfaceCurrent
{
public: // with description
RE02PSFlatSurfaceCurrent(G4String name, G4int direction,
G4int nx,G4int ny, G4int nz);
virtual ~RE02PSFlatSurfaceCurrent();
public: // with description
RE02PSFlatSurfaceCurrent(G4String name, G4int direction, G4int nx, G4int ny, G4int nz);
virtual ~RE02PSFlatSurfaceCurrent();
protected: // with description
virtual G4int GetIndex(G4Step*);
protected: // with description
virtual G4int GetIndex(G4Step*);
private:
G4int fNx, fNy, fNz;
G4int fNx, fNy, fNz;
};
#endif
@@ -57,16 +57,14 @@
class RE02PSFlatSurfaceFlux : public G4PSFlatSurfaceFlux
{
public: // with description
RE02PSFlatSurfaceFlux(G4String name, G4int direction,
G4int nx,G4int ny, G4int nz);
virtual ~RE02PSFlatSurfaceFlux();
public: // with description
RE02PSFlatSurfaceFlux(G4String name, G4int direction, G4int nx, G4int ny, G4int nz);
virtual ~RE02PSFlatSurfaceFlux();
protected: // with description
virtual G4int GetIndex(G4Step*);
protected: // with description
virtual G4int GetIndex(G4Step*);
private:
G4int fNx, fNy, fNz;
G4int fNx, fNy, fNz;
};
#endif
@@ -43,15 +43,14 @@
class RE02PSNofStep : public G4PSNofStep
{
public: // with description
RE02PSNofStep(G4String name,G4int nx,G4int ny, G4int nz);
virtual ~RE02PSNofStep();
public: // with description
RE02PSNofStep(G4String name, G4int nx, G4int ny, G4int nz);
virtual ~RE02PSNofStep();
protected: // with description
virtual G4int GetIndex(G4Step*);
protected: // with description
virtual G4int GetIndex(G4Step*);
private:
G4int fNx, fNy, fNz;
G4int fNx, fNy, fNz;
};
#endif
@@ -48,16 +48,15 @@
class RE02PSPassageCellFlux : public G4PSPassageCellFlux
{
public: // with description
RE02PSPassageCellFlux(G4String name,G4int nx,G4int ny, G4int nz);
virtual ~RE02PSPassageCellFlux();
public: // with description
RE02PSPassageCellFlux(G4String name, G4int nx, G4int ny, G4int nz);
virtual ~RE02PSPassageCellFlux();
protected: // with description
virtual G4int GetIndex(G4Step*);
protected: // with description
virtual G4int GetIndex(G4Step*);
private:
G4int fNx, fNy, fNz;
G4int fNx, fNy, fNz;
};
#endif
@@ -28,7 +28,7 @@
//
//
//
#ifndef RE02PrimaryGeneratorAction_h
#define RE02PrimaryGeneratorAction_h 1
@@ -43,26 +43,24 @@ class G4Event;
/// User primary particle generator class
///
/// - void GeneratePrimaries(G4Event*)
/// an incident particle is proton with 150 MeV energy at the position
/// an incident particle is proton with 150 MeV energy at the position
/// (x,y,-100 cm) toward the (0,0,1) direction. The x and y positions are
/// uniformly varied from -5 mm to 5 mm, respectively.
//
class RE02PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
RE02PrimaryGeneratorAction();
~RE02PrimaryGeneratorAction();
RE02PrimaryGeneratorAction();
~RE02PrimaryGeneratorAction();
public:
virtual void GeneratePrimaries(G4Event*);
private:
G4double fSigmaPosition; // Initial beam spot size in x-y plane.
G4double fSigmaPosition; // Initial beam spot size in x-y plane.
G4ParticleGun* fParticleGun;
};
//
#endif
@@ -27,24 +27,24 @@
/// \brief Definition of the RE02Run class
//
//
//
//
#ifndef RE02Run_h
#define RE02Run_h 1
#include "G4Run.hh"
#include "G4Event.hh"
#include "G4Run.hh"
#include "G4THitsMap.hh"
#include <vector>
//---------------------------------------------------------------------
/// User run class
///
/// (Description)
/// An example implementation for the multi-functional-detector and
/// (Description)
/// An example implementation for the multi-functional-detector and
/// primitive scorers.
/// This RE02Run class has collections which accumulate event information
/// This RE02Run class has collections which accumulate event information
/// into run information.
///
/// - constructor
@@ -60,7 +60,7 @@
/// - G4THitsMap<G4double>* GetHitsMap(G4int i)
/// gets a run HitsMap of the i-th primitive scorer
///
/// - G4THitsMap<G4double>* GetHitsMap(const G4String& detName,
/// - G4THitsMap<G4double>* GetHitsMap(const G4String& detName,
/// const G4String& colName)
/// gets a run HitsMap with the detName and the colName
///
@@ -71,39 +71,38 @@
/// shows all HitsMap information of this run.
/// This method calls G4THisMap::PrintAll() for individual HitsMap.
//---------------------------------------------------------------------
class RE02Run : public G4Run {
class RE02Run : public G4Run
{
public:
// constructor and destructor.
// vector of multifunctionaldetector name has to given to constructor.
RE02Run(const std::vector<G4String> mfdName);
virtual ~RE02Run();
public:
// constructor and destructor.
// vector of multifunctionaldetector name has to given to constructor.
RE02Run(const std::vector<G4String> mfdName);
virtual ~RE02Run();
public:
// virtual method from G4Run.
// The method is overriden in this class for scoring.
virtual void RecordEvent(const G4Event*);
virtual void Merge(const G4Run*);
public:
// virtual method from G4Run.
// The method is overriden in this class for scoring.
virtual void RecordEvent(const G4Event*);
virtual void Merge(const G4Run*);
// Access methods for scoring information.
// - Number of HitsMap for this RUN.
// This is equal to number of collections.
G4int GetNumberOfHitsMap() const { return fRunMap.size(); }
// - Get HitsMap of this RUN.
// by sequential number, by multifucntional name and collection name,
// and by collection name with full path.
G4THitsMap<G4double>* GetHitsMap(G4int i) { return fRunMap[i]; }
G4THitsMap<G4double>* GetHitsMap(const G4String& detName, const G4String& colName);
G4THitsMap<G4double>* GetHitsMap(const G4String& fullName);
// - Dump All HitsMap of this RUN.
// This method calls G4THisMap::PrintAll() for individual HitsMap.
void DumpAllScorer();
// Access methods for scoring information.
// - Number of HitsMap for this RUN.
// This is equal to number of collections.
G4int GetNumberOfHitsMap() const {return fRunMap.size();}
// - Get HitsMap of this RUN.
// by sequential number, by multifucntional name and collection name,
// and by collection name with full path.
G4THitsMap<G4double>* GetHitsMap(G4int i){return fRunMap[i];}
G4THitsMap<G4double>* GetHitsMap(const G4String& detName,
const G4String& colName);
G4THitsMap<G4double>* GetHitsMap(const G4String& fullName);
// - Dump All HitsMap of this RUN.
// This method calls G4THisMap::PrintAll() for individual HitsMap.
void DumpAllScorer();
private:
std::vector<G4String> fCollName;
std::vector<G4int> fCollID;
std::vector<G4THitsMap<G4double>*> fRunMap;
private:
std::vector<G4String> fCollName;
std::vector<G4int> fCollID;
std::vector<G4THitsMap<G4double>*> fRunMap;
};
//
@@ -27,8 +27,8 @@
/// \brief Definition of the RE02RunAction class
//
//
//
//
//
//
//
#ifndef RE02RunAction_h
@@ -36,13 +36,14 @@
#include "G4UserRunAction.hh"
#include "globals.hh"
#include <vector>
class G4Run;
//=======================================================================
// RE02RunAction
//
//
// Generate Run object and Dumping Run summary.
//
// T.Aso Created. 2007.Nov.
@@ -55,7 +56,7 @@ class G4Run;
/// instanciates a run of RE02Run with a sensitive detector name
///
/// - void BeginOfRunAction(const G4Run*)
/// shows the run number
/// shows the run number
///
/// - void EndOfRunAction(const G4Run*)
/// shows accumulated information of primitive scorers and
@@ -67,38 +68,31 @@ class G4Run;
//
class RE02RunAction : public G4UserRunAction
{
public:
// constructor and destructor
RE02RunAction();
virtual ~RE02RunAction();
public:
// constructor and destructor
RE02RunAction();
virtual ~RE02RunAction();
public:
// virtual method from G4UserRunAction.
virtual G4Run* GenerateRun();
virtual void BeginOfRunAction(const G4Run*);
virtual void EndOfRunAction(const G4Run*);
public:
// virtual method from G4UserRunAction.
virtual G4Run* GenerateRun();
virtual void BeginOfRunAction(const G4Run*);
virtual void EndOfRunAction(const G4Run*);
public:
// Utility method for converting segment number of
// water phantom to copyNo of HitsMap.
G4int CopyNo(G4int ix, G4int iy, G4int iz)
{ return (iy*(fNx*fNz)+ix*fNz+iz); }
public:
// Utility method for converting segment number of
// water phantom to copyNo of HitsMap.
G4int CopyNo(G4int ix, G4int iy, G4int iz) { return (iy * (fNx * fNz) + ix * fNz + iz); }
private:
// Data member
// - vector of MultiFunctionalDetecor names.
std::vector<G4String> fSDName;
// for conversion of sengment number to copyNo.
G4int fNx, fNy, fNz;
private:
// Data member
// - vector of MultiFunctionalDetecor names.
std::vector<G4String> fSDName;
// for conversion of sengment number to copyNo.
G4int fNx, fNy, fNz;
};
//
#endif