7 void detectorId(
int *ids=0,
char** cds=0)
10 std::cout <<
"------------------------------" << std::endl;
11 std::cout <<
"detectorId has been deprecated" << std::endl;
12 std::cout <<
"------------------------------" << std::endl;
16 if (!ids) { ids = myIds; cds = myCds; }
19 memset(ids,0,
sizeof(ids[0])*100);
20 memset(cds,0,
sizeof(cds[0])*100);
22 TString myPath(
"$STAR/StRoot/StEvent/StEnumerations.h");
23 gSystem->ExpandPathName(myPath);
25 int notExi = gSystem->AccessPathName(myPath.Data(),kFileExists);
26 if (notExi) { ids[0]=-1;
return;}
27 FILE *fp = fopen(myPath.Data(),
"r");
28 if (!fp) { ids[0]=-1;
return;}
40 if (tb.Index(
"enum")<0)
continue;
41 if (tb.Index(
"StDetectorId")<0)
continue;
42 if (tb.Index(
"=")<0)
continue;
43 if (tb.Index(
"kUnknownId")<0)
continue;
46 tb.ReplaceAll(
" ",
"");
47 if (tb.Index(
"//")==0)
continue;
48 int myK = tb.Index(
"k");
if (myK <0)
break;
49 int myEq= tb.Index(
"=");
if (myEq<0)
break;
50 int myE = tb.Index(
",");
51 if (myE<0) myE = tb.Index(
"}");
54 TString com(tb.Data()+myK,myEq-myK);
55 int id = gROOT->ProcessLineFast(com);
58 cds[ids[0]] =
new char[com.Length()+1];
59 strcpy(cds[ids[0]],com.Data());
61 if (tb[myE]==
'}')
break;
64 for (
int i=1;i<=ids[0];i++) {
65 printf(
"%d = %s\n",ids[i],cds[i]);
75 int nG=0, nGtot=0, nGmax=0;
76 int nG15=0, nG15tot=0, nG15max=0;
77 int nP=0, nPtot=0, nPmax=0;
78 int nP15=0, nP15tot=0, nP15max=0;
80 double times[4] = {0};
87 FILE *fp = fopen(file,
"r");
94 while ((file = it.NextFile())) {
97 if ((num%100)==1) printf(
"%5d - InputFile = %s\n",num,file);
98 FILE *fp = fopen(file,
"r");
99 if (!fp) { printf(
"Wrong file %s\n",file);
continue;}
106 res = strstr(buf,
"StvStEventFiller::fillEvent");
107 if (!res) res = strstr(buf,
"StiStEventFiller::fillEvent");
109 res = strstr(buf,
"global(2):");
111 if (nEv == nEvt)
break;
113 sscanf(res,
"global(2):%d",&nG);
114 nGtot+=nG;
if (nGmax<nG) nGmax=nG;
116 res = strstr(buf,
"GOOD globals:");
118 sscanf(res,
"GOOD globals:%d",&nG15);
119 nG15tot+=nG15;
if (nG15max<nG15) nG15max=nG15;
121 res = strstr(buf,
"fillEventPrimaries");
123 res = strstr(buf,
"(2):");
125 sscanf(res,
"(2):%d",&nP);
126 nPtot+=nP;
if (nPmax<nP) nPmax=nP;
128 res = strstr(buf,
"GOOD:");
130 sscanf(res,
"GOOD:%d",&nP15);
131 nP15tot+=nP15;
if (nP15max<nP15) nP15max=nP15;
136 const char *cpu = strstr(buf,
"Ast =");
139 if (strstr(buf,
"StBFChain::bfc")) kase = 1;
140 if (strstr(buf,
"StiMaker::Sti" )) kase = 2;
141 if (strstr(buf,
"StvMaker::Stv" )) kase = 3;
144 cpuTime = atof(cpu+5);
145 times[kase]+=cpuTime;
151 printf(
"In File(s) %s\n",myfile);
152 printf(
"nFiles =%g nEvents = %d <nEvents>=%d\n",nFile,nEv,nEv/nFile);
153 printf(
"nGlob = %10d <nGlob> = %5d nGlobMax=%5d\n" ,nGtot ,nGtot /nEv,nGmax );
154 printf(
"nGgoo = %10d <nGgoo> = %5d nGgooMax=%5d Ggoo/Gtot=%5.3f\n",nG15tot,nG15tot/nEv,nG15max,
double(nG15tot)/nGtot );
155 printf(
"nPrim = %10d <nPrim> = %5d nPrimMax=%5d Ptot/Gtot=%5.3f\n",nPtot ,nPtot /nEv,nPmax ,
double(nPtot )/nGtot );
156 printf(
"nPgoo = %10d <nPgoo> = %5d nPgooMax=%5d Pgoo/Ggoo=%5.3f\n",nP15tot,nP15tot/nEv,nP15max,
double(nP15tot)/nG15tot);
159 printf(
"CpuTot/Event = %g CpuTot/tracks = %g\n",times[1]/nEv,times[1]/nGtot);
162 printf(
"StiTot/Event = %g StiTot/tracks = %g StiPct=%g%%\n"
163 ,times[2]/nEv,times[2]/nGtot,times[2]/(times[1]-times[2])*100+1e-10);}
165 printf(
"StvTot/Event = %g StvTot/tracks = %g StvPct=%g%%\n"
166 ,times[3]/nEv,times[3]/nGtot,times[3]/(times[1]-times[3])*100+1e-10);}