StRoot
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
StEEmcUtil
database
macros
upload
writeIdealStat.C
1
void
writeIdealStat(){
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,
"stat-%02d"
,k+1);
11
FILE *file=fopen(title,
"w"
); assert(file);
12
fprintf(file,
"#sector%02d/eemcPMTstat\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\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\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\n"
,mapt);
33
}
34
}
35
}
36
37
fclose(file);
38
}
// end of sector
39
40
system(
"mv stat* idealPedStatus"
);
41
42
}
Generated by
1.8.5