// ESAF : Euso Simulation and Analysis Framework // CorsikaFileShowerGenerator.hh #ifndef __CORSIKAFILESHOWERGENERATOR_HH_ #define __CORSIKAFILESHOWERGENERATOR_HH_ #include "euso.hh" #include "EventGenerator.hh" #include "Config.hh" #include "ShowerTrack.hh" #include "EsafMsgSource.hh" #include "EConst.hh" class PhysicsData; class ShowerTrack; class MCTruth; class CorsikaFileShowerGenerator : public EventGenerator , public EsafMsgSource { public: // ctor CorsikaFileShowerGenerator(); // dtor ~CorsikaFileShowerGenerator(); // get a new event PhysicsData *Get(); // get pointer to MonteCarlo Truth MCTruth *GetTruth(); // get ready for next event virtual void Reset() {} //FIXME : to be implemented virtual void ReplaceInputFile(const char*, const char* ); void Open(); void Close(); // read Corsika Output Files void ReadParticleHeader(); void ReadLong(); float GetAltitude(float); float GetThickness(float); float GetCoeff(float); float GetXstep(float); float GetYstep(float); float GetStepTime(float); float GetAge(float); EsafConfigClass(Generators, CorsikaFileShowerGenerator) private: ShowerTrack *fTrack; ShowerStep fStep; FILE* fParticleFile; FILE* fLongFile; MCTruth *fTruth; string fParticleFileName, fLongFileName; bool LoadTrack(Int_t) ; bool LoadHeader() ; map fHeader; string thinning; double howmany; double r; multimap particle; multimap::iterator pnum; float vertical_distance; float coeff_i, coeff_f; float xi, xf, yi, yf, zi, zf; float z_firstint, thick_firstint; float epolangd, eaziangd; float timei, timef; float distance; float energy; float thickness; float Nemax, to, tmax; float eldircos, emdircos, endircos; float x0comes, y0comes, z0comes; size_t nin, nkey; char header[4]; int i,j, k; int n1, n2, nmax; Int_t nev_an; Int_t ev_num, event; long int pos; char longitudinal[150]; float xmax, ymax, zmax; float nstep; float step_long; int nshow; float part[10], en[10]; float step[6]; float aatm[5], batm[5], catm[5]; ClassDef(CorsikaFileShowerGenerator,0) }; #endif /* __CORSIKAFILESHOWERGENERATOR_HH_ */