void create_STS_geo_file(char *geometry="sts-3maps-4strips") { // macro to create STS geometry description files for CBMROOT // from a data table // Johann M. Heuser, GSI // v1.0 29 Jul 2005 // v1.1 06 Feb 2006 changed to write 2-digit station numbers // v1.2 24 May 2006 only MAPS stations 1,2,(3 if present) are // placed in vacuum "pipevac1", otherwhise in "cave" char infile[256]; // geometry data file - input char outfile[256]; // geometry data file for CBMROOT - output char logfile[256]; // log file for the conversion const Int_t max = 20; // max. number of stations Float_t d[max]; // detector thickness [mm] Float_t ri[max]; // inner radius [mm] Float_t ro[max]; // outer radius [mm] Float_t z[max]; // z position from target [mm] Float_t ai[max]; // inner acceptance [deg] Float_t ao[max]; // outer acceptance [deg] char type[20][max]; // detector type Int_t n,nn; // counters char dummy[20]; //dummy text Float_t area[max]; // area [cm**2] printf("geometry: %s\n",geometry); sprintf(infile,"%s.dat",geometry); sprintf(outfile,"%s.geo",geometry); sprintf(logfile,"%s.log",geometry); printf("input file: %s\n",infile); if(!fopen(infile,"r")){ printf("... does not exist.\n"); printf("... exit.\n\n"); } else{ printf("output file: %s\n",outfile); printf("log file: %s\n",logfile); printf("converting ...\n"); FILE *fin= fopen(infile,"r"); fscanf (fin, "%s",dummy); fscanf (fin, "%d", &n); for(Int_t i=0; i<16; i++){ fscanf (fin, "%s",dummy); } for(Int_t i=0; i