Import Geant4 11.0.0.beta source tree
This commit is contained in:
@@ -46,66 +46,75 @@ class G4ParallelWorldProcess;
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This class represents a multi-functional detector to be used by command-based scorer
|
||||
// For parallel world scorer, this class creates a parallel world mesh geometry
|
||||
// This class represents a multi-functional detector to be used by
|
||||
// command-based scorer For parallel world scorer, this class creates a
|
||||
// parallel world mesh geometry
|
||||
//
|
||||
|
||||
class G4VScoringMesh
|
||||
{
|
||||
public:
|
||||
enum class MeshShape { box, cylinder, sphere, realWorldLogVol, probe, undefined = -1};
|
||||
using EventScore = G4THitsMap< G4double >;
|
||||
using RunScore = G4THitsMap< G4StatDouble >;
|
||||
using MeshScoreMap = std::map< G4String, RunScore* >;
|
||||
public:
|
||||
enum class MeshShape
|
||||
{
|
||||
box,
|
||||
cylinder,
|
||||
sphere,
|
||||
realWorldLogVol,
|
||||
probe,
|
||||
undefined = -1
|
||||
};
|
||||
using EventScore = G4THitsMap<G4double>;
|
||||
using RunScore = G4THitsMap<G4StatDouble>;
|
||||
using MeshScoreMap = std::map<G4String, RunScore*>;
|
||||
|
||||
public:
|
||||
public:
|
||||
G4VScoringMesh(const G4String& wName);
|
||||
virtual ~G4VScoringMesh();
|
||||
|
||||
public: // with description
|
||||
public: // with description
|
||||
// a pure virtual function to construct this mesh geometry
|
||||
void Construct(G4VPhysicalVolume* fWorldPhys);
|
||||
|
||||
void WorkerConstruct(G4VPhysicalVolume* fWorldPhys);
|
||||
|
||||
protected:
|
||||
virtual void SetupGeometry(G4VPhysicalVolume * fWorldPhys) = 0;
|
||||
protected:
|
||||
virtual void SetupGeometry(G4VPhysicalVolume* fWorldPhys) = 0;
|
||||
|
||||
public: // with description
|
||||
// list infomration of this mesh
|
||||
public: // with description
|
||||
// list infomration of this mesh
|
||||
virtual void List() const;
|
||||
|
||||
public: // with description
|
||||
|
||||
public: // with description
|
||||
// get the world name
|
||||
// If this ScoringMesh is for parallel world, it returns the name of the parallel world
|
||||
// If this ScoringMesh is for real world logical volume, it returns name of logical volume
|
||||
inline const G4String& GetWorldName() const
|
||||
{ return fWorldName; }
|
||||
// If this ScoringMesh is for parallel world, it returns the name of the
|
||||
// parallel world If this ScoringMesh is for real world logical volume, it
|
||||
// returns name of logical volume
|
||||
inline const G4String& GetWorldName() const { return fWorldName; }
|
||||
// get whether this mesh is active or not
|
||||
inline G4bool IsActive() const
|
||||
{ return fActive; }
|
||||
inline G4bool IsActive() const { return fActive; }
|
||||
// set an activity of this mesh
|
||||
inline void Activate(G4bool vl = true)
|
||||
{ fActive = vl; }
|
||||
inline void Activate(G4bool vl = true) { fActive = vl; }
|
||||
// get the shape of this mesh
|
||||
inline MeshShape GetShape() const
|
||||
{ return fShape; }
|
||||
inline MeshShape GetShape() const { return fShape; }
|
||||
// accumulate hits in a registered primitive scorer
|
||||
void Accumulate(G4THitsMap<G4double> * map);
|
||||
void Accumulate(G4THitsMap<G4StatDouble> * map);
|
||||
void Accumulate(G4THitsMap<G4double>* map);
|
||||
void Accumulate(G4THitsMap<G4StatDouble>* map);
|
||||
// merge same kind of meshes
|
||||
void Merge(const G4VScoringMesh * scMesh);
|
||||
void Merge(const G4VScoringMesh* scMesh);
|
||||
// dump information of primitive socrers registered in this mesh
|
||||
void Dump();
|
||||
// draw a projected quantity on a current viewer
|
||||
void DrawMesh(const G4String& psName,G4VScoreColorMap* colorMap,G4int axflg=111);
|
||||
void DrawMesh(const G4String& psName, G4VScoreColorMap* colorMap,
|
||||
G4int axflg = 111);
|
||||
// draw a column of a quantity on a current viewer
|
||||
void DrawMesh(const G4String& psName,G4int idxPlane,G4int iColumn,G4VScoreColorMap* colorMap);
|
||||
void DrawMesh(const G4String& psName, G4int idxPlane, G4int iColumn,
|
||||
G4VScoreColorMap* colorMap);
|
||||
// draw a projected quantity on a current viewer
|
||||
virtual void Draw(RunScore * map, G4VScoreColorMap* colorMap, G4int axflg=111) = 0;
|
||||
virtual void Draw(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
G4int axflg = 111) = 0;
|
||||
// draw a column of a quantity on a current viewer
|
||||
virtual void DrawColumn(RunScore * map, G4VScoreColorMap* colorMap,
|
||||
G4int idxProj, G4int idxColumn) = 0;
|
||||
virtual void DrawColumn(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
G4int idxProj, G4int idxColumn) = 0;
|
||||
// reset registered primitive scorers
|
||||
void ResetScore();
|
||||
|
||||
@@ -114,10 +123,12 @@ public: // with description
|
||||
void SetSize(G4double size[3]);
|
||||
// get size of this mesh
|
||||
G4ThreeVector GetSize() const;
|
||||
// set starting and span angles (used only for tube segment)
|
||||
void SetAngles(G4double, G4double);
|
||||
// set position of center of this mesh
|
||||
void SetCenterPosition(G4double centerPosition[3]);
|
||||
// get position of center of this mesh
|
||||
G4ThreeVector GetTranslation() const {return fCenterPosition;}
|
||||
G4ThreeVector GetTranslation() const { return fCenterPosition; }
|
||||
// set a rotation angle around the x axis
|
||||
void RotateX(G4double delta);
|
||||
// set a rotation angle around the y axis
|
||||
@@ -125,9 +136,12 @@ public: // with description
|
||||
// set a rotation angle around the z axis
|
||||
void RotateZ(G4double delta);
|
||||
// get a rotation matrix
|
||||
G4RotationMatrix GetRotationMatrix() const {
|
||||
if(fRotationMatrix) return *fRotationMatrix;
|
||||
else return G4RotationMatrix::IDENTITY;
|
||||
G4RotationMatrix GetRotationMatrix() const
|
||||
{
|
||||
if(fRotationMatrix)
|
||||
return *fRotationMatrix;
|
||||
else
|
||||
return G4RotationMatrix::IDENTITY;
|
||||
}
|
||||
|
||||
// set number of segments of this mesh
|
||||
@@ -135,63 +149,65 @@ public: // with description
|
||||
// get number of segments of this mesh
|
||||
void GetNumberOfSegments(G4int nSegment[3]);
|
||||
|
||||
// register a primitive scorer to the MFD & set it to the current primitive scorer
|
||||
void SetPrimitiveScorer(G4VPrimitiveScorer * ps);
|
||||
// register a primitive scorer to the MFD & set it to the current primitive
|
||||
// scorer
|
||||
void SetPrimitiveScorer(G4VPrimitiveScorer* ps);
|
||||
// register a filter to a current primtive scorer
|
||||
void SetFilter(G4VSDFilter * filter);
|
||||
void SetFilter(G4VSDFilter* filter);
|
||||
// set a primitive scorer to the current one by the name
|
||||
void SetCurrentPrimitiveScorer(const G4String & name);
|
||||
void SetCurrentPrimitiveScorer(const G4String& name);
|
||||
// find registered primitive scorer by the name
|
||||
G4bool FindPrimitiveScorer(const G4String & psname);
|
||||
G4bool FindPrimitiveScorer(const G4String& psname);
|
||||
// get whether current primitive scorer is set or not
|
||||
G4bool IsCurrentPrimitiveScorerNull() {
|
||||
if(fCurrentPS == nullptr) return true;
|
||||
else return false;
|
||||
G4bool IsCurrentPrimitiveScorerNull()
|
||||
{
|
||||
if(fCurrentPS == nullptr)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
// get unit of primitive scorer by the name
|
||||
G4String GetPSUnit(const G4String & psname);
|
||||
G4String GetPSUnit(const G4String& psname);
|
||||
// get unit of current primitive scorer
|
||||
G4String GetCurrentPSUnit();
|
||||
// set unit of current primitive scorer
|
||||
void SetCurrentPSUnit(const G4String& unit);
|
||||
// get unit value of primitive scorer by the name
|
||||
G4double GetPSUnitValue(const G4String & psname);
|
||||
G4double GetPSUnitValue(const G4String& psname);
|
||||
// set PS name to be drawn
|
||||
void SetDrawPSName(const G4String & psname) {fDrawPSName = psname;}
|
||||
void SetDrawPSName(const G4String& psname) { fDrawPSName = psname; }
|
||||
|
||||
// get axis names of the hierarchical division in the divided order
|
||||
void GetDivisionAxisNames(G4String divisionAxisNames[3]);
|
||||
|
||||
// set current primitive scorer to NULL
|
||||
void SetNullToCurrentPrimitiveScorer() {fCurrentPS = nullptr;}
|
||||
void SetNullToCurrentPrimitiveScorer() { fCurrentPS = nullptr; }
|
||||
// set verbose level
|
||||
inline void SetVerboseLevel(G4int vl)
|
||||
{ verboseLevel = vl; }
|
||||
inline void SetVerboseLevel(G4int vl) { verboseLevel = vl; }
|
||||
// get the primitive scorer map
|
||||
inline MeshScoreMap GetScoreMap() const
|
||||
{ return fMap; }
|
||||
inline MeshScoreMap GetScoreMap() const { return fMap; }
|
||||
// get whether this mesh setup has been ready
|
||||
inline G4bool ReadyForQuantity() const
|
||||
{ return (sizeIsSet && nMeshIsSet); }
|
||||
inline G4bool ReadyForQuantity() const { return (sizeIsSet && nMeshIsSet); }
|
||||
|
||||
//protected:
|
||||
// protected:
|
||||
// get registered primitive socrer by the name
|
||||
G4VPrimitiveScorer * GetPrimitiveScorer(const G4String & name);
|
||||
G4VPrimitiveScorer* GetPrimitiveScorer(const G4String& name);
|
||||
|
||||
protected:
|
||||
G4String fWorldName;
|
||||
G4VPrimitiveScorer * fCurrentPS;
|
||||
G4bool fConstructed;
|
||||
G4bool fActive;
|
||||
protected:
|
||||
G4String fWorldName;
|
||||
G4VPrimitiveScorer* fCurrentPS;
|
||||
G4bool fConstructed;
|
||||
G4bool fActive;
|
||||
MeshShape fShape;
|
||||
|
||||
G4double fSize[3];
|
||||
G4double fAngle[2];
|
||||
G4ThreeVector fCenterPosition;
|
||||
G4RotationMatrix * fRotationMatrix;
|
||||
G4RotationMatrix* fRotationMatrix;
|
||||
G4int fNSegment[3];
|
||||
|
||||
MeshScoreMap fMap;
|
||||
G4MultiFunctionalDetector * fMFD;
|
||||
G4MultiFunctionalDetector* fMFD;
|
||||
|
||||
G4int verboseLevel;
|
||||
|
||||
@@ -204,47 +220,54 @@ protected:
|
||||
|
||||
G4String fDivisionAxisNames[3];
|
||||
|
||||
G4LogicalVolume * fMeshElementLogical;
|
||||
G4LogicalVolume* fMeshElementLogical;
|
||||
|
||||
public:
|
||||
public:
|
||||
inline void SetMeshElementLogical(G4LogicalVolume* val)
|
||||
{ fMeshElementLogical = val; }
|
||||
{
|
||||
fMeshElementLogical = val;
|
||||
}
|
||||
inline G4LogicalVolume* GetMeshElementLogical() const
|
||||
{ return fMeshElementLogical; }
|
||||
{
|
||||
return fMeshElementLogical;
|
||||
}
|
||||
|
||||
protected:
|
||||
protected:
|
||||
G4ParallelWorldProcess* fParallelWorldProcess;
|
||||
G4bool fGeometryHasBeenDestroyed;
|
||||
public:
|
||||
|
||||
public:
|
||||
inline void SetParallelWorldProcess(G4ParallelWorldProcess* proc)
|
||||
{ fParallelWorldProcess = proc; }
|
||||
{
|
||||
fParallelWorldProcess = proc;
|
||||
}
|
||||
inline G4ParallelWorldProcess* GetParallelWorldProcess() const
|
||||
{ return fParallelWorldProcess; }
|
||||
{
|
||||
return fParallelWorldProcess;
|
||||
}
|
||||
inline void GeometryHasBeenDestroyed()
|
||||
{
|
||||
fGeometryHasBeenDestroyed = true;
|
||||
fMeshElementLogical = nullptr;
|
||||
fMeshElementLogical = nullptr;
|
||||
}
|
||||
|
||||
protected:
|
||||
protected:
|
||||
G4int copyNumberLevel;
|
||||
public:
|
||||
|
||||
public:
|
||||
// Geometry hirarchy level (bottom = 0) to be used as the copy number
|
||||
// This is used only for real-world scorer
|
||||
inline void SetCopyNumberLevel(G4int val)
|
||||
{ copyNumberLevel = val; }
|
||||
inline G4int GetCopyNumberLevel() const
|
||||
{ return copyNumberLevel; }
|
||||
inline void SetCopyNumberLevel(G4int val) { copyNumberLevel = val; }
|
||||
inline G4int GetCopyNumberLevel() const { return copyNumberLevel; }
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// This flag may be set to true for Probe scoring mesh.
|
||||
// There is no public set method for this boolean flag, but it should be set to true
|
||||
// through SetMaterial() method of Probe scoring mesh.
|
||||
// There is no public set method for this boolean flag, but it should be set
|
||||
// to true through SetMaterial() method of Probe scoring mesh.
|
||||
G4bool layeredMassFlg;
|
||||
public:
|
||||
G4bool LayeredMassFlg()
|
||||
{ return layeredMassFlg; }
|
||||
|
||||
public:
|
||||
G4bool LayeredMassFlg() { return layeredMassFlg; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user