File indexing completed on 2025-08-05 08:16:50
0001 #ifndef PHGEOMETRY_PHGEOMUTILITY_H
0002 #define PHGEOMETRY_PHGEOMUTILITY_H
0003
0004 #include <string>
0005
0006 class PHCompositeNode;
0007 class TGeoManager;
0008 class PHGeomTGeo;
0009 class PHGeomIOTGeo;
0010
0011
0012 class PHGeomUtility
0013 {
0014 public:
0015
0016 static TGeoManager *
0017 GetTGeoManager(PHCompositeNode *topNode);
0018
0019
0020 static int
0021 ImportGeomFile(PHCompositeNode *topNode, const std::string &geometry_file);
0022
0023
0024 static int
0025 ImportCurrentTGeoManager(PHCompositeNode *topNode);
0026
0027
0028 static void
0029 ExportGeomtry(PHCompositeNode *topNode, const std::string &geometry_file);
0030
0031
0032 static PHGeomTGeo *
0033 GetGeomTGeoNode(PHCompositeNode *topNode, bool build_new = true);
0034
0035
0036 static PHGeomIOTGeo *
0037 GetGeomIOTGeoNode(PHCompositeNode *topNode, bool build_new = true);
0038
0039
0040
0041 static PHGeomIOTGeo *
0042 UpdateIONode(PHCompositeNode *topNode);
0043
0044
0045
0046 static PHGeomTGeo *
0047 LoadFromIONode(PHCompositeNode *topNode);
0048
0049
0050
0051
0052 static std::string
0053 GenerateGeometryFileName(const std::string &filename_extension = "gdml");
0054
0055
0056 static bool
0057 RemoveGeometryFile(const std::string &file_name);
0058
0059
0060 static void SetVerbosity(int v);
0061
0062
0063 static int GetVerbosity();
0064
0065
0066 static std::string
0067 GetDSTNodeName()
0068 {
0069 return std::string("GEOMETRY");
0070 }
0071
0072
0073 static std::string
0074 GetDSTIONodeName()
0075 {
0076 return std::string("GEOMETRY_IO");
0077 }
0078
0079
0080
0081 static void SetGenerateGeometryFileNameBase(const std::string &base) { mg_GenerateGeometryFileNameBase = base; }
0082
0083 private:
0084 PHGeomUtility() = delete;
0085 ~PHGeomUtility() = delete;
0086
0087
0088
0089 static std::string mg_GenerateGeometryFileNameBase;
0090 };
0091
0092 #endif