Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions bin/common/computeLimit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ int main(int argc, char* argv[])
//init tab
TVirtualPad* pad = t1->cd(I);
pad->SetTopMargin(0.06); pad->SetRightMargin(0.03); pad->SetBottomMargin(I<=NBins?0.09:0.12); pad->SetLeftMargin((I-1)%NBins!=0?0.09:0.12);
pad->SetLogy(true);
//pad->SetLogy(true);

//print histograms
TH1* axis = (TH1*)map_data[p->first]->Clone("axis");
Expand All @@ -1237,7 +1237,7 @@ int main(int argc, char* argv[])
axis->SetMinimum(1E-2);
axis->SetMaximum(std::max(axis->GetMaximum(), 5E1));
}else{
axis->SetMinimum(1E-1);
axis->SetMinimum(1E-2);
axis->SetMaximum(std::max(axis->GetMaximum(), 5E1));
}
if((I-1)%NBins!=0)axis->GetYaxis()->SetTitle("");
Expand All @@ -1248,7 +1248,7 @@ int main(int argc, char* argv[])
for(unsigned int i=0;i<map_signals[p->first].size();i++){
map_signals[p->first][i]->Draw("HIST same");
}
map_dataE[p->first]->Draw("P0 same");
if(!blindData) map_dataE[p->first]->Draw("P0 same");


