toRoot(char *filename="") { /* Author: G. Bonomi Date: 9 June 2005 This macro open a data file containing the list of runs to translate from rzf to root (one run per line) and apply the command h2root to all of them. For each .rzf file a .root file is created */ FILE *rdat; int nrun=0,runs[2000],check,sl; char name[100],comando[200]; if (!strcmp(filename,"")) { printf("Please pass a filename as an argument:\n [0].x toRoot.C(\"exam.dat\")\n"); return; } /* It opens the file with the list of runs to be analyzed */ rdat=fopen(filename,"r"); if(rdat==NULL) { printf("File doesn't exist\n"); return; } while(check=fscanf(rdat,"%d",&runs[nrun])>-1){ nrun++; } fclose(rdat); /* ---> <--- */ for(int i=0; i