/************************************************ * usr_fill_event.c * This routine is called from usr_analysis.c to * fill the stdhep common blocks with smeared mc track * information. * Paul Eugenio * Carnegie Mellon University * 1 Oct 98 * Last Modified: 11 Nov 99 **********************************************/ #include #include #include #include #include #include void hfn_(int *,float *); /****************** * Local Structure ******************/ typedef struct { double x,y,z; } dvector3_t; typedef struct { double t; dvector3_t space; } dvector4_t; typedef struct { int statusCode; /* 1 indicates a final state particle */ int pid; /* the PDG MC numbering scheme */ double mass; dvector4_t p; /* four momentum */ dvector3_t v; /* a point on the track */ }mc_part_t; #define MAX_PARTS 200 void usr_fill_event(int nparts){ int ret; static int written=0; mc_part_t parts[MAX_PARTS]; /* * get the fortran common block structure */ fill_parts(nparts,parts); /* * fill the stdhep event stucture */ fill_hepevt(nparts, parts); if(!(++written %100)) fprintf(stderr,"McFast events Written: %d\r",written); } /******************** * fill_parts *******************/ int fill_parts(int nparts, mc_part_t *part){ int i,k,id,hb_nt=1; float value,weight=1.0 ,nTuple_values[100]; extern struct trk_off_c trk_off_c_ ; double tmpdf,stmpdf; extern int Debug; for(i=0;i