Import Geant4 10.5.1 source tree

This commit is contained in:
Gabriele Cosmo
2019-04-17 10:39:02 +02:00
parent a7fdc52004
commit 28a70706e0
661 changed files with 55791 additions and 106984 deletions
@@ -37,6 +37,9 @@ class G4VSensitiveDetector;
class G4HCofThisEvent;
class G4SDmessenger;
#include "G4VSDFilter.hh"
#include <vector>
// class description:
//
// This is a singleton class which manages the sensitive detectors.
@@ -104,6 +107,12 @@ private:
G4SDManager( const G4SDManager& );
G4SDManager& operator=(const G4SDManager&);
public:
void RegisterSDFilter(G4VSDFilter* filter);
void DeRegisterSDFilter(G4VSDFilter* filter);
private:
void DestroyFilters();
std::vector<G4VSDFilter*> FilterList;
};
@@ -49,7 +49,7 @@ class G4SDStructure
G4SDStructure(G4String aPath);
~G4SDStructure();
G4int operator==(const G4SDStructure &right) const;
G4bool operator==(const G4SDStructure &right) const;
void AddNewDetector(G4VSensitiveDetector*aSD, G4String treeStructure);
void Activate(G4String aName, G4bool sensitiveFlag);
@@ -67,8 +67,8 @@ class G4SensitiveVolumeList
);
//Equality Operations
G4int operator==(const G4SensitiveVolumeList &right) const;
G4int operator!=(const G4SensitiveVolumeList &right) const;
G4bool operator==(const G4SensitiveVolumeList &right) const;
G4bool operator!=(const G4SensitiveVolumeList &right) const;
//Other Operations
@@ -46,8 +46,8 @@ class G4VReadOutGeometry
G4VReadOutGeometry(G4String);
virtual ~G4VReadOutGeometry();
G4int operator==(const G4VReadOutGeometry &right) const;
G4int operator!=(const G4VReadOutGeometry &right) const;
G4bool operator==(const G4VReadOutGeometry &right) const;
G4bool operator!=(const G4VReadOutGeometry &right) const;
// buildROGeomety must be invoked to Build (ie Build() method)
// the ROGeometry. It sets up in addition the needed
@@ -35,7 +35,7 @@ class G4Step;
// class description:
//
// This is the abstract base class of a filter to be associated with a
// sensitive detector.
// sensitive detector or a primitive scorer.
class G4VSDFilter
{
@@ -61,8 +61,8 @@ class G4VSensitiveDetector
G4VSensitiveDetector & operator=(const G4VSensitiveDetector &right);
G4int operator==(const G4VSensitiveDetector &right) const;
G4int operator!=(const G4VSensitiveDetector &right) const;
G4bool operator==(const G4VSensitiveDetector &right) const;
G4bool operator!=(const G4VSensitiveDetector &right) const;
public: // with description
virtual void Initialize(G4HCofThisEvent*);
@@ -61,6 +61,7 @@ G4SDManager::~G4SDManager()
delete theMessenger;
delete HCtable;
delete treeTop;
DestroyFilters();
theMessenger = nullptr;
HCtable = nullptr;
treeTop = nullptr;
@@ -149,4 +150,32 @@ G4int G4SDManager::GetCollectionID(G4VHitsCollection* aHC)
return GetCollectionID(HCname);
}
void G4SDManager::RegisterSDFilter(G4VSDFilter* filter)
{
FilterList.push_back(filter);
}
void G4SDManager::DeRegisterSDFilter(G4VSDFilter* filter)
{
for(auto f = FilterList.begin(); f != FilterList.end(); f++)
{
if(*f == filter)
{
FilterList.erase(f);
break;
}
}
}
void G4SDManager::DestroyFilters()
{
auto f = FilterList.begin();
while( f != FilterList.end() )
{
if(verboseLevel>0) G4cout << "### deleting " << (*f)->GetName() << " " << (*f) << G4endl;
delete *f;
f = FilterList.begin();
}
FilterList.clear();
}
@@ -52,7 +52,7 @@ G4SDStructure::~G4SDStructure()
detector.clear();
}
G4int G4SDStructure::operator==(const G4SDStructure &right) const
G4bool G4SDStructure::operator==(const G4SDStructure &right) const
{
return (this==&right);
}
@@ -63,12 +63,12 @@
//Equality Operations
G4int G4SensitiveVolumeList::operator==(const G4SensitiveVolumeList &right) const
G4bool G4SensitiveVolumeList::operator==(const G4SensitiveVolumeList &right) const
{
return (this == (G4SensitiveVolumeList *) &right);
}
G4int G4SensitiveVolumeList::operator!=(const G4SensitiveVolumeList &right) const
G4bool G4SensitiveVolumeList::operator!=(const G4SensitiveVolumeList &right) const
{
return (this != (G4SensitiveVolumeList *) &right);
}
@@ -94,10 +94,10 @@ G4VReadOutGeometry & G4VReadOutGeometry::operator=(const G4VReadOutGeometry &rig
return *this;
}
G4int G4VReadOutGeometry::operator==(const G4VReadOutGeometry &right) const
G4bool G4VReadOutGeometry::operator==(const G4VReadOutGeometry &right) const
{ return (this == (G4VReadOutGeometry *) &right); }
G4int G4VReadOutGeometry::operator!=(const G4VReadOutGeometry &right) const
G4bool G4VReadOutGeometry::operator!=(const G4VReadOutGeometry &right) const
{ return (this != (G4VReadOutGeometry *) &right); }
void G4VReadOutGeometry::BuildROGeometry()
@@ -27,10 +27,16 @@
//
// G4VSensitiveDetector
#include "G4VSDFilter.hh"
#include "G4SDManager.hh"
G4VSDFilter::G4VSDFilter(G4String name)
:filterName(name)
{;}
{
G4SDManager::GetSDMpointer()->RegisterSDFilter(this);
}
G4VSDFilter::~G4VSDFilter()
{;}
{
G4SDManager::GetSDMpointer()->DeRegisterSDFilter(this);
}
@@ -88,12 +88,12 @@ G4VSensitiveDetector & G4VSensitiveDetector::operator=(const G4VSensitiveDetecto
return *this;
}
G4int G4VSensitiveDetector::operator==(const G4VSensitiveDetector &right) const
G4bool G4VSensitiveDetector::operator==(const G4VSensitiveDetector &right) const
{
return (this==&right);
}
G4int G4VSensitiveDetector::operator!=(const G4VSensitiveDetector &right) const
G4bool G4VSensitiveDetector::operator!=(const G4VSensitiveDetector &right) const
{
return (this!=&right);
}