21 lines
473 B
C++
21 lines
473 B
C++
|
|
#include "HEP/Geant/Matter.h"
|
|
#include <Geant4/G4Material.hh>
|
|
#include <Geant4/G4NistManager.hh>
|
|
|
|
using namespace uLib::Geant;
|
|
|
|
Material::Material() : m_G4Data(nullptr) {}
|
|
|
|
Material::Material(const char *name) : m_G4Data(nullptr) {
|
|
this->SetFromNist(name);
|
|
}
|
|
|
|
Material::~Material() {
|
|
if(m_G4Data) delete m_G4Data;
|
|
}
|
|
|
|
void Material::SetFromNist(const char *name) {
|
|
G4NistManager* man = G4NistManager::Instance();
|
|
m_G4Data = man->FindOrBuildMaterial(name);
|
|
} |