19 |
|
#include <TProfile.h> |
20 |
|
#include <TKey.h> |
21 |
|
|
22 |
+ |
#include "ShapeDroplet.C" |
23 |
+ |
#include "ShapeLimit.C" |
24 |
+ |
|
25 |
|
//#include "TTbar_stuff.C" |
26 |
|
using namespace std; |
27 |
|
|
75 |
|
} |
76 |
|
|
77 |
|
bool delete_any_cached_scans() { |
78 |
+ |
char hostname[1023]; |
79 |
+ |
gethostname(hostname,1023); |
80 |
|
|
81 |
|
|
82 |
|
/* |
83 |
|
//This should only be called via CRAB |
84 |
|
cout << " Deleting all cached files." << endl; |
85 |
|
gSystem->Exec("ls -ltrh | grep root"); |
81 |
– |
char hostname[1023]; |
82 |
– |
gethostname(hostname,1023); |
86 |
|
if(!((Contains(hostname,"t3ui")||Contains(hostname,"t3wn")))) |
87 |
|
{ |
88 |
|
vector<string> all_files; |
100 |
|
return true; |
101 |
|
} |
102 |
|
*/ |
103 |
< |
if(SUSYScanSpace::SUSYscantype==mSUGRA) { |
103 |
> |
if(!((Contains(hostname,"t3ui")||Contains(hostname,"t3wn")))) { |
104 |
|
cout << "Going to purge files in local_storage that have been loaded!" << endl; |
105 |
|
for(int i=0;i<SUSYScanSpace::loaded_files.size();i++) { |
106 |
|
gSystem->Exec(((string)"rm "+SUSYScanSpace::loaded_files[i]).c_str()); |
114 |
|
|
115 |
|
int srmcpretries=0; |
116 |
|
|
117 |
< |
void load_scan_sample(int a, int b, int &scanfileindex,int scantype,int mglu, int mlsp, bool isretry=false) { |
118 |
< |
|
119 |
< |
// There is no need to define your sample here. That is done in Setup.C where you define the loading directory! |
117 |
< |
|
118 |
< |
dout << "Going to load file with Xzone=" << a << " and Yzone=" << b << " for scantype (mSugra: " << (bool)(scantype==mSUGRA) << " , SMS: " << (bool)(scantype==SMS) << " , GMSB: " << (bool)(scantype==GMSB) << ")" << endl; |
119 |
< |
stringstream filetoload; |
120 |
< |
char hostname[1023]; |
121 |
< |
gethostname(hostname,1023); |
122 |
< |
string samplename; |
123 |
< |
if((Contains(hostname,"t3ui")||Contains(hostname,"t3wn"))&&scantype!=mSUGRA) { // local case |
117 |
> |
void load_local_scan_sample(int a, int b, int &scanfileindex,int scantype,int mglu, int mlsp, bool isretry=false) { |
118 |
> |
stringstream filetoload; |
119 |
> |
string samplename; |
120 |
|
filetoload << "/shome/buchmann/ntuples/"<<PlottingSetup::ScanSampleDirectory; |
121 |
|
if(scantype==mSUGRA) { |
122 |
|
//filetoload << "/mSUGRA_clean_splitup_" << any2string(a) << "_" << any2string(b) << ".root"; |
133 |
|
filetoload << "/GMSB_clean_splitup_" << any2string(a) << "_" << any2string(b) << ".root"; |
134 |
|
samplename="GMSB"; |
135 |
|
} |
136 |
+ |
|
137 |
+ |
if(scantype==SMS && Contains(PlottingSetup::ScanSampleDirectory,"T1lh")) { |
138 |
+ |
filetoload.str(""); |
139 |
+ |
filetoload << "/shome/lbaeni/jzb/" << PlottingSetup::ScanSampleDirectory << "/SMS_MassGlu_" << mglu << "__MassLSP_" << mlsp << ".root"; |
140 |
+ |
samplename="SMS"; |
141 |
+ |
} |
142 |
+ |
|
143 |
|
if(scansample.collection.size()<1||!Contains(((scansample.collection)[(scansample.collection).size()-1]).filename,"_"+any2string(a)+"_"+any2string(b))) { |
144 |
|
dout << "The last sample is NOT the same one as the current one, possibly popping off last one and adding the new one." << endl; |
145 |
|
if((scansample.collection).size()>=1) { |
155 |
|
scanfileindex=(scansample.collection).size()-1; |
156 |
|
} |
157 |
|
dout << " Going to use the following file: " << filetoload.str() << endl; |
158 |
< |
} // end of t3 case |
159 |
< |
else { |
160 |
< |
//CRAB case |
158 |
> |
} |
159 |
> |
|
160 |
> |
void load_remote_scan_sample(int a, int b, int &scanfileindex,int scantype,int mglu, int mlsp, bool isretry=false) { |
161 |
|
write_info(__FUNCTION__,"Hello, CRAB! Might need to load files ..."); |
162 |
+ |
string samplename; |
163 |
|
PlottingSetup::limitpatience=PlottingSetup::limitpatienceCRAB; |
164 |
|
stringstream copyfile; |
165 |
|
gSystem->Exec("mkdir -p local_storage"); |
208 |
|
if(srmcpretries<5) { |
209 |
|
dout << "The file could not be loaded correctly - retrying!" << endl; |
210 |
|
sleep(5); |
211 |
< |
load_scan_sample(a,b,scanfileindex,scantype,mglu,mlsp,true); |
211 |
> |
load_remote_scan_sample(a,b,scanfileindex,scantype,mglu,mlsp,true); |
212 |
|
} else { |
213 |
|
dout << "Have tried 5 times to load this sample. Giving up now and failing the program execution" << endl; |
214 |
|
assert(srmcpretries<5); |
220 |
|
dout << "Last sample is the same as the current one. Recycling it." << endl; |
221 |
|
scanfileindex=(scansample.collection).size()-1; |
222 |
|
} |
223 |
< |
|
224 |
< |
} |
225 |
< |
|
223 |
> |
} |
224 |
> |
|
225 |
> |
void load_scan_sample(int a, int b, int &scanfileindex,int scantype,int mglu, int mlsp, bool isretry=false) { |
226 |
|
|
227 |
< |
// WATCH OUT THIS LINE NEEDS TO BE REMOVED |
228 |
< |
scanfileindex=0; |
227 |
> |
// There is no need to define your sample here. That is done in Setup.C where you define the loading directory! |
228 |
> |
|
229 |
> |
dout << "Going to load file with Xzone=" << a << " and Yzone=" << b << " for scantype (mSugra: " << (bool)(scantype==mSUGRA) << " , SMS: " << (bool)(scantype==SMS) << " , GMSB: " << (bool)(scantype==GMSB) << ")" << endl; |
230 |
> |
char hostname[1023]; |
231 |
> |
gethostname(hostname,1023); |
232 |
> |
if((Contains(hostname,"t3ui")||Contains(hostname,"t3wn"))) load_local_scan_sample(a,b,scanfileindex,scantype,mglu,mlsp,isretry); |
233 |
> |
else load_remote_scan_sample(a,b,scanfileindex,scantype,mglu,mlsp,isretry); |
234 |
|
} |
235 |
|
|
236 |
|
/*float get_xs(float &altxs, float mglu, float mlsp, string massgluname, string massLSPname, map < pair<float, float>, map<string, float> > &xsec, string mcjzb, bool requireZ) { |
352 |
|
continue; |
353 |
|
} |
354 |
|
vector<float> sigmas; |
355 |
< |
if(scantype!=mSUGRA) sigmas=compute_one_upper_limit(currmceff,currtoterr,ibin,mcjzb,plotfilename,true, flipped); |
355 |
> |
if(scantype!=mSUGRA) { |
356 |
> |
sigmas=compute_one_upper_limit(currmceff,currtoterr,ibin,mcjzb,plotfilename,true, flipped,true); |
357 |
> |
write_warning(__FUNCTION__,"Temporarily doing asymptotic limits!!!!"); |
358 |
> |
} |
359 |
|
else { |
360 |
|
//this is a bit trickier - what we want to do is compute the limit fast, and if it is in [0.5 xs, 2xs], compute it again but "correctly"! |
361 |
|
vector<float> asigmas; |
362 |
|
asigmas=compute_one_upper_limit(currmceff,currtoterr,ibin,mcjzb,plotfilename,true, flipped,true); // asymptotic limit first |
363 |
|
float strength=asigmas[0]/XSmap->GetBinContent(GlobalBin); |
364 |
< |
if(strength>0.5&&strength<2) { |
364 |
> |
/* if(strength>0.5&&strength<2) { |
365 |
|
sigmas=compute_one_upper_limit(currmceff,currtoterr,ibin,mcjzb,plotfilename,true, flipped); // asymptotic limit first |
366 |
|
asymptoticmap->SetBinContent(GlobalBin,0); |
367 |
< |
} |
356 |
< |
else { |
367 |
> |
} else {*/ |
368 |
|
sigmas=asigmas; |
369 |
|
asymptoticmap->SetBinContent(GlobalBin,1); |
370 |
< |
} |
370 |
> |
/* }*/ |
371 |
|
exclmap->SetBinContent(GlobalBin,strength); |
372 |
|
} |
373 |
|
|
389 |
|
TFile *outputfile=new TFile(("output/DistributedLimitsFromSystematics_job"+string(any2string(jobnumber))+"_of_"+string(any2string(njobs))+".root").c_str(),"UPDATE");//needs to be "UPDATE" as we can get to this point for different JZB cuts and don't want to erase the previous data :-) |
390 |
|
outputfile->cd(); |
391 |
|
limitmap->Write(); |
392 |
+ |
XSmap->Write(); |
393 |
|
flipmap->Write(); |
394 |
|
asymptoticmap->Write(); |
395 |
|
if(doexpected) { |
419 |
|
|
420 |
|
|
421 |
|
|
422 |
< |
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, bool systematicsonly=false,bool efficiencyonly=false) { |
422 |
> |
void scan_SUSY_parameter_space(string mcjzb,string datajzb,vector<float> jzb_cut,bool requireZ, float peakerror, float peakerrordata, int ibin,float njobs=-1, float jobnumber=-1, bool systematicsonly=false,bool efficiencyonly=false, bool shapeanalysis=false) { |
423 |
> |
|
424 |
> |
if(shapeanalysis&&ibin>0) return; // pointless since we're doing a shape analysis :-) |
425 |
> |
|
426 |
|
bool runninglocally=true; |
427 |
|
if(njobs>-1&&jobnumber>-1) { |
428 |
|
runninglocally=false; |
444 |
|
string prefix="SMS_"; |
445 |
|
// up to here, everything is set up for SMS; now we need to switch stuff around if we're dealing with an mSUGRA scan! |
446 |
|
int scantype=SMS; |
447 |
< |
if(Contains((scansample.collection)[0].samplename,"SUGRA")) scantype=mSUGRA; |
448 |
< |
if(Contains((scansample.collection)[0].samplename,"GMSB")) scantype=GMSB; |
447 |
> |
if(Contains((PlottingSetup::ScanSampleDirectory),"SUGRA")) scantype=mSUGRA; |
448 |
> |
if(Contains((PlottingSetup::ScanSampleDirectory),"GMSB")) scantype=GMSB; |
449 |
|
|
450 |
|
if(scantype==mSUGRA) { |
451 |
|
massgluname="M0"; // this is the "x axis" in the limit plot (like the gluino in the SMS case) |
505 |
|
TH2F *systotmap = new TH2F((prefix+"systotmap"+any2string(jzbSel)).c_str(),"",(int)((mgluend-mglustart)/mglustep+1),mglustart-0.5*mglustep,mgluend+0.5*mglustep,int((mLSPend-mLSPstart)/mLSPstep+1),mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep); |
506 |
|
TH2F *sysstatmap = new TH2F((prefix+"sysstatmap"+any2string(jzbSel)).c_str(),"",(int)((mgluend-mglustart)/mglustep+1),mglustart-0.5*mglustep,mgluend+0.5*mglustep,int((mLSPend-mLSPstart)/mLSPstep+1),mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep); |
507 |
|
TH2F *XSmap = new TH2F((prefix+"XS"+any2string(jzbSel)).c_str(),"",(int)((mgluend-mglustart)/mglustep+1),mglustart-0.5*mglustep,mgluend+0.5*mglustep,int((mLSPend-mLSPstart)/mLSPstep+1),mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep); |
508 |
+ |
TH2F *absXSmap = new TH2F((prefix+"absXS"+any2string(jzbSel)).c_str(),"",(int)((mgluend-mglustart)/mglustep+1),mglustart-0.5*mglustep,mgluend+0.5*mglustep,int((mLSPend-mLSPstart)/mLSPstep+1),mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep); |
509 |
+ |
TH2F *FilterEff = new TH2F((prefix+"FilterEfficiency"+any2string(jzbSel)).c_str(),"",(int)((mgluend-mglustart)/mglustep+1),mglustart-0.5*mglustep,mgluend+0.5*mglustep,int((mLSPend-mLSPstart)/mLSPstep+1),mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep); |
510 |
|
|
511 |
|
TH2F *imposedxmap; |
512 |
|
TH2F *realxmap; |
647 |
|
if(scantype==mSUGRA) { |
648 |
|
float absxs=0; |
649 |
|
for(int i=0;i<12;i++) absxs+=GetXSecForPointAndChannel(mglu,mlsp,xsec,i); |
650 |
+ |
TFile *FilterEffFile = new TFile(PlottingSetup::FilterEfficiencyFile.c_str()); |
651 |
+ |
TH2F *FilterEfficiency = (TH2F*)FilterEffFile->Get("FilterEfficiency"); |
652 |
+ |
float filtereff = FilterEfficiency->GetBinContent(FilterEfficiency->FindBin(mglu,mlsp)); |
653 |
+ |
FilterEff->SetBinContent(GlobalBin,filtereff); |
654 |
+ |
FilterEffFile->Close(); |
655 |
+ |
absXSmap->SetBinContent(GlobalBin,absxs); |
656 |
+ |
absxs*=filtereff; |
657 |
|
XSmap->SetBinContent(GlobalBin,absxs); |
658 |
|
} |
659 |
|
|
694 |
|
Neventsmap->SetBinContent(GlobalBin,nevents); |
695 |
|
ipointmap->SetBinContent(GlobalBin,ipoint); |
696 |
|
if(efficiencyonly) continue; |
697 |
< |
|
698 |
< |
do_systematics_for_one_file((scansample.collection)[scanfileindex].events,(int)nevents,"SUSY SCAN", systematics,flipped, xsec, mcjzb,datajzb,peakerror,requireZ, addcut.str(),true,scantype); |
699 |
< |
float JZBcutat = systematics[0][0]; |
700 |
< |
float mceff = systematics[0][1]; |
701 |
< |
float mcefferr = systematics[0][2];//MC stat error |
702 |
< |
float toterr = systematics[0][4]; |
703 |
< |
float sys_jes = systematics[0][5]; // Jet Energy Scale |
704 |
< |
float sys_jsu = systematics[0][6]; // JZB scale uncertainty |
705 |
< |
float sys_res = systematics[0][7]; // resolution |
706 |
< |
float mcwoscef = systematics[0][8]; // efficiency without signal contamination |
707 |
< |
float mcwoscefr= systematics[0][9]; // error on efficiency without signal contamination |
708 |
< |
float sys_pdf = 0; |
709 |
< |
if(systematics[0].size()>10) sys_pdf = systematics[0][10]; // PDF |
710 |
< |
cout << "Going to store: total error is: " << toterr << " and the relative tot error, i.e. total error / mc efficiency is " << toterr/mceff << endl; |
711 |
< |
if(mceff!=mceff||toterr!=toterr||mceff<0 && (!systematicsonly&&!efficiencyonly)) { |
712 |
< |
dout << "Limits can't be calculated for this configuration (mglu="<<mglu<<" , mlsp="<<mlsp << ") as either the efficiency or its error are not positive numbers! (mceff="<<mceff<<" and toterr="<<toterr<<")"<< endl; |
713 |
< |
continue; |
697 |
> |
|
698 |
> |
if(!shapeanalysis) { |
699 |
> |
do_systematics_for_one_file((scansample.collection)[scanfileindex].events,(int)nevents,"SUSY SCAN", systematics,flipped, xsec, mcjzb,datajzb,peakerror,requireZ, addcut.str(),true,scantype); |
700 |
> |
float JZBcutat = systematics[0][0]; |
701 |
> |
float mceff = systematics[0][1]; |
702 |
> |
float mcefferr = systematics[0][2];//MC stat error |
703 |
> |
float toterr = systematics[0][4]; |
704 |
> |
float sys_jes = systematics[0][5]; // Jet Energy Scale |
705 |
> |
float sys_jsu = systematics[0][6]; // JZB scale uncertainty |
706 |
> |
float sys_res = systematics[0][7]; // resolution |
707 |
> |
float mcwoscef = systematics[0][8]; // efficiency without signal contamination |
708 |
> |
float mcwoscefr= systematics[0][9]; // error on efficiency without signal contamination |
709 |
> |
float sys_pdf = 0; |
710 |
> |
if(systematics[0].size()>10) sys_pdf = systematics[0][10]; // PDF |
711 |
> |
cout << "Going to store: total error is: " << toterr << " and the relative tot error, i.e. total error / mc efficiency is " << toterr/mceff << endl; |
712 |
> |
if(mceff!=mceff||toterr!=toterr||mceff<0 && (!systematicsonly&&!efficiencyonly)) { |
713 |
> |
dout << "Limits can't be calculated for this configuration (" << massgluname <<"="<<mglu<<" , " << massLSPname << "="<<mlsp << ") as either the efficiency or its error are not positive numbers! (mceff="<<mceff<<" and toterr="<<toterr<<")"<< endl; |
714 |
> |
continue; |
715 |
> |
} else { |
716 |
> |
// Systematics and efficiencies make sense (i.e. non-zero, and all numbers) |
717 |
> |
if(!systematicsonly&&!efficiencyonly) { |
718 |
> |
dout << "Calculating limit now for "<<massgluname<<"="<<mglu<<" , "<<massLSPname<<"="<<mlsp <<endl; |
719 |
> |
vector<float> sigmas; |
720 |
> |
string plotfilename=(string)(TString((scansample.collection)[scanfileindex].samplename)+TString(massgluname)+TString(any2string(mglu))+TString("__")+TString(massLSPname)+TString(any2string(mlsp))+TString(".png")); |
721 |
> |
sigmas=compute_one_upper_limit(mceff,toterr,ibin,mcjzb,plotfilename,true,flipped); |
722 |
> |
// do_limit_wrapper(mceff,toterr,ibin,mcjzb,sigmas,plotfilename); |
723 |
> |
if(sigmas[0]>-0.5) { // negative sigmas are the error signature of do_limit_wrapper, so we want to exclude them. |
724 |
> |
limitmap->SetBinContent(GlobalBin,sigmas[0]); |
725 |
> |
if(sigmas.size()>1) { |
726 |
> |
explimitmap->SetBinContent(GlobalBin,sigmas[1]); |
727 |
> |
exp1plimitmap->SetBinContent(GlobalBin,sigmas[2]); |
728 |
> |
exp1mlimitmap->SetBinContent(GlobalBin,sigmas[3]); |
729 |
> |
exp2plimitmap->SetBinContent(GlobalBin,sigmas[4]); |
730 |
> |
exp2mlimitmap->SetBinContent(GlobalBin,sigmas[5]); |
731 |
> |
} |
732 |
> |
sysjesmap->SetBinContent(GlobalBin,sys_jes); |
733 |
> |
sysjsumap->SetBinContent(GlobalBin,sys_jsu); |
734 |
> |
sysresmap->SetBinContent(GlobalBin,sys_res); |
735 |
> |
syspdfmap->SetBinContent(GlobalBin,sys_pdf); |
736 |
> |
systotmap->SetBinContent(GlobalBin,toterr/mceff);//total relative (!) error |
737 |
> |
sysstatmap->SetBinContent(GlobalBin,mcefferr);//total relative (!) error |
738 |
> |
dout << "A limit has been added at " << sigmas[0] << " for m_{glu}="<<mglu << " and m_{lsp}="<<mlsp<<endl; |
739 |
> |
}//end of if sigma is positive |
740 |
> |
}//end of not systematics only condition |
741 |
> |
if(systematicsonly) { |
742 |
> |
sysjesmap->SetBinContent(GlobalBin,sys_jes); |
743 |
> |
sysjsumap->SetBinContent(GlobalBin,sys_jsu); |
744 |
> |
sysresmap->SetBinContent(GlobalBin,sys_res); |
745 |
> |
syspdfmap->SetBinContent(GlobalBin,sys_pdf); |
746 |
> |
systotmap->SetBinContent(GlobalBin,toterr/mceff);//total relative (!) error |
747 |
> |
sysstatmap->SetBinContent(GlobalBin,mcefferr);//total relative (!) error |
748 |
> |
} |
749 |
> |
}//efficiency is valid |
750 |
|
} else { |
751 |
< |
if(!systematicsonly&&!efficiencyonly) { |
752 |
< |
dout << "Calculating limit now for "<<massgluname<<"="<<mglu<<" , "<<massLSPname<<"="<<mlsp <<endl; |
753 |
< |
vector<float> sigmas; |
754 |
< |
string plotfilename=(string)(TString((scansample.collection)[scanfileindex].samplename)+TString(massgluname)+TString(any2string(mglu))+TString("__")+TString(massLSPname)+TString(any2string(mlsp))+TString(".png")); |
755 |
< |
sigmas=compute_one_upper_limit(mceff,toterr,ibin,mcjzb,plotfilename,true,flipped); |
756 |
< |
// do_limit_wrapper(mceff,toterr,ibin,mcjzb,sigmas,plotfilename); |
757 |
< |
dout << "back in " << __FUNCTION__ << endl; |
758 |
< |
if(sigmas[0]>-0.5) { // negative sigmas are the error signature of do_limit_wrapper, so we want to exclude them. |
759 |
< |
limitmap->SetBinContent(GlobalBin,sigmas[0]); |
760 |
< |
if(sigmas.size()>1) { |
761 |
< |
explimitmap->SetBinContent(GlobalBin,sigmas[1]); |
762 |
< |
exp1plimitmap->SetBinContent(GlobalBin,sigmas[2]); |
763 |
< |
exp1mlimitmap->SetBinContent(GlobalBin,sigmas[3]); |
764 |
< |
exp2plimitmap->SetBinContent(GlobalBin,sigmas[4]); |
765 |
< |
exp2mlimitmap->SetBinContent(GlobalBin,sigmas[5]); |
766 |
< |
} |
767 |
< |
|
768 |
< |
sysjesmap->SetBinContent(GlobalBin,sys_jes); |
709 |
< |
sysjsumap->SetBinContent(GlobalBin,sys_jsu); |
710 |
< |
sysresmap->SetBinContent(GlobalBin,sys_res); |
711 |
< |
syspdfmap->SetBinContent(GlobalBin,sys_pdf); |
712 |
< |
systotmap->SetBinContent(GlobalBin,toterr/mceff);//total relative (!) error |
713 |
< |
sysstatmap->SetBinContent(GlobalBin,mcefferr);//total relative (!) error |
714 |
< |
dout << "A limit has been added at " << sigmas[0] << " for m_{glu}="<<mglu << " and m_{lsp}="<<mlsp<<endl; |
715 |
< |
} //end of if sigma is positive |
716 |
< |
|
717 |
< |
//end of not systematics only condition |
718 |
< |
} |
719 |
< |
if(systematicsonly) { |
720 |
< |
sysjesmap->SetBinContent(GlobalBin,sys_jes); |
721 |
< |
sysjsumap->SetBinContent(GlobalBin,sys_jsu); |
722 |
< |
sysresmap->SetBinContent(GlobalBin,sys_res); |
723 |
< |
syspdfmap->SetBinContent(GlobalBin,sys_pdf); |
724 |
< |
systotmap->SetBinContent(GlobalBin,toterr/mceff);//total relative (!) error |
725 |
< |
sysstatmap->SetBinContent(GlobalBin,mcefferr);//total relative (!) error |
726 |
< |
} |
727 |
< |
}//efficiency is valid |
751 |
> |
//shape analysis |
752 |
> |
cout << "This is the shape analysis. Have fun with it!" << endl; |
753 |
> |
stringstream PointName; |
754 |
> |
PointName << massgluname << "_" << mglu << "__" << massLSPname << "_" << mlsp; |
755 |
> |
ShapeDroplet droplet = LimitsFromShapes((scansample.collection)[scanfileindex].events,PointName.str(),mcjzb,datajzb,jzb_cut,peakerror,peakerror); |
756 |
> |
limitmap->SetBinContent(GlobalBin,droplet.observed); |
757 |
> |
explimitmap->SetBinContent(GlobalBin,droplet.expected); |
758 |
> |
exp1plimitmap->SetBinContent(GlobalBin,droplet.expectedPlus1Sigma); |
759 |
> |
exp1mlimitmap->SetBinContent(GlobalBin,droplet.expectedMinus1Sigma); |
760 |
> |
exp2plimitmap->SetBinContent(GlobalBin,droplet.expectedPlus2Sigma); |
761 |
> |
exp2mlimitmap->SetBinContent(GlobalBin,droplet.expectedMinus2Sigma); |
762 |
> |
|
763 |
> |
sysjesmap->SetBinContent(GlobalBin,droplet.JES); |
764 |
> |
sysjsumap->SetBinContent(GlobalBin,droplet.JSU); |
765 |
> |
syspdfmap->SetBinContent(GlobalBin,droplet.PDF); |
766 |
> |
systotmap->SetBinContent(GlobalBin,droplet.toterr); |
767 |
> |
sysstatmap->SetBinContent(GlobalBin,droplet.staterr); |
768 |
> |
} |
769 |
|
finish = clock(); |
770 |
|
timemap->SetBinContent(GlobalBin,((float(finish)-float(start))/CLOCKS_PER_SEC)); |
771 |
|
} |
820 |
|
systotmap->Write(); |
821 |
|
sysstatmap->Write(); |
822 |
|
XSmap->Write(); |
823 |
+ |
absXSmap->Write(); |
824 |
+ |
FilterEff->Write(); |
825 |
|
if(ibin==0) imposedxmap->Write(); |
826 |
|
if(ibin==0) realxmap->Write(); |
827 |
|
Neventsmap->Write(); |
884 |
|
syspdfmap->Write(); |
885 |
|
systotmap->Write(); |
886 |
|
sysstatmap->Write(); |
887 |
+ |
absXSmap->Write(); |
888 |
|
XSmap->Write(); |
889 |
+ |
FilterEff->Write(); |
890 |
|
if(ibin==0) imposedxmap->Write(); |
891 |
|
if(ibin==0) realxmap->Write(); |
892 |
|
timemap->Write(); |
1000 |
|
delete systotmap; |
1001 |
|
delete sysstatmap; |
1002 |
|
delete XSmap; |
1003 |
+ |
delete absXSmap; |
1004 |
|
delete limcanvas; |
1005 |
|
} |
1006 |
|
|
1007 |
< |
void scan_SUSY_parameter_space(string mcjzb,string datajzb,vector<float> jzb_cut,bool requireZ, float peakerror, float njobs=-1, float jobnumber=-1, bool systonly=false, bool effonly=false) { |
1007 |
> |
void scan_SUSY_parameter_space(string mcjzb,string datajzb,vector<float> jzb_cut,bool requireZ, float peakerror, float peakerrordata, float njobs=-1, float jobnumber=-1, bool systonly=false, bool effonly=false,bool shapeanalysis=false) { |
1008 |
|
dout << "Starting the SUSY scan now with all " << jzb_cut.size() << " bin(s)" << endl; |
1009 |
|
for(int ibin=0;ibin<jzb_cut.size();ibin++) { |
1010 |
< |
scan_SUSY_parameter_space(mcjzb,datajzb,jzb_cut,requireZ, peakerror, ibin, njobs, jobnumber,systonly,effonly); |
1010 |
> |
scan_SUSY_parameter_space(mcjzb,datajzb,jzb_cut,requireZ, peakerror, peakerrordata, ibin, njobs, jobnumber,systonly,effonly,shapeanalysis); |
1011 |
|
} |
1012 |
|
delete_any_cached_scans();// tidy up ... |
1013 |
|
} |