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
@@ -57,7 +57,7 @@ G4double G4DNACPA100LogLogInterpolation::Calculate(G4double x, G4int bin,
const G4DataVector& data) const
{
//G4cout << "G4DNACPA100LogLogInterpolation is performed (2 arguments) " << G4endl;
G4int nBins = data.size() - 1;
G4int nBins = G4int(data.size() - 1);
//G4double oldresult = 0.;
G4double value = 0.;
if (x < points[0])
@@ -115,7 +115,7 @@ G4double G4DNACPA100LogLogInterpolation::Calculate(G4double x, G4int bin,
const G4DataVector& log_points,
const G4DataVector& log_data) const
{
G4int nBins = data.size() - 1;
G4int nBins = G4int(data.size() - 1);
G4double value = 0.;
G4double log_x = std::log10(x);
if (x < points[0])
@@ -54,7 +54,7 @@ G4DNACPA100WaterExcitationStructure::G4DNACPA100WaterExcitationStructure(): nLev
energyConstant.push_back(12.91*eV);
energyConstant.push_back(14.50*eV);
nLevels = energyConstant.size();
nLevels = (G4int)energyConstant.size();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -53,7 +53,7 @@ G4DNACPA100WaterIonisationStructure::G4DNACPA100WaterIonisationStructure(): nLev
UConstant.push_back(70.71*eV);
UConstant.push_back(796.2*eV);
nLevels = energyConstant.size();
nLevels = (G4int)energyConstant.size();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -415,21 +415,21 @@ void G4DNAChemistryManager::InitializeMaster()
description << "No user chemistry list has been provided.";
G4Exception("G4DNAChemistryManager::InitializeMaster", "NO_CHEM_LIST",
FatalException, description);
}else
{
fpUserChemistryList->ConstructDissociationChannels();
if (!fSkipReactions)
{
fpUserChemistryList->ConstructReactionTable(G4DNAMolecularReactionTable::GetReactionTable());
}
else
{
G4DNAMolecularReactionTable::GetReactionTable(); // init pointer
}
}
G4Scheduler::Instance();
// creates a concrete object of the scheduler
fpUserChemistryList->ConstructDissociationChannels();
if (!fSkipReactions)
{
fpUserChemistryList->ConstructReactionTable(G4DNAMolecularReactionTable::GetReactionTable());
}
else
{
G4DNAMolecularReactionTable::GetReactionTable(); // init pointer
}
fMasterInitialized = true;
}
@@ -482,6 +482,10 @@ void G4DNAChemistryManager::InitializeThread()
description << "No user chemistry list has been provided.";
G4Exception("G4DNAChemistryManager::InitializeThread", "NO_CHEM_LIST",
FatalException, description);
}else
{
HandleStandaloneInitialization();// To make coverty happy
fpUserChemistryList->ConstructTimeStepModel(G4DNAMolecularReactionTable::GetReactionTable());
}
if (fVerbose)
@@ -490,9 +494,6 @@ void G4DNAChemistryManager::InitializeThread()
<< G4endl;
}
HandleStandaloneInitialization();
fpUserChemistryList->ConstructTimeStepModel(G4DNAMolecularReactionTable::GetReactionTable());
G4Scheduler::Instance()->Initialize();
fpThreadData->fThreadInitialized = true;
@@ -187,7 +187,7 @@ G4bool G4DNACrossSectionDataSet::LoadData(const G4String & argFileName)
delete stream;
std::vector<G4DataVector *>::size_type maxI(columns.size());
std::size_t maxI(columns.size());
if (maxI<2)
{
@@ -199,10 +199,10 @@ G4bool G4DNACrossSectionDataSet::LoadData(const G4String & argFileName)
return false;
}
std::vector<G4DataVector*>::size_type i(1);
std::size_t i(1);
while (i<maxI)
{
G4DataVector::size_type maxJ(columns[i]->size());
std::size_t maxJ(columns[i]->size());
if (maxJ!=columns[0]->size())
{
@@ -214,7 +214,7 @@ G4bool G4DNACrossSectionDataSet::LoadData(const G4String & argFileName)
return false;
}
G4DataVector::size_type j(0);
std::size_t j(0);
G4DataVector *argEnergies=new G4DataVector;
G4DataVector *argData=new G4DataVector;
@@ -230,7 +230,7 @@ G4bool G4DNACrossSectionDataSet::LoadData(const G4String & argFileName)
j++;
}
AddComponent(new G4EMDataSet(i-1, argEnergies, argData, argLogEnergies, argLogData, GetAlgorithm()->Clone(), GetUnitEnergies(), GetUnitData()));
AddComponent(new G4EMDataSet(G4int(i-1), argEnergies, argData, argLogEnergies, argLogData, GetAlgorithm()->Clone(), GetUnitEnergies(), GetUnitData()));
i++;
}
@@ -337,7 +337,7 @@ G4bool G4DNACrossSectionDataSet::LoadNonLogData(const G4String & argFileName)
delete stream;
std::vector<G4DataVector *>::size_type maxI(columns.size());
std::size_t maxI(columns.size());
if (maxI<2)
{
@@ -349,10 +349,10 @@ G4bool G4DNACrossSectionDataSet::LoadNonLogData(const G4String & argFileName)
return false;
}
std::vector<G4DataVector*>::size_type i(1);
std::size_t i(1);
while (i<maxI)
{
G4DataVector::size_type maxJ(columns[i]->size());
std::size_t maxJ(columns[i]->size());
if (maxJ!=columns[0]->size())
{
@@ -364,7 +364,7 @@ G4bool G4DNACrossSectionDataSet::LoadNonLogData(const G4String & argFileName)
return false;
}
G4DataVector::size_type j(0);
std::size_t j(0);
G4DataVector *argEnergies=new G4DataVector;
G4DataVector *argData=new G4DataVector;
@@ -376,7 +376,7 @@ G4bool G4DNACrossSectionDataSet::LoadNonLogData(const G4String & argFileName)
j++;
}
AddComponent(new G4EMDataSet(i-1, argEnergies, argData, GetAlgorithm()->Clone(), GetUnitEnergies(), GetUnitData()));
AddComponent(new G4EMDataSet(G4int(i-1), argEnergies, argData, GetAlgorithm()->Clone(), GetUnitEnergies(), GetUnitData()));
i++;
}
@@ -394,7 +394,7 @@ G4bool G4DNACrossSectionDataSet::LoadNonLogData(const G4String & argFileName)
G4bool G4DNACrossSectionDataSet::SaveData(const G4String & argFileName) const
{
const size_t n(NumberOfComponents());
const std::size_t n(NumberOfComponents());
if (n==0)
{
@@ -421,12 +421,12 @@ G4bool G4DNACrossSectionDataSet::SaveData(const G4String & argFileName) const
G4DataVector::const_iterator iEnergiesEnd(GetComponent(0)->GetEnergies(0).end());
G4DataVector::const_iterator * iData(new G4DataVector::const_iterator[n]);
size_t k(n);
std::size_t k(n);
while (k>0)
{
k--;
iData[k]=GetComponent(k)->GetData(0).begin();
iData[k]=GetComponent((G4int)k)->GetData(0).cbegin();
}
while (iEnergies!=iEnergiesEnd)
@@ -500,18 +500,18 @@ G4double G4DNACrossSectionDataSet::FindValue(G4double argEnergy, G4int /* argCom
void G4DNACrossSectionDataSet::PrintData(void) const
{
const size_t n(NumberOfComponents());
const G4int n = (G4int)NumberOfComponents();
G4cout << "The data set has " << n << " components" << G4endl;
G4cout << G4endl;
size_t i(0);
G4int i(0);
while (i<n)
{
G4cout << "--- Component " << i << " ---" << G4endl;
GetComponent(i)->PrintData();
i++;
++i;
}
}
@@ -27,7 +27,7 @@
#include "G4DNADamage.hh"
#include "G4UnitsTable.hh"
G4ThreadLocal G4DNADamage* G4DNADamage::fpInstance(0);
G4ThreadLocal G4DNADamage* G4DNADamage::fpInstance(nullptr);
G4DNAIndirectHit::G4DNAIndirectHit(const G4String& baseName,
const G4Molecule* molecule,
@@ -42,8 +42,8 @@ G4DNAIndirectHit::G4DNAIndirectHit(const G4String& baseName,
G4DNAIndirectHit::~G4DNAIndirectHit()
{
if (fpMolecule) delete fpMolecule;
fpMolecule = 0;
if (fpMolecule != nullptr) delete fpMolecule;
fpMolecule = nullptr;
}
void G4DNAIndirectHit::Print()
@@ -55,7 +55,7 @@ void G4DNAIndirectHit::Print()
G4DNADamage* G4DNADamage::Instance()
{
if (!fpInstance) new G4DNADamage();
if (fpInstance == nullptr) new G4DNADamage();
return fpInstance;
}
@@ -69,7 +69,7 @@ G4DNADamage::G4DNADamage()
G4DNADamage::~G4DNADamage()
{
for (int i = 0; i < (int) fIndirectHits.size(); i++)
for (G4int i = 0; i < (G4int) fIndirectHits.size(); ++i)
{
if (fIndirectHits[i]) delete fIndirectHits[i];
}
@@ -79,13 +79,13 @@ G4DNADamage::~G4DNADamage()
void G4DNADamage::DeleteInstance()
{
if (fpInstance) delete fpInstance;
fpInstance = 0;
fpInstance = nullptr;
}
void G4DNADamage::Reset()
{
fNIndirectDamage = 0;
for (int i = 0; i < (int) fIndirectHits.size(); i++)
for (G4int i = 0; i < (G4int) fIndirectHits.size(); ++i)
{
if (fIndirectHits[i]) delete fIndirectHits[i];
}
@@ -103,13 +103,12 @@ void G4DNADamage::AddIndirectDamage(const G4String& baseName,
return;
}
G4DNAIndirectHit* indirectHit = 0;
std::map<G4Molecule, const G4Molecule*>::iterator it =
fMolMap.find(*molecule);
G4DNAIndirectHit* indirectHit = nullptr;
auto it = fMolMap.find(*molecule);
if (it == fMolMap.end())
if (it == fMolMap.cend())
{
G4Molecule* mol(0);
G4Molecule* mol(nullptr);
fMolMap[*molecule] = (mol = new G4Molecule(*molecule));
indirectHit = new G4DNAIndirectHit(baseName, mol, position, time);
}
@@ -46,7 +46,7 @@ G4DNAEmfietzoglouWaterExcitationStructure::G4DNAEmfietzoglouWaterExcitationStruc
energyConstant.push_back(12.61*eV);
energyConstant.push_back(13.77*eV);
nLevels = energyConstant.size();
nLevels = (G4int)energyConstant.size();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -46,7 +46,7 @@ G4DNAEmfietzoglouWaterIonisationStructure::G4DNAEmfietzoglouWaterIonisationStruc
energyConstant.push_back(32.2*eV);
energyConstant.push_back(539.7*eV);
nLevels = energyConstant.size();
nLevels = (G4int)energyConstant.size();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -42,7 +42,7 @@ G4DNAMesh::Voxel& G4DNAMesh::GetVoxel(const Index& key)
Data mapList;
G4DNAMesh::Voxel& voxel =
fVoxelVector.emplace_back(std::make_tuple(key, box, std::move(mapList)));
fIndexMap[key] = fVoxelVector.size() - 1;
fIndexMap[key] = G4int(fVoxelVector.size() - 1);
return voxel;
}
else
@@ -233,4 +233,4 @@ G4VDNAMesh::Index G4DNAMesh::ConvertIndex(const Index& index,
exceptionDescription);
}
return Index{ dx, dy, dz };
}
}
@@ -522,7 +522,7 @@ G4MolecularConfiguration*
G4DNAMolecularMaterial::
GetMolecularConfiguration(const G4Material* material) const
{
int material_id = material->GetIndex();
G4int material_id = (G4int)material->GetIndex();
auto it = fMaterialToMolecularConf.find(material_id);
if(it == fMaterialToMolecularConf.cend()) return nullptr;
return it->second;
@@ -536,7 +536,7 @@ SetMolecularConfiguration(const G4Material* material,
G4MolecularConfiguration* molConf)
{
assert(material != nullptr);
int material_id = material->GetIndex();
G4int material_id = (G4int)material->GetIndex();
fMaterialToMolecularConf[material_id] = molConf;
}
@@ -547,7 +547,7 @@ G4DNAMolecularMaterial::SetMolecularConfiguration(const G4Material* material,
const G4String& molUserID)
{
assert(material != nullptr);
int material_id = material->GetIndex();
G4int material_id = (G4int)material->GetIndex();
fMaterialToMolecularConf[material_id] =
G4MoleculeTable::Instance()->GetConfiguration(molUserID, true);
}
@@ -168,7 +168,7 @@ void G4DNAMolecularReactionData::AddProduct(Reactant* pMolecule)
G4int G4DNAMolecularReactionData::GetNbProducts() const
{
return fProducts.size();
return (G4int)fProducts.size();
}
G4DNAMolecularReactionData::Reactant* G4DNAMolecularReactionData::GetProduct(G4int i) const
@@ -406,7 +406,7 @@ void G4DNAMolecularReactionTable::SetReaction(G4DNAMolecularReactionData* pReact
}
fVectorOfReactionData.emplace_back(pReactionData);
pReactionData->SetReactionID(fVectorOfReactionData.size());
pReactionData->SetReactionID((G4int)fVectorOfReactionData.size());
}
//_____________________________________________________________________________________
@@ -439,7 +439,7 @@ void G4DNAMolecularReactionTable::PrintTable(G4VDNAReactionModel* pReactionModel
G4cout << "Number of chemical species involved in reactions = "
<< fReactantsMV.size() << G4endl;
G4int nbPrintable = fReactantsMV.size() * fReactantsMV.size();
std::size_t nbPrintable = fReactantsMV.size() * fReactantsMV.size();
G4String* outputReaction = new G4String[nbPrintable];
G4String* outputReactionRate = new G4String[nbPrintable];
@@ -447,14 +447,14 @@ void G4DNAMolecularReactionTable::PrintTable(G4VDNAReactionModel* pReactionModel
G4int n = 0;
for (itReactives = fReactantsMV.begin(); itReactives != fReactantsMV.end();
itReactives++)
++itReactives)
{
Reactant* moleculeA = (Reactant*)itReactives->first;
const vector<Reactant*>* reactivesVector = CanReactWith(moleculeA);
if (pReactionModel) pReactionModel->InitialiseToPrint(moleculeA);
G4int nbReactants = fReactantsMV[itReactives->first].size();
G4int nbReactants = (G4int)fReactantsMV[itReactives->first].size();
for (G4int iReact = 0; iReact < nbReactants; iReact++)
{
@@ -520,15 +520,15 @@ void G4DNAMolecularReactionTable::PrintTable(G4VDNAReactionModel* pReactionModel
G4int maxlengthOutputReaction = -1;
G4int maxlengthOutputReactionRate = -1;
for (G4int i = 0; i < n; i++)
for (G4int i = 0; i < n; ++i)
{
if (maxlengthOutputReaction < (G4int)outputReaction[i].length())
{
maxlengthOutputReaction = outputReaction[i].length();
maxlengthOutputReaction = (G4int)outputReaction[i].length();
}
if (maxlengthOutputReactionRate < (G4int)outputReactionRate[i].length())
{
maxlengthOutputReactionRate = outputReactionRate[i].length();
maxlengthOutputReactionRate = (G4int)outputReactionRate[i].length();
}
}
@@ -0,0 +1,114 @@
//
// ********************************************************************
// * 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 "G4DNAPTBExcitationStructure.hh"
#include "G4SystemOfUnits.hh"
G4DNAPTBExcitationStructure::G4DNAPTBExcitationStructure()
{
// taken directly from PTra code by MPietrzak
energyConstant["N2"].push_back( 1.85*eV);
energyConstant["N2"].push_back( 2.15*eV);
energyConstant["N2"].push_back( 8.00*eV);
energyConstant["N2"].push_back( 8.50*eV);
energyConstant["N2"].push_back( 8.60*eV);
energyConstant["N2"].push_back(11.05*eV);
energyConstant["N2"].push_back(11.79*eV);
energyConstant["N2"].push_back(11.90*eV);
energyConstant["N2"].push_back(12.25*eV);
energyConstant["N2"].push_back(12.50*eV);
energyConstant["N2"].push_back(13.01*eV);
energyConstant["N2"].push_back(13.19*eV);
energyConstant["N2"].push_back(13.30*eV);
energyConstant["N2"].push_back(14.33*eV);
energyConstant["N2"].push_back(14.84*eV);
energyConstant["N2"].push_back(15.18*eV);
energyConstant["N2"].push_back(15.70*eV);
energyConstant["N2"].push_back(15.75*eV);
energyConstant["N2"].push_back(15.86*eV);
energyConstant["N2"].push_back(17.36*eV);
energyConstant["N2"].push_back(17.95*eV);
energyConstant["N2"].push_back(19.77*eV);
energyConstant["N2"].push_back(20.79*eV);
energyConstant["N2"].push_back(20.87*eV);
energyConstant["N2"].push_back(22.27*eV);
energyConstant["N2"].push_back(22.83*eV);
energyConstant["N2"].push_back(37.19*eV);
energyConstant["N2"].push_back(38.67*eV);
energyConstant["N2"].push_back(39.23*eV);
for(const auto& [name,levels] : energyConstant)
{
nExcLevels[name] = (G4int)levels.size();
}
}
G4double G4DNAPTBExcitationStructure::ExcitationEnergy(G4int ExcLevel, const G4String& materialName)
{
G4String matNameModif = ReplaceMaterial(materialName);
// check if the material exist in the map
if(energyConstant.find(matNameModif)==energyConstant.end())
{
std::ostringstream oss;
oss << "Material name was not found in energyConstantMap. Problematic material is: "<<matNameModif;
G4Exception("G4DNAPTBExcitationStructure::ExcitationEnergy","em0002",
FatalException, oss.str().c_str());
}
G4double excitation = 0.;
if (ExcLevel >=0 && ExcLevel < nExcLevels[matNameModif]) excitation = energyConstant[matNameModif][ExcLevel];
return excitation;
}
G4int G4DNAPTBExcitationStructure::NumberOfExcLevels(const G4String& materialName)
{
G4String matNameModif = ReplaceMaterial(materialName);
// check if the material exist in the map
if(nExcLevels.find(matNameModif)==nExcLevels.end())
{
std::ostringstream oss;
oss << "Material name was not found in energyConstantMap. Problematic material is: "<<matNameModif;
G4Exception("G4DNAPTBNDExcitationStructure::NumberOfExcLevels","em0002",
FatalException, oss.str().c_str());
}
return nExcLevels[matNameModif];
}
G4String G4DNAPTBExcitationStructure::ReplaceMaterial(const G4String& materialName)
{
G4String materialNameModified (materialName);
if(materialName=="G4_N2") materialNameModified = "N2";
return materialNameModified;
}
@@ -31,6 +31,13 @@
G4DNAPTBIonisationStructure::G4DNAPTBIonisationStructure()
{
// MPietrzak
energyConstant["N2"].push_back(15.58*eV);
energyConstant["N2"].push_back(17.07*eV);
energyConstant["N2"].push_back(21.00*eV);
energyConstant["N2"].push_back(41.72*eV);
// MPietrzak
energyConstant["G4_WATER"].push_back(10.79*eV);
energyConstant["G4_WATER"].push_back(13.39*eV);
energyConstant["G4_WATER"].push_back(16.05*eV);
@@ -150,10 +157,9 @@ G4DNAPTBIonisationStructure::G4DNAPTBIonisationStructure()
energyConstant["TMP"].push_back(559.41*eV);
energyConstant["TMP"].push_back(2178.05*eV);
std::map<G4String, std::vector<G4double> >::iterator it;
for(it=energyConstant.begin();it!=energyConstant.end();it++)
for(auto it=energyConstant.cbegin();it!=energyConstant.cend();++it)
{
nLevels[it->first] = (it->second).size();
nLevels[it->first] = (G4int)(it->second).size();
}
}
@@ -344,7 +344,7 @@ void G4DNAScavengerMaterial::Dump()
G4cout << " --- > For " << pReactant->GetName() << G4endl;
for(auto it2 : it.second)
for(const auto& it2 : it.second)
{
G4cout << " " << G4BestUnit(it2.first, "Time") << " "
<< it2.second / (Avogadro * V * 1.0e-6 /*mm3 to L*/) << G4endl;
@@ -34,7 +34,7 @@ G4DNAWaterExcitationStructure::G4DNAWaterExcitationStructure(): nLevels(5)
energyConstant.push_back(12.61*eV);
energyConstant.push_back(13.77*eV);
nLevels = energyConstant.size();
nLevels = (G4int)energyConstant.size();
}
@@ -34,7 +34,7 @@ G4DNAWaterIonisationStructure::G4DNAWaterIonisationStructure(): nLevels(5)
energyConstant.push_back(32.30*eV);
energyConstant.push_back(539.0*eV);
nLevels = energyConstant.size();
nLevels = (G4int)energyConstant.size();
}
View File
@@ -48,7 +48,7 @@ void TG4MoleculeShoot<G4Track>::ShootAtRandomPosition(G4MoleculeGun* gun)
{
G4ThreeVector positionInLocalCoordinate;
for(int i = 0; i < fNumber; ++i)
for(G4int i = 0; i < fNumber; ++i)
{
RandomPosInBox(*fBoxSize, positionInLocalCoordinate);
gun->BuildAndPushTrack(fMoleculeName,
@@ -62,7 +62,7 @@ void TG4MoleculeShoot<G4Track>::ShootAtRandomPosition(G4MoleculeGun* gun)
template<>
void TG4MoleculeShoot<G4Track>::ShootAtFixedPosition(G4MoleculeGun* gun)
{
for(int i = 0; i < fNumber; ++i)
for(G4int i = 0; i < fNumber; ++i)
{
gun->BuildAndPushTrack(fMoleculeName, fPosition, fTime);
}
@@ -106,7 +106,7 @@ G4MoleculeGun::~G4MoleculeGun()
void G4MoleculeGun::DefineTracks()
{
for (size_t i = 0; i < fShoots.size(); i++)
for (std::size_t i = 0; i < fShoots.size(); i++)
{
fShoots[i]->Shoot(this);
}
@@ -116,7 +116,7 @@ void G4MoleculeGun::DefineTracks()
void G4MoleculeGun::AddMolecule(const G4String& name,
const G4ThreeVector& position,
double time)
G4double time)
{
G4shared_ptr<G4MoleculeShoot> shoot(new TG4MoleculeShoot<G4Track>());
shoot->fMoleculeName = name;
@@ -127,13 +127,13 @@ void G4MoleculeGun::AddMolecule(const G4String& name,
//------------------------------------------------------------------------------
void G4MoleculeGun::AddNMolecules(size_t n,
void G4MoleculeGun::AddNMolecules(std::size_t n,
const G4String& moleculeName,
const G4ThreeVector& position,
double time)
G4double time)
{
G4shared_ptr<G4MoleculeShoot> shoot(new TG4MoleculeShoot<G4Track>());
shoot->fNumber = n;
shoot->fNumber = (G4int)n;
shoot->fMoleculeName = moleculeName;
shoot->fPosition = position;
shoot->fTime = time;
@@ -143,14 +143,14 @@ void G4MoleculeGun::AddNMolecules(size_t n,
//------------------------------------------------------------------------------
void
G4MoleculeGun::AddMoleculesRandomPositionInBox(size_t n,
G4MoleculeGun::AddMoleculesRandomPositionInBox(std::size_t n,
const G4String& moleculeName,
const G4ThreeVector& boxCenter,
const G4ThreeVector& boxSize,
double time)
G4double time)
{
G4shared_ptr<G4MoleculeShoot> shoot(new TG4MoleculeShoot<G4Track>());
shoot->fNumber = n;
shoot->fNumber = (G4int)n;
shoot->fMoleculeName = moleculeName;
shoot->fPosition = boxCenter;
shoot->fBoxSize = new G4ThreeVector(boxSize);
@@ -161,8 +161,8 @@ G4MoleculeGun::AddMoleculesRandomPositionInBox(size_t n,
//------------------------------------------------------------------------------
void G4MoleculeGun::BuildAndPushTrack(const G4String& name,
const G4ThreeVector& position,
double time)
const G4ThreeVector& position,
G4double time)
{
G4MolecularConfiguration* conf =
G4MoleculeTable::Instance()->GetConfiguration(name);
@@ -176,7 +176,7 @@ void G4MoleculeGun::BuildAndPushTrack(const G4String& name,
void G4MoleculeGun::GetNameAndNumber(G4MoleculeGun::NameNumber& output)
{
for(size_t i = 0 ; i < fShoots.size() ; ++i)
for(std::size_t i = 0 ; i < fShoots.size() ; ++i)
{
output[fShoots[i]->fMoleculeName]+=fShoots[i]->fNumber;
}
@@ -218,12 +218,12 @@ G4MoleculeGun::AddMoleculeShoot(G4shared_ptr<G4MoleculeShoot> shoot)
fShoots.push_back(shoot);
}
void G4MoleculeGun::AddMoleculeInCMRepresentation(size_t n,
void G4MoleculeGun::AddMoleculeInCMRepresentation(std::size_t n,
const G4String& moleculeName,
double time)
G4double time)
{
G4shared_ptr<G4MoleculeShoot> shoot(new TG4MoleculeShoot<G4ContinuousMedium>());
shoot->fNumber = n;
shoot->fNumber = (G4int)n;
shoot->fMoleculeName = moleculeName;
shoot->fTime = time;
fShoots.push_back(shoot);
@@ -171,7 +171,7 @@ void G4MoleculeShootMessenger::SetNewValue(G4UIcommand* command, G4String newVal
if(newValue == "CM")
{
// G4cout << "**** Change type" << G4endl;
// TG4MoleculeShoot<G4ContinuousMedium>* casted = reinterpret_cast<TG4MoleculeShoot<G4ContinuousMedium>*>(fpShoot.get());
// TG4MoleculeShoot<G4ContinuousMedium>* casted = static_cast<TG4MoleculeShoot<G4ContinuousMedium>*>(fpShoot.get());
// fpShoot.reset(casted);
fpShoot = fpShoot.get()->ChangeType<G4ContinuousMedium>();
}
@@ -121,7 +121,7 @@ void G4VUserChemistryList::BuildPhysicsTable(G4MoleculeDefinition* moleculeDef)
<< moleculeDef->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;
@@ -130,14 +130,14 @@ void G4VUserChemistryList::BuildPhysicsTable(G4MoleculeDefinition* moleculeDef)
<< 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