-
Notifications
You must be signed in to change notification settings - Fork 0
/
simpleRunner.csh
executable file
·71 lines (52 loc) · 1.69 KB
/
simpleRunner.csh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/csh
cp hzg_selector_Template.C hzg_selector.C
tar -xzf plugins.tar.gz
tar -xzf src.tar.gz
tar -xzf PhysicsTools.tar.gz
sed -i "s/SUFFIX/$1/g" hzg_selector.C
cat > run.C << +EOF
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cstdlib>
using namespace std;
void run() {
gROOT->ProcessLine("#include <TLorentzVector.h>");
gROOT->LoadMacro("src/TCPhysObject.cc+");
gROOT->LoadMacro("src/TCJet.cc+");
gROOT->LoadMacro("src/TCMET.cc+");
gROOT->LoadMacro("src/TCElectron.cc+");
gROOT->LoadMacro("src/TCMuon.cc+");
gROOT->LoadMacro("src/TCTau.cc+");
gROOT->LoadMacro("src/TCPhoton.cc+");
gROOT->LoadMacro("src/TCGenJet.cc+");
gROOT->LoadMacro("src/TCGenParticle.cc+");
gROOT->LoadMacro("src/TCPrimaryVtx.cc+");
gROOT->LoadMacro("src/TCTriggerObject.cc+");
gROOT->LoadMacro("plugins/HistManager.cc+");
gROOT->LoadMacro("plugins/TriggerSelector.cc+");
TChain* fChain = new TChain("ntupleProducer/eventTree");
ifstream sourceFiles("$1.txt");
char line[128];
int count = 0;
cout<<"Adding files from $1 to chain..."<<endl;
while (sourceFiles >> line) {
fChain->Add(line);
++count;
}
cout<<count<<" files added!"<<endl;
sourceFiles.close();
TStopwatch timer;
timer.Start();
// fChain->Process("simple_v2.C+");
fChain->Process("hzg_selector.C++");
cout << "\n\nDone!" << endl;
cout << "CPU Time : " << timer.CpuTime() << endl;
cout << "RealTime : " << timer.RealTime() << endl;
cout << "\n";
}
+EOF
root -l -b -q run.C
rm -f run.C
rm -f hzg_selector.C