SamFileNameToRunSubrun.C
Go to the documentation of this file.
1 
2 void SamFileNameToRunSubrun(TString filelist="listTestSAM"){
3 
4  ofstream runfile;
5  runfile.open(filelist+"_test.txt");
6 
7  ifstream fileListItr((filelist+".txt").Data());
8 // int run;
9 // int subrun;
10 
11  TString omFileName;
12  TString run, subrun;
13 
14  int thisFile = 0;
15 
16  while(fileListItr >> omFileName){
17 
18  run = omFileName(8,8);
19  subrun = omFileName(18,2);
20 
21  runfile << run+"\t0"+subrun << endl;
22 
23  thisFile++;
24 
25  if(thisFile%50000==0) cout << thisFile << " files done" << endl;
26 
27  }
28 
29  cout << "Finished " << thisFile << " files" << endl;
30 
31  runfile.close();
32 
33 }
OStream cout
Definition: OStream.cxx:6
TFile * thisFile
ifstream fileListItr("ManBadSubruns.txt")
void SamFileNameToRunSubrun(TString filelist="listTestSAM")