Import Geant4 10.6.0 source tree
This commit is contained in:
@@ -16,6 +16,17 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
November 19th, 2019 G. Cosmo (digits_hits-V10-05-07)
|
||||
- Fixed more cases of implicit type conversions.
|
||||
|
||||
November 15th, 2019 G. Cosmo (digits_hits-V10-05-06)
|
||||
- Fixed implicit type conversions from size_t to G4int in digits and hits
|
||||
classes (collections, vectors, maps).
|
||||
- Pass G4String by const reference in digits and hist collections base classes.
|
||||
|
||||
July 4th, 2019 S. Wenzel (digits_hits-V10-05-05)
|
||||
- G4SDStructure : pass G4String by reference
|
||||
|
||||
May 29th, 2019 M. Asai (digits_hits-V10-05-04)
|
||||
- G4PSSphereSurfaceFlux : fix track weight forgotten from SphereSurfaceFlux.
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class G4HCtable
|
||||
|
||||
public:
|
||||
inline G4int entries() const
|
||||
{ return HClist.size(); }
|
||||
{ return G4int(HClist.size()); }
|
||||
inline G4String GetSDname(G4int i) const
|
||||
{
|
||||
if(i<0||i>entries()) return "***Not Defined***";
|
||||
|
||||
@@ -59,7 +59,7 @@ class G4MultiFunctionalDetector : public G4VSensitiveDetector
|
||||
G4bool RegisterPrimitive(G4VPrimitiveScorer*);
|
||||
G4bool RemovePrimitive(G4VPrimitiveScorer*);
|
||||
inline G4int GetNumberOfPrimitives() const
|
||||
{ return primitives.size(); }
|
||||
{ return G4int(primitives.size()); }
|
||||
G4VPrimitiveScorer* GetPrimitive(G4int id) const
|
||||
{ return primitives[id]; }
|
||||
|
||||
|
||||
@@ -46,22 +46,22 @@ class G4HCofThisEvent;
|
||||
class G4SDStructure
|
||||
{
|
||||
public:
|
||||
G4SDStructure(G4String aPath);
|
||||
G4SDStructure(const G4String &aPath);
|
||||
~G4SDStructure();
|
||||
|
||||
G4bool operator==(const G4SDStructure &right) const;
|
||||
|
||||
void AddNewDetector(G4VSensitiveDetector*aSD, G4String treeStructure);
|
||||
void Activate(G4String aName, G4bool sensitiveFlag);
|
||||
void AddNewDetector(G4VSensitiveDetector*aSD, const G4String &treeStructure);
|
||||
void Activate(const G4String &aName, G4bool sensitiveFlag);
|
||||
void Initialize(G4HCofThisEvent*HCE);
|
||||
void Terminate(G4HCofThisEvent*HCE);
|
||||
G4VSensitiveDetector* FindSensitiveDetector(G4String aName, G4bool warning = true);
|
||||
G4VSensitiveDetector* GetSD(G4String aName);
|
||||
G4VSensitiveDetector* FindSensitiveDetector(const G4String &aName, G4bool warning = true);
|
||||
G4VSensitiveDetector* GetSD(const G4String &aName);
|
||||
void ListTree();
|
||||
|
||||
private:
|
||||
G4SDStructure* FindSubDirectory(G4String subD);
|
||||
G4String ExtractDirName(G4String aPath);
|
||||
G4SDStructure* FindSubDirectory(const G4String &subD);
|
||||
G4String ExtractDirName(const G4String &aPath);
|
||||
void RemoveSD(G4VSensitiveDetector*);
|
||||
|
||||
private:
|
||||
|
||||
@@ -133,7 +133,7 @@ class G4VSensitiveDetector
|
||||
|
||||
public:
|
||||
inline G4int GetNumberOfCollections() const
|
||||
{ return collectionName.size(); }
|
||||
{ return G4int(collectionName.size()); }
|
||||
inline G4String GetCollectionName(G4int id) const
|
||||
{ return collectionName[id]; }
|
||||
inline void SetVerboseLevel(G4int vl)
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "G4SDStructure.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
G4SDStructure::G4SDStructure(G4String aPath):verboseLevel(0)
|
||||
G4SDStructure::G4SDStructure(const G4String &aPath):verboseLevel(0)
|
||||
{
|
||||
pathName = aPath;
|
||||
dirName = aPath;
|
||||
@@ -58,7 +58,7 @@ G4bool G4SDStructure::operator==(const G4SDStructure &right) const
|
||||
}
|
||||
|
||||
void G4SDStructure::AddNewDetector(G4VSensitiveDetector*aSD,
|
||||
G4String treeStructure)
|
||||
const G4String &treeStructure)
|
||||
{
|
||||
G4String remainingPath = treeStructure;
|
||||
remainingPath.remove(0,pathName.length());
|
||||
@@ -95,14 +95,14 @@ void G4SDStructure::AddNewDetector(G4VSensitiveDetector*aSD,
|
||||
}
|
||||
}
|
||||
|
||||
G4SDStructure* G4SDStructure::FindSubDirectory(G4String subD)
|
||||
G4SDStructure* G4SDStructure::FindSubDirectory(const G4String &subD)
|
||||
{
|
||||
for(auto st : structure)
|
||||
{ if( subD == st->dirName ) return st; }
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
G4VSensitiveDetector* G4SDStructure::GetSD(G4String aSDName)
|
||||
G4VSensitiveDetector* G4SDStructure::GetSD(const G4String &aSDName)
|
||||
{
|
||||
for(auto det : detector)
|
||||
{ if(aSDName == det->GetName()) return det; }
|
||||
@@ -115,7 +115,7 @@ void G4SDStructure::RemoveSD(G4VSensitiveDetector* sd)
|
||||
if(det!=detector.end()) detector.erase(det);
|
||||
}
|
||||
|
||||
G4String G4SDStructure::ExtractDirName(G4String aName)
|
||||
G4String G4SDStructure::ExtractDirName(const G4String &aName)
|
||||
{
|
||||
G4String subD = aName;
|
||||
G4int i = aName.first('/');
|
||||
@@ -123,11 +123,11 @@ G4String G4SDStructure::ExtractDirName(G4String aName)
|
||||
return subD;
|
||||
}
|
||||
|
||||
void G4SDStructure::Activate(G4String aName, G4bool sensitiveFlag)
|
||||
void G4SDStructure::Activate(const G4String &aName, G4bool sensitiveFlag)
|
||||
{
|
||||
G4String aPath = aName;
|
||||
aPath.remove(0,pathName.length());
|
||||
if( aPath.first('/') != G4int(std::string::npos) )
|
||||
if( aPath.first('/') != std::string::npos )
|
||||
{ // Command is ordered for a subdirectory.
|
||||
G4String subD = ExtractDirName(aPath);
|
||||
G4SDStructure* tgtSDS = FindSubDirectory(subD);
|
||||
@@ -159,11 +159,11 @@ void G4SDStructure::Activate(G4String aName, G4bool sensitiveFlag)
|
||||
}
|
||||
}
|
||||
|
||||
G4VSensitiveDetector* G4SDStructure::FindSensitiveDetector(G4String aName, G4bool warning)
|
||||
G4VSensitiveDetector* G4SDStructure::FindSensitiveDetector(const G4String &aName, G4bool warning)
|
||||
{
|
||||
G4String aPath = aName;
|
||||
aPath.remove(0,pathName.length());
|
||||
if( aPath.first('/') != G4int(std::string::npos) )
|
||||
if( aPath.first('/') != std::string::npos )
|
||||
{ // SD exists in sub-directory
|
||||
G4String subD = ExtractDirName(aPath);
|
||||
G4SDStructure* tgtSDS = FindSubDirectory(subD);
|
||||
|
||||
@@ -79,7 +79,7 @@ class G4DCofThisEvent
|
||||
// Returns the number of digi collections which are stored in this class
|
||||
// object.
|
||||
public:
|
||||
inline G4int GetCapacity() const
|
||||
inline size_t GetCapacity() const
|
||||
{
|
||||
return DC->size();
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ template <class T> class G4TDigiCollection : public G4DigiCollection
|
||||
return (std::vector<T*>*)theCollection;
|
||||
}
|
||||
// Returns a collection vector.
|
||||
inline G4int insert(T* aHit)
|
||||
inline size_t insert(T* aHit)
|
||||
{
|
||||
if (!aDCAllocator_G4MT_TLS_()) aDCAllocator_G4MT_TLS_() = new G4Allocator<G4DigiCollection>;
|
||||
std::vector<T*>*theDigiCollection
|
||||
@@ -104,7 +104,7 @@ template <class T> class G4TDigiCollection : public G4DigiCollection
|
||||
}
|
||||
// Insert a digi object. Total number of digi objects stored in this
|
||||
// collection is returned.
|
||||
inline G4int entries() const
|
||||
inline size_t entries() const
|
||||
{
|
||||
if (!aDCAllocator_G4MT_TLS_()) aDCAllocator_G4MT_TLS_() = new G4Allocator<G4DigiCollection>;
|
||||
std::vector<T*>*theDigiCollection
|
||||
|
||||
@@ -59,10 +59,10 @@ class G4VDigiCollection
|
||||
G4String DMname;
|
||||
|
||||
public:
|
||||
inline G4String GetName()
|
||||
{ return collectionName; };
|
||||
inline G4String GetDMname()
|
||||
{ return DMname; };
|
||||
inline const G4String& GetName() const
|
||||
{ return collectionName; }
|
||||
inline const G4String& GetDMname() const
|
||||
{ return DMname; }
|
||||
|
||||
public:
|
||||
// GetDigi and GetSize are given a default implementation here so
|
||||
|
||||
@@ -81,7 +81,7 @@ class G4HCofThisEvent
|
||||
// Returns the number of hits collections which are stored in this class
|
||||
// object.
|
||||
public:
|
||||
inline G4int GetCapacity()
|
||||
inline size_t GetCapacity()
|
||||
{
|
||||
return HC->size();
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ template <class T> class G4THitsCollection : public G4HitsCollection
|
||||
if (!anHCAllocator_G4MT_TLS_()) anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection>;
|
||||
return (std::vector<T*>*)theCollection; }
|
||||
// Returns a collection vector.
|
||||
inline G4int insert(T* aHit)
|
||||
inline size_t insert(T* aHit)
|
||||
{
|
||||
if (!anHCAllocator_G4MT_TLS_()) anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection>;
|
||||
std::vector<T*>*theHitsCollection = (std::vector<T*>*)theCollection;
|
||||
@@ -103,7 +103,7 @@ template <class T> class G4THitsCollection : public G4HitsCollection
|
||||
}
|
||||
// Insert a hit object. Total number of hit objects stored in this
|
||||
// collection is returned.
|
||||
inline G4int entries() const
|
||||
inline size_t entries() const
|
||||
{
|
||||
if (!anHCAllocator_G4MT_TLS_()) anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection>;
|
||||
std::vector<T*>*theHitsCollection = (std::vector<T*>*)theCollection;
|
||||
@@ -120,8 +120,8 @@ template <class T> class G4THitsCollection : public G4HitsCollection
|
||||
virtual size_t GetSize() const
|
||||
{
|
||||
if (!anHCAllocator_G4MT_TLS_()) anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection>;
|
||||
return ((std::vector<T*>*)theCollection)->size(); }
|
||||
|
||||
return ((std::vector<T*>*)theCollection)->size();
|
||||
}
|
||||
};
|
||||
|
||||
template <class T> inline void* G4THitsCollection<T>::operator new(size_t)
|
||||
|
||||
@@ -152,7 +152,7 @@ public: // with description
|
||||
{ return (Map_t*)theCollection; }
|
||||
// Overwrite a hit object. Total number of hit objects stored in this
|
||||
// map is returned.
|
||||
inline G4int entries() const
|
||||
inline size_t entries() const
|
||||
{ return ((Map_t*)theCollection)->size(); }
|
||||
// Returns the number of hit objects stored in this map
|
||||
inline void clear();
|
||||
@@ -174,7 +174,7 @@ public:
|
||||
template <typename U = T,
|
||||
typename MapU_t = Map_t,
|
||||
enable_if_t<is_same_t(U, T) && ! is_mmap_t(MapU_t), int> = 0>
|
||||
G4int add(const G4int& key, U*& aHit) const
|
||||
size_t add(const G4int& key, U*& aHit) const
|
||||
{
|
||||
map_type* theHitsMap = GetMap();
|
||||
if(theHitsMap->find(key) == theHitsMap->end())
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
template <typename U = T,
|
||||
typename MapU_t = Map_t,
|
||||
enable_if_t<(is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
|
||||
G4int add(const G4int& key, U*& aHit) const
|
||||
size_t add(const G4int& key, U*& aHit) const
|
||||
{
|
||||
map_type* theHitsMap = GetMap();
|
||||
theHitsMap->insert(pair_t(key, aHit));
|
||||
@@ -202,7 +202,7 @@ public:
|
||||
template <typename U = T,
|
||||
typename MapU_t = Map_t,
|
||||
enable_if_t<(!is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
|
||||
G4int add(const G4int& key, U*& aHit) const
|
||||
size_t add(const G4int& key, U*& aHit) const
|
||||
{
|
||||
map_type* theHitsMap = GetMap();
|
||||
T* hit = allocate();
|
||||
@@ -221,7 +221,7 @@ public:
|
||||
template <typename U = T,
|
||||
typename MapU_t = Map_t,
|
||||
enable_if_t<(is_same_t(U, T) && ! is_mmap_t(MapU_t)), int> = 0>
|
||||
G4int add(const G4int& key, U& aHit) const
|
||||
size_t add(const G4int& key, U& aHit) const
|
||||
{
|
||||
map_type* theHitsMap = GetMap();
|
||||
if(theHitsMap->find(key) == theHitsMap->end())
|
||||
@@ -237,7 +237,7 @@ public:
|
||||
template <typename U = T,
|
||||
typename MapU_t = Map_t,
|
||||
enable_if_t<(! is_same_t(U, T) && ! is_mmap_t(MapU_t)), int> = 0>
|
||||
G4int add(const G4int& key, U& aHit) const
|
||||
size_t add(const G4int& key, U& aHit) const
|
||||
{
|
||||
map_type* theHitsMap = GetMap();
|
||||
if(theHitsMap->find(key) == theHitsMap->end())
|
||||
@@ -251,7 +251,7 @@ public:
|
||||
template <typename U = T,
|
||||
typename MapU_t = Map_t,
|
||||
enable_if_t<(is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
|
||||
G4int add(const G4int& key, U& aHit) const
|
||||
size_t add(const G4int& key, U& aHit) const
|
||||
{
|
||||
map_type* theHitsMap = GetMap();
|
||||
theHitsMap->insert(pair_t(key, new T(aHit)));
|
||||
@@ -264,7 +264,7 @@ public:
|
||||
template <typename U = T,
|
||||
typename MapU_t = Map_t,
|
||||
enable_if_t<(!is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
|
||||
G4int add(const G4int& key, U& aHit) const
|
||||
size_t add(const G4int& key, U& aHit) const
|
||||
{
|
||||
map_type* theHitsMap = GetMap();
|
||||
T* hit = allocate();
|
||||
@@ -284,7 +284,7 @@ public:
|
||||
template <typename U = T,
|
||||
typename MapU_t = Map_t,
|
||||
enable_if_t<(is_same_t(U, T) && ! is_mmap_t(MapU_t)), int> = 0>
|
||||
inline G4int set(const G4int& key, U*& aHit) const
|
||||
inline size_t set(const G4int& key, U*& aHit) const
|
||||
{
|
||||
map_type* theHitsMap = GetMap();
|
||||
if(theHitsMap->find(key) != theHitsMap->end())
|
||||
@@ -298,7 +298,7 @@ public:
|
||||
template <typename U = T,
|
||||
typename MapU_t = Map_t,
|
||||
enable_if_t<(is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
|
||||
inline G4int set(const G4int& key, U*& aHit) const
|
||||
inline size_t set(const G4int& key, U*& aHit) const
|
||||
{
|
||||
map_type* theHitsMap = GetMap();
|
||||
if(theHitsMap->find(key) != theHitsMap->end())
|
||||
@@ -316,7 +316,7 @@ public:
|
||||
template <typename U = T,
|
||||
typename MapU_t = Map_t,
|
||||
enable_if_t<(!is_same_t(U, T) && ! is_mmap_t(MapU_t)), int> = 0>
|
||||
inline G4int set(const G4int & key, U*& aHit) const
|
||||
inline size_t set(const G4int & key, U*& aHit) const
|
||||
{
|
||||
map_type* theHitsMap = GetMap();
|
||||
T* hit = nullptr;
|
||||
@@ -333,7 +333,7 @@ public:
|
||||
template <typename U = T,
|
||||
typename MapU_t = Map_t,
|
||||
enable_if_t<(!is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
|
||||
inline G4int set(const G4int& key, U*& aHit) const
|
||||
inline size_t set(const G4int& key, U*& aHit) const
|
||||
{
|
||||
map_type* theHitsMap = GetMap();
|
||||
T* hit = allocate();
|
||||
@@ -359,7 +359,7 @@ public:
|
||||
template <typename U = T,
|
||||
typename MapU_t = Map_t,
|
||||
enable_if_t<(is_same_t(U, T) && ! is_mmap_t(MapU_t)), int> = 0>
|
||||
inline G4int set(const G4int& key, U& aHit) const
|
||||
inline size_t set(const G4int& key, U& aHit) const
|
||||
{
|
||||
map_type* theHitsMap = GetMap();
|
||||
T* hit = nullptr;
|
||||
@@ -376,7 +376,7 @@ public:
|
||||
template <typename U = T,
|
||||
typename MapU_t = Map_t,
|
||||
enable_if_t<(is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
|
||||
inline G4int set(const G4int& key, U& aHit) const
|
||||
inline size_t set(const G4int& key, U& aHit) const
|
||||
{
|
||||
map_type* theHitsMap = GetMap();
|
||||
if(theHitsMap->find(key) != theHitsMap->end())
|
||||
@@ -391,7 +391,7 @@ public:
|
||||
template <typename U = T,
|
||||
typename MapU_t = Map_t,
|
||||
enable_if_t<(!is_same_t(U, T) && ! is_mmap_t(MapU_t)), int> = 0>
|
||||
inline G4int set(const G4int & key, U& aHit) const
|
||||
inline size_t set(const G4int & key, U& aHit) const
|
||||
{
|
||||
map_type* theHitsMap = GetMap();
|
||||
T* hit = nullptr;
|
||||
@@ -408,7 +408,7 @@ public:
|
||||
template <typename U = T,
|
||||
typename MapU_t = Map_t,
|
||||
enable_if_t<(!is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
|
||||
inline G4int set(const G4int& key, U& aHit) const
|
||||
inline size_t set(const G4int& key, U& aHit) const
|
||||
{
|
||||
map_type* theHitsMap = GetMap();
|
||||
T* hit = allocate();
|
||||
|
||||
@@ -148,14 +148,14 @@ public:
|
||||
|
||||
// Overwrite a hit object. Total number of hit objects stored in this
|
||||
// map is returned.
|
||||
inline G4int entries() const
|
||||
inline std::size_t entries() const
|
||||
{ return (scast(Vector_t*)(theCollection))->size(); }
|
||||
|
||||
// Returns the number of hit objects stored in this map
|
||||
inline void clear();
|
||||
|
||||
virtual G4VHit* GetHit(size_t) const { return nullptr; }
|
||||
virtual size_t GetSize() const
|
||||
virtual G4VHit* GetHit(std::size_t) const { return nullptr; }
|
||||
virtual std::size_t GetSize() const
|
||||
{ return (scast(Vector_t*)(theCollection))->size(); }
|
||||
|
||||
inline map_t* GetMap() const;
|
||||
@@ -275,7 +275,7 @@ public:
|
||||
//------------------------------------------------------------------------//
|
||||
template <typename U = T,
|
||||
enable_if_t< is_same_t(U, T), int> = 0>
|
||||
G4int add(const G4int& key, U*& aHit) const
|
||||
std::size_t add(const G4int& key, U*& aHit) const
|
||||
{
|
||||
vector_type* theHitsVector = GetVector(key);
|
||||
_add(theHitsVector, key, *aHit);
|
||||
@@ -286,7 +286,7 @@ public:
|
||||
//------------------------------------------------------------------------//
|
||||
template <typename U = T,
|
||||
enable_if_t< !is_same_t(U, T), int> = 0>
|
||||
G4int add(const G4int& key, U*& aHit) const
|
||||
std::size_t add(const G4int& key, U*& aHit) const
|
||||
{
|
||||
vector_type* theHitsVector = GetVector(key);
|
||||
store_type hit = allocate();
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
//------------------------------------------------------------------------//
|
||||
template <typename U = T,
|
||||
enable_if_t< is_same_t(U, T), int> = 0>
|
||||
G4int add(const G4int& key, U& aHit) const
|
||||
std::size_t add(const G4int& key, U& aHit) const
|
||||
{
|
||||
vector_type* theHitsVector = GetVector(key);
|
||||
_add(theHitsVector, key, aHit);
|
||||
@@ -310,7 +310,7 @@ public:
|
||||
//------------------------------------------------------------------------//
|
||||
template <typename U = T,
|
||||
enable_if_t< !is_same_t(U, T), int> = 0>
|
||||
G4int add(const G4int& key, U& aHit) const
|
||||
std::size_t add(const G4int& key, U& aHit) const
|
||||
{
|
||||
vector_type* theHitsVector = GetVector(key);
|
||||
_add(theHitsVector, key, aHit);
|
||||
@@ -327,7 +327,7 @@ public:
|
||||
//------------------------------------------------------------------------//
|
||||
template <typename U = T,
|
||||
enable_if_t< is_same_t(U, T), int> = 0>
|
||||
inline G4int set(const G4int& key, U*& aHit) const
|
||||
inline std::size_t set(const G4int& key, U*& aHit) const
|
||||
{
|
||||
vector_type* theHitsVector = GetVector(key);
|
||||
_assign(theHitsVector, key, aHit);
|
||||
@@ -338,7 +338,7 @@ public:
|
||||
//------------------------------------------------------------------------//
|
||||
template <typename U = T,
|
||||
enable_if_t< !is_same_t(U, T), int> = 0>
|
||||
inline G4int set(const G4int & key, U*& aHit) const
|
||||
inline std::size_t set(const G4int & key, U*& aHit) const
|
||||
{
|
||||
vector_type* theHitsVector = GetVector(key);
|
||||
store_type hit = allocate();
|
||||
@@ -357,7 +357,7 @@ public:
|
||||
//------------------------------------------------------------------------//
|
||||
template <typename U = T,
|
||||
enable_if_t< is_same_t(U, T), int> = 0>
|
||||
inline G4int set(const G4int& key, U& aHit) const
|
||||
inline std::size_t set(const G4int& key, U& aHit) const
|
||||
{
|
||||
vector_type* theHitsVector = GetVector(key);
|
||||
_assign(theHitsVector, key, &aHit);
|
||||
@@ -368,7 +368,7 @@ public:
|
||||
//------------------------------------------------------------------------//
|
||||
template <typename U = T,
|
||||
enable_if_t< !is_same_t(U, T), int> = 0>
|
||||
inline G4int set(const G4int & key, U& aHit) const
|
||||
inline std::size_t set(const G4int & key, U& aHit) const
|
||||
{
|
||||
vector_type* theHitsVector = GetVector(key);
|
||||
store_type hit = allocate();
|
||||
@@ -627,7 +627,7 @@ G4VTHitsVector<T, Vector_t>::GetMap() const
|
||||
G4ThreadLocalStatic map_t* theHitsMap = new map_t();
|
||||
theHitsMap->clear();
|
||||
vector_type* theHitsVector = GetVector();
|
||||
for(G4int i = 0; i < theHitsVector->size(); ++i)
|
||||
for(std::size_t i = 0; i < theHitsVector->size(); ++i)
|
||||
{
|
||||
store_type& _obj = (*theHitsVector)[i];
|
||||
if(_obj)
|
||||
|
||||
@@ -61,9 +61,9 @@ class G4VHitsCollection
|
||||
G4int colID;
|
||||
|
||||
public:
|
||||
inline G4String& GetName()
|
||||
inline const G4String& GetName() const
|
||||
{ return collectionName; }
|
||||
inline G4String& GetSDname()
|
||||
inline const G4String& GetSDname() const
|
||||
{ return SDname; }
|
||||
inline void SetColID(G4int i)
|
||||
{ colID = i; }
|
||||
|
||||
@@ -16,6 +16,28 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
October 23rd, 2019 M.Asai (detutils-V10-05-04)
|
||||
- Revising utils/src/G4ScoringQuantiryMessenger.cc to better handle
|
||||
ther error cases.
|
||||
|
||||
September 30th, 2019 I. Hrivnacova (detutils-V10-05-03)
|
||||
- Added 'ntuple' subdirectory for score ntuple writer UI commands
|
||||
|
||||
September 30th, 2019 M.Asai (detutils-V10-05-02)
|
||||
- Revising utils/src/G4ScoringMessenger.cc to better handle the error
|
||||
cases.
|
||||
|
||||
September 19th, 2019 M.Asai (detutils-V10-05-01)
|
||||
- Introducing G4ScoringRealWorld that allows to define command-based
|
||||
scorers to a logical volume in the mass world.
|
||||
- Co-working with run-V10-05-05.
|
||||
|
||||
July 8th, 2019 I. Hrivnacova (detutils-V10-05-00)
|
||||
- Added G4TScoreNtupleWriter and G4TScoreNtupleWriterMessenger
|
||||
which implements storing hits collections of G4THitsMap<G4double>
|
||||
type vith Geant4 analysis tools, define in G4VcoreNtupleWriter
|
||||
The dependency on the analysis category is avoided via template.
|
||||
|
||||
March 20, 2015 A.Kimura (detutils-V10-01-02)
|
||||
- fixed type convertion warnigs at l.132 and l.157 of G4VScoreColorMap.cc
|
||||
|
||||
|
||||
@@ -88,8 +88,9 @@ class G4ScoringMessenger: public G4UImessenger
|
||||
//
|
||||
G4UIdirectory* meshCreateDir;
|
||||
G4UIcmdWithAString* meshBoxCreateCmd;
|
||||
G4UIcmdWithAString* meshCylinderCreateCmd;
|
||||
G4UIcmdWithAString* meshCylinderCreateCmd;
|
||||
// G4UIcmdWithAString* meshSphereCreateCmd;
|
||||
G4UIcommand* meshRWLogVolCreateCmd;
|
||||
//
|
||||
// Mesh commands
|
||||
G4UIdirectory* meshDir;
|
||||
@@ -111,7 +112,7 @@ class G4ScoringMessenger: public G4UImessenger
|
||||
G4UIcmdWithoutParameter* mTResetCmd;
|
||||
G4UIcmdWith3VectorAndUnit* mTXyzCmd;
|
||||
G4UIdirectory* mRotDir;
|
||||
G4UIcmdWithoutParameter* mRResetCmd;
|
||||
// G4UIcmdWithoutParameter* mRResetCmd;
|
||||
G4UIcmdWithADoubleAndUnit* mRotXCmd;
|
||||
G4UIcmdWithADoubleAndUnit* mRotYCmd;
|
||||
G4UIcmdWithADoubleAndUnit* mRotZCmd;
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef G4ScoringRealWorld_h
|
||||
#define G4ScoringRealWorld_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VScoringMesh.hh"
|
||||
class G4VPhysicalVolume;
|
||||
class G4LogicalVolume;
|
||||
|
||||
class G4ScoringRealWorld : public G4VScoringMesh
|
||||
{
|
||||
public:
|
||||
G4ScoringRealWorld(G4String lvName);
|
||||
~G4ScoringRealWorld();
|
||||
|
||||
protected:
|
||||
// construct this mesh
|
||||
virtual void SetupGeometry(G4VPhysicalVolume* );
|
||||
|
||||
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
|
||||
@@ -0,0 +1,101 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 30/10/2018 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4TScoreNtupleWriter_h
|
||||
#define G4TScoreNtupleWriter_h 1
|
||||
|
||||
#include "G4VScoreNtupleWriter.hh"
|
||||
#include "G4HCofThisEvent.hh"
|
||||
#include "G4Threading.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class G4HCofThisEvent;
|
||||
|
||||
template <typename T>
|
||||
class G4TScoreNtupleWriterMessenger;
|
||||
class G4HCofThisEvent;
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This class implements storing hits collections of G4THitsMap<G4double>
|
||||
// type vith Geant4 analysis tools.
|
||||
// In order to avoid introducing dependency on the analysis category,
|
||||
// the analysis manager type is defined via template.
|
||||
//
|
||||
// An ntuple with three columns is created for each primitive scorer:
|
||||
// int column - eventNumber
|
||||
// int column - copyNumber
|
||||
// double column - scored value
|
||||
|
||||
template <typename T>
|
||||
class G4TScoreNtupleWriter : public G4VScoreNtupleWriter
|
||||
{
|
||||
public:
|
||||
G4TScoreNtupleWriter();
|
||||
virtual ~G4TScoreNtupleWriter();
|
||||
|
||||
// methods
|
||||
virtual G4bool Book(G4HCofThisEvent* hce);
|
||||
virtual void OpenFile();
|
||||
virtual void Fill(G4HCofThisEvent* hce, G4int eventNumber);
|
||||
virtual void Write();
|
||||
|
||||
// set methods
|
||||
void SetFileName(const G4String& fileName);
|
||||
void SetVerboseLevel(G4int value);
|
||||
|
||||
// get methods
|
||||
G4String GetFileName() const { return fFileName; }
|
||||
G4int GetVerboseLevel() const { return fVerboseLevel; }
|
||||
|
||||
protected:
|
||||
// methods
|
||||
virtual G4VScoreNtupleWriter* CreateInstance() const;
|
||||
|
||||
private:
|
||||
// methods
|
||||
void CreateAnalysisManager();
|
||||
|
||||
// data members
|
||||
G4TScoreNtupleWriterMessenger<T>* fMessenger;
|
||||
std::vector<G4int> fHCIds;
|
||||
T* fAnalysisManager;
|
||||
G4String fFileName;
|
||||
G4int fVerboseLevel;
|
||||
G4bool fHasAnalysisManager;
|
||||
G4bool fHasAnalysisFile;
|
||||
G4bool fIsBooked;
|
||||
G4bool fIsInitialized;
|
||||
G4int fFirstNtupleId;
|
||||
};
|
||||
|
||||
#include "G4TScoreNtupleWriter.icc"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,308 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 30/10/2018 (ivana@ipno.in2p3.fr)
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
#include "G4TScoreNtupleWriterMessenger.hh"
|
||||
#include "G4THitsMap.hh"
|
||||
#include "G4Threading.hh"
|
||||
|
||||
//_____________________________________________________________________________
|
||||
//
|
||||
// ctor, dtor
|
||||
//
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4TScoreNtupleWriter<T>::G4TScoreNtupleWriter()
|
||||
: G4VScoreNtupleWriter(),
|
||||
fMessenger(nullptr),
|
||||
fHCIds(),
|
||||
fAnalysisManager(nullptr),
|
||||
fFileName("scoring"),
|
||||
fVerboseLevel(1),
|
||||
fHasAnalysisManager(false),
|
||||
fHasAnalysisFile(false),
|
||||
fIsBooked(false),
|
||||
fIsInitialized(false),
|
||||
fFirstNtupleId(0)
|
||||
{
|
||||
if ( G4Threading::IsMasterThread() ) {
|
||||
fMessenger = new G4TScoreNtupleWriterMessenger<T>(this);
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4TScoreNtupleWriter<T>::~G4TScoreNtupleWriter()
|
||||
{
|
||||
if ( fHasAnalysisManager ) {
|
||||
delete fAnalysisManager;
|
||||
}
|
||||
|
||||
delete fMessenger;
|
||||
}
|
||||
|
||||
//
|
||||
// private methods
|
||||
//
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
void G4TScoreNtupleWriter<T>::CreateAnalysisManager()
|
||||
{
|
||||
if ( fAnalysisManager ) return;
|
||||
|
||||
// create analysis manager
|
||||
if ( ! T::IsInstance() ) fHasAnalysisManager = true;
|
||||
fAnalysisManager = T::Instance();
|
||||
|
||||
fAnalysisManager->SetVerboseLevel(fVerboseLevel);
|
||||
}
|
||||
|
||||
//
|
||||
// protected methods
|
||||
//
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4VScoreNtupleWriter* G4TScoreNtupleWriter<T>::CreateInstance() const
|
||||
{
|
||||
auto instance = new G4TScoreNtupleWriter();
|
||||
instance->SetFileName(fFileName);
|
||||
instance->SetVerboseLevel(fVerboseLevel);
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
//
|
||||
// public methods
|
||||
//
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4bool G4TScoreNtupleWriter<T>::Book(G4HCofThisEvent* hce)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fVerboseLevel > 1 ) {
|
||||
G4cout << "--- G4TScoreNtupleWriter<T>::Book" << G4endl;
|
||||
}
|
||||
#endif
|
||||
if ( ! hce) return false;
|
||||
|
||||
// book collection ID if DoubleHitsMap
|
||||
if (fHCIds.size() == 0) {
|
||||
#ifdef G4VERBOSE
|
||||
if ( fVerboseLevel > 1 ) {
|
||||
G4cout << "--- going to fill fHCIds " << G4endl;
|
||||
}
|
||||
#endif
|
||||
for (G4int i=0; i<hce->GetNumberOfCollections(); ++i) {
|
||||
auto hitsMap
|
||||
= dynamic_cast<G4THitsMap<G4double>*>(hce->GetHC(i));
|
||||
|
||||
if ( hitsMap ) {
|
||||
#ifdef G4VERBOSE
|
||||
if ( fVerboseLevel > 1 ) {
|
||||
G4cout << "--- adding hcID = " << i << G4endl;
|
||||
}
|
||||
#endif
|
||||
fHCIds.push_back(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create analysis manager
|
||||
if ( fHCIds.size() ) {
|
||||
CreateAnalysisManager();
|
||||
}
|
||||
|
||||
// Create ntuples (only once)
|
||||
if ( ! fIsInitialized ) {
|
||||
#ifdef G4VERBOSE
|
||||
if ( fVerboseLevel > 1 ) {
|
||||
G4cout << "-- going to create ntuples " << G4endl;
|
||||
}
|
||||
#endif
|
||||
auto first = true;
|
||||
for (auto id : fHCIds) {
|
||||
auto hitsMap
|
||||
= static_cast<G4THitsMap<G4double>*>(hce->GetHC(id));
|
||||
|
||||
// Create ntuple for this primitive
|
||||
G4String ntupleName(hitsMap->GetSDname());
|
||||
ntupleName.append("_");
|
||||
ntupleName.append(hitsMap->GetName());
|
||||
|
||||
G4int ntupleId
|
||||
= fAnalysisManager->CreateNtuple(ntupleName, ntupleName);
|
||||
if ( first ) {
|
||||
fFirstNtupleId = ntupleId;
|
||||
#ifdef G4VERBOSE
|
||||
if ( fVerboseLevel > 1 ) {
|
||||
G4cout << "-- set first ntuple Id " << fFirstNtupleId << G4endl;
|
||||
}
|
||||
#endif
|
||||
first = false;
|
||||
}
|
||||
|
||||
G4String colName(ntupleName);
|
||||
colName.append("_eventId");
|
||||
fAnalysisManager->CreateNtupleIColumn(colName);
|
||||
colName = ntupleName;
|
||||
colName.append("_cell");
|
||||
fAnalysisManager->CreateNtupleIColumn(colName);
|
||||
colName = ntupleName;
|
||||
colName.append("_score");
|
||||
fAnalysisManager->CreateNtupleDColumn(colName);
|
||||
fAnalysisManager->FinishNtuple();
|
||||
fIsBooked = true;
|
||||
}
|
||||
fIsInitialized = true;
|
||||
}
|
||||
|
||||
return fIsBooked;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
void G4TScoreNtupleWriter<T>::OpenFile()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fVerboseLevel > 1 ) {
|
||||
G4cout << "--- G4TScoreNtupleWriter<T>::OpenFile" << G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( fAnalysisManager->IsOpenFile() ) return;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fVerboseLevel > 1 ) {
|
||||
G4cout << "--- G4TScoreNtupleWriter<T>::OpenFile executing" << G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( fAnalysisManager->GetFileName() == "" ) {
|
||||
fAnalysisManager->SetFileName(fFileName);
|
||||
}
|
||||
fAnalysisManager->OpenFile();
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fVerboseLevel > 1 ) {
|
||||
G4cout << "--- G4TScoreNtupleWriter<T>::OpenFile isOpenFile: "
|
||||
<< fAnalysisManager->IsOpenFile() << G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
fHasAnalysisFile = fAnalysisManager->IsOpenFile();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
void G4TScoreNtupleWriter<T>::Fill(G4HCofThisEvent* hce, G4int eventNumber)
|
||||
{
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fVerboseLevel > 1 ) {
|
||||
G4cout << "--- start G4TScoreNtupleWriter<T>::Fill" << G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
auto counter = 0;
|
||||
for (auto id : fHCIds) {
|
||||
#ifdef G4VERBOSE
|
||||
if ( fVerboseLevel > 1 ) {
|
||||
G4cout << "in loop over fHCIds, counter " << counter << G4endl;
|
||||
}
|
||||
#endif
|
||||
auto hitsMap
|
||||
= static_cast<G4THitsMap<G4double>*>(hce->GetHC(id));
|
||||
|
||||
//G4cout << eventNumber << ".. go to fill ntuple " << counter + fFirstNtupleId << G4endl;
|
||||
|
||||
// fill hits in ntuple
|
||||
std::map<G4int, G4double*>::iterator it;
|
||||
for ( it = hitsMap->GetMap()->begin(); it != hitsMap->GetMap()->end(); it++ ) {
|
||||
fAnalysisManager->FillNtupleIColumn(counter + fFirstNtupleId, 0, eventNumber);
|
||||
fAnalysisManager->FillNtupleIColumn(counter + fFirstNtupleId, 1, it->first);
|
||||
fAnalysisManager->FillNtupleDColumn(counter + fFirstNtupleId, 2, *(it->second));
|
||||
fAnalysisManager->AddNtupleRow(counter + fFirstNtupleId);
|
||||
}
|
||||
counter++;
|
||||
}
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fVerboseLevel > 1 ) {
|
||||
G4cout << "--- done G4TScoreNtupleWriter<T>::Fill" << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
void G4TScoreNtupleWriter<T>::Write()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fVerboseLevel > 1 ) {
|
||||
G4cout << "--- start G4TScoreNtupleWriter<T>::Write" << G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( fHasAnalysisFile ) {
|
||||
#ifdef G4VERBOSE
|
||||
if ( fVerboseLevel > 1 ) {
|
||||
G4cout << "--- G4TScoreNtupleWriter<T>::Write - has file" << G4endl;
|
||||
}
|
||||
#endif
|
||||
fAnalysisManager->Write();
|
||||
fAnalysisManager->CloseFile();
|
||||
fAnalysisManager->SetFileName("");
|
||||
}
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fVerboseLevel > 1 ) {
|
||||
G4cout << "--- done G4TScoreNtupleWriter<T>::Write" << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
void G4TScoreNtupleWriter<T>::SetVerboseLevel(G4int value)
|
||||
{
|
||||
fVerboseLevel = value;
|
||||
if ( fAnalysisManager ) {
|
||||
fAnalysisManager->SetVerboseLevel(value);
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
void G4TScoreNtupleWriter<T>::SetFileName(const G4String& fileName)
|
||||
{
|
||||
fFileName = fileName;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 30/10/2018 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4TScoreNtupleWriterMessenger_h
|
||||
#define G4TScoreNtupleWriterMessenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
template <typename T>
|
||||
class G4TScoreNtupleWriter;
|
||||
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithoutParameter;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This is a concrete class of G4UImessenger which handles the commands for
|
||||
// G4TScoreNtupleWriter. This class has the following commands:
|
||||
// /score/writerFileName filename
|
||||
// /score/writerVerbose value
|
||||
//
|
||||
|
||||
template <typename T>
|
||||
class G4TScoreNtupleWriterMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
G4TScoreNtupleWriterMessenger(G4TScoreNtupleWriter<T>* scoreNtupleWriter);
|
||||
~G4TScoreNtupleWriterMessenger();
|
||||
void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
|
||||
private:
|
||||
G4TScoreNtupleWriter<T>* fScoreNtupleWriter;
|
||||
G4UIdirectory* fDirectory;
|
||||
G4UIcmdWithAString* fWriterFileNameCmd;
|
||||
G4UIcmdWithAnInteger* fWriterVerboseCmd;
|
||||
};
|
||||
|
||||
#include "G4TScoreNtupleWriterMessenger.icc"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 30/10/2018 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#include "G4TScoreNtupleWriterMessenger.hh"
|
||||
#include "G4TScoreNtupleWriter.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4TScoreNtupleWriterMessenger<T>::G4TScoreNtupleWriterMessenger(
|
||||
G4TScoreNtupleWriter<T>* scoreNtupleWriter)
|
||||
: G4UImessenger(),
|
||||
fScoreNtupleWriter(scoreNtupleWriter),
|
||||
fWriterFileNameCmd(nullptr),
|
||||
fWriterVerboseCmd(nullptr)
|
||||
{
|
||||
fDirectory = new G4UIdirectory("/score/ntuple/");
|
||||
fDirectory->SetGuidance("Interactive score ntuple writer commands.");
|
||||
|
||||
fWriterFileNameCmd = new G4UIcmdWithAString("/score/ntuple/writerFileName",this);
|
||||
fWriterFileNameCmd->SetGuidance( "Set the ntuple writer output file name.");
|
||||
fWriterFileNameCmd->SetParameterName("outputFileName",false);
|
||||
fWriterFileNameCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
fWriterVerboseCmd = new G4UIcmdWithAnInteger("/score/ntuple/writerVerbose",this);
|
||||
fWriterVerboseCmd->SetGuidance("Set the ntuple writer verbose level.");
|
||||
fWriterVerboseCmd->SetParameterName("writerVerbose",false);
|
||||
fWriterVerboseCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4TScoreNtupleWriterMessenger<T>::~G4TScoreNtupleWriterMessenger()
|
||||
{
|
||||
delete fWriterFileNameCmd;
|
||||
delete fWriterVerboseCmd;
|
||||
delete fDirectory;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
void G4TScoreNtupleWriterMessenger<T>::SetNewValue(G4UIcommand * command,G4String newVal)
|
||||
{
|
||||
if ( command==fWriterFileNameCmd ) {
|
||||
fScoreNtupleWriter->SetFileName(newVal);
|
||||
}
|
||||
else if ( command==fWriterVerboseCmd ) {
|
||||
fScoreNtupleWriter->SetVerboseLevel(fWriterVerboseCmd->GetNewIntValue(newVal));
|
||||
}
|
||||
}
|
||||
@@ -44,36 +44,41 @@ class G4ParallelWorldProcess;
|
||||
|
||||
#include <map>
|
||||
|
||||
enum MeshShape { boxMesh, cylinderMesh, sphereMesh , undefinedMesh = -1};
|
||||
typedef G4THitsMap< G4double > EventScore;
|
||||
typedef G4THitsMap< G4StatDouble > RunScore;
|
||||
typedef std::map< G4String, RunScore* > MeshScoreMap;
|
||||
// class description:
|
||||
//
|
||||
// This class represents a parallel world for interactive scoring purposes.
|
||||
// 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:
|
||||
public:
|
||||
enum class MeshShape { box, cylinder, sphere, realWorldLogVol, undefined = -1};
|
||||
using EventScore = G4THitsMap< G4double >;
|
||||
using RunScore = G4THitsMap< G4StatDouble >;
|
||||
using MeshScoreMap = std::map< G4String, RunScore* >;
|
||||
|
||||
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:
|
||||
protected:
|
||||
virtual void SetupGeometry(G4VPhysicalVolume * fWorldPhys) = 0;
|
||||
|
||||
public: // with description
|
||||
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; }
|
||||
// get whether this mesh is active or not
|
||||
@@ -104,6 +109,7 @@ class G4VScoringMesh
|
||||
// reset registered primitive scorers
|
||||
void ResetScore();
|
||||
|
||||
// Following set/get methods make sense only for parallel world scoring mesh
|
||||
// set size of this mesh
|
||||
void SetSize(G4double size[3]);
|
||||
// get size of this mesh
|
||||
@@ -123,6 +129,7 @@ class G4VScoringMesh
|
||||
if(fRotationMatrix) return *fRotationMatrix;
|
||||
else return G4RotationMatrix::IDENTITY;
|
||||
}
|
||||
|
||||
// set number of segments of this mesh
|
||||
void SetNumberOfSegments(G4int nSegment[3]);
|
||||
// get number of segments of this mesh
|
||||
@@ -218,6 +225,16 @@ public:
|
||||
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; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -46,11 +46,16 @@ GEANT4_DEFINE_MODULE(NAME G4detutils
|
||||
G4DefaultLinearColorMap.hh
|
||||
G4ScoreLogColorMap.hh
|
||||
G4VScoreNtupleWriter.hh
|
||||
G4TScoreNtupleWriter.hh
|
||||
G4TScoreNtupleWriter.icc
|
||||
G4TScoreNtupleWriterMessenger.hh
|
||||
G4TScoreNtupleWriterMessenger.icc
|
||||
G4ScoreQuantityMessenger.hh
|
||||
G4ScoringBox.hh
|
||||
G4ScoringCylinder.hh
|
||||
G4ScoringManager.hh
|
||||
G4ScoringMessenger.hh
|
||||
G4ScoringRealWorld.hh
|
||||
G4VScoreColorMap.hh
|
||||
G4VScoreWriter.hh
|
||||
G4VScoringMesh.hh
|
||||
@@ -64,6 +69,7 @@ GEANT4_DEFINE_MODULE(NAME G4detutils
|
||||
G4ScoringCylinder.cc
|
||||
G4ScoringManager.cc
|
||||
G4ScoringMessenger.cc
|
||||
G4ScoringRealWorld.cc
|
||||
G4VScoreColorMap.cc
|
||||
G4VScoreWriter.cc
|
||||
G4VScoringMesh.cc
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "G4ScoreQuantityMessenger.hh"
|
||||
#include "G4ScoringManager.hh"
|
||||
#include "G4VScoringMesh.hh"
|
||||
#include "G4VPrimitiveScorer.hh"
|
||||
|
||||
#include "G4PSCellCharge3D.hh"
|
||||
#include "G4PSCellFlux3D.hh"
|
||||
@@ -66,6 +67,30 @@
|
||||
#include "G4PSTrackCounter3D.hh"
|
||||
#include "G4PSTermination3D.hh"
|
||||
#include "G4PSMinKinEAtGeneration3D.hh"
|
||||
|
||||
#include "G4PSCellCharge.hh"
|
||||
#include "G4PSCellFlux.hh"
|
||||
#include "G4PSPassageCellFlux.hh"
|
||||
#include "G4PSEnergyDeposit.hh"
|
||||
#include "G4PSDoseDeposit.hh"
|
||||
#include "G4PSNofStep.hh"
|
||||
#include "G4PSNofSecondary.hh"
|
||||
//
|
||||
#include "G4PSTrackLength.hh"
|
||||
#include "G4PSPassageCellCurrent.hh"
|
||||
#include "G4PSPassageTrackLength.hh"
|
||||
#include "G4PSFlatSurfaceCurrent.hh"
|
||||
#include "G4PSFlatSurfaceFlux.hh"
|
||||
#include "G4PSSphereSurfaceCurrent.hh"
|
||||
#include "G4PSSphereSurfaceFlux.hh"
|
||||
#include "G4PSCylinderSurfaceCurrent.hh"
|
||||
#include "G4PSCylinderSurfaceFlux.hh"
|
||||
#include "G4PSNofCollision.hh"
|
||||
#include "G4PSPopulation.hh"
|
||||
#include "G4PSTrackCounter.hh"
|
||||
#include "G4PSTermination.hh"
|
||||
#include "G4PSMinKinEAtGeneration.hh"
|
||||
|
||||
//
|
||||
// For debug purpose
|
||||
#include "G4PSStepChecker3D.hh"
|
||||
@@ -214,7 +239,10 @@ G4ScoreQuantityMessenger::~G4ScoreQuantityMessenger()
|
||||
|
||||
void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal)
|
||||
{
|
||||
using MeshShape = G4VScoringMesh::MeshShape;
|
||||
|
||||
G4ExceptionDescription ed;
|
||||
|
||||
//
|
||||
// Get Current Mesh
|
||||
//
|
||||
@@ -225,6 +253,8 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
command->CommandFailed(ed);
|
||||
return;
|
||||
}
|
||||
// Mesh type
|
||||
auto shape = mesh->GetShape();
|
||||
// Tokens
|
||||
G4TokenVec token;
|
||||
FillTokenVec(newVal,token);
|
||||
@@ -238,84 +268,112 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
mesh->SetCurrentPSUnit(newVal);
|
||||
} else if(command== qCellChgCmd) {
|
||||
if ( CheckMeshPS(mesh,token[0],command) ){
|
||||
G4PSCellCharge3D* ps = new G4PSCellCharge3D(token[0]);
|
||||
G4PSCellCharge* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
{ ps = new G4PSCellCharge(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSCellCharge3D(token[0]); }
|
||||
ps->SetUnit(token[1]);
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
}
|
||||
} else if(command== qCellFluxCmd) {
|
||||
if ( CheckMeshPS(mesh,token[0],command) ){
|
||||
if( mesh->GetShape()==boxMesh ) {
|
||||
G4PSCellFlux3D* ps = new G4PSCellFlux3D(token[0]);
|
||||
ps->SetUnit(token[1]);
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
} else if( mesh->GetShape()==cylinderMesh ) {
|
||||
G4PSCellFluxForCylinder3D* ps =
|
||||
new G4PSCellFluxForCylinder3D(token[0]);
|
||||
ps->SetUnit(token[1]);
|
||||
G4PSCellFlux* ps = nullptr;
|
||||
if( shape==MeshShape::box ) {
|
||||
ps = new G4PSCellFlux3D(token[0]);
|
||||
} else if( shape==MeshShape::cylinder ) {
|
||||
G4PSCellFluxForCylinder3D* pps = new G4PSCellFluxForCylinder3D(token[0]);
|
||||
G4ThreeVector msize = mesh->GetSize(); // gevin in R Z N/A
|
||||
ps->SetCylinderSize(msize[0],msize[1]); // given in dr dz
|
||||
pps->SetCylinderSize(msize[0],msize[1]); // given in dr dz
|
||||
G4int nSeg[3];
|
||||
mesh->GetNumberOfSegments(nSeg);
|
||||
ps->SetNumberOfSegments(nSeg);
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
pps->SetNumberOfSegments(nSeg);
|
||||
ps = pps;
|
||||
} else if(shape==MeshShape::realWorldLogVol) {
|
||||
ed<<"Cell flux for real world volume is not yet supported. Command ignored.";
|
||||
command->CommandFailed(ed);
|
||||
return;
|
||||
}
|
||||
ps->SetUnit(token[1]);
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
}
|
||||
} else if(command== qPassCellFluxCmd) {
|
||||
if ( CheckMeshPS(mesh,token[0],command) ){
|
||||
if( mesh->GetShape()==boxMesh ) {
|
||||
G4PSPassageCellFlux3D* ps = new G4PSPassageCellFlux3D(token[0]);
|
||||
ps->SetUnit(token[1]);
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
} else if( mesh->GetShape()==cylinderMesh ) {
|
||||
G4PSPassageCellFluxForCylinder3D* ps =
|
||||
new G4PSPassageCellFluxForCylinder3D(token[0]);
|
||||
ps->SetUnit(token[1]);
|
||||
G4PSPassageCellFlux* ps = nullptr;
|
||||
if( shape==MeshShape::box ) {
|
||||
ps = new G4PSPassageCellFlux3D(token[0]);
|
||||
} else if( shape==MeshShape::cylinder ) {
|
||||
G4PSPassageCellFluxForCylinder3D* pps = new G4PSPassageCellFluxForCylinder3D(token[0]);
|
||||
G4ThreeVector msize = mesh->GetSize(); // gevin in R Z N/A
|
||||
ps->SetCylinderSize(msize[0],msize[1]); // given in dr dz
|
||||
pps->SetCylinderSize(msize[0],msize[1]); // given in dr dz
|
||||
G4int nSeg[3];
|
||||
mesh->GetNumberOfSegments(nSeg);
|
||||
ps->SetNumberOfSegments(nSeg);
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
pps->SetNumberOfSegments(nSeg);
|
||||
ps = pps;
|
||||
} else if(shape==MeshShape::realWorldLogVol) {
|
||||
ed<<"Passing cell flux for real world volume is not yet supported. Command ignored.";
|
||||
command->CommandFailed(ed);
|
||||
return;
|
||||
}
|
||||
ps->SetUnit(token[1]);
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
}
|
||||
} else if(command==qeDepCmd) {
|
||||
if ( CheckMeshPS(mesh,token[0],command) ){
|
||||
G4PSEnergyDeposit3D* ps =new G4PSEnergyDeposit3D(token[0]);
|
||||
G4PSEnergyDeposit* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
{ ps =new G4PSEnergyDeposit(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps =new G4PSEnergyDeposit3D(token[0]); }
|
||||
ps->SetUnit(token[1]);
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
}
|
||||
} else if(command== qdoseDepCmd) {
|
||||
if ( CheckMeshPS(mesh,token[0],command) ){
|
||||
if( mesh->GetShape()==boxMesh ) {
|
||||
G4PSDoseDeposit3D* ps = new G4PSDoseDeposit3D(token[0]);
|
||||
ps->SetUnit(token[1]);
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
} else if( mesh->GetShape()==cylinderMesh ) {
|
||||
G4PSDoseDepositForCylinder3D* ps =
|
||||
new G4PSDoseDepositForCylinder3D(token[0]);
|
||||
ps->SetUnit(token[1]);
|
||||
G4PSDoseDeposit* ps = nullptr;
|
||||
if( shape==MeshShape::box ) {
|
||||
ps = new G4PSDoseDeposit3D(token[0]);
|
||||
} else if( shape==MeshShape::cylinder ) {
|
||||
G4PSDoseDepositForCylinder3D* pps = new G4PSDoseDepositForCylinder3D(token[0]);
|
||||
pps->SetUnit(token[1]);
|
||||
G4ThreeVector msize = mesh->GetSize(); // gevin in R Z N/A
|
||||
ps->SetCylinderSize(msize[0],msize[1]); // given in dr dz
|
||||
pps->SetCylinderSize(msize[0],msize[1]); // given in dr dz
|
||||
G4int nSeg[3];
|
||||
mesh->GetNumberOfSegments(nSeg);
|
||||
ps->SetNumberOfSegments(nSeg);
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
pps->SetNumberOfSegments(nSeg);
|
||||
ps = pps;
|
||||
} else if(shape==MeshShape::realWorldLogVol) {
|
||||
ps = new G4PSDoseDeposit(token[0],mesh->GetCopyNumberLevel());
|
||||
}
|
||||
ps->SetUnit(token[1]);
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
}
|
||||
} else if(command== qnOfStepCmd) {
|
||||
if ( CheckMeshPS(mesh,token[0],command) ){
|
||||
G4PSNofStep3D* ps = new G4PSNofStep3D(token[0]);
|
||||
G4PSNofStep* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
{ ps = new G4PSNofStep(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSNofStep3D(token[0]); }
|
||||
ps->SetBoundaryFlag(StoB(token[1]));
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
}
|
||||
} else if(command== qnOfSecondaryCmd) {
|
||||
if ( CheckMeshPS(mesh,token[0],command) ){
|
||||
G4PSNofSecondary3D* ps =new G4PSNofSecondary3D(token[0]);
|
||||
G4PSNofSecondary* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
{ ps = new G4PSNofSecondary(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSNofSecondary3D(token[0]); }
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
}
|
||||
} else if(command== qTrackLengthCmd) {
|
||||
if ( CheckMeshPS(mesh,token[0],command) ){
|
||||
G4PSTrackLength3D* ps = new G4PSTrackLength3D(token[0]);
|
||||
G4PSTrackLength* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
{ ps = new G4PSTrackLength(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSTrackLength3D(token[0]); }
|
||||
ps->Weighted(StoB(token[1]));
|
||||
ps->MultiplyKineticEnergy(StoB(token[2]));
|
||||
ps->DivideByVelocity(StoB(token[3]));
|
||||
@@ -324,21 +382,32 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
}
|
||||
} else if(command== qPassCellCurrCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command) ) {
|
||||
G4PSPassageCellCurrent* ps = new G4PSPassageCellCurrent3D(token[0]);
|
||||
G4PSPassageCellCurrent* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
{ ps = new G4PSPassageCellCurrent(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSPassageCellCurrent3D(token[0]); }
|
||||
ps->Weighted(StoB(token[1]));
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
}
|
||||
} else if(command== qPassTrackLengthCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command) ) {
|
||||
G4PSPassageTrackLength* ps = new G4PSPassageTrackLength3D(token[0]);
|
||||
G4PSPassageTrackLength* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
{ ps = new G4PSPassageTrackLength(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSPassageTrackLength3D(token[0]); }
|
||||
ps->Weighted(StoB(token[1]));
|
||||
ps->SetUnit(token[2]);
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
}
|
||||
} else if(command== qFlatSurfCurrCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command)) {
|
||||
G4PSFlatSurfaceCurrent3D* ps =
|
||||
new G4PSFlatSurfaceCurrent3D(token[0],StoI(token[1]));
|
||||
G4PSFlatSurfaceCurrent* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
{ ps = new G4PSFlatSurfaceCurrent(token[0],StoI(token[1]),mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSFlatSurfaceCurrent3D(token[0],StoI(token[1])); }
|
||||
ps->Weighted(StoB(token[2]));
|
||||
ps->DivideByArea(StoB(token[3]));
|
||||
if ( StoB(token[3]) ){
|
||||
@@ -350,7 +419,11 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
}
|
||||
} else if(command== qFlatSurfFluxCmd){
|
||||
if( CheckMeshPS(mesh, token[0],command )) {
|
||||
G4PSFlatSurfaceFlux3D* ps = new G4PSFlatSurfaceFlux3D(token[0],StoI(token[1]));
|
||||
G4PSFlatSurfaceFlux* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
{ ps = new G4PSFlatSurfaceFlux(token[0],StoI(token[1]),mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSFlatSurfaceFlux3D(token[0],StoI(token[1])); }
|
||||
ps->Weighted(StoB(token[2]));
|
||||
ps->DivideByArea(StoB(token[3]));
|
||||
if ( StoB(token[3]) ){
|
||||
@@ -413,38 +486,62 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
|
||||
// }
|
||||
} else if(command== qNofCollisionCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command)) {
|
||||
G4PSNofCollision3D* ps =new G4PSNofCollision3D(token[0]);
|
||||
G4PSNofCollision* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
{ ps = new G4PSNofCollision3D(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSNofCollision3D(token[0]); }
|
||||
ps->Weighted(StoB(token[1]));
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
}
|
||||
} else if(command== qPopulationCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command) ) {
|
||||
G4PSPopulation3D* ps =new G4PSPopulation3D(token[0]);
|
||||
G4PSPopulation* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
{ ps = new G4PSPopulation(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSPopulation3D(token[0]); }
|
||||
ps->Weighted(StoB(token[1]));
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
}
|
||||
} else if(command== qTrackCountCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command)) {
|
||||
G4PSTrackCounter3D* ps =new G4PSTrackCounter3D(token[0],StoI(token[1]));
|
||||
G4PSTrackCounter* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
{ ps = new G4PSTrackCounter(token[0],StoI(token[1]),mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSTrackCounter3D(token[0],StoI(token[1])); }
|
||||
ps->Weighted(StoB(token[2]));
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
}
|
||||
} else if(command== qTerminationCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command)) {
|
||||
G4PSTermination3D* ps =new G4PSTermination3D(token[0]);
|
||||
G4PSTermination* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
{ ps = new G4PSTermination(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSTermination3D(token[0]); }
|
||||
ps->Weighted(StoB(token[1]));
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
}
|
||||
|
||||
} else if(command== qMinKinEAtGeneCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command) ){
|
||||
G4PSMinKinEAtGeneration3D* ps =new G4PSMinKinEAtGeneration3D(token[0]);
|
||||
G4PSMinKinEAtGeneration* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
{ ps = new G4PSMinKinEAtGeneration(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSMinKinEAtGeneration3D(token[0]); }
|
||||
ps->SetUnit(token[1]);
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
}
|
||||
} else if(command== qStepCheckerCmd){
|
||||
if( CheckMeshPS(mesh,token[0],command) ){
|
||||
G4PSStepChecker3D* ps =new G4PSStepChecker3D(token[0]);
|
||||
G4PSStepChecker* ps = nullptr;
|
||||
if(shape==MeshShape::realWorldLogVol)
|
||||
{ ps = new G4PSStepChecker(token[0],mesh->GetCopyNumberLevel()); }
|
||||
else
|
||||
{ ps = new G4PSStepChecker3D(token[0]); }
|
||||
mesh->SetPrimitiveScorer(ps);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
G4ScoringBox::G4ScoringBox(G4String wName)
|
||||
:G4VScoringMesh(wName), fSegmentDirection(-1)
|
||||
{
|
||||
fShape = boxMesh;
|
||||
fShape = MeshShape::box;
|
||||
fDivisionAxisNames[0] = "X";
|
||||
fDivisionAxisNames[1] = "Y";
|
||||
fDivisionAxisNames[2] = "Z";
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
G4ScoringCylinder::G4ScoringCylinder(G4String wName)
|
||||
:G4VScoringMesh(wName)
|
||||
{
|
||||
fShape = cylinderMesh;
|
||||
fShape = MeshShape::cylinder;
|
||||
|
||||
fDivisionAxisNames[0] = "Z";
|
||||
fDivisionAxisNames[1] = "PHI";
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "G4VScoringMesh.hh"
|
||||
#include "G4ScoringBox.hh"
|
||||
#include "G4ScoringCylinder.hh"
|
||||
#include "G4ScoringRealWorld.hh"
|
||||
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
@@ -49,7 +50,7 @@
|
||||
G4ScoringMessenger::G4ScoringMessenger(G4ScoringManager* SManager)
|
||||
:fSMan(SManager)
|
||||
{
|
||||
G4UIparameter* param;
|
||||
G4UIparameter* param = nullptr;
|
||||
|
||||
scoreDir = new G4UIdirectory("/score/");
|
||||
scoreDir->SetGuidance("Interactive scoring commands.");
|
||||
@@ -83,6 +84,19 @@ G4ScoringMessenger::G4ScoringMessenger(G4ScoringManager* SManager)
|
||||
// meshSphereCreateCmd = new G4UIcmdWithAString("/score/create/sphereMesh",this);
|
||||
// meshSphereCreateCmd->SetGuidance("Create scoring mesh.");
|
||||
// meshSphereCreateCmd->SetParameterName("MeshName",false);
|
||||
//
|
||||
meshRWLogVolCreateCmd = new G4UIcommand("/score/create/realWorldLogVol",this);
|
||||
meshRWLogVolCreateCmd->SetGuidance("Define scorers to a logical volume defined in the real world.");
|
||||
meshRWLogVolCreateCmd->SetGuidance(" - Name of the specified logical volume is used as the mesh name.");
|
||||
meshRWLogVolCreateCmd->SetGuidance(" - /score/mesh commands do not affect for this mesh.");
|
||||
meshRWLogVolCreateCmd->SetGuidance(" - If copyNumberLevel is set, the copy number of that-level higher");
|
||||
meshRWLogVolCreateCmd->SetGuidance(" in the geometrical hierarchy is used as the index.");
|
||||
param = new G4UIparameter("logVol",'s',false);
|
||||
meshRWLogVolCreateCmd->SetParameter(param);
|
||||
param = new G4UIparameter("copyNumberLevel",'i',true);
|
||||
param->SetParameterRange("copyNumberLevel>=0");
|
||||
param->SetDefaultValue(0);
|
||||
meshRWLogVolCreateCmd->SetParameter(param);
|
||||
//
|
||||
meshOpnCmd = new G4UIcmdWithAString("/score/open",this);
|
||||
meshOpnCmd->SetGuidance("Open scoring mesh.");
|
||||
@@ -160,8 +174,8 @@ G4ScoringMessenger::G4ScoringMessenger(G4ScoringManager* SManager)
|
||||
mRotDir = new G4UIdirectory("/score/mesh/rotate/");
|
||||
mRotDir->SetGuidance("Mesh rotation commands.");
|
||||
//
|
||||
mRResetCmd = new G4UIcmdWithoutParameter("/score/mesh/rotate/reset",this);
|
||||
mRResetCmd->SetGuidance("Reset rotation angles of the scoring mesh.");
|
||||
//mRResetCmd = new G4UIcmdWithoutParameter("/score/mesh/rotate/reset",this);
|
||||
//mRResetCmd->SetGuidance("Reset rotation angles of the scoring mesh.");
|
||||
//
|
||||
mRotXCmd = new G4UIcmdWithADoubleAndUnit("/score/mesh/rotate/rotateX",this);
|
||||
mRotXCmd->SetGuidance("Rotate the scoring mesh in X axis.");
|
||||
@@ -294,6 +308,7 @@ G4ScoringMessenger::~G4ScoringMessenger()
|
||||
delete meshCreateDir;
|
||||
delete meshBoxCreateCmd;
|
||||
delete meshCylinderCreateCmd;
|
||||
delete meshRWLogVolCreateCmd;
|
||||
// delete meshSphereCreateCmd;
|
||||
//
|
||||
delete meshOpnCmd;
|
||||
@@ -311,7 +326,7 @@ G4ScoringMessenger::~G4ScoringMessenger()
|
||||
delete mTResetCmd;
|
||||
delete mTXyzCmd;
|
||||
delete mTransDir;
|
||||
delete mRResetCmd;
|
||||
// delete mRResetCmd;
|
||||
delete mRotXCmd;
|
||||
delete mRotYCmd;
|
||||
delete mRotZCmd;
|
||||
@@ -333,6 +348,8 @@ G4ScoringMessenger::~G4ScoringMessenger()
|
||||
|
||||
void G4ScoringMessenger::SetNewValue(G4UIcommand * command,G4String newVal)
|
||||
{
|
||||
using MeshShape = G4VScoringMesh::MeshShape;
|
||||
|
||||
if(command==listCmd) {
|
||||
fSMan->List();
|
||||
} else if(command==dumpCmd) {
|
||||
@@ -419,6 +436,33 @@ void G4ScoringMessenger::SetNewValue(G4UIcommand * command,G4String newVal)
|
||||
command->CommandFailed(ed);
|
||||
}
|
||||
}
|
||||
} else if(command==meshRWLogVolCreateCmd) {
|
||||
auto mesh = fSMan->GetCurrentMesh();
|
||||
if ( mesh ){
|
||||
G4ExceptionDescription ed;
|
||||
ed << "ERROR[" << meshRWLogVolCreateCmd->GetCommandPath()
|
||||
<< "] : Mesh <" << mesh->GetWorldName()
|
||||
<< "> is still open. Close it first. Command ignored.";
|
||||
command->CommandFailed(ed);
|
||||
}
|
||||
else
|
||||
{
|
||||
G4Tokenizer next(newVal);
|
||||
G4String meshName = next();
|
||||
G4int idx = StoI(next());
|
||||
mesh = fSMan->FindMesh(meshName);
|
||||
if ( !mesh ){
|
||||
mesh = new G4ScoringRealWorld(meshName);
|
||||
mesh->SetCopyNumberLevel(idx);
|
||||
fSMan->RegisterScoringMesh(mesh);
|
||||
}else{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "ERROR[" << meshRWLogVolCreateCmd->GetCommandPath()
|
||||
<< "] : Scoring mesh <" << meshName << "> already exists. Command ignored.";
|
||||
command->CommandFailed(ed);
|
||||
}
|
||||
}
|
||||
|
||||
} else if(command==listColorMapCmd) {
|
||||
fSMan->ListScoreColorMaps();
|
||||
} else if(command==floatMinMaxCmd) {
|
||||
@@ -478,6 +522,14 @@ void G4ScoringMessenger::SetNewValue(G4UIcommand * command,G4String newVal)
|
||||
//
|
||||
// Commands for Current Mesh
|
||||
if ( mesh ){
|
||||
MeshShape shape = mesh->GetShape();
|
||||
if ( shape == MeshShape::realWorldLogVol ) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "ERROR[" << mBinCmd->GetCommandPath()
|
||||
<< "] : Number of mesh command cannot be set for this type of mesh. Command ignored.";
|
||||
command->CommandFailed(ed);
|
||||
} else {
|
||||
|
||||
// Tokens
|
||||
G4TokenVec token;
|
||||
FillTokenVec(newVal,token);
|
||||
@@ -488,8 +540,7 @@ void G4ScoringMessenger::SetNewValue(G4UIcommand * command,G4String newVal)
|
||||
// mesh->Activate(meshActCmd->GetNewBoolValue(newVal));
|
||||
// } else
|
||||
if(command==mBoxSizeCmd) {
|
||||
MeshShape shape = mesh->GetShape();
|
||||
if ( shape == boxMesh ){
|
||||
if ( shape == MeshShape::box){
|
||||
G4ThreeVector size = mBoxSizeCmd->GetNew3VectorValue(newVal);
|
||||
G4double vsize[3];
|
||||
vsize[0] = size.x();
|
||||
@@ -503,8 +554,7 @@ void G4ScoringMessenger::SetNewValue(G4UIcommand * command,G4String newVal)
|
||||
command->CommandFailed(ed);
|
||||
}
|
||||
}else if(command==mCylinderSizeCmd) {
|
||||
MeshShape shape = mesh->GetShape();
|
||||
if ( shape == cylinderMesh ){
|
||||
if ( shape == MeshShape::cylinder ){
|
||||
G4double vsize[3];
|
||||
vsize[0] = StoD(token[0]);
|
||||
vsize[1] = StoD(token[1]);
|
||||
@@ -520,7 +570,7 @@ void G4ScoringMessenger::SetNewValue(G4UIcommand * command,G4String newVal)
|
||||
command->CommandFailed(ed);
|
||||
}
|
||||
} else if(command==mBinCmd) {
|
||||
MeshBinCommand(mesh,token);
|
||||
MeshBinCommand(mesh,token);
|
||||
} else if(command==mTResetCmd) {
|
||||
G4double centerPosition[3] ={ 0., 0., 0.};
|
||||
mesh->SetCenterPosition(centerPosition);
|
||||
@@ -531,7 +581,7 @@ void G4ScoringMessenger::SetNewValue(G4UIcommand * command,G4String newVal)
|
||||
centerPosition[1] = xyz.y();
|
||||
centerPosition[2] = xyz.z();
|
||||
mesh->SetCenterPosition(centerPosition);
|
||||
} else if(command==mRResetCmd) {
|
||||
// } else if(command==mRResetCmd) {
|
||||
} else if(command==mRotXCmd) {
|
||||
G4double value = mRotXCmd->GetNewDoubleValue(newVal);
|
||||
mesh->RotateX(value);
|
||||
@@ -542,11 +592,12 @@ void G4ScoringMessenger::SetNewValue(G4UIcommand * command,G4String newVal)
|
||||
G4double value = mRotZCmd->GetNewDoubleValue(newVal);
|
||||
mesh->RotateZ(value);
|
||||
}
|
||||
}else{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "ERROR: No mesh is currently open. Open/create a mesh first. Command ignored.";
|
||||
command->CommandFailed(ed);
|
||||
}
|
||||
}else{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "ERROR: No mesh is currently open. Open/create a mesh first. Command ignored.";
|
||||
command->CommandFailed(ed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "G4ScoringRealWorld.hh"
|
||||
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4PhysicalVolumeStore.hh"
|
||||
#include "G4Region.hh"
|
||||
|
||||
#include "G4MultiFunctionalDetector.hh"
|
||||
#include "G4SDParticleFilter.hh"
|
||||
#include "G4VPrimitiveScorer.hh"
|
||||
|
||||
#include "G4ScoringManager.hh"
|
||||
#include "G4StatDouble.hh"
|
||||
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
G4ScoringRealWorld::G4ScoringRealWorld(G4String lvName)
|
||||
:G4VScoringMesh(lvName)
|
||||
{
|
||||
fShape = MeshShape::realWorldLogVol;
|
||||
logVolName = lvName;
|
||||
G4double size[] = {0.,0.,0.};
|
||||
SetSize(size);
|
||||
G4int nBin[] = {1,1,1};
|
||||
SetNumberOfSegments(nBin);
|
||||
}
|
||||
|
||||
G4ScoringRealWorld::~G4ScoringRealWorld()
|
||||
{
|
||||
}
|
||||
|
||||
void G4ScoringRealWorld::List() const
|
||||
{
|
||||
G4cout << "G4ScoringRealWorld : " << logVolName << G4endl;
|
||||
G4VScoringMesh::List();
|
||||
}
|
||||
|
||||
void G4ScoringRealWorld::SetupGeometry(G4VPhysicalVolume* )
|
||||
{
|
||||
auto store = G4LogicalVolumeStore::GetInstance();
|
||||
auto itr = store->begin();
|
||||
for(;itr!=store->end();itr++)
|
||||
{
|
||||
if((*itr)->GetName()==logVolName)
|
||||
{
|
||||
fMeshElementLogical = (*itr); // Logical volume to score
|
||||
G4int nb = 0;
|
||||
auto pvStore = G4PhysicalVolumeStore::GetInstance();
|
||||
auto pvItr = pvStore->begin();
|
||||
for(;pvItr!=pvStore->end();pvItr++)
|
||||
{
|
||||
if((*pvItr)->GetLogicalVolume()==(*itr))
|
||||
{ nb += (*pvItr)->GetMultiplicity(); }
|
||||
}
|
||||
G4int nBin[] = {nb,1,1};
|
||||
SetNumberOfSegments(nBin);
|
||||
// check if this logical volume belongs to the real world
|
||||
auto region = (*itr)->GetRegion();
|
||||
if(region && !(region->IsInMassGeometry()))
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Logical Volume with name <" << logVolName << "> is not used in the mass world.";
|
||||
G4Exception("G4ScoringRealWorld","SWV0001",FatalException,ed);
|
||||
}
|
||||
// set the sensitive detector
|
||||
fMeshElementLogical->SetSensitiveDetector(fMFD);
|
||||
return;
|
||||
}
|
||||
}
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Logical Volume with name <" << logVolName << "> is not found";
|
||||
G4Exception("G4ScoringRealWorld","SWV0000",FatalException,ed);
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ void G4VScoreWriter::DumpQuantityToFile(const G4String& psName,
|
||||
}
|
||||
ofile << "# mesh name: " << fScoringMesh->GetWorldName() << G4endl;
|
||||
|
||||
|
||||
using MeshScoreMap = G4VScoringMesh::MeshScoreMap;
|
||||
// retrieve the map
|
||||
MeshScoreMap fSMap = fScoringMesh->GetScoreMap();
|
||||
|
||||
@@ -174,6 +174,7 @@ void G4VScoreWriter::DumpAllQuantitiesToFile(const G4String& fileName,
|
||||
ofile << "# mesh name: " << fScoringMesh->GetWorldName() << G4endl;
|
||||
|
||||
// retrieve the map
|
||||
using MeshScoreMap = G4VScoringMesh::MeshScoreMap;
|
||||
MeshScoreMap fSMap = fScoringMesh->GetScoreMap();
|
||||
MeshScoreMap::const_iterator msMapItr = fSMap.begin();
|
||||
std::map<G4int, G4StatDouble*> * score;
|
||||
|
||||
@@ -43,11 +43,13 @@
|
||||
#include "G4SDManager.hh"
|
||||
|
||||
G4VScoringMesh::G4VScoringMesh(const G4String& wName)
|
||||
: fWorldName(wName),fCurrentPS(nullptr),fConstructed(false),fActive(true),fShape(undefinedMesh),
|
||||
: fWorldName(wName),fCurrentPS(nullptr),fConstructed(false),fActive(true),
|
||||
fShape(MeshShape::undefined),
|
||||
fRotationMatrix(nullptr), fMFD(new G4MultiFunctionalDetector(wName)),
|
||||
verboseLevel(0),sizeIsSet(false),nMeshIsSet(false),
|
||||
fDrawUnit(""), fDrawUnitValue(1.), fMeshElementLogical(nullptr),
|
||||
fParallelWorldProcess(nullptr), fGeometryHasBeenDestroyed(false)
|
||||
fParallelWorldProcess(nullptr), fGeometryHasBeenDestroyed(false),
|
||||
copyNumberLevel(0)
|
||||
{
|
||||
G4SDManager::GetSDMpointer()->AddNewDetector(fMFD);
|
||||
|
||||
@@ -90,7 +92,7 @@ void G4VScoringMesh::SetCenterPosition(G4double centerPosition[3]) {
|
||||
fCenterPosition = G4ThreeVector(centerPosition[0], centerPosition[1], centerPosition[2]);
|
||||
}
|
||||
void G4VScoringMesh::SetNumberOfSegments(G4int nSegment[3]) {
|
||||
if ( !nMeshIsSet ){
|
||||
if ( !nMeshIsSet || fShape==MeshShape::realWorldLogVol ){
|
||||
for(int i = 0; i < 3; i++) fNSegment[i] = nSegment[i];
|
||||
nMeshIsSet = true;
|
||||
} else {
|
||||
@@ -357,7 +359,7 @@ void G4VScoringMesh::Construct(G4VPhysicalVolume* fWorldPhys)
|
||||
fGeometryHasBeenDestroyed = false;
|
||||
}
|
||||
if(verboseLevel > 0)
|
||||
G4cout << fWorldPhys->GetName() << " --- All quantities are reset."
|
||||
G4cout << fWorldName << " --- All quantities are reset."
|
||||
<< G4endl;
|
||||
ResetScore();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user