Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 07:49:32

0001 /**
0002 CSGOptiXServiceTest
0003 ======================
0004 
0005 The actual FastAPI connected service needs to be
0006 in python using a binding to the very high level
0007 CSGOptiXService API. So this test is for refining the
0008 very high level API that will be used from python via
0009 nanobind.
0010 
0011 Note the similarity to the embedded G4CXOpticks usage
0012 from within JUNOSW can use techniques from there like
0013 the embedded logging
0014 
0015 **/
0016 
0017 #include "OPTICKS_LOG.hh"
0018 #include "SEvt.hh"
0019 #include "CSGOptiXService.h"
0020 
0021 int main(int argc, char** argv)
0022 {
0023     OPTICKS_LOG(argc, argv);
0024 
0025     CSGOptiXService cxs ;
0026 
0027 
0028     NP* gs = nullptr ;
0029     int eventID = 0 ;
0030 
0031     // in server-client situation the gensteps and eventID
0032     // will arrive in HTTP request body and headers
0033     {
0034         SEvt* sev = SEvt::Get_EGPU();
0035         sev->setIndex(eventID);
0036         // need to set index before creating input genstep
0037         // for the number of photons config to work
0038         gs = sev->createInputGenstep_configured();
0039     }
0040 
0041     assert( gs );
0042     gs->set_meta<int>("eventID", eventID );  // required by QSim::simulate
0043 
0044 
0045     std::cout << "gs: " << ( gs ? gs->sstr() : "-" ) << "\n" ;
0046 
0047     NP* ht = cxs.simulate(gs, eventID );
0048 
0049     std::cout << "ht: " << ( ht ? ht->sstr() : "-" ) << "\n" ;
0050 
0051     return 0 ;
0052 }