-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_root_TSelector_SusySel.C
87 lines (63 loc) · 2.11 KB
/
run_root_TSelector_SusySel.C
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Ask me if you have questions/problems. Thomas M.
// Version 0.1.5
// Start with root runSelector.C
// please read all comments with // !!! up to line 115
// You have to make some changes at various places
#include <string>
#include <vector>
#include <iostream>
#include <stdlib.h>
#include "TROOT.h"
#include "TFile.h"
#include "TTree.h"
#include "TChain.h"
#include "TBranch.h"
#include "TFileCollection.h"
#include <TH2.h>
#include <map>
#include <TColor.h>
#include <TH1.h>
#include <TTree.h>
#include <TNtuple.h>
#include <TCanvas.h>
#include <TStyle.h>
#include <sstream>
#include <iostream>
#include <string>
#include <stdlib.h>
#include <sys/stat.h>
#include <iostream>
#include <math.h>
#include "string.h"
#include "TSystem.h"
#include "TProof.h"
#include "TDSet.h"
#include "TError.h" // for debugging with ddd
void throwException(string str){
// necessary because cint does not handle thrown errors correctly
cout <<"Exception raised "<< str<<endl;
throw(str);
abort();
};
void run_root_TSelector_SusySel(TString InputPath) {
cout<<"Have you set up RootCore via \"source RootCore/scripts/setup.sh\" ?"<<endl;
gSystem->Setenv("ROOTCOREDIR", "/data/etp3/jwittkow/analysis_SUSYTools_03_04/RootCore");
gSystem->SetIncludePath("-I$ROOTCOREDIR/include/");
// gROOT->ProcessLine("#include <vector>");
gROOT->ProcessLine(".x $ROOTCOREDIR/scripts/load_packages.C+");
TString selectorName = "SusySel"; // !!! enter the name of your Selector (without _C.so)
TChain *ch;
ch = new TChain("SusySel");
TString processLine = ".L " + selectorName + ".C++g";
TString execLine;
gROOT->ProcessLine(processLine); // need to add this, or PoD at LRZ will not be able to load the .so
gROOT->ProcessLine(".x $ROOTCOREDIR/scripts/load_packages.C+");
ch->Add(InputPath);
// ch->Add("/data/etp3/jwittkow/analysis_SUSYTools_03_04/WZ_SusySel.root");
Long64_t nEntries = ch->GetEntries();
ch->ls();
cout << "all entries: " << nEntries << endl;
ch->Process("SusySel.C+g");
if (ch) {delete ch; ch=0;}
abort();
}