Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #include <iostream>
0002 #include <string>
0003 #include <vector>
0004 
0005 #include "eic-opticks/g4cx/G4CXOpticks.hh"
0006 #include "eic-opticks/sysrap/NP.hh"
0007 #include "eic-opticks/sysrap/sphoton.h"
0008 
0009 #include "eic-opticks/config.h"
0010 #include "eic-opticks/torch.h"
0011 
0012 using namespace std;
0013 
0014 int main(int argc, char **argv)
0015 {
0016     gphox::Config config("dev");
0017 
0018     cout << config.torch.desc() << endl;
0019 
0020     vector<sphoton> phs = generate_photons(config.torch);
0021 
0022     size_t num_floats = phs.size() * 4 * 4;
0023     float *data = reinterpret_cast<float *>(phs.data());
0024     NP *photons = NP::MakeFromValues<float>(data, num_floats);
0025 
0026     photons->reshape({static_cast<int64_t>(phs.size()), 4, 4});
0027     photons->dump();
0028     photons->save("out/photons.npy");
0029 
0030     return EXIT_SUCCESS;
0031 }