GetManualSubruns.C
Go to the documentation of this file.
1 
2 
3 void GetManualSubruns(TString badruns = "ManBadRuns.txt"){
4 
5  TFile file("MetricsTree_All.root","read");
6  TTree *tree = (TTree*)file.Get("mytree");
7 
8  int run, subrun;
9 
10  tree->SetBranchAddress("run",&run);
11  tree->SetBranchAddress("subrun",&subrun);
12 
13  int nentries = tree->GetEntries();
14 
15  int runtemp = 0;
16 
17  ifstream infile(badruns.Data());
18 
19  int rmruns;
20  set<int> runlist;
21 
22  while(infile >> rmruns){
23  runlist.insert(rmruns);
24  }
25 
26  ofstream procfile;
27  procfile.open("ManBadSubruns.txt");
28 
29  for(int i = 0; i < nentries; i++){
30 
31  if(i%(nentries/10)==0) cout << int(100.0*i/nentries+0.5) << "% done" << endl;
32 
33  tree->GetEntry(i);
34 
35  if(runlist.count(run) != 0){
36  procfile << TString::Format("%08d\t%03d",run,subrun) << endl;
37  }
38 
39  }
40 
41  procfile.close();
42 
43 }
string infile
Long64_t nentries
OStream cout
Definition: OStream.cxx:6
void GetManualSubruns(TString badruns="ManBadRuns.txt")
ofstream procfile
TFile * file
Definition: cellShifts.C:17
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154