Import Geant4 11.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2023-12-08 10:43:34 +01:00
parent dd1f179cda
commit 860a2b92bf
3962 changed files with 139318 additions and 164259 deletions
+18
View File
@@ -6,6 +6,24 @@ It must **not** be used as a substitute for writing good git commit messages!
-------------------------------------------------------------------------------
## 2023-11-17 I. Hrivnacova (run-V11-01-10)
- Do not call G4ParticleTable::WorkerG4ParticleTable() in
G4WorkerRunManager constructor as this function
is called already from G4ParticleTable::GetParticleTable()
which is called beforehand by other Geant4 classes.
Duplicate call is causing memory leak at exit.
## 2023-10-20 Makoto Asai (run-V11-01-08, -09)
- Reverting G4RunManager and G4Run back to run-V11-01-05.
## 2023-08-28 Makoto Asai (run-V11-01-06, -07)
- Introducing sub-event in Event category. Co-working with event-V11-01-02, -03
and global-V11-02-16.
## 2023-07-12 Alberto Ribon (run-V11-01-05)
- G4PhysicsListHelper : removed the unused code related to reading from the
file OrderingParameterTable (which has been deleted).
## 2023-06-02 Ben Morgan (run-V11-01-04)
- Apply core and optional clang-tidy fixes, plus clang-format and tidying:
- Removal of obsolete comments/dead blocks
+10 -3
View File
@@ -66,6 +66,13 @@ class G4Run
// to the global G4Run object.
virtual void Merge(const G4Run*);
// Method to be overwritten by the user for merging sub-event results
// (e.g. hits) into the master G4Event.
// [N.B.] Trajectories are merged in the base-class method. So, the user
// should invoke the base-class method at the end of his/her overwriting
// method.
virtual void MergeSubEvent(G4Event* masterEv, const G4Event* subEv);
// Store a G4Event object until this run object is deleted.
// Given the potential large memory size of G4Event and its data-member
// objects stored in G4Event, the user must be careful and responsible
@@ -84,17 +91,17 @@ class G4Run
inline G4int GetNumberOfEventToBeProcessed() const { return numberOfEventToBeProcessed; }
// List of names of hits collection.
// Returns hits collection.
inline const G4HCtable* GetHCtable() const { return HCtable; }
// List of names of digi collection.
// Returns digi collection.
inline const G4DCtable* GetDCtable() const { return DCtable; }
// Returns random number status at the beginning of this run.
inline const G4String& GetRandomNumberStatus() const { return randomNumberStatus; }
// Returns the event vector.
inline const std::vector<const G4Event*>* GetEventVector() const { return eventVector; }
inline std::vector<const G4Event*>* GetEventVector() const { return eventVector; }
inline void SetRunID(G4int id) { runID = id; }
inline void SetNumberOfEventToBeProcessed(G4int n_ev) { numberOfEventToBeProcessed = n_ev; }
+1 -1
View File
@@ -401,7 +401,7 @@ class G4RunManager
// he/she can use the corresponding ENUM in G4ClassificationOfNewTrack.
inline void SetNumberOfAdditionalWaitingStacks(G4int iAdd)
{
eventManager->SetNumberOfAdditionalWaitingStacks(iAdd);
eventManager->GetStackManager()->SetNumberOfAdditionalWaitingStacks(iAdd);
}
inline const G4String& GetVersionString() const { return kernel->GetVersionString(); }
+4 -1
View File
@@ -110,11 +110,14 @@ G4bool G4ExceptionHandler::Notify(const char* originOfException, const char* exc
}
abortionForCoreDump = false;
break;
default:
case JustWarning:
G4cout << ws_banner << message.str() << "*** This is just a warning message. ***" << we_banner
<< G4endl;
abortionForCoreDump = false;
break;
default:
abortionForCoreDump = false;
break;
}
return abortionForCoreDump;
}
+1 -43
View File
@@ -255,35 +255,8 @@ void G4PhysicsListHelper::AddTransportation()
// --------------------------------------------------------------------
void G4PhysicsListHelper::ReadOrdingParameterTable()
{
G4bool readInFile = false;
std::ifstream fIn;
if (std::getenv("G4ORDPARAMTABLE") != nullptr) {
ordParamFileName = std::getenv("G4ORDPARAMTABLE");
#ifdef G4VERBOSE
if (verboseLevel > 1) {
G4cout << "G4PhysicsListHelper::ReadOrdingParameterTable :" << ordParamFileName
<< " is assigned to Ordering Parameter Table " << G4endl;
}
#endif
// open input file //
fIn.open(ordParamFileName, std::ios::in);
// check if the file has been opened successfully
if (!fIn) {
#ifdef G4VERBOSE
if (verboseLevel > 0) {
G4cout << "G4PhysicsListHelper::ReadOrdingParameterTable "
<< " Can not open file " << ordParamFileName << G4endl;
}
#endif
G4Exception("G4PhysicsListHelper::ReadOrdingParameterTable", "Run0105", JustWarning,
"Fail to open ordering parameter table ");
}
else {
readInFile = true;
}
}
// create OrdParamTable
if (theTable != nullptr) {
theTable->clear();
@@ -294,22 +267,7 @@ void G4PhysicsListHelper::ReadOrdingParameterTable()
theTable = new G4OrdParamTable();
sizeOfTable = 0;
if (readInFile) {
// read in the file and fill the table
while (!fIn.eof()) {
G4PhysicsListOrderingParameter tmp;
G4int flag;
fIn >> tmp.processTypeName >> tmp.processType >> tmp.processSubType >> tmp.ordering[0]
>> tmp.ordering[1] >> tmp.ordering[2] >> flag;
tmp.isDuplicable = (flag != 0);
theTable->push_back(tmp);
++sizeOfTable;
}
fIn.close();
}
else {
ReadInDefaultOrderingParameter();
}
ReadInDefaultOrderingParameter();
if (sizeOfTable == 0) {
#ifdef G4VERBOSE
+16 -8
View File
@@ -45,11 +45,12 @@ G4Run::G4Run()
G4Run::~G4Run()
{
// Objects made by local thread should not be deleted by the master thread
G4RunManager::RMType rmType = G4RunManager::GetRunManager()->GetRunManagerType();
if (rmType != G4RunManager::masterRM) {
for (const auto& itr : *eventVector) {
delete itr;
}
G4RunManager::RMType rmType =
G4RunManager::GetRunManager()->GetRunManagerType();
if(rmType != G4RunManager::masterRM)
{
for(auto& itr : *eventVector)
{ delete itr; }
}
delete eventVector;
}
@@ -64,9 +65,8 @@ void G4Run::RecordEvent(const G4Event*)
void G4Run::Merge(const G4Run* right)
{
numberOfEvent += right->numberOfEvent;
for (const auto& itr : *right->eventVector) {
eventVector->push_back(itr);
}
for(auto& itr : *(right->eventVector))
{ eventVector->push_back(itr); }
}
// --------------------------------------------------------------------
@@ -74,3 +74,11 @@ void G4Run::StoreEvent(G4Event* evt)
{
eventVector->push_back(evt);
}
// --------------------------------------------------------------------
void G4Run::MergeSubEvent(G4Event* /*masterEv*/, const G4Event* /*subEv*/)
{
// trajectories are merged here.......
;
}
+5 -1
View File
@@ -85,7 +85,10 @@ G4WorkerRunManager::G4WorkerRunManager() : G4RunManager(workerRM)
"applications.";
G4Exception("G4WorkerRunManager::G4WorkerRunManager()", "Run0103", FatalException, msg);
#endif
G4ParticleTable::GetParticleTable()->WorkerG4ParticleTable();
// G4ParticleTable::GetParticleTable()->WorkerG4ParticleTable();
// WorkerG4ParticleTable() would be performed twice,
// as it is called already from G4ParticleTable::GetParticleTable()
// which is called beforehand by other Geant4 classes
G4ScoringManager* masterScM = G4MTRunManager::GetMasterScoringManager();
if (masterScM != nullptr) G4ScoringManager::GetScoringManager(); // TLS instance for a worker
@@ -114,6 +117,7 @@ G4WorkerRunManager::G4WorkerRunManager() : G4RunManager(workerRM)
// --------------------------------------------------------------------
G4WorkerRunManager::~G4WorkerRunManager()
{
CleanUpPreviousEvents();
// Put these pointers to zero: owned by master thread
// If not to zero, the base class destructor will attempt to
// delete them