FileNameToRunSubrun.C
Go to the documentation of this file.
1 
2 void FileNameToRunSubrun(TString filelist="listFiles", bool isNewRel=true, bool isDev=true){
3 
4  ofstream runfile;
5  runfile.open(filelist+"_test.txt");
6 
7  ifstream fileListItr((filelist+".txt").Data());
8 
9  TString omFileName;
10  TString run, subrun;
11 
12  int thisFile = 0;
13 
14  while(fileListItr >> omFileName){
15 
16  if(isDev){
17  run = omFileName(52,8);
18  }
19 
20 
21 
22  else if(isNewRel){
23  run = omFileName(50,8);
24  }
25 
26 
27  else{
28  run = omFileName(51,8);
29  }
30 
31 
32  runfile << run << endl;
33 
34  thisFile++;
35 
36  if(thisFile%50000==0) cout << thisFile << " files done" << endl;
37 
38  }
39 
40  cout << "Finished " << thisFile << " files" << endl;
41 
42  runfile.close();
43 
44 }
void FileNameToRunSubrun(TString filelist="listFiles", bool isNewRel=true, bool isDev=true)
OStream cout
Definition: OStream.cxx:6
TFile * thisFile
ifstream fileListItr("ManBadSubruns.txt")