Import Geant4 11.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2022-12-09 14:43:28 +01:00
parent c07cea1fe0
commit 9f34590941
3810 changed files with 200490 additions and 182326 deletions
+5 -4
View File
@@ -140,8 +140,9 @@ void G4AdjointSimManager::RunAdjointSimulation(G4int nb_evt)
// Make the run
//------------
nb_evt_of_last_run = nb_evt;
G4RunManager::GetRunManager()->BeamOn(
nb_evt * theAdjointPrimaryGeneratorAction->GetNbOfAdjointPrimaryTypes());
G4RunManager::GetRunManager()
->BeamOn( G4int(nb_evt*theAdjointPrimaryGeneratorAction
->GetNbOfAdjointPrimaryTypes()) );
// Back to Fwd Simulation Mode
//--------------------------------
@@ -489,8 +490,8 @@ void G4AdjointSimManager::RegisterAtEndOfAdjointTrack()
std::vector<G4ParticleDefinition*>* aList =
theAdjointPrimaryGeneratorAction->GetListOfPrimaryFwdParticles();
last_fwd_part_index = -1;
std::size_t i = 0;
while(i < aList->size() && last_fwd_part_index < 0)
G4int i = 0;
while(i < (G4int)aList->size() && last_fwd_part_index < 0)
{
if((*aList)[i]->GetParticleName() == last_fwd_part_name)
last_fwd_part_index = i;
+7 -7
View File
@@ -344,7 +344,7 @@ void G4MTRunManager::CreateAndStartWorkers()
std::stringstream ss;
ss.fill('=');
ss << std::setw(msg.str().length()) << "";
ss << std::setw(G4int(msg.str().length())) << "";
G4cout << "\n"
<< ss.str() << "\n"
<< msg.str() << "\n"
@@ -522,11 +522,11 @@ void G4MTRunManager::ConstructScoringWorlds()
G4RunManager::ConstructScoringWorlds();
masterWorlds.clear();
std::size_t nWorlds =
G4int nWorlds = (G4int)
G4TransportationManager::GetTransportationManager()->GetNoWorlds();
auto itrW =
G4TransportationManager::GetTransportationManager()->GetWorldsIterator();
for(std::size_t iWorld = 0; iWorld < nWorlds; ++iWorld)
for(G4int iWorld = 0; iWorld < nWorlds; ++iWorld)
{
addWorld(iWorld, *itrW);
++itrW;
@@ -744,7 +744,7 @@ void G4MTRunManager::AbortEvent()
// --------------------------------------------------------------------
void G4MTRunManager::WaitForReadyWorkers()
{
beginOfEventLoopBarrier.Wait(GetNumberActiveThreads());
beginOfEventLoopBarrier.Wait((G4int)GetNumberActiveThreads());
endOfEventLoopBarrier.ResetCounter();
beginOfEventLoopBarrier.ReleaseBarrier();
}
@@ -758,7 +758,7 @@ void G4MTRunManager::ThisWorkerReady()
// --------------------------------------------------------------------
void G4MTRunManager::WaitForEndEventLoopWorkers()
{
endOfEventLoopBarrier.Wait(GetNumberActiveThreads());
endOfEventLoopBarrier.Wait((G4int)GetNumberActiveThreads());
beginOfEventLoopBarrier.ResetCounter();
endOfEventLoopBarrier.ReleaseBarrier();
}
@@ -773,7 +773,7 @@ void G4MTRunManager::ThisWorkerEndEventLoop()
void G4MTRunManager::NewActionRequest(
G4MTRunManager::WorkerActionRequest newRequest)
{
nextActionRequestBarrier.Wait(GetNumberActiveThreads());
nextActionRequestBarrier.Wait((G4int)GetNumberActiveThreads());
// nextActionRequest is a shared resource, but there is no
// data-race thanks to the barrier: all threads are waiting
nextActionRequest = newRequest;
@@ -793,7 +793,7 @@ void G4MTRunManager::RequestWorkersProcessCommandsStack()
{
PrepareCommandsStack();
NewActionRequest(WorkerActionRequest::PROCESSUI);
processUIBarrier.SetActiveThreads(GetNumberActiveThreads());
processUIBarrier.SetActiveThreads((G4int)GetNumberActiveThreads());
processUIBarrier.WaitForReadyWorkers();
}
+2 -2
View File
@@ -118,7 +118,7 @@ void G4PhysicsListHelper::CheckParticleList() const
if(!isEmProc)
{
G4ProcessVector* list = particle->GetProcessManager()->GetProcessList();
for(std::size_t idx = 0; idx < list->size(); ++idx)
for(G4int idx = 0; idx < (G4int)list->size(); ++idx)
{
isEmProc = ((*list)[idx])->GetProcessType() == fElectromagnetic;
if(isEmProc)
@@ -561,7 +561,7 @@ G4bool G4PhysicsListHelper::RegisterProcess(G4VProcess* process,
{
G4bool duplicated = false;
G4ProcessVector* pList = pManager->GetProcessList();
for(std::size_t idx = 0; idx < pList->size(); ++idx)
for(G4int idx = 0; idx < (G4int)pList->size(); ++idx)
{
const G4VProcess* p = (*pList)[idx];
if((p->GetProcessType() == pType) && (p->GetProcessSubType() == pSubType))
+4 -4
View File
@@ -364,7 +364,7 @@ void G4RunManager::RunInitialization()
if(G4VScoreNtupleWriter::Instance() != nullptr)
{
auto hce = fSDM->PrepareNewEvent();
auto hce = (fSDM != nullptr) ? fSDM->PrepareNewEvent() : nullptr;
isScoreNtupleWriter = G4VScoreNtupleWriter::Instance()->Book(hce);
delete hce;
}
@@ -907,7 +907,7 @@ void G4RunManager::ConstructScoringWorlds()
if(ScM == nullptr)
return;
G4int nPar = ScM->GetNumberOfMesh();
G4int nPar = (G4int)ScM->GetNumberOfMesh();
if(nPar < 1)
return;
@@ -981,14 +981,14 @@ void G4RunManager::UpdateScoring()
G4ScoringManager* ScM = G4ScoringManager::GetScoringManagerIfExist();
if(ScM == nullptr)
return;
G4int nPar = ScM->GetNumberOfMesh();
G4int nPar = (G4int)ScM->GetNumberOfMesh();
if(nPar < 1)
return;
G4HCofThisEvent* HCE = currentEvent->GetHCofThisEvent();
if(HCE == nullptr)
return;
G4int nColl = HCE->GetCapacity();
G4int nColl = (G4int)HCE->GetCapacity();
for(G4int i = 0; i < nColl; ++i)
{
G4VHitsCollection* HC = HCE->GetHC(i);
+2 -2
View File
@@ -121,7 +121,7 @@ G4RunManagerKernel::G4RunManagerKernel()
G4AllocatorList* allocList = G4AllocatorList::GetAllocatorListIfExist();
if(allocList != nullptr)
numberOfStaticAllocators = allocList->Size();
numberOfStaticAllocators = (G4int)allocList->Size();
if(G4StateManager::GetStateManager()->GetExceptionHandler() == nullptr)
{
@@ -1171,7 +1171,7 @@ void G4RunManagerKernel::SetupShadowProcess() const
if(pm != nullptr)
{
G4ProcessVector& procs = *(pm->GetProcessList());
for(std::size_t idx = 0; idx < procs.size(); ++idx)
for(G4int idx = 0; idx < (G4int)procs.size(); ++idx)
{
const G4VProcess* masterP = procs[idx]->GetMasterProcess();
if(masterP == nullptr)
+8 -7
View File
@@ -118,7 +118,7 @@ G4TaskRunManager::G4TaskRunManager(G4VUserTaskQueue* task_queue, G4bool useTBB,
//------------------------------------------------------------------------//
G4String _nthread_env = G4GetEnv<G4String>("G4FORCENUMBEROFTHREADS", "");
for(auto& itr : _nthread_env)
itr = tolower(itr);
itr = (char)std::tolower(itr);
if(_nthread_env == "max")
forcedNwokers = G4Threading::G4GetNumberOfCores();
@@ -310,7 +310,8 @@ void G4TaskRunManager::TerminateOneEvent()
void G4TaskRunManager::ComputeNumberOfTasks()
{
G4int grainSize = (eventGrainsize == 0) ? threadPool->size() : eventGrainsize;
G4int grainSize = (eventGrainsize == 0)
? (G4int)threadPool->size() : eventGrainsize;
grainSize =
G4GetEnv<G4int>("G4FORCE_GRAINSIZE", grainSize, "Forcing grainsize...");
if(grainSize == 0)
@@ -366,7 +367,7 @@ void G4TaskRunManager::ComputeNumberOfTasks()
std::stringstream ss;
ss.fill('=');
ss << std::setw(msg.str().length()) << "";
ss << std::setw((G4int)msg.str().length()) << "";
G4cout << "\n"
<< ss.str() << "\n"
<< msg.str() << "\n"
@@ -410,7 +411,7 @@ void G4TaskRunManager::CreateAndStartWorkers()
std::stringstream ss;
ss.fill('=');
ss << std::setw(msg.str().length()) << "";
ss << std::setw((G4int)msg.str().length()) << "";
G4cout << "\n"
<< ss.str() << "\n"
<< msg.str() << "\n"
@@ -447,7 +448,7 @@ void G4TaskRunManager::CreateAndStartWorkers()
std::stringstream ss;
ss.fill('=');
ss << std::setw(msg.str().length()) << "";
ss << std::setw((G4int)msg.str().length()) << "";
G4cout << "\n"
<< ss.str() << "\n"
<< msg.str() << "\n"
@@ -617,11 +618,11 @@ void G4TaskRunManager::ConstructScoringWorlds()
G4RunManager::ConstructScoringWorlds();
masterWorlds.clear();
size_t nWorlds =
G4int nWorlds = (G4int)
G4TransportationManager::GetTransportationManager()->GetNoWorlds();
std::vector<G4VPhysicalVolume*>::iterator itrW =
G4TransportationManager::GetTransportationManager()->GetWorldsIterator();
for(size_t iWorld = 0; iWorld < nWorlds; ++iWorld)
for(G4int iWorld = 0; iWorld < nWorlds; ++iWorld)
{
addWorld(iWorld, *itrW);
++itrW;
+2 -2
View File
@@ -162,8 +162,8 @@ void G4TaskRunManagerKernel::InitializeWorker()
// Initliazie per-thread stream-output
// The following line is needed before we actually do IO initialization
// becasue the constructor of UI manager resets the IO destination.
context()->SetNumberThreads(mrm->GetThreadPool()->size());
context()->SetThreadId(G4ThreadPool::get_this_thread_id() - 1);
context()->SetNumberThreads((G4int)mrm->GetThreadPool()->size());
context()->SetThreadId(G4int(G4ThreadPool::get_this_thread_id() - 1));
G4int thisID = context()->GetThreadId();
G4Threading::G4SetThreadId(thisID);
G4UImanager::GetUIpointer()->SetUpForAThread(thisID);
@@ -95,7 +95,7 @@ void G4VUserDetectorConstruction::ConstructParallelSD()
// --------------------------------------------------------------------
G4int G4VUserDetectorConstruction::GetNumberOfParallelWorld() const
{
return parallelWorld.size();
return (G4int)parallelWorld.size();
}
// --------------------------------------------------------------------
+7 -7
View File
@@ -754,7 +754,7 @@ void G4VUserPhysicsList::BuildPhysicsTable(G4ParticleDefinition* particle)
<< particle->GetParticleName() << G4endl;
G4cout << " ProcessManager : " << pManager
<< " ProcessManagerShadow : " << pManagerShadow << G4endl;
for(std::size_t iv1 = 0; iv1 < pVector->size(); ++iv1)
for(G4int iv1 = 0; iv1 < (G4int)pVector->size(); ++iv1)
{
G4cout << " " << iv1 << " - " << (*pVector)[iv1]->GetProcessName()
<< G4endl;
@@ -763,14 +763,14 @@ void G4VUserPhysicsList::BuildPhysicsTable(G4ParticleDefinition* particle)
<< G4endl;
G4ProcessVector* pVectorShadow = pManagerShadow->GetProcessList();
for(std::size_t iv2 = 0; iv2 < pVectorShadow->size(); ++iv2)
for(G4int iv2 = 0; iv2 < (G4int)pVectorShadow->size(); ++iv2)
{
G4cout << " " << iv2 << " - "
<< (*pVectorShadow)[iv2]->GetProcessName() << G4endl;
}
}
#endif
for(std::size_t j = 0; j < pVector->size(); ++j)
for(G4int j = 0; j < (G4int)pVector->size(); ++j)
{
// Andrea July 16th 2013 : migration to new interface...
// Infer if we are in a worker thread or master thread
@@ -842,7 +842,7 @@ void G4VUserPhysicsList::PreparePhysicsTable(G4ParticleDefinition* particle)
FatalException, "No process Vector");
return;
}
for(std::size_t j = 0; j < pVector->size(); ++j)
for(G4int j = 0; j < (G4int)pVector->size(); ++j)
{
// Andrea July 16th 2013 : migration to new interface...
// Infer if we are in a worker thread or master thread
@@ -962,7 +962,7 @@ G4bool G4VUserPhysicsList::StorePhysicsTable(const G4String& directory)
// Store physics tables for every process for this particle type
G4ProcessVector* pVector =
(particle->GetProcessManager())->GetProcessList();
for(std::size_t j = 0; j < pVector->size(); ++j)
for(G4int j = 0; j < (G4int)pVector->size(); ++j)
{
if(!(*pVector)[j]->StorePhysicsTable(particle, dir, ascii))
{
@@ -1000,7 +1000,7 @@ void G4VUserPhysicsList::RetrievePhysicsTable(G4ParticleDefinition* particle,
G4bool success[100];
// Retrieve physics tables for every process for this particle type
G4ProcessVector* pVector = (particle->GetProcessManager())->GetProcessList();
for(std::size_t j = 0; j < pVector->size(); ++j)
for(G4int j = 0; j < (G4int)pVector->size(); ++j)
{
success[j] =
(*pVector)[j]->RetrievePhysicsTable(particle, directory, ascii);
@@ -1020,7 +1020,7 @@ void G4VUserPhysicsList::RetrievePhysicsTable(G4ParticleDefinition* particle,
(*pVector)[j]->BuildPhysicsTable(*particle);
}
}
for(std::size_t j = 0; j < pVector->size(); ++j)
for(G4int j = 0; j < (G4int)pVector->size(); ++j)
{
// temporary addition to make the integral schema
if(!success[j])
+2 -2
View File
@@ -221,7 +221,7 @@ void G4WorkerRunManager::RunInitialization()
if(G4VScoreNtupleWriter::Instance())
{
auto hce = fSDM->PrepareNewEvent();
auto hce = (fSDM != nullptr) ? fSDM->PrepareNewEvent() : nullptr;
isScoreNtupleWriter = G4VScoreNtupleWriter::Instance()->Book(hce);
delete hce;
}
@@ -544,7 +544,7 @@ void G4WorkerRunManager::ConstructScoringWorlds()
G4ScoringManager* ScM = G4ScoringManager::GetScoringManagerIfExist();
if(ScM == nullptr)
return;
G4int nPar = ScM->GetNumberOfMesh();
G4int nPar = (G4int)ScM->GetNumberOfMesh();
if(nPar < 1)
return;
+3 -3
View File
@@ -89,14 +89,14 @@ void G4WorkerRunManagerKernel::SetupShadowProcess() const
<< pd->GetParticleName() << ">" << G4endl;
G4cout << " ProcessManager : " << pm << " ProcessManagerShadow : " << pmM
<< G4endl;
for(std::size_t iv1 = 0; iv1 < procs.size(); ++iv1)
for(G4int iv1 = 0; iv1 < (G4int)procs.size(); ++iv1)
{
G4cout << " " << iv1 << " - " << procs[iv1]->GetProcessName()
<< G4endl;
}
G4cout << "--------------------------------------------------------------"
<< G4endl;
for(std::size_t iv2 = 0; iv2 < procsM.size(); ++iv2)
for(G4int iv2 = 0; iv2 < (G4int)procsM.size(); ++iv2)
{
G4cout << " " << iv2 << " - " << procsM[iv2]->GetProcessName()
<< G4endl;
@@ -117,7 +117,7 @@ void G4WorkerRunManagerKernel::SetupShadowProcess() const
// process from master. Note that we rely on
// processes being in the correct order!
// We could use some checking using process name or type
for(std::size_t idx = 0; idx < procs.size(); ++idx)
for(G4int idx = 0; idx < (G4int)procs.size(); ++idx)
{
procs[idx]->SetMasterProcess(procsM[idx]);
}
+4 -2
View File
@@ -136,12 +136,14 @@ void G4WorkerTaskRunManager::RunInitialization()
currentRun->SetDCtable(DCtable);
G4SDManager* fSDM = G4SDManager::GetSDMpointerIfExist();
if(fSDM)
if(fSDM != nullptr)
{
currentRun->SetHCtable(fSDM->GetHCtable());
}
if(G4VScoreNtupleWriter::Instance())
{
auto hce = fSDM->PrepareNewEvent();
auto hce = (fSDM != nullptr) ? fSDM->PrepareNewEvent() : nullptr;
isScoreNtupleWriter = G4VScoreNtupleWriter::Instance()->Book(hce);
delete hce;
}
@@ -89,14 +89,14 @@ void G4WorkerTaskRunManagerKernel::SetupShadowProcess() const
G4cout << " ProcessManager : " << pm << " ProcessManagerShadow : " << pmM
<< G4endl;
for(size_t iv1 = 0; iv1 < procs.size(); iv1++)
for(G4int iv1 = 0; iv1 < (G4int)procs.size(); ++iv1)
G4cout << " " << iv1 << " - " << procs[iv1]->GetProcessName()
<< G4endl;
G4cout << "--------------------------------------------------------------"
<< G4endl;
for(size_t iv2 = 0; iv2 < procsM.size(); iv2++)
for(G4int iv2 = 0; iv2 < (G4int)procsM.size(); ++iv2)
G4cout << " " << iv2 << " - " << procsM[iv2]->GetProcessName()
<< G4endl;
@@ -117,7 +117,7 @@ void G4WorkerTaskRunManagerKernel::SetupShadowProcess() const
// process from master. Note that we rely on
// processes being in the correct order!
// We could use some checking using process name or type
for(size_t idx = 0; idx < procs.size(); ++idx)
for(G4int idx = 0; idx < (G4int)procs.size(); ++idx)
{
procs[idx]->SetMasterProcess(procsM[idx]);
}