Import Geant4 11.2.0.beta source tree
This commit is contained in:
@@ -22,9 +22,6 @@
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
@@ -38,86 +35,67 @@
|
||||
// contains a map of G4VMaterialExtension associated with an integer key.
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef G4EXTENDEDMATERIAL_HH
|
||||
#define G4EXTENDEDMATERIAL_HH 1
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include <unordered_map>
|
||||
#include "G4VMaterialExtension.hh" //Needed for hash defintion
|
||||
|
||||
#include <memory>
|
||||
#include "G4VMaterialExtension.hh"//Needed for hash defintion
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
// A map for material extensions based on the hash of the name.
|
||||
// Extensions are owned by the map
|
||||
using G4MaterialExtensionMap=std::unordered_map<G4String, //KEY
|
||||
std::unique_ptr<G4VMaterialExtension>,//VALUE
|
||||
G4MaterialExtensionHash>;//HASHING FUNCTOR
|
||||
using G4MaterialExtensionMap = std::unordered_map<G4String, // KEY
|
||||
std::unique_ptr<G4VMaterialExtension>, // VALUE
|
||||
G4MaterialExtensionHash>; // HASHING FUNCTOR
|
||||
|
||||
class G4ExtendedMaterial : public G4Material
|
||||
{
|
||||
public: // with description
|
||||
//
|
||||
public: // with description
|
||||
// Constructor to create an extended material from the base-class G4Material
|
||||
//
|
||||
G4ExtendedMaterial(const G4String& name, //its name
|
||||
const G4Material* baseMaterial); //base material
|
||||
G4ExtendedMaterial(const G4String& name, // its name
|
||||
const G4Material* baseMaterial); // base material
|
||||
|
||||
//
|
||||
// Constructor to create an extended material from single element
|
||||
//
|
||||
G4ExtendedMaterial(const G4String& name, //its name
|
||||
G4double z, //atomic number
|
||||
G4double a, //mass of mole
|
||||
G4double density, //density
|
||||
G4State state = kStateUndefined, //solid,gas
|
||||
G4double temp = NTP_Temperature, //temperature
|
||||
G4double pressure = CLHEP::STP_Pressure); //pressure
|
||||
G4ExtendedMaterial(const G4String& name, // its name
|
||||
G4double z, // atomic number
|
||||
G4double a, // mass of mole
|
||||
G4double density, // density
|
||||
G4State state = kStateUndefined, // solid,gas
|
||||
G4double temp = NTP_Temperature, // temperature
|
||||
G4double pressure = CLHEP::STP_Pressure); // pressure
|
||||
|
||||
//
|
||||
// Constructor to create an extended material from a combination of elements
|
||||
// and/or materials subsequently added via AddElement and/or AddMaterial
|
||||
//
|
||||
G4ExtendedMaterial(const G4String& name, //its name
|
||||
G4double density, //density
|
||||
G4int nComponents, //nbOfComponents
|
||||
G4State state = kStateUndefined, //solid,gas
|
||||
G4double temp = NTP_Temperature, //temperature
|
||||
G4double pressure = CLHEP::STP_Pressure); //pressure
|
||||
G4ExtendedMaterial(const G4String& name, // its name
|
||||
G4double density, // density
|
||||
G4int nComponents, // nbOfComponents
|
||||
G4State state = kStateUndefined, // solid,gas
|
||||
G4double temp = NTP_Temperature, // temperature
|
||||
G4double pressure = CLHEP::STP_Pressure); // pressure
|
||||
|
||||
//
|
||||
// Constructor to create an extended material from the base extended material
|
||||
//
|
||||
G4ExtendedMaterial(const G4String& name, //its name
|
||||
G4double density, //density
|
||||
const G4ExtendedMaterial* baseMaterial, //base material
|
||||
G4State state = kStateUndefined, //solid,gas
|
||||
G4double temp = NTP_Temperature, //temperature
|
||||
G4double pressure = CLHEP::STP_Pressure); //pressure
|
||||
G4ExtendedMaterial(const G4String& name, // its name
|
||||
G4double density, // density
|
||||
const G4ExtendedMaterial* baseMaterial, // base material
|
||||
G4State state = kStateUndefined, // solid,gas
|
||||
G4double temp = NTP_Temperature, // temperature
|
||||
G4double pressure = CLHEP::STP_Pressure); // pressure
|
||||
|
||||
public:
|
||||
~G4ExtendedMaterial() override = default;
|
||||
~G4ExtendedMaterial() override = default;
|
||||
|
||||
private:
|
||||
G4MaterialExtensionMap fExtensionMap;
|
||||
public: // with description
|
||||
//
|
||||
// register G4VMaterialExtension
|
||||
// This class owns extensions. Register with:
|
||||
// RegisterExtension(std::unique_ptr<MyExtension>(new MyExtension("name")));
|
||||
// or:
|
||||
// RegisteerExtension(std::make_unique<MyExtension>("name"));
|
||||
void RegisterExtension(std::unique_ptr<G4VMaterialExtension> extension);
|
||||
//
|
||||
|
||||
// retrieve G4VMaterialExtension, null pointer is returned if model is not available
|
||||
G4VMaterialExtension* RetrieveExtension(const G4String& name);
|
||||
|
||||
inline G4int GetNumberOfExtensions() const
|
||||
{ return G4int(fExtensionMap.size()); }
|
||||
inline G4int GetNumberOfExtensions() const { return G4int(fExtensionMap.size()); }
|
||||
|
||||
// Retrieve iterators, proxyes to c++ methods. These are const for read-only
|
||||
// access. Use Register/RetreiveExtension to modify map
|
||||
@@ -126,11 +104,11 @@ public: // with description
|
||||
G4MaterialExtensionMap::const_iterator end() const { return fExtensionMap.end(); }
|
||||
G4MaterialExtensionMap::const_iterator cend() const { return fExtensionMap.cend(); }
|
||||
|
||||
public:
|
||||
G4bool IsExtended() const override;
|
||||
void Print(std::ostream& flux) const;
|
||||
G4bool IsExtended() const override;
|
||||
void Print(std::ostream& flux) const;
|
||||
|
||||
private:
|
||||
G4MaterialExtensionMap fExtensionMap;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user