1 |
buchmann |
1.1 |
#include <iostream>
|
2 |
|
|
#include <vector>
|
3 |
|
|
#include <sys/stat.h>
|
4 |
|
|
#include <fstream>
|
5 |
buchmann |
1.7 |
#include <pthread.h>
|
6 |
buchmann |
1.1 |
|
7 |
|
|
#include <TCut.h>
|
8 |
|
|
#include <TROOT.h>
|
9 |
|
|
#include <TCanvas.h>
|
10 |
|
|
#include <TMath.h>
|
11 |
|
|
#include <TColor.h>
|
12 |
|
|
#include <TPaveText.h>
|
13 |
|
|
#include <TRandom.h>
|
14 |
|
|
#include <TH1.h>
|
15 |
|
|
#include <TH2.h>
|
16 |
|
|
#include <TF1.h>
|
17 |
|
|
#include <TSQLResult.h>
|
18 |
|
|
#include <TProfile.h>
|
19 |
|
|
|
20 |
|
|
//#include "TTbar_stuff.C"
|
21 |
|
|
using namespace std;
|
22 |
|
|
|
23 |
|
|
using namespace PlottingSetup;
|
24 |
|
|
|
25 |
|
|
void susy_scan_axis_labeling(TH2F *histo) {
|
26 |
|
|
histo->GetXaxis()->SetTitle("#Chi_{2}^{0}-LSP");
|
27 |
|
|
histo->GetXaxis()->CenterTitle();
|
28 |
|
|
histo->GetYaxis()->SetTitle("m_{#tilde{q}}");
|
29 |
|
|
histo->GetYaxis()->CenterTitle();
|
30 |
|
|
}
|
31 |
|
|
|
32 |
|
|
void scan_susy_space(string mcjzb, string datajzb) {
|
33 |
|
|
TCanvas *c3 = new TCanvas("c3","c3");
|
34 |
|
|
vector<float> binning;
|
35 |
|
|
binning=allsamples.get_optimal_binsize(mcjzb,cutmass&&cutOSSF&&cutnJets,20,50,800);
|
36 |
|
|
float arrbinning[binning.size()];
|
37 |
|
|
for(int i=0;i<binning.size();i++) arrbinning[i]=binning[i];
|
38 |
|
|
TH1F *puredata = allsamples.Draw("puredata", datajzb,binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,data,luminosity);
|
39 |
|
|
puredata->SetMarkerSize(DataMarkerSize);
|
40 |
|
|
TH1F *allbgs = allsamples.Draw("allbgs", "-"+datajzb,binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,data,luminosity);
|
41 |
|
|
TH1F *allbgsb = allsamples.Draw("allbgsb", "-"+datajzb,binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,data,luminosity);
|
42 |
|
|
TH1F *allbgsc = allsamples.Draw("allbgsc", datajzb,binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,data,luminosity);
|
43 |
|
|
allbgs->Add(allbgsb,-1);
|
44 |
|
|
allbgs->Add(allbgsc);
|
45 |
|
|
int ndata=puredata->Integral();
|
46 |
|
|
ofstream myfile;
|
47 |
|
|
myfile.open ("susyscan_log.txt");
|
48 |
|
|
TFile *susyscanfile = new TFile("/scratch/fronga/SMS/T5z_SqSqToQZQZ_38xFall10.root");
|
49 |
|
|
TTree *suevents = (TTree*)susyscanfile->Get("events");
|
50 |
|
|
TH2F *exclusionmap = new TH2F("exclusionmap","",20,0,500,20,0,1000);
|
51 |
|
|
TH2F *exclusionmap1s = new TH2F("exclusionmap1s","",20,0,500,20,0,1000);
|
52 |
|
|
TH2F *exclusionmap2s = new TH2F("exclusionmap2s","",20,0,500,20,0,1000);
|
53 |
|
|
TH2F *exclusionmap3s = new TH2F("exclusionmap3s","",20,0,500,20,0,1000);
|
54 |
|
|
|
55 |
|
|
susy_scan_axis_labeling(exclusionmap);
|
56 |
|
|
susy_scan_axis_labeling(exclusionmap1s);
|
57 |
|
|
susy_scan_axis_labeling(exclusionmap2s);
|
58 |
|
|
susy_scan_axis_labeling(exclusionmap3s);
|
59 |
|
|
|
60 |
|
|
Int_t MyPalette[100];
|
61 |
|
|
Double_t r[] = {0., 0.0, 1.0, 1.0, 1.0};
|
62 |
|
|
Double_t g[] = {0., 0.0, 0.0, 1.0, 1.0};
|
63 |
|
|
Double_t b[] = {0., 1.0, 0.0, 0.0, 1.0};
|
64 |
|
|
Double_t stop[] = {0., .25, .50, .75, 1.0};
|
65 |
|
|
Int_t FI = TColor::CreateGradientColorTable(5, stop, r, g, b, 100);
|
66 |
|
|
for (int i=0;i<100;i++) MyPalette[i] = FI+i;
|
67 |
|
|
|
68 |
|
|
gStyle->SetPalette(100, MyPalette);
|
69 |
|
|
|
70 |
|
|
for(int m23=50;m23<500;m23+=25) {
|
71 |
|
|
for (int m0=(2*(m23-50)+150);m0<=1000;m0+=50)
|
72 |
|
|
{
|
73 |
|
|
c3->cd();
|
74 |
|
|
stringstream drawcondition;
|
75 |
|
|
drawcondition << "pfJetGoodNum>=3&&(TMath::Abs(masses[0]-"<<m0<<")<10&&TMath::Abs(masses[2]-masses[3]-"<<m23<<")<10)&&mll>5&&id1==id2";
|
76 |
|
|
TH1F *puresignal = new TH1F("puresignal","puresignal",binning.size()-1,arrbinning);
|
77 |
|
|
TH1F *puresignall= new TH1F("puresignall","puresignal",binning.size()-1,arrbinning);
|
78 |
|
|
stringstream drawvar,drawvar2;
|
79 |
|
|
drawvar<<mcjzb<<">>puresignal";
|
80 |
|
|
drawvar2<<"-"<<mcjzb<<">>puresignall";
|
81 |
|
|
suevents->Draw(drawvar.str().c_str(),drawcondition.str().c_str());
|
82 |
|
|
suevents->Draw(drawvar2.str().c_str(),drawcondition.str().c_str());
|
83 |
|
|
if(puresignal->Integral()<60) {
|
84 |
|
|
delete puresignal;
|
85 |
|
|
continue;
|
86 |
|
|
}
|
87 |
|
|
puresignal->Add(puresignall,-1);//we need to correct for the signal contamination - we effectively only see (JZB>0)-(JZB<0) !!
|
88 |
|
|
puresignal->Scale(ndata/(20*puresignal->Integral()));//normalizing it to 5% of the data
|
89 |
|
|
stringstream saveas;
|
90 |
|
|
saveas<<"Model_Scan/m0_"<<m0<<"__m23_"<<m23;
|
91 |
|
|
dout << "PLEASE KEEP IN MIND THAT SIGNAL CONTAMINATION IS NOT REALLY TAKEN CARE OF YET DUE TO LOW STATISTICS! SHOULD BE SOMETHING LIKE THIS : "<< endl;
|
92 |
|
|
// TH1F *signalpredlo = allsamples.Draw("signalpredlo", "-"+mcjzb, binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,mc, luminosity,allsamples.FindSample("LM4"));
|
93 |
|
|
// TH1F *signalpredro = allsamples.Draw("signalpredro", mcjzb, binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,mc, luminosity,allsamples.FindSample("LM4"));
|
94 |
|
|
// TH1F *puredata = allsamples.Draw("puredata", datajzb,binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,data,luminosity);
|
95 |
|
|
// signalpred->Add(signalpredlo,-1);
|
96 |
|
|
// signalpred->Add(signalpredro);
|
97 |
|
|
// puresignal->Add(signalpred,-1);//subtracting signal contamination
|
98 |
|
|
//---------------------
|
99 |
|
|
// dout << "(m0,m23)=("<<m0<<","<<m23<<") contains " << puresignal->Integral() << endl;
|
100 |
|
|
// TH1F *puresignal = allsamples.Draw("puresignal",mcjzb, binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,mc, luminosity,allsamples.FindSample("LM4"));
|
101 |
|
|
vector<float> results=establish_upper_limits(puredata,allbgs,puresignal,saveas.str(),myfile);
|
102 |
|
|
if(results.size()==0) {
|
103 |
|
|
delete puresignal;
|
104 |
|
|
continue;
|
105 |
|
|
}
|
106 |
|
|
exclusionmap->Fill(m23,m0,results[0]);
|
107 |
|
|
exclusionmap1s->Fill(m23,m0,results[1]);
|
108 |
|
|
exclusionmap2s->Fill(m23,m0,results[2]);
|
109 |
|
|
exclusionmap3s->Fill(m23,m0,results[3]);
|
110 |
|
|
delete puresignal;
|
111 |
|
|
dout << "(m0,m23)=("<<m0<<","<<m23<<") : 3 sigma at " << results[3] << endl;
|
112 |
|
|
}
|
113 |
|
|
}//end of model scan for loop
|
114 |
|
|
|
115 |
|
|
dout << "Exclusion Map contains" << exclusionmap->Integral() << " (integral) and entries: " << exclusionmap->GetEntries() << endl;
|
116 |
|
|
c3->cd();
|
117 |
|
|
exclusionmap->Draw("CONTZ");
|
118 |
|
|
CompleteSave(c3,"Model_Scan/CONT/Model_Scan_Mean_values");
|
119 |
|
|
exclusionmap->Draw("COLZ");
|
120 |
|
|
CompleteSave(c3,"Model_Scan/COL/Model_Scan_Mean_values");
|
121 |
|
|
|
122 |
|
|
exclusionmap1s->Draw("CONTZ");
|
123 |
|
|
CompleteSave(c3,"Model_Scan/CONT/Model_Scan_1sigma_values");
|
124 |
|
|
exclusionmap1s->Draw("COLZ");
|
125 |
|
|
CompleteSave(c3,"Model_Scan/COL/Model_Scan_1sigma_values");
|
126 |
|
|
|
127 |
|
|
exclusionmap2s->Draw("CONTZ");
|
128 |
|
|
CompleteSave(c3,"Model_Scan/CONT/Model_Scan_2sigma_values");
|
129 |
|
|
exclusionmap2s->Draw("COLZ");
|
130 |
|
|
CompleteSave(c3,"Model_Scan/COL/Model_Scan_2sigma_values");
|
131 |
|
|
|
132 |
|
|
exclusionmap3s->Draw("CONTZ");
|
133 |
|
|
CompleteSave(c3,"Model_Scan/CONT/Model_Scan_3sigma_values");
|
134 |
|
|
exclusionmap3s->Draw("COLZ");
|
135 |
|
|
CompleteSave(c3,"Model_Scan/COL/Model_Scan_3sigma_values");
|
136 |
|
|
|
137 |
|
|
TFile *exclusion_limits = new TFile("exclusion_limits.root","RECREATE");
|
138 |
|
|
exclusionmap->Write();
|
139 |
|
|
exclusionmap1s->Write();
|
140 |
|
|
exclusionmap2s->Write();
|
141 |
|
|
exclusionmap3s->Write();
|
142 |
|
|
exclusion_limits->Close();
|
143 |
|
|
susyscanfile->Close();
|
144 |
|
|
|
145 |
|
|
myfile.close();
|
146 |
|
|
}
|
147 |
|
|
|
148 |
buchmann |
1.4 |
void efficiency_scan_in_susy_space(string mcjzb, string datajzb, bool requireZ, float peakerror) {
|
149 |
|
|
dout << "Doing efficiency scan using " << (scansample.collection)[0].filename << endl;
|
150 |
buchmann |
1.5 |
geqleq="geq";
|
151 |
buchmann |
1.1 |
automatized=true;
|
152 |
buchmann |
1.2 |
mcjzbexpression=mcjzb;
|
153 |
buchmann |
1.1 |
|
154 |
|
|
string massgluname="MassGlu";
|
155 |
|
|
string massLSPname="MassLSP";
|
156 |
|
|
|
157 |
|
|
Int_t MyPalette[100];
|
158 |
|
|
Double_t r[] = {0., 0.0, 1.0, 1.0, 1.0};
|
159 |
|
|
Double_t g[] = {0., 0.0, 0.0, 1.0, 1.0};
|
160 |
|
|
Double_t b[] = {0., 1.0, 0.0, 0.0, 1.0};
|
161 |
|
|
Double_t stop[] = {0., .25, .50, .75, 1.0};
|
162 |
buchmann |
1.2 |
Int_t FI = TColor::CreateGradientColorTable(5, stop, r, g, b, 110);
|
163 |
buchmann |
1.1 |
for (int i=0;i<100;i++) MyPalette[i] = FI+i;
|
164 |
|
|
|
165 |
|
|
gStyle->SetPalette(100, MyPalette);
|
166 |
|
|
|
167 |
|
|
TH2F *efficiencymap = new TH2F("efficiencymap","",(mgluend-mglustart)/mglustep+1,mglustart-0.5*mglustep,mgluend+0.5*mglustep,(mLSPend-mLSPstart)/mLSPstep+1,mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
|
168 |
buchmann |
1.4 |
TH2F *Neventsmap = new TH2F("Neventsmap","", (mgluend-mglustart)/mglustep+1,mglustart-0.5*mglustep,mgluend+0.5*mglustep,(mLSPend-mLSPstart)/mLSPstep+1,mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
|
169 |
buchmann |
1.2 |
|
170 |
buchmann |
1.1 |
float rightmargin=gStyle->GetPadRightMargin();
|
171 |
buchmann |
1.2 |
gStyle->SetPadRightMargin(0.14);
|
172 |
|
|
|
173 |
buchmann |
1.1 |
TCanvas *effcanvas = new TCanvas("effcanvas","Efficiency canvas");
|
174 |
buchmann |
1.2 |
|
175 |
buchmann |
1.1 |
for(int mglu=mglustart;mglu<=mgluend;mglu+=mglustep) {
|
176 |
|
|
for (int mlsp=mLSPstart;mlsp<=mLSPend&&mlsp<=mglu;mlsp+=mLSPstep)
|
177 |
|
|
{
|
178 |
|
|
float result,resulterr;
|
179 |
|
|
stringstream addcut;
|
180 |
|
|
addcut << "(TMath::Abs("<<massgluname<<"-"<<mglu<<")<5)&&(TMath::Abs("<<massLSPname<<"-"<<mlsp<<")<5)";
|
181 |
|
|
MCefficiency((scansample.collection)[0].events,result,resulterr,mcjzb,requireZ,addcut.str());
|
182 |
|
|
if(result!=result||isanyinf(result)) {
|
183 |
buchmann |
1.4 |
dout << "Watch out the result for mlsp=" << mlsp << " and mglu=" << mglu << " (" << result << ") has been detected as being not a number (nan) or infinity (inf) !" << endl;
|
184 |
buchmann |
1.1 |
result=0; // kicking nan and inf errors
|
185 |
|
|
}
|
186 |
buchmann |
1.5 |
else {
|
187 |
|
|
efficiencymap->Fill(mglu,mlsp,result);
|
188 |
|
|
dout << " ok! Added efficiency " << result << " for mlsp=" << mlsp << " and mglu=" << mglu << endl;
|
189 |
|
|
}
|
190 |
buchmann |
1.2 |
|
191 |
|
|
(scansample.collection)[0].events->Draw(mcjzb.c_str(),addcut.str().c_str(),"goff");
|
192 |
|
|
float nevents = (scansample.collection)[0].events->GetSelectedRows();
|
193 |
|
|
Neventsmap->Fill(mglu,mlsp,nevents);
|
194 |
buchmann |
1.1 |
}
|
195 |
|
|
}
|
196 |
|
|
|
197 |
|
|
efficiencymap->GetXaxis()->SetTitle("m_{glu}");
|
198 |
|
|
efficiencymap->GetXaxis()->CenterTitle();
|
199 |
|
|
efficiencymap->GetYaxis()->SetTitle("m_{LSP}");
|
200 |
|
|
efficiencymap->GetYaxis()->CenterTitle();
|
201 |
|
|
|
202 |
buchmann |
1.2 |
Neventsmap->GetXaxis()->SetTitle("m_{glu}");
|
203 |
|
|
Neventsmap->GetXaxis()->CenterTitle();
|
204 |
|
|
Neventsmap->GetYaxis()->SetTitle("m_{LSP}");
|
205 |
|
|
Neventsmap->GetYaxis()->CenterTitle();
|
206 |
buchmann |
1.4 |
|
207 |
buchmann |
1.1 |
efficiencymap->Draw("COLZ");
|
208 |
|
|
TText *title = write_title("Efficiency in LSP-Glu plane");
|
209 |
|
|
title->Draw();
|
210 |
|
|
CompleteSave(effcanvas,"SUSYScan/Efficency");
|
211 |
buchmann |
1.4 |
|
212 |
buchmann |
1.2 |
Neventsmap->Draw("COLZ");
|
213 |
|
|
TText *title2 = write_title("Number of events in LSP-Glu plane");
|
214 |
|
|
title2->Draw();
|
215 |
buchmann |
1.5 |
CompleteSave(effcanvas,"SUSYScan/Nevents");
|
216 |
buchmann |
1.4 |
}
|
217 |
|
|
|
218 |
buchmann |
1.7 |
bool isThreadActive=false;
|
219 |
|
|
|
220 |
|
|
struct limit_args {
|
221 |
|
|
float mceff;
|
222 |
|
|
float toterr;
|
223 |
|
|
int ibin;
|
224 |
|
|
string mcjzb;
|
225 |
|
|
vector<float> sigmas;
|
226 |
|
|
};
|
227 |
|
|
|
228 |
|
|
void* compute_one_upper_limit_wrapper(void* data) {
|
229 |
|
|
isThreadActive=true;
|
230 |
|
|
limit_args* args = (limit_args*) data;
|
231 |
|
|
std::cout << "Thread to compute limits has been started" << std::endl;
|
232 |
|
|
args->sigmas=compute_one_upper_limit(args->mceff,args->toterr,args->ibin,args->mcjzb);
|
233 |
|
|
std::cout << "Thread to compute limits has finished" << std::endl;
|
234 |
|
|
isThreadActive=false;
|
235 |
|
|
return NULL; // oder in C++: return 0;// Damit kann man Werte zurückgeben
|
236 |
|
|
}
|
237 |
|
|
|
238 |
|
|
void do_limit_wrapper(float mceff,float toterr,int ibin,string mcjzb,vector<float> &sigmas) {
|
239 |
|
|
pthread_t limitthread;
|
240 |
fronga |
1.8 |
limit_args limargs={mceff,toterr,ibin,mcjzb,sigmas};
|
241 |
buchmann |
1.7 |
pthread_create( &limitthread, NULL, compute_one_upper_limit_wrapper, (void*) &limargs);
|
242 |
|
|
int counter=0;
|
243 |
|
|
sleep(1); //waiting a second for the process to become active
|
244 |
|
|
while(counter<limitpatience*60 && isThreadActive) {
|
245 |
|
|
std::cout << "Checking round " << counter << std::endl;
|
246 |
|
|
counter++;
|
247 |
|
|
sleep(1);
|
248 |
|
|
}
|
249 |
|
|
|
250 |
|
|
if(!isThreadActive) {
|
251 |
|
|
cout << "Thread finished sucessfully" << endl;
|
252 |
|
|
pthread_join( limitthread, NULL );
|
253 |
|
|
std::cout<< __FUNCTION__ << " : going to save sigmas " << std::endl;
|
254 |
|
|
sigmas=limargs.sigmas;
|
255 |
|
|
} else {
|
256 |
|
|
pthread_cancel(limitthread);
|
257 |
|
|
std::cout << "DID NOT TERMINATE IN TIME - ABORTED!" << std::endl;
|
258 |
|
|
sigmas.push_back(-1);sigmas.push_back(-1);sigmas.push_back(-1);
|
259 |
|
|
}
|
260 |
|
|
}
|
261 |
|
|
|
262 |
buchmann |
1.6 |
void scan_SUSY_parameter_space(string mcjzb,string datajzb,vector<float> jzb_cut,bool requireZ, float peakerror, int ibin,float njobs=-1, float jobnumber=-1) {
|
263 |
|
|
bool runninglocally=true;
|
264 |
|
|
if(njobs>-1&&jobnumber>-1) {
|
265 |
|
|
runninglocally=false;
|
266 |
buchmann |
1.7 |
dout << "Running on the GRID (this is job " << jobnumber << "/" << njobs << ")" << endl;
|
267 |
buchmann |
1.6 |
} else {
|
268 |
buchmann |
1.7 |
dout << "Running locally " << endl;
|
269 |
|
|
dout << "This will take a really, really long time - if you want to see the results THIS week try running the LimitWorkerScript on the grid (DistributedModelCalculation/Limits/)" << endl;
|
270 |
buchmann |
1.6 |
}
|
271 |
buchmann |
1.4 |
|
272 |
|
|
jzbSel=jzb_cut[ibin];
|
273 |
|
|
geqleq="geq";
|
274 |
|
|
automatized=true;
|
275 |
|
|
mcjzbexpression=mcjzb;
|
276 |
|
|
|
277 |
|
|
string massgluname="MassGlu";
|
278 |
|
|
string massLSPname="MassLSP";
|
279 |
|
|
|
280 |
|
|
Int_t MyPalette[100];
|
281 |
|
|
Double_t r[] = {0., 0.0, 1.0, 1.0, 1.0};
|
282 |
|
|
Double_t g[] = {0., 0.0, 0.0, 1.0, 1.0};
|
283 |
|
|
Double_t b[] = {0., 1.0, 0.0, 0.0, 1.0};
|
284 |
|
|
Double_t stop[] = {0., .25, .50, .75, 1.0};
|
285 |
|
|
Int_t FI = TColor::CreateGradientColorTable(5, stop, r, g, b, 110);
|
286 |
|
|
for (int i=0;i<100;i++) MyPalette[i] = FI+i;
|
287 |
|
|
|
288 |
|
|
gStyle->SetPalette(100, MyPalette);
|
289 |
|
|
|
290 |
buchmann |
1.6 |
TH2F *limitmap = new TH2F(("limitmap"+any2string(jzbSel)).c_str(),"",(mgluend-mglustart)/mglustep+1,mglustart-0.5*mglustep,mgluend+0.5*mglustep,(mLSPend-mLSPstart)/mLSPstep+1,mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
|
291 |
buchmann |
1.4 |
|
292 |
|
|
float rightmargin=gStyle->GetPadRightMargin();
|
293 |
|
|
gStyle->SetPadRightMargin(0.15);
|
294 |
|
|
|
295 |
|
|
TCanvas *limcanvas = new TCanvas("limcanvas","Limit canvas");
|
296 |
|
|
|
297 |
buchmann |
1.6 |
|
298 |
|
|
int Npoints=0;
|
299 |
|
|
for(int mglu=mglustart;mglu<=mgluend;mglu+=mglustep) {
|
300 |
|
|
for (int mlsp=mLSPstart;mlsp<=mLSPend&&mlsp<=mglu;mlsp+=mLSPstep) Npoints++;
|
301 |
|
|
}
|
302 |
|
|
|
303 |
|
|
int ipoint=-1;
|
304 |
buchmann |
1.4 |
for(int mglu=mglustart;mglu<=mgluend;mglu+=mglustep) {
|
305 |
|
|
for (int mlsp=mLSPstart;mlsp<=mLSPend&&mlsp<=mglu;mlsp+=mLSPstep)
|
306 |
|
|
{
|
307 |
buchmann |
1.6 |
ipoint++;
|
308 |
|
|
if(!runninglocally&&!do_this_point(ipoint,Npoints,jobnumber,njobs)) continue;
|
309 |
buchmann |
1.4 |
float result,resulterr;
|
310 |
|
|
stringstream addcut;
|
311 |
|
|
addcut << "(TMath::Abs("<<massgluname<<"-"<<mglu<<")<5)&&(TMath::Abs("<<massLSPname<<"-"<<mlsp<<")<5)";
|
312 |
|
|
vector<vector<float> > systematics;
|
313 |
buchmann |
1.6 |
MCefficiency((scansample.collection)[0].events,result,resulterr,mcjzb,requireZ,addcut.str());
|
314 |
|
|
if(result!=result||resulterr!=resulterr) {
|
315 |
|
|
dout << "Limits can't be calculated for this configuration (mglu="<<mglu<<" , mlsp="<<mlsp << ") as either the efficiency or its error are not numbers! (result="<<result<<" and resulterr="<<resulterr<<")"<< endl;
|
316 |
|
|
continue;
|
317 |
|
|
} else {
|
318 |
buchmann |
1.7 |
dout << "Configuration (mglu="<<mglu<<" , mlsp="<<mlsp << ") passed the mcefficiency test; will compute systematics and limits now." << endl;
|
319 |
buchmann |
1.6 |
}
|
320 |
buchmann |
1.4 |
do_systematics_for_one_file((scansample.collection)[0].events,"SUSY SCAN", systematics,mcjzb,datajzb,peakerror,requireZ, addcut.str());
|
321 |
|
|
float JZBcutat=systematics[0][0];
|
322 |
|
|
float mceff=systematics[0][1];
|
323 |
|
|
float toterr =systematics[0][4];
|
324 |
|
|
if(mceff!=mceff||toterr!=toterr) {
|
325 |
buchmann |
1.6 |
dout << "Limits can't be calculated for this configuration (mglu="<<mglu<<" , mlsp="<<mlsp << ") as either the efficiency or its error are not numbers! (mceff="<<mceff<<" and toterr="<<toterr<<")"<< endl;
|
326 |
buchmann |
1.4 |
continue;
|
327 |
buchmann |
1.5 |
} else {
|
328 |
buchmann |
1.6 |
dout << "Calculating limit now for m_{glu}="<<mglu << " and m_{lsp}="<<mlsp<<endl;
|
329 |
buchmann |
1.7 |
vector<float> sigmas;
|
330 |
|
|
do_limit_wrapper(mceff,toterr,ibin,mcjzb,sigmas);
|
331 |
|
|
cout << "back in " << __FUNCTION__ << endl;
|
332 |
|
|
if(sigmas[0]>-0.5) { // negative sigmas are the error signature of do_limit_wrapper, so we want to exclude them.
|
333 |
|
|
limitmap->Fill(mglu,mlsp,sigmas[0]);
|
334 |
|
|
dout << "A limit has been added at " << sigmas[0] << " for m_{glu}="<<mglu << " and m_{lsp}="<<mlsp<<endl;
|
335 |
|
|
}//end of if sigma is positive
|
336 |
buchmann |
1.4 |
}
|
337 |
|
|
}
|
338 |
|
|
}
|
339 |
|
|
|
340 |
|
|
limitmap->GetXaxis()->SetTitle("m_{glu}");
|
341 |
|
|
limitmap->GetXaxis()->CenterTitle();
|
342 |
|
|
limitmap->GetYaxis()->SetTitle("m_{LSP}");
|
343 |
|
|
limitmap->GetYaxis()->CenterTitle();
|
344 |
|
|
|
345 |
|
|
limitmap->GetXaxis()->SetTitle("m_{glu}");
|
346 |
|
|
limitmap->GetXaxis()->CenterTitle();
|
347 |
|
|
limitmap->GetYaxis()->SetTitle("m_{LSP}");
|
348 |
|
|
limitmap->GetYaxis()->CenterTitle();
|
349 |
|
|
|
350 |
|
|
limcanvas->cd();
|
351 |
|
|
limitmap->Draw("COLZ");
|
352 |
|
|
TText *title = write_title("Limits in LSP-Glu plane");
|
353 |
|
|
title->Draw();
|
354 |
buchmann |
1.6 |
if(runninglocally) {
|
355 |
|
|
CompleteSave(limcanvas,"SUSYScan/Limits_JZB_geq"+any2string(jzb_cut[ibin]));
|
356 |
|
|
} else {
|
357 |
|
|
TFile *outputfile=new TFile(("output/DistributedLimits_job"+string(any2string(jobnumber))+"_of_"+string(any2string(njobs))+".root").c_str(),"UPDATE");
|
358 |
|
|
limitmap->Write();
|
359 |
|
|
outputfile->Close();
|
360 |
|
|
}
|
361 |
buchmann |
1.1 |
}
|
362 |
buchmann |
1.4 |
|
363 |
buchmann |
1.6 |
void scan_SUSY_parameter_space(string mcjzb,string datajzb,vector<float> jzb_cut,bool requireZ, float peakerror, float njobs=-1, float jobnumber=-1) {
|
364 |
buchmann |
1.4 |
for(int ibin=0;ibin<jzb_cut.size();ibin++) {
|
365 |
buchmann |
1.6 |
scan_SUSY_parameter_space(mcjzb,datajzb,jzb_cut,requireZ, peakerror, ibin, njobs, jobnumber);
|
366 |
buchmann |
1.4 |
}
|
367 |
buchmann |
1.6 |
}
|