Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:03

0001 /**
0002 G4CX_U4TreeCreateCSGFoundryTest.cc
0003 ====================================
0004 
0005 1. creates Geant4 pv with U4VolumeMaker::PV which is configured via GEOM envvar,
0006    see also U4SolidMaker::Make for implemented names and to add more
0007 2. applies U4Tree::Create populating an stree
0008 3. invokes CSGFoundry::CreateFromSim which imports the stree
0009 4. saves the CSGFoundry to $FOLD
0010 
0011 **/
0012 
0013 #include "SLOG.hh"
0014 #include "SSim.hh"
0015 #include "U4Tree.h"
0016 #include "CSGFoundry.h"
0017 #include "U4VolumeMaker.hh"
0018 
0019 struct G4CX_U4TreeCreateCSGFoundryTest
0020 {
0021     const G4VPhysicalVolume* world ;
0022     SSim* sim ;
0023     stree*  st ;
0024     U4Tree* tr ;
0025     CSGFoundry* fd ;
0026 
0027     G4CX_U4TreeCreateCSGFoundryTest();
0028 };
0029 
0030 inline G4CX_U4TreeCreateCSGFoundryTest::G4CX_U4TreeCreateCSGFoundryTest()
0031     :
0032     world(U4VolumeMaker::PV()),
0033     sim(SSim::CreateOrReuse()),
0034     st(sim->get_tree()),
0035     tr(U4Tree::Create(st,world,nullptr)),
0036     fd(nullptr)
0037 {
0038     sim->initSceneFromTree();
0039     fd = CSGFoundry::CreateFromSim();
0040     fd->save("$FOLD");
0041 }
0042 
0043 int main()
0044 {
0045     G4CX_U4TreeCreateCSGFoundryTest t ;
0046     return 0 ;
0047 }