StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
writeIdealPed.C
1 void writeIdealPed(){
2 
3  const int etabin=12;
4  const int strip=288;
5  char title[100], tow[100], mapt[100];
6 
7  system("mkdir -p idealPedStatus/");
8 
9  for (int k=0;k<etabin;k++){
10  sprintf(title,"ped.sector%02d",k+1);
11  FILE *file=fopen(title,"w"); assert(file);
12  fprintf(file,"#sector%02d/eemcPMTped\n",k+1);
13  //tower files
14  for (char zub='A';zub<='E';zub++){
15  for (int j=0;j<etabin;j++){
16  sprintf(tow,"%02dT%c%02d",k+1,zub,j+1);
17  fprintf(file,"%s 0.0 1.0\n",tow);
18  }
19  }
20  // SMD
21  for (char zub='U';zub<='V';zub++){
22  for (int j=0;j<strip;j++){
23  sprintf(mapt,"%02d%c%03d",k+1,zub,j+1);
24  fprintf(file,"%s 0.0 0.7\n",mapt);
25  }
26  }
27  // pre/post
28  for (char zub='P';zub<='R';zub++){
29  for (char sub='A';sub<='E';sub++){
30  for (int j=0;j<etabin;j++){
31  sprintf(mapt,"%02d%c%c%02d",k+1,zub,sub,j+1);
32  fprintf(file,"%s 0.0 0.7\n",mapt);
33  }
34  }
35  }
36 
37  fclose(file);
38  }// end of sector
39 
40  system("mv ped* idealPedStatus/");
41 
42 }