Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /**
0002 G4CXSimulateTest.cc
0003 ====================
0004 
0005 GGeo creation done when starting from gdml or live G4, still needs Opticks instance,  
0006 TODO: avoid this by replacing with automated SOpticks instanciated by OPTICKS_LOG
0007 and reimplemnting geometry translation in a new more direct "Geo" package  
0008 
0009 Formerly did "U4Material::LoadBnd()" here in main 
0010 which created G4 materials from the persisted bnd.npy 
0011 that requires CFBASE or OPTICKS_KEY to derive it
0012 in order to load SSim from $CFBase/CSGFoundry/SSim)
0013 
0014 Clearly that is not acceptable when running from live Geant4 or GDML,
0015 so cannot U4Material::LoadBnd from main. 
0016 
0017 The new workflow equivalent would be to access the SSim instance
0018 and get the bnd.npy arrays that way.  
0019 
0020 **/
0021 
0022 #include <cuda_runtime.h>
0023 #include "OPTICKS_LOG.hh"
0024 #include "SEventConfig.hh"
0025 #include "G4CXOpticks.hh"
0026 
0027 int main(int argc, char** argv)
0028 {
0029     OPTICKS_LOG(argc, argv); 
0030 
0031     LOG(info) << "[ cu first " ; 
0032     cudaDeviceSynchronize(); 
0033     LOG(info) << "] cu first " ; 
0034 
0035     SEventConfig::SetDebugLite(); // controls which and dimensions of SEvt arrays 
0036 
0037     G4CXOpticks* gx = G4CXOpticks::SetGeometry() ;  
0038 
0039     int eventID = 0 ; 
0040     bool end = true ; 
0041 
0042     gx->simulate(eventID, end); 
0043 
0044     return 0 ; 
0045 }