Import Geant4 11.1.0 source tree
This commit is contained in:
@@ -35,11 +35,11 @@
|
||||
class G4DefaultLinearColorMap : public G4VScoreColorMap
|
||||
{
|
||||
public:
|
||||
G4DefaultLinearColorMap(G4String mName);
|
||||
virtual ~G4DefaultLinearColorMap();
|
||||
using G4VScoreColorMap::G4VScoreColorMap;
|
||||
~G4DefaultLinearColorMap() override = default;
|
||||
|
||||
public:
|
||||
virtual void GetMapColor(G4double val, G4double color[4]);
|
||||
void GetMapColor(G4double val, G4double color[4]) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,15 +35,15 @@
|
||||
class G4ScoreLogColorMap : public G4VScoreColorMap
|
||||
{
|
||||
public:
|
||||
G4ScoreLogColorMap(G4String mName);
|
||||
virtual ~G4ScoreLogColorMap();
|
||||
using G4VScoreColorMap::G4VScoreColorMap;
|
||||
~G4ScoreLogColorMap() override = default;
|
||||
|
||||
public:
|
||||
virtual void GetMapColor(G4double val, G4double color[4]);
|
||||
void GetMapColor(G4double val, G4double color[4]) override;
|
||||
|
||||
// draw a color chart
|
||||
virtual void DrawColorChartBar(G4int nPoint);
|
||||
virtual void DrawColorChartText(G4int nPoint);
|
||||
void DrawColorChartBar(G4int nPoint) override;
|
||||
void DrawColorChartText(G4int nPoint) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -46,7 +46,7 @@ class G4UIcmdWithAString;
|
||||
class G4UIcmdWithoutParameter;
|
||||
class G4UIcommand;
|
||||
|
||||
typedef std::vector<G4String> G4TokenVec;
|
||||
using G4TokenVec = std::vector<G4String>;
|
||||
|
||||
// class description:
|
||||
//
|
||||
@@ -59,11 +59,11 @@ class G4ScoreQuantityMessenger : public G4UImessenger
|
||||
public:
|
||||
G4ScoreQuantityMessenger(G4ScoringManager* SManager);
|
||||
|
||||
~G4ScoreQuantityMessenger();
|
||||
~G4ScoreQuantityMessenger() override;
|
||||
|
||||
void SetNewValue(G4UIcommand* command, G4String newValues);
|
||||
void SetNewValue(G4UIcommand* command, G4String newValues) override;
|
||||
|
||||
G4String GetCurrentValue(G4UIcommand*);
|
||||
G4String GetCurrentValue(G4UIcommand*) override;
|
||||
|
||||
protected:
|
||||
void FillTokenVec(G4String newValues, G4TokenVec& token);
|
||||
@@ -101,16 +101,11 @@ class G4ScoreQuantityMessenger : public G4UImessenger
|
||||
G4UIcommand* qFlatSurfCurrCmd;
|
||||
G4UIcommand* qFlatSurfFluxCmd;
|
||||
G4UIcommand* qVolFluxCmd;
|
||||
// G4UIcommand* qSphereSurfCurrCmd;
|
||||
// G4UIcommand* qSphereSurfFluxCmd;
|
||||
// G4UIcommand* qCylSurfCurrCmd;
|
||||
// G4UIcommand* qCylSurfFluxCmd;
|
||||
G4UIcommand* qNofCollisionCmd;
|
||||
G4UIcommand* qPopulationCmd;
|
||||
G4UIcommand* qTrackCountCmd;
|
||||
G4UIcommand* qTerminationCmd;
|
||||
G4UIcommand* qMinKinEAtGeneCmd;
|
||||
//
|
||||
G4UIcommand* qStepCheckerCmd;
|
||||
|
||||
//
|
||||
|
||||
@@ -43,21 +43,21 @@ class G4ScoringBox : public G4VScoringMesh
|
||||
{
|
||||
public:
|
||||
G4ScoringBox(G4String wName);
|
||||
~G4ScoringBox();
|
||||
|
||||
protected:
|
||||
// construct this mesh
|
||||
virtual void SetupGeometry(G4VPhysicalVolume* fWorldPhys);
|
||||
~G4ScoringBox() override = default;
|
||||
|
||||
public:
|
||||
void List() const;
|
||||
void Draw(RunScore* map, G4VScoreColorMap* colorMap, G4int axflg = 111);
|
||||
void List() const override;
|
||||
void Draw(RunScore* map, G4VScoreColorMap* colorMap, G4int axflg = 111) override;
|
||||
void DrawColumn(RunScore* map, G4VScoreColorMap* colorMap, G4int idxProj,
|
||||
G4int idxColumn);
|
||||
G4int idxColumn) override;
|
||||
|
||||
// set a direction to segment this mesh
|
||||
void SetSegmentDirection(G4int dir) { fSegmentDirection = dir; }
|
||||
|
||||
protected:
|
||||
// construct this mesh
|
||||
void SetupGeometry(G4VPhysicalVolume* fWorldPhys) override;
|
||||
|
||||
private:
|
||||
// get replicated position from 3D index (x,y,z)
|
||||
G4ThreeVector GetReplicaPosition(G4int x, G4int y, G4int z);
|
||||
|
||||
@@ -41,17 +41,15 @@ class G4ScoringCylinder : public G4VScoringMesh
|
||||
{
|
||||
public:
|
||||
G4ScoringCylinder(G4String wName);
|
||||
~G4ScoringCylinder();
|
||||
~G4ScoringCylinder() override = default;
|
||||
|
||||
protected:
|
||||
virtual void SetupGeometry(G4VPhysicalVolume* fWorldPhys);
|
||||
|
||||
public:
|
||||
virtual void List() const;
|
||||
virtual void Draw(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
G4int axflg = 111);
|
||||
virtual void DrawColumn(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
G4int idxProj, G4int idxColumn);
|
||||
void List() const override;
|
||||
void Draw(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
G4int axflg = 111) override;
|
||||
void DrawColumn(RunScore* map, G4VScoreColorMap* colorMap,
|
||||
G4int idxProj, G4int idxColumn) override;
|
||||
|
||||
void SetRMin(G4double rMin) { fSize[0] = rMin; }
|
||||
void SetRMax(G4double rMax) { fSize[1] = rMax; }
|
||||
@@ -62,10 +60,11 @@ class G4ScoringCylinder : public G4VScoringMesh
|
||||
// get 3D index (z,phi,r) from sequential index
|
||||
void GetRZPhi(G4int index, G4int q[3]) const;
|
||||
|
||||
protected:
|
||||
void SetupGeometry(G4VPhysicalVolume* fWorldPhys) override;
|
||||
|
||||
private:
|
||||
// Xin Dong 09302011 for Scorers
|
||||
public:
|
||||
// private:
|
||||
// enum IDX {IR, IZ, IPHI};
|
||||
enum IDX
|
||||
{
|
||||
IZ,
|
||||
@@ -73,7 +72,6 @@ class G4ScoringCylinder : public G4VScoringMesh
|
||||
IR
|
||||
};
|
||||
|
||||
private:
|
||||
void DumpVolumes();
|
||||
void DumpSolids(G4int);
|
||||
void DumpLogVols(G4int);
|
||||
|
||||
@@ -48,41 +48,34 @@ class G4VScoreColorMap;
|
||||
// the singleton object.
|
||||
//
|
||||
|
||||
typedef std::vector<G4VScoringMesh*> MeshVec;
|
||||
typedef std::vector<G4VScoringMesh*>::iterator MeshVecItr;
|
||||
typedef std::vector<G4VScoringMesh*>::const_iterator MeshVecConstItr;
|
||||
typedef std::map<G4String, G4VScoreColorMap*> ColorMapDict;
|
||||
typedef std::map<G4String, G4VScoreColorMap*>::iterator ColorMapDictItr;
|
||||
typedef std::map<G4String, G4VScoreColorMap*>::const_iterator
|
||||
ColorMapDictConstItr;
|
||||
typedef std::map<G4int, G4VScoringMesh*> MeshMap;
|
||||
typedef std::map<G4int, G4VScoringMesh*>::iterator MeshMapItr;
|
||||
typedef std::map<G4int, G4VScoringMesh*>::const_iterator MeshMapConstItr;
|
||||
using MeshVec = std::vector<G4VScoringMesh *>;
|
||||
using MeshVecItr = MeshVec::iterator;
|
||||
using MeshVecConstItr = MeshVec::const_iterator;
|
||||
using ColorMapDict = std::map<G4String, G4VScoreColorMap *>;
|
||||
using ColorMapDictItr = ColorMapDict::iterator;
|
||||
using ColorMapDictConstItr = ColorMapDict::const_iterator;
|
||||
using MeshMap = std::map<G4int, G4VScoringMesh *>;
|
||||
using MeshMapItr = MeshMap::iterator;
|
||||
using MeshMapConstItr = MeshMap::const_iterator;
|
||||
|
||||
class G4ScoringManager
|
||||
{
|
||||
public: // with description
|
||||
static G4ScoringManager* GetScoringManager();
|
||||
// Returns the pointer to the singleton object.
|
||||
public:
|
||||
|
||||
static G4ScoringManager* GetScoringManagerIfExist();
|
||||
|
||||
~G4ScoringManager();
|
||||
|
||||
public:
|
||||
static void SetReplicaLevel(G4int);
|
||||
static G4int GetReplicaLevel();
|
||||
|
||||
protected:
|
||||
G4ScoringManager();
|
||||
|
||||
public:
|
||||
~G4ScoringManager();
|
||||
|
||||
public: // with description
|
||||
void RegisterScoreColorMap(G4VScoreColorMap* colorMap);
|
||||
// Register a color map. Once registered, it is available by /score/draw and
|
||||
// /score/drawColumn commands.
|
||||
|
||||
public:
|
||||
void Accumulate(G4VHitsCollection* map);
|
||||
void Merge(const G4ScoringManager* scMan);
|
||||
G4VScoringMesh* FindMesh(G4VHitsCollection* map);
|
||||
@@ -102,34 +95,17 @@ class G4ScoringManager
|
||||
G4VScoreColorMap* GetScoreColorMap(const G4String& mapName);
|
||||
void ListScoreColorMaps();
|
||||
|
||||
private:
|
||||
static G4ThreadLocal G4ScoringManager* fSManager;
|
||||
static G4ThreadLocal G4int replicaLevel;
|
||||
G4int verboseLevel;
|
||||
G4ScoringMessenger* fMessenger;
|
||||
G4ScoreQuantityMessenger* fQuantityMessenger;
|
||||
|
||||
MeshVec fMeshVec;
|
||||
G4VScoringMesh* fCurrentMesh;
|
||||
|
||||
G4VScoreWriter* writer;
|
||||
G4VScoreColorMap* fDefaultLinearColorMap;
|
||||
ColorMapDict* fColorMapDict;
|
||||
|
||||
MeshMap fMeshMap;
|
||||
|
||||
public:
|
||||
inline void SetCurrentMesh(G4VScoringMesh* scm) { fCurrentMesh = scm; }
|
||||
inline G4VScoringMesh* GetCurrentMesh() const { return fCurrentMesh; }
|
||||
inline void CloseCurrentMesh() { fCurrentMesh = 0; }
|
||||
inline void CloseCurrentMesh() { fCurrentMesh = nullptr; }
|
||||
inline void SetVerboseLevel(G4int vl)
|
||||
{
|
||||
verboseLevel = vl;
|
||||
for(MeshVecItr itr = fMeshVec.begin(); itr != fMeshVec.end(); itr++)
|
||||
for(auto& itr : fMeshVec)
|
||||
{
|
||||
(*itr)->SetVerboseLevel(vl);
|
||||
itr->SetVerboseLevel(vl);
|
||||
}
|
||||
if(writer)
|
||||
if(writer != nullptr)
|
||||
writer->SetVerboseLevel(vl);
|
||||
}
|
||||
inline G4int GetVerboseLevel() const { return verboseLevel; }
|
||||
@@ -149,12 +125,9 @@ class G4ScoringManager
|
||||
public: // with description
|
||||
inline void SetScoreWriter(G4VScoreWriter* sw)
|
||||
{
|
||||
if(writer)
|
||||
{
|
||||
delete writer;
|
||||
}
|
||||
delete writer;
|
||||
writer = sw;
|
||||
if(writer)
|
||||
if(writer != nullptr)
|
||||
writer->SetVerboseLevel(verboseLevel);
|
||||
}
|
||||
// Replace score writers.
|
||||
@@ -162,25 +135,42 @@ class G4ScoringManager
|
||||
public:
|
||||
inline void SetFactor(G4double val = 1.0)
|
||||
{
|
||||
if(writer)
|
||||
if(writer != nullptr)
|
||||
writer->SetFactor(val);
|
||||
}
|
||||
inline G4double GetFactor() const
|
||||
{
|
||||
if(writer)
|
||||
if(writer != nullptr)
|
||||
{
|
||||
return writer->GetFactor();
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
protected:
|
||||
G4ScoringManager();
|
||||
|
||||
private:
|
||||
// Disable copy constructor and assignement operator
|
||||
G4ScoringManager(const G4ScoringManager&);
|
||||
G4ScoringManager& operator=(const G4ScoringManager&);
|
||||
|
||||
private:
|
||||
static G4ThreadLocal G4ScoringManager* fSManager;
|
||||
static G4ThreadLocal G4int replicaLevel;
|
||||
G4int verboseLevel;
|
||||
G4ScoringMessenger* fMessenger;
|
||||
G4ScoreQuantityMessenger* fQuantityMessenger;
|
||||
|
||||
MeshVec fMeshVec;
|
||||
G4VScoringMesh* fCurrentMesh;
|
||||
|
||||
G4VScoreWriter* writer;
|
||||
G4VScoreColorMap* fDefaultLinearColorMap;
|
||||
ColorMapDict* fColorMapDict;
|
||||
|
||||
MeshMap fMeshMap;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -50,7 +50,7 @@ class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWith3VectorAndUnit;
|
||||
class G4UIcommand;
|
||||
|
||||
typedef std::vector<G4String> G4TokenVec;
|
||||
using G4TokenVec = std::vector<G4String>;
|
||||
|
||||
// class description:
|
||||
//
|
||||
@@ -63,11 +63,11 @@ class G4ScoringMessenger : public G4UImessenger
|
||||
public:
|
||||
G4ScoringMessenger(G4ScoringManager* SManager);
|
||||
|
||||
~G4ScoringMessenger();
|
||||
~G4ScoringMessenger() override;
|
||||
|
||||
void SetNewValue(G4UIcommand* command, G4String newValues);
|
||||
void SetNewValue(G4UIcommand* command, G4String newValues) override;
|
||||
|
||||
G4String GetCurrentValue(G4UIcommand* command);
|
||||
G4String GetCurrentValue(G4UIcommand* command) override;
|
||||
|
||||
protected:
|
||||
void FillTokenVec(G4String newValues, G4TokenVec& token);
|
||||
@@ -84,7 +84,6 @@ class G4ScoringMessenger : public G4UImessenger
|
||||
G4UIdirectory* meshCreateDir;
|
||||
G4UIcmdWithAString* meshBoxCreateCmd;
|
||||
G4UIcmdWithAString* meshCylinderCreateCmd;
|
||||
// G4UIcmdWithAString* meshSphereCreateCmd;
|
||||
G4UIcommand* meshRWLogVolCreateCmd;
|
||||
G4UIcommand* probeCreateCmd;
|
||||
//
|
||||
@@ -93,14 +92,12 @@ class G4ScoringMessenger : public G4UImessenger
|
||||
G4UIcmdWithAString* meshOpnCmd;
|
||||
//
|
||||
G4UIcmdWithoutParameter* meshClsCmd;
|
||||
// G4UIcmdWithABool* meshActCmd;
|
||||
//
|
||||
// Size commands
|
||||
G4UIcmdWith3VectorAndUnit* mBoxSizeCmd;
|
||||
G4UIcommand* mCylinderSizeCmd;
|
||||
G4UIcmdWithADoubleAndUnit* mCylinderRMinCmd;
|
||||
G4UIcommand* mCylinderAngleCmd;
|
||||
// G4UIcmdWith3VectorAndUnit* mSphereSizeCmd;
|
||||
//
|
||||
// Division command
|
||||
G4UIcommand* mBinCmd;
|
||||
@@ -110,7 +107,6 @@ class G4ScoringMessenger : public G4UImessenger
|
||||
G4UIcmdWithoutParameter* mTResetCmd;
|
||||
G4UIcmdWith3VectorAndUnit* mTXyzCmd;
|
||||
G4UIdirectory* mRotDir;
|
||||
// G4UIcmdWithoutParameter* mRResetCmd;
|
||||
G4UIcmdWithADoubleAndUnit* mRotXCmd;
|
||||
G4UIcmdWithADoubleAndUnit* mRotYCmd;
|
||||
G4UIcmdWithADoubleAndUnit* mRotZCmd;
|
||||
@@ -127,7 +123,6 @@ class G4ScoringMessenger : public G4UImessenger
|
||||
G4UIcmdWithoutParameter* listColorMapCmd;
|
||||
G4UIcmdWithAString* floatMinMaxCmd;
|
||||
G4UIcommand* colorMapMinMaxCmd;
|
||||
// G4UIcommand * chartCmd;
|
||||
//
|
||||
// Dump scoring result to file
|
||||
G4UIcommand* dumpQtyToFileCmd;
|
||||
|
||||
@@ -30,20 +30,44 @@
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VScoringMesh.hh"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
class G4Material;
|
||||
#include <vector>
|
||||
|
||||
class G4ScoringProbe : public G4VScoringMesh
|
||||
{
|
||||
public:
|
||||
G4ScoringProbe(G4String lvName, G4double half_size,
|
||||
G4bool checkOverlap = false);
|
||||
~G4ScoringProbe();
|
||||
~G4ScoringProbe() override = default;
|
||||
|
||||
public:
|
||||
void LocateProbe(G4ThreeVector pos)
|
||||
{
|
||||
posVec.push_back(pos);
|
||||
G4int nbin[] = { static_cast<G4int>(posVec.size()), 1, 1 };
|
||||
SetNumberOfSegments(nbin);
|
||||
}
|
||||
G4int GetNumberOfProbes() const { return (G4int)posVec.size(); }
|
||||
void SetProbeSize(G4double val) { probeSize = val; }
|
||||
G4double GetProbeSize() const { return probeSize; }
|
||||
G4bool SetMaterial(G4String val);
|
||||
|
||||
void List() const override;
|
||||
|
||||
//++++++++++ visualization method not yet implemented
|
||||
void Draw(RunScore* /*map*/, G4VScoreColorMap* /*colorMap*/,
|
||||
G4int /*axflg=111*/) override
|
||||
{}
|
||||
void DrawColumn(RunScore* /*map*/, G4VScoreColorMap* /*colorMap*/,
|
||||
G4int /*idxProj*/, G4int /*idxColumn*/) override
|
||||
{}
|
||||
|
||||
protected:
|
||||
// construct scoring volume
|
||||
virtual void SetupGeometry(G4VPhysicalVolume*);
|
||||
void SetupGeometry(G4VPhysicalVolume*) override;
|
||||
|
||||
protected:
|
||||
G4String logVolName;
|
||||
@@ -53,34 +77,6 @@ class G4ScoringProbe : public G4VScoringMesh
|
||||
G4String layeredMaterialName;
|
||||
G4Material* layeredMaterial;
|
||||
G4String regName;
|
||||
|
||||
public:
|
||||
void LocateProbe(G4ThreeVector pos)
|
||||
{
|
||||
posVec.push_back(pos);
|
||||
G4int nbin[] = { static_cast<G4int>(posVec.size()), 1, 1 };
|
||||
SetNumberOfSegments(nbin);
|
||||
}
|
||||
G4int GetNumberOfProbes() const { return posVec.size(); }
|
||||
void SetProbeSize(G4double val) { probeSize = val; }
|
||||
G4double GetProbeSize() const { return probeSize; }
|
||||
G4bool SetMaterial(G4String val);
|
||||
|
||||
public:
|
||||
virtual void List() const;
|
||||
|
||||
public:
|
||||
//++++++++++ visualization method not yet implemented
|
||||
virtual void Draw(RunScore* /*map*/, G4VScoreColorMap* /*colorMap*/,
|
||||
G4int /*axflg=111*/)
|
||||
{
|
||||
;
|
||||
}
|
||||
virtual void DrawColumn(RunScore* /*map*/, G4VScoreColorMap* /*colorMap*/,
|
||||
G4int /*idxProj*/, G4int /*idxColumn*/)
|
||||
{
|
||||
;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,30 +35,26 @@ class G4ScoringRealWorld : public G4VScoringMesh
|
||||
{
|
||||
public:
|
||||
G4ScoringRealWorld(G4String lvName);
|
||||
~G4ScoringRealWorld();
|
||||
~G4ScoringRealWorld() override = default;
|
||||
|
||||
public:
|
||||
void List() const override;
|
||||
|
||||
//++++++++++ visualization method not yet implemented
|
||||
void Draw(RunScore* /*map*/, G4VScoreColorMap* /*colorMap*/,
|
||||
G4int /*axflg=111*/) override
|
||||
{}
|
||||
|
||||
void DrawColumn(RunScore* /*map*/, G4VScoreColorMap* /*colorMap*/,
|
||||
G4int /*idxProj*/, G4int /*idxColumn*/) override
|
||||
{}
|
||||
|
||||
protected:
|
||||
// construct this mesh
|
||||
virtual void SetupGeometry(G4VPhysicalVolume*);
|
||||
void SetupGeometry(G4VPhysicalVolume*) override;
|
||||
|
||||
protected:
|
||||
G4String logVolName;
|
||||
|
||||
public:
|
||||
virtual void List() const;
|
||||
|
||||
public:
|
||||
//++++++++++ visualization method not yet implemented
|
||||
virtual void Draw(RunScore* /*map*/, G4VScoreColorMap* /*colorMap*/,
|
||||
G4int /*axflg=111*/)
|
||||
{
|
||||
;
|
||||
}
|
||||
virtual void DrawColumn(RunScore* /*map*/, G4VScoreColorMap* /*colorMap*/,
|
||||
G4int /*idxProj*/, G4int /*idxColumn*/)
|
||||
{
|
||||
;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -71,6 +71,7 @@ class G4TScoreNtupleWriter : public G4VScoreNtupleWriter
|
||||
void SetDefaultFileType(const G4String& value);
|
||||
void SetFileName(const G4String& fileName);
|
||||
void SetVerboseLevel(G4int value);
|
||||
void SetNtupleMerging(G4bool value);
|
||||
|
||||
// get methods
|
||||
G4String GetFileName() const { return fFileName; }
|
||||
@@ -91,6 +92,7 @@ class G4TScoreNtupleWriter : public G4VScoreNtupleWriter
|
||||
G4String fDefaultFileType;
|
||||
G4String fFileName;
|
||||
G4int fVerboseLevel;
|
||||
G4bool fMergeNtuples;
|
||||
G4bool fHasAnalysisFile;
|
||||
G4bool fIsBooked;
|
||||
G4bool fIsInitialized;
|
||||
|
||||
@@ -46,6 +46,7 @@ G4TScoreNtupleWriter<T>::G4TScoreNtupleWriter()
|
||||
, fDefaultFileType("root")
|
||||
, fFileName("scoring")
|
||||
, fVerboseLevel(1)
|
||||
, fMergeNtuples(false)
|
||||
, fHasAnalysisFile(false)
|
||||
, fIsBooked(false)
|
||||
, fIsInitialized(false)
|
||||
@@ -72,14 +73,16 @@ G4TScoreNtupleWriter<T>::~G4TScoreNtupleWriter()
|
||||
template <typename T>
|
||||
void G4TScoreNtupleWriter<T>::CreateAnalysisManager()
|
||||
{
|
||||
if(fAnalysisManager)
|
||||
if(fAnalysisManager) {
|
||||
return;
|
||||
}
|
||||
|
||||
// create/get analysis manager
|
||||
fAnalysisManager = T::Instance();
|
||||
|
||||
fAnalysisManager->SetDefaultFileType(fDefaultFileType);
|
||||
fAnalysisManager->SetVerboseLevel(fVerboseLevel);
|
||||
fAnalysisManager->SetNtupleMerging(fMergeNtuples);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -93,6 +96,8 @@ G4VScoreNtupleWriter* G4TScoreNtupleWriter<T>::CreateInstance() const
|
||||
auto instance = new G4TScoreNtupleWriter();
|
||||
instance->SetFileName(fFileName);
|
||||
instance->SetVerboseLevel(fVerboseLevel);
|
||||
instance->SetNtupleMerging(fMergeNtuples);
|
||||
instance->fHasAnalysisFile = fHasAnalysisFile;
|
||||
|
||||
return instance;
|
||||
}
|
||||
@@ -231,7 +236,9 @@ void G4TScoreNtupleWriter<T>::OpenFile()
|
||||
}
|
||||
#endif
|
||||
|
||||
fHasAnalysisFile = fAnalysisManager->IsOpenFile();
|
||||
fHasAnalysisFile = fHasAnalysisFile || fAnalysisManager->IsOpenFile();
|
||||
// Do not overwrite file ownership
|
||||
// if merging is activated and file is not open on workers
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
@@ -342,3 +349,14 @@ void G4TScoreNtupleWriter<T>::SetVerboseLevel(G4int value)
|
||||
fAnalysisManager->SetVerboseLevel(value);
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
void G4TScoreNtupleWriter<T>::SetNtupleMerging(G4bool value)
|
||||
{
|
||||
fMergeNtuples = value;
|
||||
if(fAnalysisManager)
|
||||
{
|
||||
fAnalysisManager->SetNtupleMerging(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class G4VScoreColorMap
|
||||
{
|
||||
public:
|
||||
G4VScoreColorMap(G4String mName);
|
||||
virtual ~G4VScoreColorMap();
|
||||
virtual ~G4VScoreColorMap() = default;
|
||||
|
||||
public:
|
||||
virtual void GetMapColor(G4double val, G4double color[4]) = 0;
|
||||
@@ -77,12 +77,12 @@ class G4VScoreColorMap
|
||||
|
||||
protected:
|
||||
G4String fName;
|
||||
G4bool ifFloat;
|
||||
G4double fMinVal;
|
||||
G4double fMaxVal;
|
||||
G4VVisManager* fVisManager;
|
||||
G4String fPSUnit;
|
||||
G4String fPSName;
|
||||
G4bool ifFloat = true;
|
||||
G4double fMinVal = 0.0;
|
||||
G4double fMaxVal = DBL_MAX;
|
||||
G4VVisManager* fVisManager = nullptr;
|
||||
G4String fPSUnit = "";
|
||||
G4String fPSName = "";
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -40,8 +40,8 @@ class G4VScoringMesh;
|
||||
class G4VScoreWriter
|
||||
{
|
||||
public:
|
||||
G4VScoreWriter();
|
||||
virtual ~G4VScoreWriter();
|
||||
G4VScoreWriter() = default;
|
||||
virtual ~G4VScoreWriter() = default;
|
||||
|
||||
public:
|
||||
// store a quantity into a file
|
||||
@@ -64,10 +64,10 @@ class G4VScoreWriter
|
||||
G4int GetIndex(G4int x, G4int y, G4int z) const;
|
||||
|
||||
protected:
|
||||
G4int fNMeshSegments[3]; // number of segments of the mesh
|
||||
G4VScoringMesh* fScoringMesh;
|
||||
G4int verboseLevel;
|
||||
G4double fact;
|
||||
G4int fNMeshSegments[3] = {0, 0, 0}; // number of segments of the mesh
|
||||
G4VScoringMesh* fScoringMesh = nullptr;
|
||||
G4int verboseLevel = 0;
|
||||
G4double fact = 1.0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -69,21 +69,15 @@ class G4VScoringMesh
|
||||
|
||||
public:
|
||||
G4VScoringMesh(const G4String& wName);
|
||||
virtual ~G4VScoringMesh();
|
||||
virtual ~G4VScoringMesh() = default;
|
||||
|
||||
public: // with description
|
||||
virtual void Construct(G4VPhysicalVolume* fWorldPhys);
|
||||
virtual void WorkerConstruct(G4VPhysicalVolume* fWorldPhys);
|
||||
|
||||
protected:
|
||||
// a pure virtual function to construct this mesh geometry
|
||||
virtual void SetupGeometry(G4VPhysicalVolume* fWorldPhys) = 0;
|
||||
|
||||
public: // with description
|
||||
// list infomration of this mesh
|
||||
virtual void List() const;
|
||||
|
||||
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
|
||||
@@ -140,10 +134,9 @@ class G4VScoringMesh
|
||||
// get a rotation matrix
|
||||
G4RotationMatrix GetRotationMatrix() const
|
||||
{
|
||||
if(fRotationMatrix)
|
||||
if(fRotationMatrix != nullptr)
|
||||
return *fRotationMatrix;
|
||||
else
|
||||
return G4RotationMatrix::IDENTITY;
|
||||
return G4RotationMatrix::IDENTITY;
|
||||
}
|
||||
|
||||
// set number of segments of this mesh
|
||||
@@ -163,10 +156,7 @@ class G4VScoringMesh
|
||||
// get whether current primitive scorer is set or not
|
||||
G4bool IsCurrentPrimitiveScorerNull()
|
||||
{
|
||||
if(fCurrentPS == nullptr)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
return fCurrentPS == nullptr;
|
||||
}
|
||||
// get unit of primitive scorer by the name
|
||||
G4String GetPSUnit(const G4String& psname);
|
||||
@@ -195,6 +185,40 @@ class G4VScoringMesh
|
||||
// get registered primitive socrer by the name
|
||||
G4VPrimitiveScorer* GetPrimitiveScorer(const G4String& name);
|
||||
|
||||
inline void SetMeshElementLogical(G4LogicalVolume* val)
|
||||
{
|
||||
fMeshElementLogical = val;
|
||||
}
|
||||
inline G4LogicalVolume* GetMeshElementLogical() const
|
||||
{
|
||||
return fMeshElementLogical;
|
||||
}
|
||||
|
||||
inline void SetParallelWorldProcess(G4ParallelWorldProcess* proc)
|
||||
{
|
||||
fParallelWorldProcess = proc;
|
||||
}
|
||||
inline G4ParallelWorldProcess* GetParallelWorldProcess() const
|
||||
{
|
||||
return fParallelWorldProcess;
|
||||
}
|
||||
inline void GeometryHasBeenDestroyed()
|
||||
{
|
||||
fGeometryHasBeenDestroyed = true;
|
||||
fMeshElementLogical = nullptr;
|
||||
}
|
||||
|
||||
// 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; }
|
||||
|
||||
G4bool LayeredMassFlg() { return layeredMassFlg; }
|
||||
|
||||
protected:
|
||||
// a pure virtual function to construct this mesh geometry
|
||||
virtual void SetupGeometry(G4VPhysicalVolume* fWorldPhys) = 0;
|
||||
|
||||
protected:
|
||||
G4String fWorldName;
|
||||
G4VPrimitiveScorer* fCurrentPS;
|
||||
@@ -224,52 +248,15 @@ class G4VScoringMesh
|
||||
|
||||
G4LogicalVolume* fMeshElementLogical;
|
||||
|
||||
public:
|
||||
inline void SetMeshElementLogical(G4LogicalVolume* val)
|
||||
{
|
||||
fMeshElementLogical = val;
|
||||
}
|
||||
inline G4LogicalVolume* GetMeshElementLogical() const
|
||||
{
|
||||
return fMeshElementLogical;
|
||||
}
|
||||
|
||||
protected:
|
||||
G4ParallelWorldProcess* fParallelWorldProcess;
|
||||
G4bool fGeometryHasBeenDestroyed;
|
||||
|
||||
public:
|
||||
inline void SetParallelWorldProcess(G4ParallelWorldProcess* proc)
|
||||
{
|
||||
fParallelWorldProcess = proc;
|
||||
}
|
||||
inline G4ParallelWorldProcess* GetParallelWorldProcess() const
|
||||
{
|
||||
return fParallelWorldProcess;
|
||||
}
|
||||
inline void GeometryHasBeenDestroyed()
|
||||
{
|
||||
fGeometryHasBeenDestroyed = true;
|
||||
fMeshElementLogical = nullptr;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
G4int copyNumberLevel;
|
||||
|
||||
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; }
|
||||
|
||||
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.
|
||||
G4bool layeredMassFlg;
|
||||
|
||||
public:
|
||||
G4bool LayeredMassFlg() { return layeredMassFlg; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user