/*////////////////////////////////////////////////////////////////////////////// // CMT Cosmic Muon Tomography project ////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova All rights reserved Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > ------------------------------------------------------------------ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. //////////////////////////////////////////////////////////////////////////////*/ #ifndef MATTER_H #define MATTER_H #include "Core/Object.h" #include #include class G4Element; namespace uLib { namespace Geant { //////////////////////////////////////////////////////////////////////////////// //// ELEMENT /////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// class Element { public: uLibRefMacro(G4Data,G4Element *) private: G4Element *m_G4Data; }; //////////////////////////////////////////////////////////////////////////////// //// MATERIAL ////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // TODO: finish from G4NistMaterialBuilder class Material : public Object { public: enum State { Undefined = 0, Solid, Liquid, Gas }; virtual const char* GetClassName() const override { return "Geant.Material"; } Material(); Material(const char *name); ~Material(); void SetFromNist(const char *name); template void serialize(Ar &ar) { ar & HRP("name", m_G4Data->GetName()); ar & HRP("density", m_G4Data->GetDensity()); ar & serialization::make_hrp_enum("state", m_G4Data->GetState(), {"Undefined", "Solid", "Liquid", "Gas"}); } G4Material *GetG4Material() { return m_G4Data; } private: G4Material *m_G4Data; }; // class MaterialCompound : public Material { // public: // MaterialCompound(const char *name) {} // void AddMaterial(Material *m, double fractionmass) { m_Materials.push_back(std::make_pair(m, fractionmass)); } // void AddElement(Element *e, double fractionmass) { m_Elements.push_back(std::make_pair(e, fractionmass)); } // void SetDensity(double density) { m_Density = density; } // private: // std::vector> m_Materials; // std::vector> m_Elements; // double m_Density; // }; } } #endif // MATTER_H