#include #include #include #include #define pi 3.14159265358979323844 #define hbarc 197.323 #include "parameters.h" /* various options */ /* #define CHAIN_TESTS */ /* These tests are used for debugging */ /* #define EXTRA_TESTS */ /* #define HOLLYWOOD */ /* This is used if you wish to make movies */ /* #define LOCAL_TEMP_FIND */ /*Produces file to calc. local temp. */ /* end of options*/ /* -------------------------------------------------------------------------*/ /* Cascade Parameters */ #define neventmax 5000 #define npartmax 5000 #define nres 55 // This is the number of particle states defined /* -------------------------------------------------------------------------*/ /* Global Variables */ long IDUM; // used by random number generatro static int g[4]={1,-1,-1,-1}; //usual metric int event_number=0; /* -------------------------------------------------------------------------*/ /* The following contains information about particles */ typedef struct partinfo_struct{ int ires; int next; double r[4]; double p[4]; double b[4]; double mass; double tau; } partinfotype; partinfotype partinfo[npartmax]; int firstpart; int firstemptypart; int npart=0; /* -------------------------------------------------------------------------*/ /* The following contains information about future events */ /* Examples of events are decays, fusions and elastic collisions */ typedef struct eventinfo_struct{ double time; double tau; double delt; int scatcode; int i; int j; int next; } eventinfotype; eventinfotype eventinfo[neventmax]; int firstevent; int firstemptyevent; int n_newevent[neventmax]; double time_newevent[neventmax]; /* -------------------------------------------------------------------------*/ /* The following elements contain information about decays and resonances */ #define nbranchmax 400 typedef struct branchinfo_struct{ int nbodies; int ires[4]; double branching; int nextbranch; } branchinfotype; branchinfotype branchinfo[nbranchmax]; typedef struct resinfo_struct{ int code; double mass; int charge; int baryon; int strangeness; int degen; int decay; double width; double minmass; int firstbranch; } resinfotype; resinfotype resinfo[nres+1]; typedef struct siginfo_struct{ int ires0; double sigpar; int nextsigptr; } siginfotype; int firstsigptr[nres+1][nres+1]; double b2elastic[nres+1][nres+1]; double biggestb2[nres+1][nres+1]; siginfotype siginfo[nbranchmax]; /* -------------------------------------------------------------------------*/ /* Prototypes for functions */ void resonanceinit(void); void shell_sort(int nnewevents,double *,int *); void initpr(int i); void delevent(int n_event,int last_n_event); void addevent(int *firstn,double t,double tau, double delt,int scatcode,int i,int j); void resonancemaker(int ievent,int *kf); void resonancedecay(int ievent,int *kf); void elasticscatter(int ievent,int *kf); int colfind(int i,int j,int *scatcode,double *tevent,double *tau_event, double *delt); int decayfind(int i,int *scatcode,double *tevent,double *tau_event, double *delt); double triangle(double mass0,double mass1,double mass2); void lorentz1(double *u,double *p,double *pprime); void lorentz2(double *u,double *p1,double *p1prime,double *p2,double *p2prime); void lorentz3(double *u,double *p1,double *p1prime,double *p2,double *p2prime,double *p3,double *p3prime); void header_write(void); void write_statements(int netbaryonscat,int *nelas,int *nfusion,int *nbaryonscat); void read_particles(int *n0); double ran2(void); /* These are only used to check collision chains */ #ifdef CHAIN_TESTS void part_chain_test(); void event_chain_test(int nevents); #endif /* This is only used if making intermediate files for checking local var.s */ #ifdef LOCAL_TEMP_FIND void localtemp(int itau); #endif /* -------------------------------------------------------------------------*/ #include "cascade_main.c" #include "cascade_resonanceinitsub.c" #include "cascade_eventfindsubs.c" #include "cascade_eventsubs.c" #include "cascade_miscsubs.c" #include "cascade_inoutsubs.c" #ifdef LOCAL_TEMP_FIND #include "cascade_localtemp.c" #endif