bool printBinContent = false;
Expand Down Expand Up @@ -1312,7 +1312,7 @@ int main(int argc, char* argv[])
c1->cd(0);
double L=0.03, R=0.03, T=0.02, B=0.0;
char LumiText[1024];
if(systpostfix.Contains('3')) { double iLumi= 2269;sprintf(LumiText, "%.1f %s^{-1} (%.0f TeV)", iLumi>100?iLumi/1000:iLumi, iLumi>100?"fb":"pb", 13.0);
if(systpostfix.Contains('3')) { double iLumi= 35866;sprintf(LumiText, "%.1f %s^{-1} (%.0f TeV)", iLumi>100?iLumi/1000:iLumi, iLumi>100?"fb":"pb", 13.0);
}else if(systpostfix.Contains('8')){ double iLumi=20000;sprintf(LumiText, "%.1f %s^{-1} (%.0f TeV)", iLumi>100?iLumi/1000:iLumi, iLumi>100?"fb":"pb", 8.0);
}else{ double iLumi= 5000;sprintf(LumiText, "%.1f %s^{-1} (%.0f TeV)", iLumi>100?iLumi/1000:iLumi, iLumi>100?"fb":"pb", 7.0);
}
Expand Down Expand Up @@ -1385,8 +1385,8 @@ int main(int argc, char* argv[])
if(ch->second.shapes.find(histoName.Data())==(ch->second.shapes).end())continue;

//add the stat uncertainty is there;
ch->second.shapes[histoName.Data()].makeStatUnc("_CMS_hzz2l2v_", (TString("_")+ch->first+"_"+it->second.shortName).Data(),systpostfix.Data(), false );//add stat uncertainty to the uncertainty map;

if((it->second.shortName).find("ggH")!=std::string::npos)ch->second.shapes[histoName.Data()].makeStatUnc("_CMS_hzz2l2v_", (TString("_")+ch->first+TString("_ggH")).Data(),systpostfix.Data(), false );// attention [used to correlate Signal Shape]
else ch->second.shapes[histoName.Data()].makeStatUnc("_CMS_hzz2l2v_", (TString("_")+ch->first+"_"+it->second.shortName).Data(),systpostfix.Data(), false );


TVirtualPad* pad = t1->cd(I);
Expand Down Expand Up @@ -1631,8 +1631,9 @@ int main(int argc, char* argv[])
if(ch->second.shapes.find(histoName)==(ch->second.shapes).end())continue;
ShapeData_t& shapeInfo = ch->second.shapes[histoName];
TH1* h = shapeInfo.histo();
// shapeInfo.makeStatUnc("_CMS_hzz2l2v_", (TString("_")+ch->first+"_"+it->second.shortName).Data(),systpostfix.Data(), it->second.isSign );//add stat uncertainty to the uncertainty map;
shapeInfo.makeStatUnc("_CMS_hzz2l2v_", (TString("_")+ch->first+"_"+it->second.shortName).Data(),systpostfix.Data(), false );//add stat uncertainty to the uncertainty map;

if((it->second.shortName).find("ggH")!=std::string::npos)shapeInfo.makeStatUnc("_CMS_hzz2l2v_", (TString("_")+ch->first+TString("_ggH")).Data(),systpostfix.Data(), false );// attention [Used to correlate Signal Shapes]
else shapeInfo.makeStatUnc("_CMS_hzz2l2v_", (TString("_")+ch->first+"_"+it->second.shortName).Data(),systpostfix.Data(), false );

TString proc = it->second.shortName.c_str();
for(std::map<string, TH1* >::iterator unc=shapeInfo.uncShape.begin();unc!=shapeInfo.uncShape.end();unc++){
Expand Down
6 changes: 3 additions & 3 deletions python/HiggsWidth.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def setPhysicsOptions(self,physOptions):

def setXsec(self):
marr = [200 , 300 ,400 ,500 ,600 ,700 ,800 ,900 ,1000 ,1500 ,2000 ,2500 ,3000];
XSec100 = [0.000722821, 0.00974505, 0.0186783, 0.0170494, 0.0127224, 0.0123448, 0.00807319, 0.00694976, 0.00492894, 0.00189508, 0.000569369, 0.000196548, 5.8855e-05];
XSec010 = [0.00313343, 0.0670063, 0.218893, 0.204644, 0.145873, 0.137759, 0.086202, 0.072429, 0.0517826, 0.0192517, 0.00547137, 0.00184722, 0.000516527];
XSec001 = [0.00578392, 0.129529, 0.443913, 0.414981, 0.29471, 0.27903, 0.172004, 0.142393, 0.10418, 0.0389582, 0.0110436, 0.00363833, 0.00101596];
XSec100 = [0.000716943, 0.00960252, 0.0176147, 0.0172144, 0.0121598, 0.00997052, 0.00723416, 0.00698813, 0.0054009, 0.00189508, 0.000560771, 0.000188943, 6.75111e-05];
XSec010 = [0.00310052, 0.0659359, 0.208345, 0.206409, 0.139248, 0.108503, 0.0774346, 0.0731695, 0.0557424, 0.0192516, 0.00551768, 0.00176027, 0.000600868];
XSec001 = [0.00573029, 0.127286, 0.422868, 0.418509, 0.281284, 0.217461, 0.155051, 0.14615, 0.112064, 0.038958, 0.0110115, 0.00348143, 0.00119788];

for index in range(len(marr)):
if self.m == marr[index]:
Expand Down
3 changes: 2 additions & 1 deletion src/HiggsUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#include "TGraph.h"
#include "TSystem.h"
#include "TLorentzVector.h"
#include "UserCode/llvv_fwk/interface/th1fmorph.h"
#include "HiggsAnalysis/CombinedLimit/interface/th1fmorph.h"
//#include "UserCode/llvv_fwk/interface/th1fmorph.h"

#include <sstream>

Expand Down
6 changes: 3 additions & 3 deletions src/HxswgUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ namespace Hxswg{
double mass[13] = {200,300,400,500,600,700,800,900,1000,1500,2000,2500,3000};

//Fixed Width
double XSec100[13] = {0.000722821, 0.00974505, 0.0186783, 0.0170494, 0.0127224, 0.0123448, 0.00807319, 0.00694976, 0.00492894, 0.00189508, 0.000569369, 0.000196548, 5.8855e-05};
double XSec010[13] = {0.00313343, 0.0670063, 0.218893, 0.204644, 0.145873, 0.137759, 0.086202, 0.072429, 0.0517826, 0.0192517, 0.00547137, 0.00184722, 0.000516527};
double XSec005[13] = {0.00578392, 0.129529, 0.443913, 0.414981, 0.29471, 0.27903, 0.172004, 0.142393, 0.10418, 0.0389582, 0.0110436, 0.00363833, 0.00101596};
double XSec100[13] = {0.000716943, 0.00960252, 0.0176147, 0.0172144, 0.0121598, 0.00997052, 0.00723416, 0.00698813, 0.0054009, 0.00189508, 0.000560771, 0.000188943, 6.75111e-05};
double XSec010[13] = {0.00310052, 0.0659359, 0.208345, 0.206409, 0.139248, 0.108503, 0.0774346, 0.0731695, 0.0557424, 0.0192516, 0.00551768, 0.00176027, 0.000600868};
double XSec005[13] = {0.00573029, 0.127286, 0.422868, 0.418509, 0.281284, 0.217461, 0.155051, 0.14615, 0.112064, 0.038958, 0.0110115, 0.00348143, 0.00119788};

//Narrow Width
double XSec1[13] = {0.00952066, 0.0393434, 0.0357295, 0.0133214, 0.00500409, 0.00278995, 0.00112472, 0.000541774, 0.000283965, 4.16268e-05, 1.08999e-05, 4.70742e-06, 1.67446e-06};
Expand Down
31 changes: 12 additions & 19 deletions test/hzz2l2v/computeLimit/optimize_WideWidth.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
BIN = []
MODEL = []

LaunchOnCondor.Jobs_Queue='8nh'
LaunchOnCondor.Jobs_Queue='1nh'
FarmDirectory = "FARM"
JobName = "computeLimits"
CMSSW_BASE=os.environ.get('CMSSW_BASE')
Expand All @@ -29,37 +29,28 @@
###################################################

MODELS=["SM"] #,"RsGrav","BulkGrav","Rad"] #Models which can be used are: "RsGrav", "BulkGrav", "Rad", "SM"
based_key="2l2v_mcbased_" #to run limits on MC use: 2l2v_mcbased_, to use data driven obj use: 2l2v_datadriven_
jsonPath='$CMSSW_BASE/src/UserCode/llvv_fwk/test/hzz2l2v/samples_full2016_GGH.json'
inUrl='$CMSSW_BASE/src/UserCode/llvv_fwk/test/hzz2l2v/plotter_2017_02_17_DATA_DRIVEN_GGH_full2016_NewWidth_V5.root'
based_key="2l2v_datadriven_" #mcbased_" #to run limits on MC use: 2l2v_mcbased_, to use data driven obj use: 2l2v_datadriven_
jsonPath='$CMSSW_BASE/src/UserCode/llvv_fwk/test/hzz2l2v/samples_full2016_GGH.json' #samples_full2016_GGH_WithoutBckg.json' #samples_full2016_GGH_WithoutWZ.json' #samples_full2016_GGH_WithoutWZandZVV.json' #samples_full2016_GGH_WithoutIrriducible.json' #samples_full2016_GGH.json'
inUrl='$CMSSW_BASE/src/UserCode/llvv_fwk/test/hzz2l2v/plotter_2017_03_21_forLimits.root' #'plotter_2017_02_22_DataDriven.root'
BESTDISCOVERYOPTIM=True #Set to True for best discovery optimization, Set to False for best limit optimization
ASYMTOTICLIMIT=True #Set to True to compute asymptotic limits (faster) instead of toy based hybrid-new limits
BINS = ["eq0jets","geq1jets","vbf","eq0jets,geq1jets,vbf"] # list individual analysis bins to consider as well as combined bins (separated with a coma but without space)

#MASS = [400,600,800,1000,2000,3000]
#SUBMASS = [400,600,800,1000,2000,3000]
MASS = [200, 300, 400, 500, 600, 700, 800, 900, 1000, 1500, 2000, 2500, 3000]
SUBMASS = [200, 300, 400, 500, 600, 700, 800, 900, 1000, 1500, 2000, 2500, 3000]

#LandSArgCommonOptions=" --blind --rebin 8 --dropBckgBelow 0.00001 "
LandSArgCommonOptions=" --BackExtrapol --statBinByBin 0.00001 --dropBckgBelow 0.00001 --subNRB --blind"
#LandSArgCommonOptions=" --indexvbf 9 --subNRB --subDY $CMSSW_BASE/src/UserCode/llvv_fwk/test/hzz2l2nu/computeLimits_14_04_20/dy_from_gamma_fixed.root --interf --BackExtrapol "

for model in MODELS:
for shape in ["mt_shapes "]:# --histoVBF met_shapes"]: #here run all the shapes you want to test. '"mt_shapes --histoVBF met_shapes"' is a very particular case since we change the shape for VBF
for shape in ["mt_shapes"]:# --histoVBF met_shapes"]: #here run all the shapes you want to test. '"mt_shapes --histoVBF met_shapes"' is a very particular case since we change the shape for VBF
for bin in BINS:
if(model=="SM" or model=="MELA"):
for CP in [100.0,10.0,5.0]:
if(CP!=100.0 and not ',' in bin):continue #only do subchannel for SM
for BRN in [0.0]:
#CPSQ = CP*CP * (math.fabs(CP) / CP) #conserve sign of CP
#suffix = "_cpsq%4.2f_brn%4.2f" % (CPSQ, BRN)

suffix = "_cp%4.2f_brn%4.2f" % (CP, BRN)
#if(CPSQ<=0): suffix="" #SM case

#if ( CPSQ<=0 and not BRN==0.0):continue #SM case
#if ( (CPSQ / (1-BRN))>1.0 ):continue


#Run limit for ShapeBased GG+VBF
#signalSuffixVec += [ suffix ]
#OUTName += ["SB13TeV_SM"]
Expand Down Expand Up @@ -414,15 +405,17 @@ def findSideMassPoint(mass):

cardsdir=DataCardsDir+"/"+('%04.0f' % float(m));
SCRIPT.writelines('mkdir -p out;\ncd out;\n')
SCRIPT.writelines("computeLimit --m " + str(m) + " --in " + inUrl + " " + " --index " + indexString + " --bins " + BIN[iConf] + " --json " + jsonUrl + " " + SideMassesArgs + " " + LandSArg + cutStr +" ;\n")
SCRIPT.writelines("computeLimit --m " + str(m) + " --in " + inUrl + " " + "--syst --index " + indexString + " --bins " + BIN[iConf] + " --json " + jsonUrl + " " + SideMassesArgs + " " + LandSArg + cutStr +" ;\n")
SCRIPT.writelines("sh combineCards.sh;\n");
SCRIPT.writelines("text2workspace.py card_combined.dat -o workspace.root -P UserCode.llvv_fwk.HiggsWidth:higgswidth --PO verbose --PO \'is2l2nu\' --PO m=\'" + str(m) + "\' --PO w=\'" + str(cp) + "\' \n")
#compute pvalue
SCRIPT.writelines("combine -M ProfileLikelihood --signif --pvalue -m " + str(m) + " workspace.root > COMB.log;\n")
SCRIPT.writelines("combine -M MaxLikelihoodFit workspace.root \n")
SCRIPT.writelines("python " + CMSSW_BASE + "/src/HiggsAnalysis/CombinedLimit/test/diffNuisances.py mlfit.root -g Nuisance_CrossCheck.root \n")

### THIS IS FOR Asymptotic fit
if(ASYMTOTICLIMIT==True):
SCRIPT.writelines("combine -M Asymptotic -m " + str(m) + " workspace.root -v 3 > COMB.log;\n")
SCRIPT.writelines("combine -M Asymptotic -m " + str(m) + " workspace.root --run blind -v 3 > COMB.log;\n")

### THIS is for toy (hybridNew) fit
else:
Expand Down Expand Up @@ -469,7 +462,7 @@ def findSideMassPoint(mass):
else:
os.system("hadd -f "+DataCardsDir+"/LimitTree.root "+DataCardsDir+"/*/higgsCombineTest.HybridNewMerged.*.root > /dev/null")

os.system("root -l -b -q plotLimit.C+'(\""+DataCardsDir+"/Stength_\",\""+DataCardsDir+"/LimitTree.root\",\"\", false, true, 13 , 36814.143 )'")
os.system("root -l -b -q plotLimit.C+'(\""+DataCardsDir+"/Stength_\",\""+DataCardsDir+"/LimitTree.root\",\"\", false, true, 13 , 35914.143 )'")

######################################################################

Expand Down
Loading