Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:50:00

0001 #pragma once
0002 /**
0003 U4Material.hh
0004 =================
0005 
0006 HMM: make this header-only .h ?
0007 
0008 **/
0009 
0010 #include <vector>
0011 #include <string>
0012 #include <map>
0013 
0014 #include "plog/Severity.h"
0015 
0016 struct NP ; 
0017 struct NPFold ; 
0018 
0019 class G4Material ; 
0020 class G4MaterialPropertiesTable ;
0021 #include "G4MaterialPropertyVector.hh"
0022 #include "U4_API_EXPORT.hh"
0023 
0024 struct U4_API U4Material
0025 {
0026     static const plog::Severity LEVEL ; 
0027 
0028     static std::string DescMaterialTable(); 
0029     static void GetMaterialNames( std::vector<std::string>& names, bool extras=false); 
0030     static const char* FindMaterialName(const char* volname); 
0031 
0032     static constexpr const char* SCINTILLATOR = "SCINTILLATOR" ; 
0033     static constexpr const char* VACUUM = "VACUUM" ; 
0034 
0035     static G4Material* Get(const char* name);
0036     static G4Material* Get_(const char* name);
0037     static G4Material* Vacuum(const char* name);
0038     static G4MaterialPropertyVector* GetProperty(const G4Material* mat, const char* name); 
0039     static G4MaterialPropertyVector* GetProperty(const char* mname, const char* pname); 
0040 
0041     static void GetMinMaxValue( double& mn , double& mx, const G4MaterialPropertyVector* prop ); 
0042     static std::string DescProperty(const G4MaterialPropertyVector* prop); 
0043     static std::string DescProperty( const char* mname, const char* pname);  
0044     static std::string DescProperty(const char* mname); 
0045     static std::string DescProperty(); 
0046 
0047 
0048     static void RemoveProperty( const char* key, G4Material* mat ); 
0049 
0050     static void GetPropertyNames( std::vector<std::string>& names, const G4Material* mat ) ; 
0051     static NPFold* MakePropertyFold(const G4Material* mat ); 
0052     static NPFold* MakePropertyFold_flat(); 
0053     static NPFold* MakePropertyFold(); 
0054     static NPFold* MakePropertyFold(std::vector<const G4Material*>& mats); 
0055 
0056     static bool HasMPT(const G4Material* mat); 
0057     static void SetMPT(G4Material* mat, G4MaterialPropertiesTable* mpt); 
0058 
0059     static std::string DescPropertyNames( const G4Material* mat ); 
0060 
0061 
0062     static G4MaterialPropertiesTable* MakeMaterialPropertiesTable(const char* reldir); 
0063     static G4MaterialPropertiesTable* MakeMaterialPropertiesTable(const char* reldir, const char* keys, char delim ); 
0064 
0065     static G4MaterialPropertyVector* MakeProperty( double value ); 
0066     static G4MaterialPropertyVector* MakeProperty(const NP* a); 
0067     static NP* MakePropertyArray( double value ); 
0068     static NP* MakeStandardArray(
0069           std::vector<const G4Material*>& mats,
0070           const std::map<std::string,G4PhysicsVector*>& prop_override
0071        ); 
0072 
0073     static char Classify(const NP* a); 
0074     static std::string Desc(const char* key, const NP* a ); 
0075 
0076     static G4MaterialPropertiesTable*  MakeMaterialPropertiesTable_FromProp(
0077          const char* a_key=nullptr, const G4MaterialPropertyVector* a_prop=nullptr,
0078          const char* b_key=nullptr, const G4MaterialPropertyVector* b_prop=nullptr,
0079          const char* c_key=nullptr, const G4MaterialPropertyVector* c_prop=nullptr,
0080          const char* d_key=nullptr, const G4MaterialPropertyVector* d_prop=nullptr
0081      ); 
0082 
0083 
0084     static G4Material* MakeWater(const char* name="Water"); 
0085 
0086     static G4Material* MakeMaterial(const G4MaterialPropertyVector* rindex, const char* name="Water") ;
0087     static G4Material* MakeMaterial(const char* name, const char* reldir, const char* props ); 
0088     static G4Material* MakeMaterial(const char* name, const char* reldir); 
0089 
0090     static G4Material* MakeScintillator(); 
0091 
0092 
0093     static constexpr const char* LIBDIR = "$IDPath/GMaterialLib" ;   // TODO: USING IDPath NOT ACCEPTABLE IN NEW WORKFLOW
0094     static G4Material* LoadOri(const char* name); 
0095     static void ListOri(std::vector<std::string>& names); 
0096     static void LoadOri(); 
0097 
0098 
0099 
0100     static int GetIndex(const std::vector<G4String>& nn, const char* key ); 
0101     static int GetPropertyIndex( const G4MaterialPropertiesTable* mpt, const char* key ); 
0102     static G4MaterialPropertyVector* AddProperty( G4MaterialPropertiesTable* mpt, const char* key, const std::vector<double>& dom, const std::vector<double>& val , bool reverse ); 
0103 
0104     static void LoadBnd(const char* ssimdir=nullptr); 
0105     static void KludgeRemoveRockRINDEX();  // static
0106 
0107 
0108 };