diff --git a/source/geometry/navigation/src/G4Navigator.cc b/source/geometry/navigation/src/G4Navigator.cc index 7e0821f1a..34af7495c 100644 --- a/source/geometry/navigation/src/G4Navigator.cc +++ b/source/geometry/navigation/src/G4Navigator.cc @@ -1050,7 +1050,7 @@ G4double G4Navigator::ComputeStep( const G4ThreeVector& pGlobalpoint, << " (local position: " << newLocalPoint << ")" << G4endl << " (local direction: " << localDirection << ")." << G4endl << " Previous phys volume: '" - << ( fLastMotherPhys ? fLastMotherPhys->GetName() : "" ) + << ( fLastMotherPhys ? fLastMotherPhys->GetName() : G4String{ "" }) << "'" << G4endl << G4endl; if( actAndReport || abandon ) { diff --git a/source/processes/hadronic/cross_sections/include/G4FastPathHadronicCrossSection.hh b/source/processes/hadronic/cross_sections/include/G4FastPathHadronicCrossSection.hh index de5c864ad..e545e1303 100644 --- a/source/processes/hadronic/cross_sections/include/G4FastPathHadronicCrossSection.hh +++ b/source/processes/hadronic/cross_sections/include/G4FastPathHadronicCrossSection.hh @@ -296,8 +296,8 @@ inline void getCrossSectionCount::SampleZandA() { inline std::ostream& operator<<(std::ostream& os, const G4FastPathHadronicCrossSection::fastPathEntry& fp) { using CLHEP::MeV; - os<<"#Particle: "<<(fp.particle!=nullptr?fp.particle->GetParticleName():"UNDEFINED")<<"\n"; - os<<"#Material: "<<(fp.material!=nullptr?fp.material->GetName():"UNDEFINED")<<"\n"; + os << "#Particle: " << (fp.particle != nullptr ? fp.particle->GetParticleName() : G4String{ "UNDEFINED" }) << "\n"; + os << "#Material: " << (fp.material != nullptr ? fp.material->GetName() : G4String{ "UNDEFINED" }) << "\n"; os<<"#min_cutoff(MeV): "<GetParticleName():"UNDEFINED")<<","; - os<<(mat!=nullptr?mat->GetName():"UNDEFINED")<<"} found, but no fast path defined"; + os << "#Cache entry for {" << (pd != nullptr ? pd->GetParticleName() : G4String{ "UNDEFINED" }) << ","; + os << (mat != nullptr ? mat->GetName() : G4String{ "UNDEFINED" }) << "} found, but no fast path defined"; } } else { - os<<"#Cache entry for {"<<(pd!=nullptr?pd->GetParticleName():"UNDEFINED")<<","; - os<<(mat!=nullptr?mat->GetName():"UNDEFINED")<<"} not found."; + os << "#Cache entry for {" << (pd != nullptr ? pd->GetParticleName() : G4String{ "UNDEFINED" }) << ","; + os << (mat != nullptr ? mat->GetName() : G4String{ "UNDEFINED" }) << "} not found."; } } diff --git a/source/processes/solidstate/phonon/src/G4LatticeManager.cc b/source/processes/solidstate/phonon/src/G4LatticeManager.cc index 3d5137c97..cde07da6e 100644 --- a/source/processes/solidstate/phonon/src/G4LatticeManager.cc +++ b/source/processes/solidstate/phonon/src/G4LatticeManager.cc @@ -211,13 +211,13 @@ G4LatticeLogical* G4LatticeManager::GetLattice(G4Material* Mat) const { if (latFind != fLLatticeList.end()) { if (verboseLevel) G4cout << "G4LatticeManager::GetLattice found " << latFind->second - << " for " << (Mat?Mat->GetName():"NULL") << "." << G4endl; + << " for " << (Mat ? Mat->GetName() : G4String{ "NULL" }) << "." << G4endl; return latFind->second; } if (verboseLevel) G4cerr << "G4LatticeManager:: Found no matching lattices for " - << (Mat?Mat->GetName():"NULL") << "." << G4endl; + << (Mat ? Mat->GetName() : G4String{ "NULL" }) << "." << G4endl; return 0; // No lattice associated with volume } @@ -230,13 +230,13 @@ G4LatticePhysical* G4LatticeManager::GetLattice(G4VPhysicalVolume* Vol) const { if (latFind != fPLatticeList.end()) { if (verboseLevel) G4cout << "G4LatticeManager::GetLattice found " << latFind->second - << " for " << (Vol?Vol->GetName():"default") << "." << G4endl; + << " for " << (Vol ? Vol->GetName() : G4String{ "default" }) << "." << G4endl; return latFind->second; } if (verboseLevel) G4cerr << "G4LatticeManager::GetLattice found no matching lattices for " - << (Vol?Vol->GetName():"default") << "." << G4endl; + << (Vol ? Vol->GetName() : G4String{ "default" }) << "." << G4endl; return 0; // No lattice associated with volume }