Back to home page

EIC code displayed by LXR

 
 

    


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

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