Import Geant4 11.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2024-12-06 11:11:40 +01:00
parent e58e650b32
commit 32390e802b
1984 changed files with 98713 additions and 83996 deletions
@@ -230,7 +230,7 @@ void G4tgbGeometryDumper::DumpPVPlacement(G4VPhysicalVolume* pv,
*rotMat = (*rotMat).inverse();
pvName += "_refl";
}
G4String rotName = DumpRotationMatrix(rotMat);
const G4String& rotName = DumpRotationMatrix(rotMat);
G4ThreeVector pos = pv->GetTranslation();
if(copyNo == -999) // for parameterisations copy number is provided
@@ -238,8 +238,8 @@ void G4tgbGeometryDumper::DumpPVPlacement(G4VPhysicalVolume* pv,
copyNo = pv->GetCopyNo();
}
G4String fullname = pvName + "#" + G4UIcommand::ConvertToString(copyNo) +
"/" + pv->GetMotherLogical()->GetName();
const G4String& fullname = pvName + "#" + G4UIcommand::ConvertToString(copyNo)
+ "/" + pv->GetMotherLogical()->GetName();
if(!CheckIfPhysVolExists(fullname, pv))
{
@@ -414,7 +414,7 @@ void G4tgbGeometryDumper::DumpPVReplica(G4PVReplica* pv, const G4String& lvName)
break;
}
G4String fullname = lvName + "/" + pv->GetMotherLogical()->GetName();
const G4String& fullname = lvName + "/" + pv->GetMotherLogical()->GetName();
if(!CheckIfPhysVolExists(fullname, pv))
{
@@ -463,14 +463,14 @@ G4String G4tgbGeometryDumper::DumpLogVol(G4LogicalVolume* lv,
}
//---- Dump solid
G4String solidName = DumpSolid(solid, extraName);
const G4String& solidName = DumpSolid(solid, extraName);
//---- Dump material
if(mate == nullptr)
{
mate = lv->GetMaterial();
}
G4String mateName = DumpMaterial(mate);
const G4String& mateName = DumpMaterial(mate);
//---- Dump logical volume (solid + material)
(*theFile) << ":VOLU " << SubstituteRefl(AddQuotes(lvName)) << " "
@@ -485,7 +485,7 @@ G4String G4tgbGeometryDumper::DumpLogVol(G4LogicalVolume* lv,
// --------------------------------------------------------------------
G4String G4tgbGeometryDumper::DumpMaterial(G4Material* mat)
{
G4String mateName = GetObjectName(mat, theMaterials);
const G4String& mateName = GetObjectName(mat, theMaterials);
if(theMaterials.find(mateName) != theMaterials.cend()) // alredy dumped
{
return mateName;
@@ -559,7 +559,7 @@ G4String G4tgbGeometryDumper::DumpMaterial(G4Material* mat)
// --------------------------------------------------------------------
void G4tgbGeometryDumper::DumpElement(G4Element* ele)
{
G4String elemName = GetObjectName(ele, theElements);
const G4String& elemName = GetObjectName(ele, theElements);
if(theElements.find(elemName) != theElements.cend()) // alredy dumped
{
@@ -605,7 +605,7 @@ void G4tgbGeometryDumper::DumpElement(G4Element* ele)
// --------------------------------------------------------------------
void G4tgbGeometryDumper::DumpIsotope(G4Isotope* isot)
{
G4String isotName = GetObjectName(isot, theIsotopes);
const G4String& isotName = GetObjectName(isot, theIsotopes);
if(theIsotopes.find(isotName) != theIsotopes.cend()) // alredy dumped
{
return;
@@ -725,11 +725,10 @@ void G4tgbGeometryDumper::DumpBooleanVolume(const G4String& solidType,
pos = G4ThreeVector();
}
G4String bsoName = GetObjectName(so, theSolids);
if(theSolids.find(bsoName) != theSolids.cend())
return; // alredy dumped
G4String solid0Name = FindSolidName(solid0);
G4String solid1Name = FindSolidName(solid1);
const G4String& bsoName = GetObjectName(so, theSolids);
if(theSolids.find(bsoName) != theSolids.cend()) return; // alredy dumped
const G4String& solid0Name = FindSolidName(solid0);
const G4String& solid1Name = FindSolidName(solid1);
(*theFile) << ":SOLID " << AddQuotes(bsoName) << " " << AddQuotes(solidType)
<< " " << AddQuotes(solid0Name) << " " << AddQuotes(solid1Name)
@@ -750,16 +749,16 @@ void G4tgbGeometryDumper::DumpMultiUnionVolume( G4VSolid* so)
std::vector<G4String> rotList;
for( G4int iso = 0; iso < nSolids; iso++ ) {
G4Transform3D trans = muun->GetTransformation(iso);
G4String rotName = DumpRotationMatrix( new G4RotationMatrix(trans.getRotation()));
const G4String& rotName = DumpRotationMatrix( new G4RotationMatrix(trans.getRotation()));
rotList.push_back(rotName);
G4VSolid* solN = muun->GetSolid(iso);
DumpSolid(solN);
}
G4String bsoName = GetObjectName(const_cast<G4VSolid*>(so), theSolids);
const G4String& bsoName = GetObjectName(const_cast<G4VSolid*>(so), theSolids);
(*theFile) << ":SOLID " << AddQuotes(bsoName) << " MULTIUNION "
<< nSolids;
for( G4int iso = 0; iso < nSolids; iso++ ) {
for( G4int iso = 0; iso < nSolids; ++iso ) {
G4VSolid* solN = muun->GetSolid(iso);
G4Transform3D trans = muun->GetTransformation(iso);
G4ThreeVector pos = trans.getTranslation(); // translation is of mother frame
@@ -1109,7 +1108,7 @@ std::vector<G4double> G4tgbGeometryDumper::GetSolidParams(const G4VSolid* so)
}
else
{
G4String ErrMessage = "Solid type not supported, sorry... " + solidType;
const G4String& ErrMessage = "Solid type not supported, sorry... " + solidType;
G4Exception("G4tgbGeometryDumper::DumpSolidParams()", "NotImplemented",
FatalException, ErrMessage);
}
@@ -1298,7 +1297,7 @@ G4String G4tgbGeometryDumper::GetIsotopeName(G4Isotope* isot)
// with same name
for(;; ++ii)
{
G4String newIsotName =
const G4String& newIsotName =
isotName + "_" + G4UIcommand::ConvertToString(ii);
std::map<G4String, G4Isotope*>::const_iterator ite2 =
theIsotopes.find(newIsotName);
@@ -1354,7 +1353,7 @@ G4String G4tgbGeometryDumper::GetObjectName(
G4int ii = 2;
for(;; ++ii)
{
G4String newObjName = objName + "_" + G4UIcommand::ConvertToString(ii);
const G4String& newObjName = objName + "_" + G4UIcommand::ConvertToString(ii);
typename std::map<G4String, TYP*>::const_iterator ite2 =
objectsDumped.find(newObjName);
if(ite2 == objectsDumped.cend())
+15 -15
View File
@@ -251,10 +251,10 @@ G4int G4tgrFileIn::GetWordsInLine(std::vector<G4String>& wordlist)
else if(comment > 0)
{
stemp = stemp.substr(0, comment);
wordlist.push_back(stemp);
wordlist.push_back(std::move(stemp));
break;
}
wordlist.push_back(stemp);
wordlist.push_back(std::move(stemp));
}
// These two algorithms should be the more STL-like way, but they don't
@@ -294,9 +294,9 @@ G4int G4tgrFileIn::GetWordsInLine(std::vector<G4String>& wordlist)
{
if(imerge != 1)
{
G4String err1 = " word with trailing '\"' while there is no";
G4String err2 = " previous word with leading '\"' in line ";
G4String err = err1 + err2;
const G4String& err1 = " word with trailing '\"' while there is no";
const G4String& err2 = " previous word with leading '\"' in line ";
const G4String& err = err1 + err2;
DumpException(err);
}
imerge = 2;
@@ -334,13 +334,13 @@ G4int G4tgrFileIn::GetWordsInLine(std::vector<G4String>& wordlist)
}
if(imerge == 1)
{
G4String err1 = " word with leading '\"' in line while there is no";
G4String err2 = " later word with trailing '\"' in line ";
G4String err = err1 + err2;
const G4String& err1 = " word with leading '\"' in line while there is no";
const G4String& err2 = " later word with trailing '\"' in line ";
const G4String& err = err1 + err2;
DumpException(err);
}
wordlist = wordlist2;
wordlist = std::move(wordlist2);
// Or why not like this (?):
// typedef std::istream_iterator<G4String, ptrdiff_t> string_iter;
@@ -433,10 +433,10 @@ void G4tgrFileIn::Close()
// --------------------------------------------------------------------
void G4tgrFileIn::DumpException(const G4String& sent)
{
G4String Err1 = sent + " in file " + theName;
G4String Err2 =
" line No: " + G4UIcommand::ConvertToString(theLineNo[theCurrentFile]);
G4String ErrMessage = Err1;
G4Exception("G4tgrFileIn::DumpException()", "FileError", FatalException,
ErrMessage);
const G4String& Err1 = sent + " in file " + theName;
const G4String& Err2 =
", line No: " + G4UIcommand::ConvertToString(theLineNo[theCurrentFile]);
const G4String& ErrMessage = Err1 + Err2;
G4Exception("G4tgrFileIn::DumpException()", "FileError",
FatalException, ErrMessage);
}
+1 -1
View File
@@ -150,7 +150,7 @@ void G4tgrSolid::FillSolidParams(const std::vector<G4String>& wl)
apar.clear();
apar.insert(0);
apar.insert(4);
angleParams["TWISTED_TUBS"] = apar;
angleParams["TWISTED_TUBS"] = std::move(apar);
std::vector<G4double>* vd = new std::vector<G4double>;
theSolidParams.push_back(vd);
@@ -90,7 +90,7 @@ G4tgrSolidMultiUnion::G4tgrSolidMultiUnion(const std::vector<G4String>& wl)
{
wl2[ii] = (char)std::toupper(wl2[ii]);
}
theType = wl2;
theType = std::move(wl2);
#ifdef G4VERBOSE
if(G4tgrMessenger::GetVerboseLevel() >= 1)
@@ -65,7 +65,7 @@ G4tgrSolidScaled::G4tgrSolidScaled(const std::vector<G4String>& wl)
{
wl2[ii] = (char)std::toupper(wl2[ii]);
}
theType = wl2;
theType = std::move(wl2);
#ifdef G4VERBOSE
if(G4tgrMessenger::GetVerboseLevel() >= 1)