40 |
|
// |
41 |
|
// |
42 |
|
|
43 |
< |
void makeNtuple(){ |
43 |
> |
void makeNtuple(int iflag=0){ |
44 |
> |
|
45 |
> |
//------------------------------ |
46 |
> |
// Check the flags |
47 |
> |
//------------------------------ |
48 |
> |
if (iflag < 1 || iflag > 6) { |
49 |
> |
cout << "Usage:" << endl; |
50 |
> |
cout << "makeNtuple(1) for T1tttt" << endl; |
51 |
> |
cout << "makeNtuple(2) for glstop lsp50" << endl; |
52 |
> |
cout << "makeNtuple(3) for glstop lsp250" << endl; |
53 |
> |
cout << "makeNtuple(4) for glsbottom chi150" << endl; |
54 |
> |
cout << "makeNtuple(5) for glsbottom chi300" << endl; |
55 |
> |
cout << "makeNtuple(6) for glsbottom sbpair" << endl; |
56 |
> |
return; |
57 |
> |
} |
58 |
> |
//--------------------------------------------------- |
59 |
> |
// This the model name, used for the root file name |
60 |
> |
//---------------------------------------------------- |
61 |
> |
if (iflag == 1) modelName = "T1tttt"; |
62 |
> |
if (iflag == 2) modelName = "glstop50"; |
63 |
> |
if (iflag == 3) modelName = "glstop250"; |
64 |
> |
if (iflag == 4) modelName = "glsb150"; |
65 |
> |
if (iflag == 5) modelName = "glsb300"; |
66 |
> |
if (iflag == 6) modelName = "sbpair"; |
67 |
|
|
68 |
|
//----------------------------------------------- |
69 |
|
// The name of the file with the output ntuple |
70 |
|
//----------------------------------------------- |
71 |
< |
char* ntFile = "ntuple.root"; |
71 |
> |
char* ntFile = Form("ntuple_%s.root",modelName); |
72 |
|
cout << "The output ntuple will be: " << ntFile << endl; |
73 |
|
|
74 |
|
//----------------------------------------------- |
75 |
< |
// Read in the gluino pair production xsection |
75 |
> |
// Read in the gluino or sbottom pair production xsection |
76 |
|
//----------------------------------------------- |
77 |
|
float xsec_mass[2000]; |
78 |
|
float xsec[2000]; |
79 |
|
float xsecup[2000]; |
80 |
|
float xsecdwn[2000]; |
81 |
|
int nxsec=0; |
82 |
< |
char* xsecFile = "../xsec/xsec_gluino.txt"; |
82 |
> |
char* xsecFile; |
83 |
> |
if (iflag == 6) { |
84 |
> |
xsecFile = "../xsec/xsec_sbottom.txt"; |
85 |
> |
} else { |
86 |
> |
xsecFile = "../xsec/xsec_gluino.txt"; |
87 |
> |
} |
88 |
|
ifstream fromfile(Form("%s",xsecFile)); |
89 |
|
if ( !fromfile.good() ) { |
90 |
|
cout << "gluino xsec file does not exist" << endl ; |
91 |
|
return; |
92 |
|
} |
93 |
< |
cout << "Reading gluino xsection from " << xsecFile << endl; |
93 |
> |
cout << "Reading xsection from " << xsecFile << endl; |
94 |
|
// cout << "ASSUMING THAT THE XSEC IS IN fb...TURN IT INTO pb" << endl; |
95 |
|
int xs=0; |
96 |
|
while (!fromfile.eof()) { |
137 |
|
|
138 |
|
//----------------------------------------------- |
139 |
|
// The file names, ordered by signal region... |
140 |
+ |
// Again, have to sort out the file names |
141 |
|
//----------------------------------------------- |
142 |
+ |
char* fileWhere; |
143 |
+ |
if (iflag == 1) fileWhere = "../T1tttt/L2_T1tttt"; |
144 |
+ |
if (iflag == 2) fileWhere = "../glstop/lsp50/L2_lsp50"; |
145 |
+ |
if (iflag == 3) fileWhere = "../glstop/lsp250/L2_lsp250"; |
146 |
+ |
if (iflag == 4) fileWhere = "../glsbottom/chi150/L2_chi150"; |
147 |
+ |
if (iflag == 5) fileWhere = "../glsbottom/chi300/L2_chi300"; |
148 |
+ |
if (iflag == 6) fileWhere = "../sbottompair/L2_sbottompair"; |
149 |
|
vector<TString> filenames; |
150 |
< |
filenames.push_back("../T1tttt/L2_T1tttt_SR0_CC.txt"); |
151 |
< |
filenames.push_back("../T1tttt/L2_T1tttt_SR1_CC.txt"); |
152 |
< |
filenames.push_back("../T1tttt/L2_T1tttt_SR2_CC.txt"); |
153 |
< |
filenames.push_back("../T1tttt/L2_T1tttt_SR3_CC.txt"); |
154 |
< |
filenames.push_back("../T1tttt/L2_T1tttt_SR4_CC.txt"); |
155 |
< |
filenames.push_back("../T1tttt/L2_T1tttt_SR5_CC.txt"); |
156 |
< |
filenames.push_back("../T1tttt/L2_T1tttt_SR6_CC.txt"); |
157 |
< |
filenames.push_back("../T1tttt/L2_T1tttt_SR7_CC.txt"); |
158 |
< |
filenames.push_back("../T1tttt/L2_T1tttt_SR8_CC.txt"); |
150 |
> |
for (int kk=0; kk<9; kk++) { |
151 |
> |
filenames.push_back(Form("%s_SR%d_CC.txt", fileWhere,kk)); |
152 |
> |
cout << "Will read from file " << filenames[kk] << endl; |
153 |
> |
} |
154 |
> |
//filenames.push_back("../sbottompair/L2_sbottompair_SR0_CC.txt"); |
155 |
> |
//filenames.push_back("../sbottompair/L2_sbottompair_SR1_CC.txt"); |
156 |
> |
//filenames.push_back("../sbottompair/L2_sbottompair_SR2_CC.txt"); |
157 |
> |
//filenames.push_back("../sbottompair/L2_sbottompair_SR3_CC.txt"); |
158 |
> |
//filenames.push_back("../sbottompair/L2_sbottompair_SR4_CC.txt"); |
159 |
> |
//filenames.push_back("../sbottompair/L2_sbottompair_SR5_CC.txt"); |
160 |
> |
//filenames.push_back("../sbottompair/L2_sbottompair_SR6_CC.txt"); |
161 |
> |
//filenames.push_back("../sbottompair/L2_sbottompair_SR7_CC.txt"); |
162 |
> |
//filenames.push_back("../sbottompair/L2_sbottompair_SR8_CC.txt"); |
163 |
|
|
164 |
|
|
165 |
|
//----------------------------------------------- |
186 |
|
nentries[ireg]++; |
187 |
|
} |
188 |
|
fromfile.close(); |
189 |
< |
// the last entry is junk |
189 |
> |
// the last entry is junk |
190 |
|
nentries[ireg] = nentries[ireg]-1; |
191 |
|
} |
192 |
|
//------------------------------------------- |
245 |
|
cout << "Calculating limits for SR" << sr << endl; |
246 |
|
for (int il=0; il<numbLines; il++) { |
247 |
|
float thisErr = err[sr][il]; |
248 |
< |
double blahObs = observedLimitOnNumberOfEvents(sr+1, 100.*thisErr, false ); |
248 |
> |
double blahObs = observedLimitOnNumberOfEvents(sr+1, 100.*thisErr, true ); |
249 |
|
double blahExp = expectedLimitOnNumberOfEvents(sr+1, 100.*thisErr, false ); |
250 |
|
obslim[sr][il] = (float) blahObs; |
251 |
|
explim[sr][il] = (float) blahExp; |
375 |
|
// Note: the best region is the one with the smallest |
376 |
|
// ratio of expected limit and efficiency |
377 |
|
cout << "Filling an ntuple with " << numbLines << " entries" << endl; |
378 |
+ |
cout << "SR0 is not allowed to be the best region" << endl; |
379 |
|
for (int il=0; il<numbLines; il++) { |
380 |
|
float best = 999999.; |
381 |
|
int ibest = -1; |
388 |
|
obslimsr0_ = obslim[0][il]; |
389 |
|
explimsr0_ = explim[0][il]; |
390 |
|
float temp = explimsr0_/effsr0_; |
391 |
< |
if (temp < best) { |
392 |
< |
best = temp; |
393 |
< |
ibest = 0; |
394 |
< |
} |
391 |
> |
// if (temp < best) { |
392 |
> |
// best = temp; |
393 |
> |
// ibest = 0; |
394 |
> |
// } |
395 |
|
} |
396 |
|
if (nentries[1] != 0) { |
397 |
|
glmass_ = glmass[1][il]; |