63 void TrimBeamLineFiles(
const char* input,
const char* output=
"out.list",
64 int min=2500,
double fudgefactor=1.0);
80 void TrimBeamLineFiles(
const char* input,
const char* output,
81 int min,
double fudgefactor) {
84 out =
new ofstream(output);
89 if (strcmp(line1,
"fill")) {
92 in >> line2 >> line2 >> line2 >> line2 >> line2;
99 while (!in.eof() && ct<1024) {
100 if (fill != oldfill && fill>0) {
101 numfiles += flush_fill();
106 in >> nper[ct] >> nfiles[ct] >> goodb >> line1 >> line2;
107 good[ct] = fudgefactor * goodb;
112 numfiles += flush_fill();
113 printf(
"Total file count = %d\n",numfiles);
126 for (k=0;k<ct;k++) totgood += good[k];
128 int mfiles = minfiles;
131 Bool_t happy = kFALSE;
134 double mctratio = ((double) mfiles)/((double) ct);
135 double fneed = TMath::Max(minimum/totgood,mctratio);
136 fneed = TMath::Min(fneed,1.0);
142 while (nused<mfiles && giveup<gaveup) {
143 gRandom->RndmArray(ct,
using);
149 Bool_t last_k = (k==(ct-1) || nper[k] != nper[k+1]);
152 if (last_k && rused==0 && good[k]>750)
using[k] = 0.0;
153 if (good[k]<50)
using[k]=1.0;
154 if (
using[k] <= fneed) {
164 if (tcount < minimum && mfiles < ct) {
166 mfiles = TMath::Max(mfiles+1,(
int) (fneed*ct));
174 if (
using[k] <= fneed) (*out) << fname[k].Data() << endl;
176 printf(
"Guess for fill %d = %f (%d files)\n",oldfill,tcount,nused);
178 printf(
"^^^^^ WARNING ^^^^^ Below minimum=%d\n",(
int) minimum);