-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_TSelector_SusyNtuple_Truth_n0150_WH.C
132 lines (99 loc) · 5.25 KB
/
run_TSelector_SusyNtuple_Truth_n0150_WH.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// 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_TSelector_SusyNtuple_Truth_n0150_WH(TString SysUncertType, TString InputPath) {
// TString options = TString(""); //TString(tag.c_str()) ;
// // TString outputfile = "test.root";
// string richtigerString = InputPath;
// // int Position = richtigerString.find("mc12_8TeV.");
// // outputfile = "histos_ZTauTau_" + richtigerString.substr(Position+10,6) + "_proof.root";
//
// int Position = -1;
// Position = richtigerString.find("45_bg");
// if (Position>0){
// outputfile = "histos_test_" + richtigerString.substr(Position+6,2) + ".root";
// }
// else{
// Position = richtigerString.find("45_signal");
// if (Position>0){
// outputfile = "histos_test_" + richtigerString.substr(Position+3,2) + ".root";
// }
// }
// if(outputfile == ""){
// cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
// cout << "EMPTY OUPTPUTFILE STRING" << endl;
// cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
// abort();
// }
// cout << "outputfile= " << outputfile << endl;
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(".x $ROOTCOREDIR/scripts/load_packages.C+");
TString selectorName = "TSelector_SusyNtuple_Truth"; // !!! enter the name of your Selector (without _C.so)
TChain *ch;
ch = new TChain("susyNt");
TString processLine = ".L " + selectorName + ".cpp++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/etp6/jwittkow/SusyNtuples_n0145_bg_new/WZ_SherpaVVtotautauqq/user.sfarrell.mc12_8TeV.157816.Sherpa_CT10_VVtotautauqq.SusyNt.e1515_s1499_s1504_r3658_r3549_p1512_n0145.130708082025/*");
// ch->Add("/nobackup/etp2/Josephine.Wittkowski/SusyNtuples_n0145_data/Egamma/user.sfarrell.group.phys-susy.data12_8TeV.periodA.physics_Egamma.PhysCont.SusyNt.repro14_v01_p1542_n0145.130708161315/user.sfarrell.116519._00003.susyNt.root");
// ch->Add("/nobackup/etp2/Josephine.Wittkowski/SusyNtuples_n0145_data/Egamma/user.sfarrell.group.phys-susy.data12_8TeV.periodA.physics_Egamma.PhysCont.SusyNt.repro14_v01_p1542_n0145.130708161315/*");
// ch->Add("/nobackup/etp2/Josephine.Wittkowski/SusyNtuples_n0145_data/Egamma/user.sfarrell.group.phys-susy.data12_8TeV.periodA.physics_Egamma.PhysCont.SusyNt.repro14_v01_p1542_n0145.130708161341/*");
// ch->Add("/nobackup/etp2/Josephine.Wittkowski/SusyNtuples_n0145_data/Egamma/user.sfarrell.group.phys-susy.data12_8TeV.periodA.physics_Egamma.PhysCont.SusyNt.repro14_v01_p1542_n0145.130708161402/*");
// ch->Add("/nobackup/etp2/Josephine.Wittkowski/SusyNtuples_n0145_data/Egamma/user.sfarrell.group.phys-susy.data12_8TeV.periodA.physics_Egamma.PhysCont.SusyNt.repro14_v01_p1542_n0145.130708161438/*");
// ch->Add("/nobackup/etp2/Josephine.Wittkowski/SusyNtuples_n0150/WH/user.gerbaudo.mc12_8TeV.177501.Herwigpp_sM_wA_noslep_notauhad_WH_2Lep_1.SusyNt.e2149_s1581_s1586_r3658_r3549_p1512_n0150.140109072637/*");
// ch->Add("/data/etp6/jwittkow/user.gerbaudo.mc12_8TeV.126893.Sherpa_CT10_lllnu_WZ.SusyNt.e1434_s1499_s1504_r3658_r3549_p1512_n0145dev4.131220015824/*");
// ch->Add("/data/etp6/jwittkow/SusyNtuples_n0145_bg_new/ttbar105200/*");
// ch->Add("/data/etp6/jwittkow/SusyNtuples_n0145_signal_samples/user.gerbaudo.mc12_8TeV.177503.Herwigpp_sM_wA_noslep_notauhad_WH_2Lep_3.SusyNt.e2149_s1581_s1586_r3658_r3549_p1512_n0145.130806161345/user.gerbaudo.023459._00001.susyNt.root");
Long64_t nEntries = ch->GetEntries();
ch->ls();
cout << "all entries: " << nEntries << endl;
TSelector_SusyNtuple_Truth* SusyNtupleObject = new TSelector_SusyNtuple_Truth();
// SusyNtupleObject->buildSumwMap(ch);
// TString options="NtSys_NOM";
ch->Process(SusyNtupleObject,SysUncertType);
delete SusyNtupleObject;
if (ch) {delete ch; ch=0;}
abort();
}