Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:02

0001 // $Id: $
0002 
0003 /*!
0004  * \file PHG4GDMLUtility.hh
0005  * \brief 
0006  * \author Jin Huang <jhuang@bnl.gov>
0007  * \version $Revision:   $
0008  * \date $Date: $
0009  */
0010 
0011 #ifndef CORESOFTWARE_SIMULATION_G4SIMULATION_G4GDML_PHG4GDMLUTILITY_HH_
0012 #define CORESOFTWARE_SIMULATION_G4SIMULATION_G4GDML_PHG4GDMLUTILITY_HH_
0013 
0014 #include <string>
0015 
0016 class G4VPhysicalVolume;
0017 class PHG4GDMLConfig;
0018 class PHCompositeNode;
0019 
0020 /*!
0021  * \brief PHG4GDMLUtility is utility class that drive the PHG4GDMLWriteStructure
0022  */
0023 class PHG4GDMLUtility
0024 {
0025  public:
0026   virtual ~PHG4GDMLUtility() {}
0027 
0028   //! save the current Geant4 geometry to GDML file. Reading PHG4GDMLConfig from topNode
0029   static void Dump_GDML(const std::string &filename, G4VPhysicalVolume *vol, PHCompositeNode *topNode = nullptr);
0030 
0031   //! same as above but use default Geant functions as much as possible
0032   static void Dump_G4_GDML(const std::string &filename, G4VPhysicalVolume *vol);
0033 
0034   static constexpr const char *get_PHG4GDML_Schema()
0035   {
0036     return "http://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd";
0037   }
0038 
0039   //! Get or make the parameter node PHG4GDMLConfig from DST nodes. If not found, make a new one
0040   static PHG4GDMLConfig *GetOrMakeConfigNode(PHCompositeNode *topNode, bool build_new = true);
0041 
0042   static constexpr const char *getDSTNodeName()
0043   {
0044     return "G4GDML_CONFIG";
0045   }
0046 
0047  private:
0048   PHG4GDMLUtility() {}
0049 };
0050 
0051 #endif /* SIMULATION_CORESOFTWARE_SIMULATION_G4SIMULATION_G4GDML_PHG4GDMLUTILITY_HH_ */