5 #include "inputParameters.h"
18 void starlightinterface_();
24 void pushtrack_(
int *pdg,
int *charge,
float *mass,
float *px,
float *py,
float *pz,
float *e );
25 void pushTrack(
int pdg,
int charge,
float mass,
float px,
float py,
float pz,
float e )
27 pushtrack_( &pdg, &charge, &mass, &px, &py, &pz, &e );
29 void pushtrackreset_();
30 #define pushTrackReset pushtrackreset_
32 #define initHepevtd inithepevtd_
39 starlightinterface_();
47 static std::ofstream par_out;
51 static bool first =
true;
54 par_out.open(
"starlight.in");
59 std::string path = ku_path();
66 size_t found = path.find_last_of(
"/");
67 std::string command = path.substr(found+1);
73 par_out << command.c_str();
80 static bool first =
true;
87 par_out <<
"RND_SEED = 1234 # Dummy (using starsim RNG)" << std::endl;
88 par_out <<
"OUTPUT_FORMAT = 1" << std::endl;
94 _parameters->init(
"./starlight.in" );
97 _starlight -> setInputParameters( _parameters );
106 upcEvent event = _starlight->produceEvent();
111 const std::vector<starlightParticle> &particles = *(
event.getParticles());
112 for (
int i=0;i<particles.size();i++ )
114 float px = particles[i].GetPx();
115 float py = particles[i].GetPy();
116 float pz = particles[i].GetPz();
117 float e = particles[i].GetE();
118 float m = particles[i].M();
119 int q = particles[i].getCharge();
120 int pdg = particles[i].getPdgCode();
130 pushTrack( pdg, q, m, px, py, pz, e );