#include #include #include #define PI 3.141592 #define TPCRADIUS 2.466 // Reads file with data in the following order: // // number of tracks, vx, vy, vz, magnetic field => esd-summary // mass, charge, px, py, pz => esd-detail // // For now, we are considering classical mechanics, so p = mv (without relativistic considerations) void main() { int i, j, numberOfTracks; double vx, vy, vz, w, Rx, Ry, Rz, B, radius, t, dt; double gamaX[2], gamaY[2]; FILE *detail, *summary; summary = fopen("esd-summary.dat","r"); // filename must be "esd-summary.dat" detail = fopen("esd-detail.dat","r"); // filename must be "esd-detail.dat" do { // Reads summary file until number of tracks is different than zero (there are tracks in the event) fscanf(summary,"%d %lf %lf %lf %lf\n",&numberOfTracks, &vx,&vy,&vz,&B); } while (numberOfTracks == 0); vx = 0.01 * vx; // Vertexes are now in meters vy = 0.01 * vy; vz = 0.01 * vz; B = 0.1 * B; // Magnetic field is now in Tesla double m[numberOfTracks], q[numberOfTracks], px[numberOfTracks], py[numberOfTracks], pz[numberOfTracks]; for (i=0;i