Import Geant4 11.2.0 source tree
This commit is contained in:
+3
-3
@@ -77,11 +77,11 @@ public :
|
||||
return G4FakeParticleID(i);
|
||||
}
|
||||
|
||||
G4FakeParticleID(const int d_) : fValue(d_){;}
|
||||
G4FakeParticleID(const int d_) : fValue(d_){}
|
||||
|
||||
G4FakeParticleID(){fValue=0;}
|
||||
G4FakeParticleID(const G4FakeParticleID & d_) : fValue(d_.fValue){;}
|
||||
inline G4FakeParticleID & operator=(const G4FakeParticleID & rhs) { this->fValue = rhs.fValue; return *this;}
|
||||
G4FakeParticleID(const G4FakeParticleID & d_) = default;
|
||||
inline G4FakeParticleID & operator=(const G4FakeParticleID & rhs) = default;
|
||||
G4FakeParticleID & operator=(const int & rhs) { this->fValue = rhs; return *this;}
|
||||
inline operator int & () { return fValue; }
|
||||
inline operator const int & () const { return fValue; }
|
||||
|
||||
+23
-34
@@ -69,22 +69,21 @@ struct comparator
|
||||
{
|
||||
return totalOcc1 < totalOcc2;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4int occupancy1 = -1;
|
||||
G4int occupancy2 = -1;
|
||||
const G4int sizeOrbit = occ1.GetSizeOfOrbit();
|
||||
for (G4int i = 0; i < sizeOrbit; i++)
|
||||
{
|
||||
occupancy1 = occ1.GetOccupancy(i);
|
||||
occupancy2 = occ2.GetOccupancy(i);
|
||||
|
||||
if (occupancy1 != occupancy2)
|
||||
{
|
||||
return occupancy1 < occupancy2;
|
||||
}
|
||||
G4int occupancy1 = -1;
|
||||
G4int occupancy2 = -1;
|
||||
const G4int sizeOrbit = occ1.GetSizeOfOrbit();
|
||||
for (G4int i = 0; i < sizeOrbit; i++)
|
||||
{
|
||||
occupancy1 = occ1.GetOccupancy(i);
|
||||
occupancy2 = occ2.GetOccupancy(i);
|
||||
|
||||
if (occupancy1 != occupancy2)
|
||||
{
|
||||
return occupancy1 < occupancy2;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -99,9 +98,7 @@ class G4MolecularConfiguration
|
||||
{
|
||||
public:
|
||||
|
||||
typedef std::function<double(const G4Material*,
|
||||
double,
|
||||
const G4MolecularConfiguration*)> G4DiffCoeffParam;
|
||||
using G4DiffCoeffParam = std::function<double (const G4Material *, double, const G4MolecularConfiguration *)>;
|
||||
|
||||
//____________________________________________________________________________
|
||||
// Static methods
|
||||
@@ -342,8 +339,7 @@ public:
|
||||
class G4MolecularConfigurationManager
|
||||
{
|
||||
public:
|
||||
G4MolecularConfigurationManager() :
|
||||
fMoleculeCreationMutex()
|
||||
G4MolecularConfigurationManager()
|
||||
{
|
||||
fLastMoleculeID = -1;
|
||||
}
|
||||
@@ -420,29 +416,22 @@ public:
|
||||
private:
|
||||
|
||||
//__________________________________________________________________________
|
||||
typedef std::map<G4ElectronOccupancy,
|
||||
G4MolecularConfiguration*,
|
||||
comparator> ElectronOccupancyTable;
|
||||
typedef std::map<const G4MoleculeDefinition*,
|
||||
ElectronOccupancyTable > MolElectronConfTable;
|
||||
using ElectronOccupancyTable = std::map<G4ElectronOccupancy, G4MolecularConfiguration *, comparator>;
|
||||
using MolElectronConfTable = std::map<const G4MoleculeDefinition *, ElectronOccupancyTable>;
|
||||
MolElectronConfTable fElecOccTable;
|
||||
|
||||
//__________________________________________________________________________
|
||||
typedef std::map<int,
|
||||
G4MolecularConfiguration*> ChargeTable;
|
||||
typedef std::map<const G4MoleculeDefinition*,
|
||||
ChargeTable> MolChargeConfTable;
|
||||
using ChargeTable = std::map<int, G4MolecularConfiguration *>;
|
||||
using MolChargeConfTable = std::map<const G4MoleculeDefinition *, ChargeTable>;
|
||||
MolChargeConfTable fChargeTable;
|
||||
|
||||
//__________________________________________________________________________
|
||||
typedef std::map<const G4String,
|
||||
G4MolecularConfiguration*> LabelTable;
|
||||
typedef std::map<const G4MoleculeDefinition*,
|
||||
std::map<const G4String, G4MolecularConfiguration*> > MolLabelConfTable;
|
||||
using LabelTable = std::map<const G4String, G4MolecularConfiguration *>;
|
||||
using MolLabelConfTable = std::map<const G4MoleculeDefinition *, std::map<const G4String, G4MolecularConfiguration *>>;
|
||||
MolLabelConfTable fLabelTable;
|
||||
|
||||
//__________________________________________________________________________
|
||||
typedef std::map<G4String, G4MolecularConfiguration*> UserIDTable;
|
||||
using UserIDTable = std::map<G4String, G4MolecularConfiguration *>;
|
||||
UserIDTable fUserIDTable;
|
||||
|
||||
//__________________________________________________________________________
|
||||
@@ -550,7 +539,7 @@ inline G4int G4MolecularConfiguration::GetMoleculeID() const
|
||||
inline void G4MolecularConfiguration::SetLabel(const G4String& label)
|
||||
{
|
||||
assert(fLabel == 0 || *fLabel == "");
|
||||
if(fLabel == 0)
|
||||
if(fLabel == nullptr)
|
||||
{
|
||||
fLabel = new G4String(label);
|
||||
}
|
||||
@@ -563,7 +552,7 @@ inline void G4MolecularConfiguration::SetLabel(const G4String& label)
|
||||
|
||||
inline const G4String& G4MolecularConfiguration::GetLabel() const
|
||||
{
|
||||
if(fLabel == 0)
|
||||
if(fLabel == nullptr)
|
||||
fLabel = new G4String();
|
||||
|
||||
return (*fLabel);
|
||||
|
||||
+1
-2
@@ -65,8 +65,7 @@ class G4MolecularConfiguration;
|
||||
|
||||
namespace G4DNA
|
||||
{
|
||||
typedef std::map<const G4MolecularConfiguration*,
|
||||
std::vector<const G4MolecularDissociationChannel*> > ChannelMap;
|
||||
using ChannelMap = std::map<const G4MolecularConfiguration *, std::vector<const G4MolecularDissociationChannel *>>;
|
||||
}
|
||||
//______________________________________________________________________________
|
||||
|
||||
|
||||
@@ -101,10 +101,10 @@ class G4Molecule : public G4IT
|
||||
public:
|
||||
// With Description
|
||||
|
||||
ITDef(G4Molecule)
|
||||
ITDef(G4Molecule) // NOLINT because it's a macro
|
||||
|
||||
//From G4VUserTrackInformation
|
||||
void Print() const;
|
||||
void Print() const override;
|
||||
|
||||
// new/delete operators are overloded to use G4Allocator
|
||||
inline void *operator new(size_t);
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
return GetMoleculeID();
|
||||
}
|
||||
|
||||
virtual G4ITType GetITSubType() const
|
||||
G4ITType GetITSubType() const override
|
||||
{
|
||||
return GetMoleculeID();
|
||||
}
|
||||
@@ -154,13 +154,13 @@ public:
|
||||
|
||||
G4Molecule(const G4MolecularConfiguration*);
|
||||
|
||||
virtual ~G4Molecule();
|
||||
~G4Molecule() override;
|
||||
|
||||
//-------- Methods -------------------------------
|
||||
//Get from static definition
|
||||
/** Returns the name of the molecule
|
||||
*/
|
||||
const G4String& GetName() const;
|
||||
const G4String& GetName() const override;
|
||||
|
||||
/** Returns the formated name of the molecule
|
||||
*/
|
||||
@@ -302,7 +302,7 @@ extern G4DLLIMPORT G4Allocator<G4Molecule>*& aMoleculeAllocator();
|
||||
inline void * G4Molecule::operator new(size_t)
|
||||
//////////////////////////
|
||||
{
|
||||
if (!aMoleculeAllocator())
|
||||
if (aMoleculeAllocator() == nullptr)
|
||||
{
|
||||
aMoleculeAllocator() = new G4Allocator<G4Molecule>;
|
||||
}
|
||||
|
||||
+3
-3
@@ -87,7 +87,7 @@ public:
|
||||
G4String aType = "",
|
||||
G4FakeParticleID ID = G4FakeParticleID::Create());
|
||||
|
||||
virtual ~G4MoleculeDefinition();
|
||||
~G4MoleculeDefinition() override;
|
||||
|
||||
G4MoleculeDefinition(const G4MoleculeDefinition&) = delete;
|
||||
G4MoleculeDefinition& operator=(const G4MoleculeDefinition&) = delete;
|
||||
@@ -260,7 +260,7 @@ inline const G4String& G4MoleculeDefinition::GetType() const
|
||||
|
||||
inline G4int G4MoleculeDefinition::GetNbElectrons() const
|
||||
{
|
||||
if (fElectronOccupancy)
|
||||
if (fElectronOccupancy != nullptr)
|
||||
{
|
||||
return fElectronOccupancy->GetTotalOccupancy();
|
||||
}
|
||||
@@ -271,7 +271,7 @@ inline G4int G4MoleculeDefinition::GetNbElectrons() const
|
||||
|
||||
inline G4int G4MoleculeDefinition::GetNbMolecularShells() const
|
||||
{
|
||||
if (fElectronOccupancy)
|
||||
if (fElectronOccupancy != nullptr)
|
||||
{
|
||||
return fElectronOccupancy->GetSizeOfOrbit();
|
||||
}
|
||||
|
||||
+1
-1
@@ -47,5 +47,5 @@
|
||||
#define G4MoleculeFinder_hh 1
|
||||
#include "G4ITFinder.hh"
|
||||
#include "G4Molecule.hh"
|
||||
typedef G4ITFinder<G4Molecule> G4MoleculeFinder;
|
||||
using G4MoleculeFinder = G4ITFinder<G4Molecule>;
|
||||
#endif
|
||||
|
||||
+2
-3
@@ -53,7 +53,7 @@
|
||||
|
||||
class G4Molecule;
|
||||
|
||||
typedef G4shared_ptr<const G4Molecule> G4MoleculeHandle;
|
||||
using G4MoleculeHandle = std::shared_ptr<const G4Molecule>;
|
||||
|
||||
class G4MoleculeHandleManager
|
||||
{
|
||||
@@ -73,8 +73,7 @@ private:
|
||||
G4bool operator()(const G4Molecule* mol1, const G4Molecule* mol2) const;
|
||||
};
|
||||
|
||||
typedef std::map<const G4Molecule*, G4MoleculeHandle,
|
||||
G4MoleculeHandleManager::CompMoleculePointer> MoleculeHandleMap;
|
||||
using MoleculeHandleMap = std::map<const G4Molecule *, G4MoleculeHandle, G4MoleculeHandleManager::CompMoleculePointer>;
|
||||
MoleculeHandleMap fMoleculeHandle;
|
||||
};
|
||||
|
||||
|
||||
+9
-13
@@ -52,7 +52,7 @@ template<typename MOLECULE>
|
||||
class G4MoleculeIterator
|
||||
{
|
||||
protected:
|
||||
typedef std::map<G4String, MOLECULE*> MAP;
|
||||
using MAP = std::map<G4String, MOLECULE *>;
|
||||
MAP* fMap;
|
||||
G4bool fDefined;
|
||||
typename MAP::iterator fIt;
|
||||
@@ -65,9 +65,7 @@ public:
|
||||
}
|
||||
|
||||
virtual ~G4MoleculeIterator()
|
||||
{
|
||||
|
||||
}
|
||||
= default;
|
||||
|
||||
G4MoleculeIterator(const G4MoleculeIterator& right)
|
||||
{
|
||||
@@ -89,14 +87,14 @@ public:
|
||||
{
|
||||
if (!fDefined) return false;
|
||||
fIt++;
|
||||
return fIt != fMap->end() ? true : false;
|
||||
return static_cast<G4bool>(fIt != fMap->end());
|
||||
}
|
||||
|
||||
G4bool operator++()
|
||||
{
|
||||
if (!fDefined) return false;
|
||||
fIt++;
|
||||
return fIt != fMap->end() ? true : false;
|
||||
return static_cast<G4bool>(fIt != fMap->end());
|
||||
}
|
||||
|
||||
void reset()
|
||||
@@ -106,18 +104,16 @@ public:
|
||||
|
||||
G4bool operator()()
|
||||
{
|
||||
if (fDefined == false)
|
||||
if (!fDefined)
|
||||
{
|
||||
fDefined = true;
|
||||
fIt = fMap->begin();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
fIt++;
|
||||
}
|
||||
if (fIt == fMap->end()) return false;
|
||||
return true;
|
||||
|
||||
fIt++;
|
||||
|
||||
return static_cast<G4bool>(fIt != fMap->end());
|
||||
}
|
||||
|
||||
const G4String& Name()
|
||||
|
||||
+3
-3
@@ -55,8 +55,8 @@ class G4MoleculeDefinition;
|
||||
class G4MolecularConfiguration;
|
||||
class G4MoleculeTableMessenger;
|
||||
|
||||
typedef G4MoleculeIterator<G4MoleculeDefinition> G4MoleculeDefinitionIterator;
|
||||
typedef G4MoleculeIterator<G4MolecularConfiguration> G4ConfigurationIterator;
|
||||
using G4MoleculeDefinitionIterator = G4MoleculeIterator<G4MoleculeDefinition>;
|
||||
using G4ConfigurationIterator = G4MoleculeIterator<G4MolecularConfiguration>;
|
||||
|
||||
class G4MoleculeTable
|
||||
{
|
||||
@@ -131,7 +131,7 @@ protected:
|
||||
G4MoleculeTable();
|
||||
|
||||
static G4MoleculeTable* fpgMoleculeTable;
|
||||
typedef std::map<G4String, G4MoleculeDefinition*> MoleculeDefTable;
|
||||
using MoleculeDefTable = std::map<G4String, G4MoleculeDefinition *>;
|
||||
|
||||
MoleculeDefTable fMoleculeDefTable;
|
||||
std::unique_ptr<G4MoleculeTableMessenger> fMoleculeDefTableMessenger;
|
||||
|
||||
+1
-1
@@ -81,6 +81,6 @@ public:
|
||||
protected :
|
||||
G4VMolecularDissociationDisplacer() = default;
|
||||
|
||||
G4int fVerbose;
|
||||
G4int fVerbose{0};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user