Import Geant4 10.6.0 source tree
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user