diff --git a/.gitignore b/.gitignore
index 755f33a..9027dc0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
*/OutDir/*
screenlog.0
+.DS_Store
+*.pyc
*.tex
*.png
*.log
diff --git a/ControlPlots/.DibosonBoostedElMuCuts13TeV_WjetControlRegion_Tighter_CHS_BoostedCat.txt.swp b/ControlPlots/.DibosonBoostedElMuCuts13TeV_WjetControlRegion_Tighter_CHS_BoostedCat.txt.swp
new file mode 100644
index 0000000..e69de29
diff --git a/ControlPlots/.HZZ2l2nu_Cuts_DrellYan.txt.swp b/ControlPlots/.HZZ2l2nu_Cuts_DrellYan.txt.swp
new file mode 100644
index 0000000..e69de29
diff --git a/ControlPlots/.gitignore b/ControlPlots/.gitignore
new file mode 100644
index 0000000..1d74e21
--- /dev/null
+++ b/ControlPlots/.gitignore
@@ -0,0 +1 @@
+.vscode/
diff --git a/ControlPlots/CMS_lumi.C b/ControlPlots/CMS_lumi.C
index 38ffc55..908c335 100644
--- a/ControlPlots/CMS_lumi.C
+++ b/ControlPlots/CMS_lumi.C
@@ -1,11 +1,11 @@
#include "CMS_lumi.h"
#include
-void
+void
CMS_lumi( TPad* pad, int iPeriod, int iPosX )
-{
+{
bool outOfFrame = false;
- if( iPosX/10==0 )
+ if( iPosX/10==0 )
{
outOfFrame = true;
}
@@ -41,9 +41,9 @@ CMS_lumi( TPad* pad, int iPeriod, int iPosX )
lumiText += lumi_8TeV;
lumiText += " (8 TeV)";
}
- else if( iPeriod==3 )
+ else if( iPeriod==3 )
{
- lumiText = lumi_8TeV;
+ lumiText = lumi_8TeV;
lumiText += " (8 TeV)";
lumiText += " + ";
lumiText += lumi_7TeV;
@@ -55,12 +55,12 @@ CMS_lumi( TPad* pad, int iPeriod, int iPosX )
lumiText += " (13 TeV)";
}
else if ( iPeriod==7 )
- {
+ {
if( outOfFrame ) lumiText += "#scale[0.85]{";
- lumiText += lumi_13TeV;
+ lumiText += lumi_13TeV;
lumiText += " (13 TeV)";
lumiText += " + ";
- lumiText += lumi_8TeV;
+ lumiText += lumi_8TeV;
lumiText += " (8 TeV)";
lumiText += " + ";
lumiText += lumi_7TeV;
@@ -75,29 +75,29 @@ CMS_lumi( TPad* pad, int iPeriod, int iPosX )
{
lumiText += lumi_sqrtS;
}
-
- std::cout << lumiText << endl;
+
+ std::cout << lumiText << std::endl;
TLatex latex;
latex.SetNDC();
latex.SetTextAngle(0);
- latex.SetTextColor(kBlack);
+ latex.SetTextColor(kBlack);
float extraTextSize = extraOverCmsTextSize*cmsTextSize;
latex.SetTextFont(42);
- latex.SetTextAlign(31);
- latex.SetTextSize(lumiTextSize*t);
+ latex.SetTextAlign(31);
+ latex.SetTextSize(lumiTextSize*t);
latex.DrawLatex(1-r,1-t+lumiTextOffset*t,lumiText);
if( outOfFrame )
{
latex.SetTextFont(cmsTextFont);
- latex.SetTextAlign(11);
- latex.SetTextSize(cmsTextSize*t);
+ latex.SetTextAlign(11);
+ latex.SetTextSize(cmsTextSize*t);
latex.DrawLatex(l,1-t+lumiTextOffset*t,cmsText);
}
-
+
pad->cd();
float posX_=0;
@@ -138,7 +138,7 @@ CMS_lumi( TPad* pad, int iPeriod, int iPosX )
latex.SetTextSize(cmsTextSize*t);
latex.SetTextAlign(align_);
latex.DrawLatex(posX_, posY_, cmsText);
- if( writeExtraText )
+ if( writeExtraText )
{
latex.SetTextFont(extraTextFont);
latex.SetTextAlign(align_);
@@ -149,7 +149,7 @@ CMS_lumi( TPad* pad, int iPeriod, int iPosX )
}
else if( writeExtraText )
{
- if( iPosX==0)
+ if( iPosX==0)
{
posX_ = l + relPosX*(1-l-r);
posY_ = 1-t+lumiTextOffset*t;
@@ -157,7 +157,7 @@ CMS_lumi( TPad* pad, int iPeriod, int iPosX )
latex.SetTextFont(extraTextFont);
latex.SetTextSize(extraTextSize*t);
latex.SetTextAlign(align_);
- latex.DrawLatex(posX_, posY_, extraText);
+ latex.DrawLatex(posX_, posY_, extraText);
}
return;
}
diff --git a/ControlPlots/CMS_lumi.h b/ControlPlots/CMS_lumi.h
index e3aefdd..ded49a4 100644
--- a/ControlPlots/CMS_lumi.h
+++ b/ControlPlots/CMS_lumi.h
@@ -29,7 +29,7 @@ float relExtraDY = 1.2;
// ratio of "CMS" and extra text size
float extraOverCmsTextSize = 0.76;
-TString lumi_13TeV = "35.9 fb^{-1}";
+TString lumi_13TeV = "59.8 fb^{-1}";
TString lumi_8TeV = "19.7 fb^{-1}";
TString lumi_7TeV = "5.1 fb^{-1}";
TString lumi_sqrtS = "";
diff --git a/ControlPlots/CMS_lumi.py b/ControlPlots/CMS_lumi.py
deleted file mode 100644
index 75db730..0000000
--- a/ControlPlots/CMS_lumi.py
+++ /dev/null
@@ -1,155 +0,0 @@
-import ROOT as rt
-
-# CMS_lumi
-# Initiated by: Gautier Hamel de Monchenault (Saclay)
-# Translated in Python by: Joshua Hardenbrook (Princeton)
-#
-
-cmsText = "CMS";
-cmsTextFont = 61
-
-writeExtraText = True
-extraText = "Very Preliminary"
-extraTextFont = 52
-
-lumiTextSize = 0.5
-lumiTextOffset = 0.2
-
-cmsTextSize = 0.5
-cmsTextOffset = 0.1
-
-relPosX = 0.045
-relPosY = 0.035
-relExtraDY = 1.2
-
-extraOverCmsTextSize = 0.76
-
-lumi_13TeV = "20.1 fb^{-1}"
-lumi_8TeV = "19.7 fb^{-1}"
-lumi_7TeV = "5.1 fb^{-1}"
-
-drawLogo = False
-
-def CMS_lumi(pad, iPeriod, iPosX ):
- outOfFrame = False
- if(iPosX/10==0 ): outOfFrame = True
-
- alignY_=3
- alignX_=2
- if( iPosX/10==0 ): alignX_=1
- if( iPosX==0 ): alignY_=1
- if( iPosX/10==1 ): alignX_=1
- if( iPosX/10==2 ): alignX_=2
- if( iPosX/10==3 ): alignX_=2
- align_ = 10*alignX_ + alignY_
-
- H = pad.GetWh()
- W = pad.GetWw()
- l = pad.GetLeftMargin()
- t = pad.GetTopMargin()
- r = pad.GetRightMargin()
- b = pad.GetBottomMargin()
- e = 0.025
-
- pad.cd()
-
- lumiText = ""
- if( iPeriod==1 ):
- lumiText += lumi_7TeV
- lumiText += " (7 TeV)"
- elif ( iPeriod==2 ):
- lumiText += lumi_8TeV
- lumiText += " (8 TeV)"
-
- elif( iPeriod==3 ):
- lumiText = lumi_8TeV
- lumiText += " (8 TeV)"
- lumiText += " + "
- lumiText += lumi_7TeV
- lumiText += " (7 TeV)"
- elif ( iPeriod==4 ):
- lumiText += lumi_13TeV
- lumiText += " (13 TeV)"
- elif ( iPeriod==7 ):
- if( outOfFrame ):lumiText += "#scale[0.85]{"
- lumiText += lumi_13TeV
- lumiText += " (13 TeV)"
- lumiText += " + "
- lumiText += lumi_8TeV
- lumiText += " (8 TeV)"
- lumiText += " + "
- lumiText += lumi_7TeV
- lumiText += " (7 TeV)"
- if( outOfFrame): lumiText += "}"
- elif ( iPeriod==12 ):
- lumiText += "8 TeV"
-
- print lumiText
-
- latex = rt.TLatex()
- latex.SetNDC()
- latex.SetTextAngle(0)
- latex.SetTextColor(rt.kBlack)
-
- extraTextSize = extraOverCmsTextSize*cmsTextSize
-
- latex.SetTextFont(42)
- latex.SetTextAlign(31)
- latex.SetTextSize(lumiTextSize*t)
-
- latex.DrawLatex(1-r,1-t+lumiTextOffset*t,lumiText)
-
- if( outOfFrame ):
- latex.SetTextFont(cmsTextFont)
- latex.SetTextAlign(11)
- latex.SetTextSize(cmsTextSize*t)
- latex.DrawLatex(l,1-t+lumiTextOffset*t,cmsText)
-
- pad.cd()
-
- posX_ = 0
- if( iPosX%10<=1 ):
- posX_ = l + relPosX*(1-l-r)
- elif( iPosX%10==2 ):
- posX_ = l + 0.5*(1-l-r)
- elif( iPosX%10==3 ):
- posX_ = 0.92-r - relPosX*(1-l-r)
-
- posY_ = 1-t - relPosY*(1-t-b)
-
- if( not outOfFrame ):
- if( drawLogo ):
- posX_ = l + 0.045*(1-l-r)*W/H
- posY_ = 1-t - 0.045*(1-t-b)
- xl_0 = posX_
- yl_0 = posY_ - 0.15
- xl_1 = posX_ + 0.15*H/W
- yl_1 = posY_
- CMS_logo = rt.TASImage("CMS-BW-label.png")
- pad_logo = rt.TPad("logo","logo", xl_0, yl_0, xl_1, yl_1 )
- pad_logo.Draw()
- pad_logo.cd()
- CMS_logo.Draw("X")
- pad_logo.Modified()
- pad.cd()
- else:
- latex.SetTextFont(cmsTextFont)
- latex.SetTextSize(cmsTextSize*t)
- latex.SetTextAlign(align_)
- latex.DrawLatex(posX_, posY_, cmsText)
- if( writeExtraText ) :
- latex.SetTextFont(extraTextFont)
- latex.SetTextAlign(align_)
- latex.SetTextSize(extraTextSize*t)
- latex.DrawLatex(posX_, posY_- relExtraDY*cmsTextSize*t, extraText)
- elif( writeExtraText ):
- if( iPosX==0):
- posX_ = l + relPosX*(1-l-r)
- posY_ = 1-t+lumiTextOffset*t
-
- latex.SetTextFont(extraTextFont)
- latex.SetTextSize(extraTextSize*t)
- latex.SetTextAlign(align_)
- latex.DrawLatex(posX_, posY_, extraText)
-
- pad.Update()
diff --git a/ControlPlots/Commands.md b/ControlPlots/Commands.md
new file mode 100644
index 0000000..d69a59f
--- /dev/null
+++ b/ControlPlots/Commands.md
@@ -0,0 +1,5 @@
+```bash
+$ root -l -b
+root [0] .L myControlPlots.C
+root [1] myControlPlots("HZZ2l2nu_Cuts_LowMETControlRegion.txt", "DibosonBoostedElMuSamples13TeV_2019_03_29_03h24_v4.txt", controlplotvars_CHS , "WjetControlRegion.root", 1)
+```
diff --git a/ControlPlots/DibosonBoostedElMuCuts13TeV_2LEP_Tighter_CHS.txt b/ControlPlots/DibosonBoostedElMuCuts13TeV_2LEP_Tighter_CHS.txt
deleted file mode 100644
index bdf20ba..0000000
--- a/ControlPlots/DibosonBoostedElMuCuts13TeV_2LEP_Tighter_CHS.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-# Name Cut string
-#"type=ele(1),muon(0)
-"mu" "(type==0||type==1)"
-"1 lepton" "(l_pt1_Down>30 && (((type==0)&&(abs(l_eta1)<2.4)) || ((type==1)&&((abs(l_eta1)<2.5)&&!(abs(l_eta1)>1.4442 && abs(l_eta1)<1.566)))))"
-"2 lepton" "(l_pt2_Down>30 && (((type==0)&&(abs(l_eta2)<2.4)) || ((type==1)&&((abs(l_eta2)<2.5)&&!(abs(l_eta2)>1.4442 && abs(l_eta2)<1.566)))))"
-"7676 && dilep_m<107)"
-"Good FatJet" "((ungroomed_PuppiAK8_jet_pt>200)&&(abs(ungroomed_PuppiAK8_jet_eta)<2.4)&&(PuppiAK8_jet_tau2tau1<0.55))"
-"Anti-btag VBF jets" "(nBTagJet_loose==0)"
-"VBF Mjj > 800" "(vbf_maxpt_jj_m>800)"
-"VBF jet deta > 4.0" "(abs(vbf_maxpt_j2_eta-vbf_maxpt_j1_eta)>4.0)"
-"VBF jet pts > 30" "((vbf_maxpt_j1_pt>30) && (vbf_maxpt_j2_pt>30))"
-#
-"m_{J}<50 && m_{J}>105" "(PuppiAK8_jet_mass_so_corr>65 && PuppiAK8_jet_mass_so_corr<105)"
-#"m_{J}<50 && m_{J}>105" "((((PuppiAK8_jet_mass_so_corr>105) && (PuppiAK8_jet_mass_so_corr<105))))"
-#"m_{J}<40 && m_{J}>105" "((((PuppiAK8_jet_mass_so_corr>40) && (PuppiAK8_jet_mass_so_corr<65)) || ((PuppiAK8_jet_mass_so_corr>105) && (PuppiAK8_jet_mass_so_corr<150))))"
-#
-"mass cut" "(mass_llj_PuppiAK8_LEP_Down>600)"
diff --git a/ControlPlots/DibosonBoostedElMuCuts13TeV_LEP_Tighter_CHS.txt b/ControlPlots/DibosonBoostedElMuCuts13TeV_LEP_Tighter_CHS.txt
deleted file mode 100644
index a3e27bc..0000000
--- a/ControlPlots/DibosonBoostedElMuCuts13TeV_LEP_Tighter_CHS.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-# Name Cut string
-#"type=ele(1),muon(0)
-"mu" "(type==0||type==1)"
-"1 lepton" "(l_pt2<0 && l_pt1>30 && (((type==0)&&(abs(l_eta1)<2.4)) || ((type==1)&&((abs(l_eta1)<2.5)&&!(abs(l_eta1)>1.4442 && abs(l_eta1)<1.566)))))"
-"pfMETpuppi>30" "(((type==0)&&(pfMET_Corr>50)) || ((type==1)&&(pfMET_Corr>80)))"
-"Good FatJet" "((ungroomed_PuppiAK8_jet_pt>200)&&(abs(ungroomed_PuppiAK8_jet_eta)<2.4)&&(PuppiAK8_jet_tau2tau1<0.55))"
-##
-"m_{J}<50 && m_{J}>110" "(PuppiAK8_jet_mass_so_corr>65 && PuppiAK8_jet_mass_so_corr<105)"
-##"m_{J}<50 && m_{J}>110" "((((PuppiAK8_jet_mass_so_corr>105) && (PuppiAK8_jet_mass_so_corr<125))))"
-##"m_{J}<40 && m_{J}>125" "((((PuppiAK8_jet_mass_so_corr>40) && (PuppiAK8_jet_mass_so_corr<65)) || ((PuppiAK8_jet_mass_so_corr>125) && (PuppiAK8_jet_mass_so_corr<150))))"
-#"m_{J}<40 && m_{J}>125" "((((PuppiAK8_jet_mass_so_corr>40) && (PuppiAK8_jet_mass_so_corr<65)) || ((PuppiAK8_jet_mass_so_corr>105) && (PuppiAK8_jet_mass_so_corr<150))))"
-"Anti-btag VBF jets" "(nBTagJet_loose==0)"
-"VBF Mjj > 800" "(vbf_maxpt_jj_m>800)"
-"VBF jet deta > 4.0" "(abs(vbf_maxpt_j2_eta-vbf_maxpt_j1_eta)>4.0)"
-"VBF jet pts > 30" "((vbf_maxpt_j1_pt>30) && (vbf_maxpt_j2_pt>30))"
-##
-"mass cut" "(mass_lvj_type0_PuppiAK8>600)"
-##
-"Centrality" "(BosonCentrality_type0>1.0)"
-"Zeppenfeld30.) && (abs(l_eta1)<2.5))"
-"Good FatJet" "((ungroomed_PuppiAK8_jet_pt>200)&&(abs(ungroomed_PuppiAK8_jet_eta)<2.4))"
-"VBF jet pts > 30" "((vbf_maxpt_j1_pt>30) && (vbf_maxpt_j2_pt>30))"
-"VBF Mjj > 500" "(vbf_maxpt_jj_m>500)"
-#
-# Final Selection
-#
-"Loose b-tag Veto" "(nBTagJet_loose==0)"
-"pfMET_Corr>50" "(pfMET_Corr>50)"
-"Tau2/1" "((PuppiAK8_jet_tau2tau1<0.55))"
-"m_{J}>65 && m_{J}<105" "((PuppiAK8_jet_mass_so>65) && (PuppiAK8_jet_mass_so<105))"
-"(mjj>800&deta<4)||(mjj<800&deta>4)" "((vbf_maxpt_jj_m>800 && vbf_maxpt_jj_Deta<4.0) || (vbf_maxpt_jj_m<800 && vbf_maxpt_jj_Deta>4.0) || (vbf_maxpt_jj_m<800 && vbf_maxpt_jj_Deta<4.0))"
-"BosonCentrality>1.0" "(BosonCentrality_type0>1.0)"
-"ZeppenfeldWL<0.3" "(abs(ZeppenfeldWL_type0/vbf_maxpt_jj_Deta)<0.3)"
-"Zeppenfeldh 4.0" "(abs(vbf_maxpt_j2_eta-vbf_maxpt_j1_eta)>4.0)"
-#"VBF Mjj > 800" "(vbf_maxpt_jj_m>800)"
-###">=0 Medium b-tag AK4" "(nBTagJet_medium>0)"
-###"W p_{T}>200" "(v_pt_type0>200.)"
-#####"HF Exclusion" "(abs(vbf_maxpt_j1_eta)<3.0)"
-#####"HF Exclusion" "(abs(vbf_maxpt_j2_eta)<3.0)"
-#"VBF Mjj > 800" "(vbf_maxpt_jj_m>800)"
-###"Diboson Topology" "(issignal_PuppiAK8==1)"
-##"PtBalance_type0<0.3" "(PtBalance_type0<0.3)"
-####"HT>500" "(ungroomed_PuppiAK8_jet_pt+vbf_maxpt_j1_pt+vbf_maxpt_j2_pt > 500)"
-####"costheta2_type0>0.5" "(costheta2_type0>0.5)"
-##"deltaphi_METPuppiak8jet>2.5" "(deltaphi_METPuppiak8jet>2.5)"
-##"mass_lvj_type0>600" "(mass_lvj_type0>600)"
diff --git a/ControlPlots/DibosonBoostedElMuCuts13TeV_QCD_CHS.txt b/ControlPlots/DibosonBoostedElMuCuts13TeV_QCD_CHS.txt
deleted file mode 100644
index 2836f77..0000000
--- a/ControlPlots/DibosonBoostedElMuCuts13TeV_QCD_CHS.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-# Name Cut string
-#"type=ele(1),muon(0)
-#
-# MANDATORY CUTS
-#
-#"El or Mu" "((type==1) || (type==0))"
-"Electron" "((type==1))"
-"1 lepton" "(l_pt2<0)"
-#
-# PRE SELECTION
-#
-#"Good Muon" "((l_pt1>30.) && (abs(l_eta1)<2.5))"
-"Good Muon" "((l_pt1>30.) && (abs(l_eta1)<2.5) && (l_iso1<0.63))"
-#"Good Muon" "((l_pt1>30.) && (abs(l_eta1)<2.5) && (l_iso1>0.0588 && l_iso1<0.16))"
-#"Good Muon" "((l_pt1>30.) && (abs(l_eta1)<2.5) && (l_iso1>0.0045 && l_iso1<0.16))"
-"Good FatJet" "((ungroomed_PuppiAK8_jet_pt>200)&&(abs(ungroomed_PuppiAK8_jet_eta)<2.4))"
-"VBF jet pts > 30" "((vbf_maxpt_j1_pt>30) && (vbf_maxpt_j2_pt>30))"
-"VBF Mjj > 500" "(vbf_maxpt_jj_m>500)"
-#"s>4" "(pfMET_Corr/(sqrt(vbf_maxpt_j1_pt+vbf_maxpt_j2_pt+ungroomed_PuppiAK8_jet_pt+l_pt1)) < 4.0)"
-#
-# Final Selection
-#
-#"deltaphi_VPuppiak8jet" "(deltaphi_VPuppiak8jet>2.8)"
-#"deltaphi_METmin" "(deltaphi_METmin>1.0)"
-"Loose b-tag Veto" "(nBTagJet_loose==0)"
-"pfMET_Corr<50" "(pfMET_Corr<50)"
-"Tau2/1<0.55" "((PuppiAK8_jet_tau2tau1<0.55))"
-#"m_{J}<65 && m_{J}>105" "((PuppiAK8_jet_mass_so>40 && PuppiAK8_jet_mass_so<65) || (PuppiAK8_jet_mass_so>105 && PuppiAK8_jet_mass_so<150))"
-"m_{J}<65 && m_{J}>105" "((PuppiAK8_jet_mass_so>65 && PuppiAK8_jet_mass_so<105))"
-"VBF jet deta > 4.0" "(abs(vbf_maxpt_j2_eta-vbf_maxpt_j1_eta)>4.0)"
-"VBF Mjj > 800" "(vbf_maxpt_jj_m>800)"
-#"VBF Mjj > 800" "((vbf_maxpt_jj_m>800 && abs(vbf_maxpt_j2_eta-vbf_maxpt_j1_eta)<4.0) || (vbf_maxpt_jj_m<800 && abs(vbf_maxpt_j2_eta-vbf_maxpt_j1_eta)>4.0))"
-"BosonCentrality>1.0" "(BosonCentrality_type0>1.0)"
-"ZeppenfeldWL<0.3" "(abs(ZeppenfeldWL_type0/vbf_maxpt_jj_Deta)<0.3)"
-"Zeppenfeldh450)"
-#"l_pt1/pfMET_Corr" "(l_pt1/pfMET_Corr>0.7)"
diff --git a/ControlPlots/DibosonBoostedElMuCuts13TeV_QCD_Shape.txt b/ControlPlots/DibosonBoostedElMuCuts13TeV_QCD_Shape.txt
deleted file mode 100644
index f007918..0000000
--- a/ControlPlots/DibosonBoostedElMuCuts13TeV_QCD_Shape.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-# Name Cut string
-#"type=ele(1),muon(0)
-#
-# MANDATORY CUTS
-#
-#"El or Mu" "((type==1) || (type==0))"
-#
-# PRE SELECTION
-#
-"Good Muon" "((l_pt1>30.) && (abs(l_eta1)<2.5))"
-"Good Muon" "((l_pt2>30.) && (abs(l_eta2)<2.5))"
-"Good FatJet" "((ungroomed_PuppiAK8_jet_pt>200)&&(abs(ungroomed_PuppiAK8_jet_eta)<2.4))"
-"VBF jet pts > 30" "((vbf_maxpt_j1_pt>30) && (vbf_maxpt_j2_pt>30))"
-"VBF Mjj > 500" "(vbf_maxpt_jj_m>500)"
-#
-# Final Selection
-#
-"Loose b-tag Veto" "(nBTagJet_loose==0)"
-#"pfMET_Corr<50" "(pfMET_Corr>50)"
-"Tau2/1<0.55" "((PuppiAK8_jet_tau2tau1<0.55))"
-##"m_{J}<65 && m_{J}>105" "((PuppiAK8_jet_mass_so>40 && PuppiAK8_jet_mass_so<65) || (PuppiAK8_jet_mass_so>105 && PuppiAK8_jet_mass_so<150))"
-"m_{J}<65 && m_{J}>105" "((PuppiAK8_jet_mass_so>65 && PuppiAK8_jet_mass_so<105))"
-"VBF jet deta > 4.0" "(abs(vbf_maxpt_j2_eta-vbf_maxpt_j1_eta)>4.0)"
-"VBF Mjj > 800" "(vbf_maxpt_jj_m>800)"
-"BosonCentrality>1.0" "(BosonCentrality_type0>1.0)"
-"ZeppenfeldWL<0.3" "(abs(ZeppenfeldWL_type0/vbf_maxpt_jj_Deta)<0.3)"
-"Zeppenfeldh400)"
-##"l_pt1/pfMET_Corr" "(l_pt1/pfMET_Corr>0.7)"
diff --git a/ControlPlots/DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt b/ControlPlots/DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt
deleted file mode 100644
index 4f964d9..0000000
--- a/ControlPlots/DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-# Name Cut string
-#"type=ele(1),muon(0)
-"mu" "(type==0||type==1)"
-"1 lepton" "(l_pt2<0 && l_pt1>50 && (((type==0)&&(abs(l_eta1)<2.4)) || ((type==1)&&((abs(l_eta1)<2.5)&&!(abs(l_eta1)>1.4442 && abs(l_eta1)<1.566)))))"
-"pfMETpuppi>30" "(((type==0)&&(pfMET_Corr>50)) || ((type==1)&&(pfMET_Corr>80)))"
-"Good FatJet" "((ungroomed_PuppiAK8_jet_pt>200)&&(abs(ungroomed_PuppiAK8_jet_eta)<2.4)&&(PuppiAK8_jet_tau2tau1<0.55))"
-"m_{J}<40 && m_{J}>125" "((PuppiAK8_jet_mass_so_corr>65) && (PuppiAK8_jet_mass_so_corr<105))"
-"Anti-btag VBF jets" "(nBTagJet_loose==0)"
-"VBF Mjj > 800" "(vbf_maxpt_jj_m>800)"
-"VBF jet deta > 4.0" "(abs(vbf_maxpt_j2_eta-vbf_maxpt_j1_eta)>4.0)"
-"VBF jet pts > 30" "((vbf_maxpt_j1_pt>30) && (vbf_maxpt_j2_pt>30))"
-"mass cut" "(mass_lvj_type0_PuppiAK8>600)"
-"Centrality" "(BosonCentrality_type0>1.0)"
-"Zeppenfeld50 && (((type==0)&&(abs(l_eta1)<2.4)) || ((type==1)&&((abs(l_eta1)<2.5)&&!(abs(l_eta1)>1.4442 && abs(l_eta1)<1.566)))))"
-"pfMETpuppi>30" "(((type==0)&&(pfMET_Corr>50)) || ((type==1)&&(pfMET_Corr>80)))"
-"Good FatJet" "((ungroomed_PuppiAK8_jet_pt>200)&&(abs(ungroomed_PuppiAK8_jet_eta)<2.4)&&(PuppiAK8_jet_tau2tau1<0.55))"
-"m_{J}<65 && m_{J}>105" "(PuppiAK8_jet_mass_so_corr>65 && PuppiAK8_jet_mass_so_corr<105)"
-">=0 Medium b-tag AK4" "(nBTagJet_medium>0)"
-"VBF Mjj > 800" "(vbf_maxpt_jj_m>800)"
-"VBF jet deta > 4.0" "(abs(vbf_maxpt_j2_eta-vbf_maxpt_j1_eta)>4.0)"
-"VBF jet pts > 30" "((vbf_maxpt_j1_pt>30) && (vbf_maxpt_j2_pt>30))"
-"mass cut" "(mass_lvj_type0_PuppiAK8>600)"
-"Zeppenfeld1.0)"
diff --git a/ControlPlots/DibosonBoostedElMuCuts13TeV_WjetControlRegion_Tighter_CHS.txt b/ControlPlots/DibosonBoostedElMuCuts13TeV_WjetControlRegion_Tighter_CHS.txt
deleted file mode 100644
index a1cb019..0000000
--- a/ControlPlots/DibosonBoostedElMuCuts13TeV_WjetControlRegion_Tighter_CHS.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-# Name Cut string
-#"type=ele(1),muon(0)
-"mu" "(type==0||type==1)"
-"1 lepton" "(l_pt2<0 && l_pt1>50 && (((type==0)&&(abs(l_eta1)<2.4)) || ((type==1)&&((abs(l_eta1)<2.5)&&!(abs(l_eta1)>1.4442 && abs(l_eta1)<1.566)))))"
-"pfMETpuppi>30" "(((type==0)&&(pfMET_Corr>50)) || ((type==1)&&(pfMET_Corr>80)))"
-"Good FatJet" "((ungroomed_PuppiAK8_jet_pt>200)&&(abs(ungroomed_PuppiAK8_jet_eta)<2.4)&&(PuppiAK8_jet_tau2tau1<0.55))"
-"m_{J}<40 && m_{J}>125" "((((PuppiAK8_jet_mass_so_corr>40) && (PuppiAK8_jet_mass_so_corr<65)) || ((PuppiAK8_jet_mass_so_corr>105) && (PuppiAK8_jet_mass_so_corr<150))))"
-"Anti-btag VBF jets" "(nBTagJet_loose==0)"
-"VBF Mjj > 800" "(vbf_maxpt_jj_m>800)"
-"VBF jet deta > 4.0" "(abs(vbf_maxpt_j2_eta-vbf_maxpt_j1_eta)>4.0)"
-"VBF jet pts > 30" "((vbf_maxpt_j1_pt>30) && (vbf_maxpt_j2_pt>30))"
-"mass cut" "(mass_lvj_type0_PuppiAK8>600)"
-"Centrality" "(BosonCentrality_type0>1.0)"
-"Zeppenfeld50 && (((type==0)&&(abs(l_eta1)<2.4)) || ((type==1)&&((abs(l_eta1)<2.5)&&!(abs(l_eta1)>1.4442 && abs(l_eta1)<1.566)))))"
-"2 lepton" "(l_pt2>30 && (((type==0)&&(abs(l_eta2)<2.4)) || ((type==1)&&((abs(l_eta2)<2.5)&&!(abs(l_eta2)>1.4442 && abs(l_eta2)<1.566)))))"
-#"lep charge" "((l_charge1>0 && l_charge2<0) || (l_charge1<0 && l_charge2>0))"
-"7676 && dilep_m<107)"
-"Good FatJet" "((ungroomed_PuppiAK8_jet_pt>200)&&(abs(ungroomed_PuppiAK8_jet_eta)<2.4)&&(PuppiAK8_jet_tau2tau1<0.55))"
-"Anti-btag VBF jets" "(nBTagJet_loose==0)"
-"VBF Mjj > 800" "(vbf_maxpt_jj_m>800)"
-"VBF jet deta > 4.0" "(abs(vbf_maxpt_j2_eta-vbf_maxpt_j1_eta)>4.0)"
-"VBF jet pts > 30" "((vbf_maxpt_j1_pt>30) && (vbf_maxpt_j2_pt>30))"
-"m_{J}<40 && m_{J}>105" "((((PuppiAK8_jet_mass_so_corr>40) && (PuppiAK8_jet_mass_so_corr<65)) || ((PuppiAK8_jet_mass_so_corr>105) && (PuppiAK8_jet_mass_so_corr<150))))"
-"mass cut" "(mass_llj_PuppiAK8>600)"
diff --git a/ControlPlots/DibosonBoostedElMuSamples13TeV_2019_03_29_03h24.txt b/ControlPlots/DibosonBoostedElMuSamples13TeV_2019_03_29_03h24.txt
deleted file mode 100644
index 1c12e70..0000000
--- a/ControlPlots/DibosonBoostedElMuSamples13TeV_2019_03_29_03h24.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-# name file_location xspb/lumipb otherscale nMCevents nMCNegEvents colorcode stackit
-#data /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/SingleElectron.root 35867.06 1 1 0 1 0
-#data /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/SingleMuon.root 35867.06 1 1 0 1 0
-data /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/Data.root 35867.06 1 1 0 1 0
-WV_EWK /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WminusTo2JZTo2LJJ_EWK_LO_SM.root 0.02982 1 189086.0 0.0 840 0
-WV_EWK /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WminusToLNuWminusTo2JJJ_EWK_LO_SM.root 0.03259 1 189560.0 0.0 840 0
-WV_EWK /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WminusToLNuZTo2JJJ_EWK_LO_SM.root 0.1 1 199542.0 0.0 840 0
-WV_EWK /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WplusTo2JWminusToLNuJJ_EWK_LO_SM.root 0.9107 1 1983847.0 0.0 840 0
-WV_EWK /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WplusTo2JZTo2LJJ_EWK_LO_SM.root 0.05401 1 198922.0 0.0 840 0
-WV_EWK /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WplusToLNuWminusTo2JJJ_EWK_LO_SM.root 0.9114 1 1991227.0 0.0 840 0
-WV_EWK /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WplusToLNuWplusTo2JJJ_EWK_LO_SM.root 0.08793 1 198848.0 0.0 840 0
-WV_EWK /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WplusToLNuZTo2JJJ_EWK_LO_SM.root 0.1825 1 393171.0 0.0 840 0
-WV_EWK /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/ZTo2LZTo2JJJ_EWK_LO_SM.root 0.01589 1 99997.0 0.0 840 0
-#aQGC /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WminusTo2JZTo2LJJ_EWK_LO_aQGC.root 0.2223 1 168679.0 0.0 500 0
-#aQGC /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WminusToLNuWminusTo2JJJ_EWK_LO_aQGC.root 0.5067 1 190106.0 0.0 500 0
-#aQGC /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WminusToLNuZTo2JJJ_EWK_LO_aQGC.root 0.7414 1 160194.0 0.0 500 0
-#aQGC /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WplusTo2JWminusToLNuJJ_EWK_LO_aQGC.root 17.92 1 1706220.0 0.0 500 0
-#aQGC /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WplusTo2JZTo2LJJ_EWK_LO_aQGC.root 0.5686 1 149363.0 0.0 500 0
-#aQGC /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WplusToLNuWminusTo2JJJ_EWK_LO_aQGC.root 17.94 1 1640169.0 0.0 500 0
-#aQGC /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WplusToLNuWplusTo2JJJ_EWK_LO_aQGC.root 3.451 1 199858.0 0.0 500 0
-#aQGC /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WplusToLNuZTo2JJJ_EWK_LO_aQGC.root 1.895 1 349000.0 0.0 500 0
-#aQGC /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/ZTo2LZTo2JJJ_EWK_LO_aQGC.root 3.361 1 99392.0 0.0 500 0
-Diboson /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WminusTo2JZTo2LJJ_QCD_LO_SM.root 0.3488 1 489280.0 0.0 400 1
-Diboson /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WminusToLNuWminusTo2JJJ_QCD_LO_SM.root 0.03203 1 99657.0 0.0 400 1
-Diboson /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WminusToLNuZTo2JJJ_QCD_LO_SM.root 1.166 1 981540.0 0.0 400 1
-Diboson /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WplusTo2JWminusToLNuJJ_QCD_LO_SM.root 5.568 1 3994663.0 0.0 400 1
-Diboson /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WplusTo2JZTo2LJJ_QCD_LO_SM.root 0.575 1 499432.0 0.0 400 1
-Diboson /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WplusToLNuWminusTo2JJJ_QCD_LO_SM.root 5.546 1 3949170.0 0.0 400 1
-Diboson /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WplusToLNuWplusTo2JJJ_QCD_LO_SM.root 0.07584 1 99992.0 0.0 400 1
-Diboson /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WplusToLNuZTo2JJJ_QCD_LO_SM.root 1.938 1 1991348.0 0.0 400 1
-Diboson /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/ZTo2LZTo2JJJ_QCD_LO_SM.root 0.3449 1 49999.0 0.0 400 1
-W+jets /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WJetsToLNu_HT_100To200.root 1627.45 1 79165703.0 0.0 924 1
-W+jets /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WJetsToLNu_HT_1200To2500.root 1.60809 1 6708656.0 0.0 924 1
-W+jets /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WJetsToLNu_HT_200To400.root 435.24 1 29087430.0 0.0 924 1
-W+jets /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WJetsToLNu_HT_2500ToInf.root 0.0389136 1 2520618.0 0.0 924 1
-W+jets /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WJetsToLNu_HT_400To600.root 59.18 1 7754252.0 0.0 924 1
-W+jets /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WJetsToLNu_HT_600To800.root 14.58 1 18578604.0 0.0 924 1
-W+jets /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WJetsToLNu_HT_800To1200.root 6.655 1 7688957.0 0.0 924 1
-Z+jets /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/DY1JetsToLL.root 1012.296845 1 46443016.0 0.0 4 1
-Z+jets /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/DY2JetsToLL.root 334.717838 1 19296117.0 0.0 4 1
-Z+jets /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/DY3JetsToLL.root 102.4628 1 4866978.0 0.0 4 1
-Z+jets /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/DY4JetsToLL.root 54.48136 1 2798791.0 0.0 4 1
-top /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/ST_s_channel.root 11.36 1 999976.0 188501.0 592 1
-top /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/ST_tW_antitop_5f_NoFullyHadronicDecays.root 19.5741 1 5424956.0 0.0 592 1
-top /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/ST_tW_top_5f_NoFullyHadronicDecays.root 19.5741 1 5372830.0 0.0 592 1
-top /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/ST_t_channel_antitop.root 80.95 1 3927980.0 0.0 592 1
-top /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/ST_t_channel_top_4f.root 136.02 1 5993570.0 0.0 592 1
-top /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/TTToSemilepton.root 364.3 1 91832423.0 0.0 592 1
-top /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/TTWJetsToLNu.root 0.2043 1 5280251.0 1282079.0 592 1
-top /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/TTWJetsToQQ.root 0.4062 1 833257.0 201483.0 592 1
-top /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/TTZToLLNuNu_M-10.root 0.2529 1 7969186.0 2126557.0 592 1
-top /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/TTZToQQ.root 0.5297 1 749367.0 199113.0 592 1
-#CH_WZToLL_M1000 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLLQQ_M1000_13TeV.root 0.007685 1 89354.0 0.0 910 0
-#CH_WZToLL_M1500 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLLQQ_M1500_13TeV.root 0.00204 1 99968.0 0.0 910 0
-#CH_WZToLL_M200 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLLQQ_M200_13TeV.root 0.195011 1 99997.0 0.0 910 0
-#CH_WZToLL_M300 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLLQQ_M300_13TeV.root 0.107954 1 99998.0 0.0 910 0
-#CH_WZToLL_M400 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLLQQ_M400_13TeV.root 0.065514 1 99994.0 0.0 910 0
-#CH_WZToLL_M500 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLLQQ_M500_13TeV.root 0.04231 1 98337.0 0.0 910 0
-#CH_WZToLL_M600 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLLQQ_M600_13TeV.root 0.028534 1 99996.0 0.0 910 0
-#CH_WZToLL_M700 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLLQQ_M700_13TeV.root 0.019903 1 99994.0 0.0 910 0
-#CH_WZToLL_M800 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLLQQ_M800_13TeV.root 0.014244 1 99986.0 0.0 910 0
-#CH_WZToLL_M900 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLLQQ_M900_13TeV.root 0.010395 1 99981.0 0.0 910 0
-#CH_WZToLNu_M1000 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLNuQQ_M1000_13TeV.root 0.025718 1 99241.0 0.0 920 0
-#CH_WZToLNu_M1500 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLNuQQ_M1500_13TeV.root 0.006825 1 95776.0 0.0 920 0
-#CH_WZToLNu_M200 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLNuQQ_M200_13TeV.root 0.652561 1 99999.0 0.0 920 0
-#CH_WZToLNu_M2000 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLNuQQ_M2000_13TeV.root 0.002126 1 99959.0 0.0 920 0
-#CH_WZToLNu_M300 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLNuQQ_M300_13TeV.root 0.361243 1 99998.0 0.0 920 0
-#CH_WZToLNu_M400 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLNuQQ_M400_13TeV.root 0.219229 1 99997.0 0.0 920 0
-#CH_WZToLNu_M500 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLNuQQ_M500_13TeV.root 0.141582 1 99996.0 0.0 920 0
-#CH_WZToLNu_M600 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLNuQQ_M600_13TeV.root 0.095481 1 97780.0 0.0 920 0
-#CH_WZToLNu_M700 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLNuQQ_M700_13TeV.root 0.0666 1 99626.0 0.0 920 0
-#CH_WZToLNu_M800 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLNuQQ_M800_13TeV.root 0.047665 1 99993.0 0.0 920 0
-#CH_WZToLNu_M900 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/WWTree_ChargedHiggsToWZToLNuQQ_M900_13TeV.root 0.034785 1 97295.0 0.0 920 0
-#DCH_WW_M1000 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/DoublyChargedHiggsGMmodel_HWW_WWToLNuQQ_M1000_13TeV.root 0.067863 1 98188.0 0.0 900 0
-#DCH_WW_M1500 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/DoublyChargedHiggsGMmodel_HWW_WWToLNuQQ_M1500_13TeV.root 0.018868 1 99981.0 0.0 900 0
-#DCH_WW_M200 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/DoublyChargedHiggsGMmodel_HWW_WWToLNuQQ_M200_13TeV.root 1.554483 1 99997.0 0.0 900 0
-#DCH_WW_M2000 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/DoublyChargedHiggsGMmodel_HWW_WWToLNuQQ_M2000_13TeV.root 0.006135 1 99417.0 0.0 900 0
-#DCH_WW_M300 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/DoublyChargedHiggsGMmodel_HWW_WWToLNuQQ_M300_13TeV.root 0.871547 1 99997.0 0.0 900 0
-#DCH_WW_M400 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/DoublyChargedHiggsGMmodel_HWW_WWToLNuQQ_M400_13TeV.root 0.536185 1 99997.0 0.0 900 0
-#DCH_WW_M500 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/DoublyChargedHiggsGMmodel_HWW_WWToLNuQQ_M500_13TeV.root 0.35078 1 99996.0 0.0 900 0
-#DCH_WW_M600 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/DoublyChargedHiggsGMmodel_HWW_WWToLNuQQ_M600_13TeV.root 0.239827 1 99997.0 0.0 900 0
-#DCH_WW_M700 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/DoublyChargedHiggsGMmodel_HWW_WWToLNuQQ_M700_13TeV.root 0.169306 1 99994.0 0.0 900 0
-#DCH_WW_M800 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/DoublyChargedHiggsGMmodel_HWW_WWToLNuQQ_M800_13TeV.root 0.122536 1 99989.0 0.0 900 0
-#DCH_WW_M900 /store/user/rasharma/SecondStep/WWTree_After_CWR/2019_03_28_16h05/HaddedFiles/DoublyChargedHiggsGMmodel_HWW_WWToLNuQQ_M900_13TeV.root 0.090467 1 99992.0 0.0 900 0
diff --git a/ControlPlots/DibosonBoostedElMuSamples13TeV_2019_03_29_03h24_v5.txt b/ControlPlots/DibosonBoostedElMuSamples13TeV_2019_03_29_03h24_v5.txt
new file mode 100644
index 0000000..d13b5cb
--- /dev/null
+++ b/ControlPlots/DibosonBoostedElMuSamples13TeV_2019_03_29_03h24_v5.txt
@@ -0,0 +1,20 @@
+# name file_location xspb/lumipb otherscale nMCevents nMCNegEvents colorcode stackit
+data /eos/user/a/avijay/2018data_rootfile.root 60000 1 1 0 1 0
+DYJets_1 /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/dy_0to50.root 1202.85 1 184893494.0 1 2 1
+DYJets_2 /eos/user/a/avijay/outputfile/dy_50to100_meganew.root 147.038 1 107440405.0 1 7 1
+DYJets_3 /eos/user/a/avijay/outputfile/dy_100to250_new.root 37.908 1 56312357.0 1 9 1
+DYJets_4 /eos/user/a/avijay/outputfile/dy_250to400_new.root 0.14804 1 24195330.0 1 46 1
+DYJets_5 /eos/user/a/avijay/signal-bkg-MC-samples/drellyan/dy_400to650/dy_400to650.root 0.007629 1 3936102.0 1 36 1
+DYJets_6 /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/dy_650toInf.root 0.00005201 1 3007236.0 1 41 1
+TTJets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/TTJets.root 831.76 1 282578758.0 1 3 1
+WWTo2L2Nu /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WWTo2L2Nu.root 11.09 1 9994000.0 1 4 1
+WZTo2Q2L /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WZTo2Q2L.root 6.419 1 22182798.0 1 5 1
+ZZTo2Q2L /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ZZTo2Q2L.root 3.696 1 24685095.0 1 6 1
+#####DYJets_PS_1 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-70to100_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_70to100.root 146.5 1 17004433 1 47 1
+#####DYJets_PS_2 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-100to200_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_100to200.root 160.7 1 26202328 1 28 1
+#####DYJets_PS_3 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-200to400_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_200to400.root 48.63 1 18455718 1 40 1
+#####DYJets_PS_4 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-400to600_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_400to600.root 6.993 1 8682257 1 25 1
+#####DYJets_PS_5 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-600to800_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_600to800.root 1.761 1 7035971 1 32 1
+#DYJets_PS_6 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-800to1200_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_800to1200.root 0.8021 1 6554679 1 30 1
+#DYJets_PS_7 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-1200to2500_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_1200to2500.root 0.1937 1 5966661 1 44 1
+#DYJets_PS_8 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-2500toInf_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_2500toInf.root 0.003514 1 1978203 1 41 1
diff --git a/ControlPlots/DibosonBoostedElMuSamples13TeV_2019_03_29_03h24_v6.txt b/ControlPlots/DibosonBoostedElMuSamples13TeV_2019_03_29_03h24_v6.txt
new file mode 100644
index 0000000..02980a5
--- /dev/null
+++ b/ControlPlots/DibosonBoostedElMuSamples13TeV_2019_03_29_03h24_v6.txt
@@ -0,0 +1,20 @@
+# name file_location xspb/lumipb otherscale nMCevents nMCNegEvents colorcode stackit
+data /eos/user/a/avijay/2018data_rootfile.root 60000 1 1 0 1 0
+DYJets_1 /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/dy_0to50.root 1485 1 184893494.0 1 2 1
+DYJets_2 /eos/user/a/avijay/outputfile/dy_50to100_meganew.root 354.3 1 107440405.0 1 7 1
+DYJets_3 /eos/user/a/avijay/outputfile/dy_100to250_new.root 83.12 1 56312357.0 1 9 1
+DYJets_4 /eos/user/a/avijay/outputfile/dy_250to400_new.root 3.047 1 24195330.0 1 46 1
+DYJets_5 /eos/user/a/avijay/signal-bkg-MC-samples/drellyan/dy_400to650/dy_400to650.root 0.3921 1 3936102.0 1 36 1
+DYJets_6 /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/dy_650toInf.root 0.03636 1 3007236.0 1 41 1
+TTJets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/TTJets.root 831.76 1 282578758.0 1 3 1
+WWTo2L2Nu /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WWTo2L2Nu.root 11.09 1 9994000.0 1 4 1
+WZTo2Q2L /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WZTo2Q2L.root 6.419 1 22182798.0 1 5 1
+ZZTo2Q2L /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ZZTo2Q2L.root 3.696 1 24685095.0 1 6 1
+#####DYJets_PS_1 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-70to100_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_70to100.root 146.5 1 17004433 1 47 1
+#####DYJets_PS_2 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-100to200_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_100to200.root 160.7 1 26202328 1 28 1
+#####DYJets_PS_3 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-200to400_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_200to400.root 48.63 1 18455718 1 40 1
+#####DYJets_PS_4 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-400to600_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_400to600.root 6.993 1 8682257 1 25 1
+#####DYJets_PS_5 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-600to800_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_600to800.root 1.761 1 7035971 1 32 1
+#DYJets_PS_6 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-800to1200_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_800to1200.root 0.8021 1 6554679 1 30 1
+#DYJets_PS_7 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-1200to2500_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_1200to2500.root 0.1937 1 5966661 1 44 1
+#DYJets_PS_8 /eos/user/a/avijay/HZZCondorjobRun2018_v9/DYJetsToLL_M-50_HT-2500toInf_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8/DYJetsToLL_M-50_2500toInf.root 0.003514 1 1978203 1 41 1
diff --git a/ControlPlots/GetQCDShape.C b/ControlPlots/GetQCDShape.C
deleted file mode 100644
index f1bfb6b..0000000
--- a/ControlPlots/GetQCDShape.C
+++ /dev/null
@@ -1,1015 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "TROOT.h"
-#include "TLatex.h"
-#include "TTree.h"
-#include "TFile.h"
-#include "TH1D.h"
-#include "TH1F.h"
-#include "THStack.h"
-#include "TString.h"
-#include "TLegend.h"
-#include "TLine.h"
-#include "TPad.h"
-#include "TCanvas.h"
-#include "TCut.h"
-#include "TSystem.h"
-#include "TF1.h"
-#include "TFitResult.h"
-#include "TFitResultPtr.h"
-
-#include "tdrstyle.C"
-#include "utils.C" // Tokenize
-#include "CMS_lumi.C"
-
-#include
-
-
-typedef struct {
- int index;
- TString samplename;
- TString treefilename;
- double xsecpblumi;
- double otherscale;
- int nMCevents;
- int MCnegEvent;
- int colorcode;
- int stackit;
-}
-SampleInfo_t;
-
-//#include "controlplotvars_boosted.h"
-//#include "controlplotvars_common.h"
-#include "controlplotvars_CHS.h"
-#include "controlplotvars_CHS_2lep.h"
-//#include "controlplotvars_Puppi.h"
-//#include "controlplotvars_vbf.h"
-//#include "controlplotvars_mva.h"
-//#include "controlplotvars_Nminus1plot.h"
-//#include "controlplotvars_CHS_signal.h"
-//#include "controlplotvars_CHS_signal_2lep.h"
-//#include "controlplotvars_UpDn.h"
-
-
-
-using namespace std;
-
-double intLUMIinvpb;
-
-//=====================================================================================
-// SYNOPSIS:
-// 1. Prepare "InData" and "OutDir" directories; e.g., "ln -s . OutDir" to go to current dir
-// 2. Prepare "cuttable.txt" of cut names and cut strings
-// 3. root [0] .L GetQCDShape.C+
-// root [1] GetQCDShape("cuttable.txt","sampleFileName.txt")
-//
-// ====================================================================================
-// Self Function
-// ====================================================================================
-/*
-
-*/
-void cmspre(double intlumifbinv)
-{
- TLatex latex;
- latex.SetNDC();
- latex.SetTextSize(0.04);
-
- latex.SetTextAlign(31); // align right
- latex.DrawLatex(0.95,0.92,"#sqrt{s} = 13 TeV");
- latex.SetTextAlign(31); // align right
- latex.DrawLatex(0.73,0.93,Form("#int #font[12]{L} dt = %.1f fb^{-1}", (float)intlumifbinv));
-// latex.DrawLatex(0.65,0.93,Form("2012B", (float)intlumifbinv));
-
- latex.SetTextAlign(11); // align left
-// latex.DrawLatex(0.15,0.93,"CMS, #sqrt{s} = 7 TeV");//preliminary 2011");
- latex.SetTextSize(0.06);
- latex.DrawLatex(0.145,0.92,"CMS #bf{#it{preliminary}}");
-
-}
-
-//======================================================================
-
-void loadCutString(const char *filename, TString& cutstring)
-{
- FILE *fp = fopen(filename,"r");
- if (!fp) {
- cout << "Error, file " << TString(filename) << " not found." << endl;
- exit(-1);
- }
-
- char line[512];
-
- for (int i=0; !feof(fp) && fgets(line,512,fp); i++) {
- if (!strlen(line) || line[0]=='#') continue; // comments are welcome
-
- if (cutstring.Length()) cutstring += " && ";
-
- string strline(line);
- strline.pop_back(); // shed the \n
- vector fields;
-
- // expect columns with fields cutname, cutvalue, possible embedded spaces both
- // within and between, so " " or "\t" cannot be used as delimiters. Require quotes
- // instead.
- //
- Tokenize(strline,fields, "\"");
-
- //for (size_t j=0; jGet("otree"); if (!tree_) { cerr << "Couldn't find tree otree in file " << sinfo.treefilename << endl; return; }
- }
- ~Sample() { if (tree_) delete tree_; }
- TTree *Tree() const { return tree_; }
- TString name() const { return info_.samplename; }
- TString filename() const { return info_.treefilename; }
- bool stackit() const { return (info_.stackit != 0); }
- int colorcode() const { return info_.colorcode; }
- double otherscale() const { return info_.otherscale; }
- TH1D *Draw(const plotVar_t& pv, const TCut& cut, const TCut& cutSQ ) {
- if (!tree_) {
- cerr << "No tree to draw from." << endl;
- return 0;
- }
- double tmp = 0.;
- cout << "\tDrawing " << pv.plotvar << " for sample = " << info_.samplename << " ... ";
- TString hname = TString("th1")+ pv.outfile + Form("%d",info_.index);
- TH1D *histo = new TH1D(hname, hname, pv.NBINS, pv.MINRange, pv.MAXRange);
- assert(histo);
- histo->Sumw2();
- cout << tree_->Draw(pv.plotvar+TString(">>")+hname, cut, "goff") << " entries, ";
- histo->SetBinContent(pv.NBINS,histo->GetBinContent(pv.NBINS)+histo->GetBinContent(pv.NBINS+1));
- //cout << histo->Integral() << " " << tmp << " " << "weighted entries, (";
- cout << histo->IntegralAndError(0,histo->GetNbinsX()+1,tmp) << " " << tmp << " " << "weighted entries";
-
-#if 0
- if (strlen((const char *)cutSQ)) {
- hname = TString("th1") + pv.outfile + Form("%d",info_.index) + TString("SQ");
- TH1D *histoSQ = new TH1D(hname, hname, pv.NBINS, pv.MINRange, pv.MAXRange);
- tree_->Draw(pv.plotvar+TString(">>")+hname, cutSQ, "goff");
- for(int hi=1;hi<=pv.NBINS;hi++) {
- histo->SetBinError(hi,sqrt(histoSQ->GetBinContent(hi)));
- }
- delete histoSQ;
- }
-#endif
- if (info_.nMCevents) {
- //cout<<"\n===> Evetns = "<Scale((info_.xsecpblumi*info_.otherscale)/(info_.nMCevents - 2*info_.MCnegEvent));
- cout << ", " <IntegralAndError(1,histo->GetNbinsX(),tmp) << " " <Integral(1,histo->GetNbinsX()+1)*info_.xsecpblumi*info_.otherscale)/(info_.nMCevents - 2*info_.MCnegEvent) << " " << " scaled events in window";
- }
- cout << endl;
-
- return histo;
- }
-private:
- SampleInfo_t info_;
- TTree *tree_;
-};
-
-//======================================================================
-
-void loadSamples(const char *filename,vector& samples)
-{
- FILE *fp = fopen(filename,"r");
- if (!fp) {
- cout << "Error, file " << TString(filename) << " not found." << endl;
- exit(-1);
- }
-
- char line[512];
-
- intLUMIinvpb=-1; // obvious error condition
-
- for (int i=0; !feof(fp) && fgets(line,512,fp); i++) {
- if (!strlen(line) || line[0]=='#') continue; // comments are welcome
-
- string strline(line);
- strline.pop_back(); // shed the \n
- vector fields;
-
- // expect columns with fields cutname, cutvalue, possible embedded spaces both
- // within and between, so " " or "\t" cannot be used as delimiters. Require quotes
- // instead.
- //
- Tokenize(strline,fields, " \t");
-
- //for (size_t j=0; j " << s.treefilename << endl;
-
- if (!samples.size()) {
- if (s.samplename.EqualTo("data")) {
- intLUMIinvpb = s.xsecpblumi;
- s.xsecpblumi = 1;
- cout << "intLUMI = " << intLUMIinvpb << " pb^-1" << endl;
- } else {
- cerr << "First sample in the table must be 'data'" << endl;
- exit(-1);
- }
- } else {
- s.otherscale *= intLUMIinvpb;
- }
-
- samples.push_back(new Sample(s) );
- }
-} // loadSamples
-
-//======================================================================
-
-void GetQCDShape(const char *cuttablefilename,
- const char *samplefilename,
- const plotVar_t plotvars[] = commonplotvars_chs,
- const string OutRootFile = "testrk.root",
- const int ScaleSignal = 0,
- const string RecreateAppend = "RECREATE",
- const int isData = 1
- )
-// const plotVar_t plotvars[] = boostedplotvars )
-{
- //gROOT->ProcessLine(".L tdrstyle.C");
- if (int(ScaleSignal) != 1 && int(ScaleSignal) != 0)
- {
- std::cout << "=========================================\n\n" << endl;
- std::cerr << "Error: Scale Signal values should be 1 or 0.\n" << endl;
- exit(-1);
- }
-
- ofstream Logfile;
-
- TH1D::SetDefaultSumw2(1);
-
- //TFile *outDC = new TFile("htt_mt_inputs.root","RECREATE");
-
- TString unwtcutstring;
-
- loadCutString(cuttablefilename, unwtcutstring);
-
- TString blinddatacutstring = unwtcutstring + "&&(1)";
- // For blinding data uncomment this
- //TString blinddatacutstring = unwtcutstring + "&& (PuppiAK8_jet_mass_so<65 || PuppiAK8_jet_mass_so>105)&&(1)";
-
- // const char* the_cut = "1";
- // double BINWIDTH = ((MAXRange-MINRange)/NBINS);
-
- // Get the input trees:
-
- vector samples;
-
- loadSamples(samplefilename,samples);
-
- // Data
-
- Sample *sdata = samples[0];
-
- if (sdata->Tree())
- cout << "ndata =" << sdata->Tree()->GetEntries() <BaseName(cuttablefilename)).ReplaceAll(".txt","")+TString("_")+pv.outfile;
- Logfile.open (outfile+".log");
- TString temp = TString("Yield of Variable : ")+pv.outfile;
- const std::string spaces(temp.Length(), ' ');
- const std::string second = "* " + spaces + " *";
- const std::string first(second.size(), '*');
- Logfile << first << std::endl;
- Logfile << second << std::endl;
- Logfile << "* " << temp << " *" << std::endl;
- Logfile << second << std::endl;
- Logfile << first << std::endl;
-
- if ( !pv.plotvar.Length() ) break;
-
- cout << pv.plotvar << "\t"<Tree() &&
- sdata->Tree()->Draw(pv.plotvar,"","goff",1) == -1 ) { // check if the variable exists in the tree
- cout << "\t...can't be plotted!" << endl;
- continue;
- }
-
- //
- // ONE LEPTON CUTS
- //
- //TCut the_cut(TString("btag0Wgt*genWeight*trig_eff_Weight*id_eff_Weight*pu_Weight*(")+unwtcutstring+TString(")"));
- //TCut the_cut(TString("genWeight*trig_eff_Weight*id_eff_Weight*pu_Weight*(")+unwtcutstring+TString(")"));
- //
- // TWO LEPTON CASE
- //
- //TCut the_cut(TString("totalEventWeight_2Lep*pu_Weight*(")+unwtcutstring+TString(")"));
- TCut the_cut(TString("btag0Wgt*totalEventWeight_2Lep*pu_Weight*(")+unwtcutstring+TString(")"));
- //TCut the_cut(TString("genWeight*trig_eff_Weight2*id_eff_Weight2*pu_Weight*(")+unwtcutstring+TString(")"));
- //TCut the_cut(TString("btag0Wgt*genWeight*trig_eff_Weight2*id_eff_Weight2*pu_Weight*(")+unwtcutstring+TString(")"));
- //TCut the_cut(TString("btag1Wgt*genWeight*trig_eff_Weight2*id_eff_Weight2*pu_Weight*(")+unwtcutstring+TString(")"));
-
- TCut nullcut("");
-
- cout << "the_cut = "<< the_cut << endl;
-
- const double BINWIDTH = ((pv.MAXRange-pv.MINRange)/pv.NBINS);
-
- map m_histos;
- map m_stacked;
-
- double totevents = 0.;
-
- //============================================================
- // DRAW THE VARIABLE FOR ALL SAMPLES, CREATE HISTOS
- //============================================================
-
- for (size_t isamp=0; isampname()] = false;
-
- TH1D *h;
-
- if (s->name().EqualTo("data")) {
- plotVar_t pvnosmear = pv;
- //pvnosmear.plotvar.ReplaceAll("_smeared",""); // no smearing for data!
- h = s->Draw(pvnosmear, TCut(blinddatacutstring), nullcut); // effwt*puwt==1 for data! -- NO IT DOESN'T NECESSARILY!
- }
- //else if (s->name().EqualTo("aQGCX100")){
- else if (s->name().EqualTo("aQGC")){
- if (int(ScaleSignal) == 1)
- { h = s->Draw(pv, the_cut*"5.00"*"(LHEWeight[994]/LHEWeight[0])", the_cut*"5.00"*"(LHEWeight[994]/LHEWeight[0])");
- cout<<"====> Scale Signal = " << ScaleSignal << endl;
- }
- else
- h = s->Draw(pv, the_cut*"(LHEWeight[994]/LHEWeight[0])", the_cut*"(LHEWeight[994]/LHEWeight[0])");
- if (s->stackit()) {
- totevents += h->Integral(1,h->GetNbinsX()+1);
- }
- }
- //else if (s->name().EqualTo("WV_EWKX100")){
- else if (s->name().EqualTo("WV_EWK")){
- if (int(ScaleSignal) == 1)
- h = s->Draw(pv, the_cut*"5.00", the_cut*"5.00");
- else
- h = s->Draw(pv, the_cut, the_cut);
- if (s->stackit()) {
- totevents += h->Integral(1,h->GetNbinsX()+1);
- }
- }
- else {
- h = s->Draw(pv, the_cut, the_cut);
- if (s->stackit()) {
- totevents += h->Integral(1,h->GetNbinsX()+1);
- }
- }
-
- if (!h) continue;
-
- map::iterator mit = m_histos.find(s->name());
- if (mit == m_histos.end()) {
- h->SetName(s->name());
- h->SetTitle(s->name());
- if (s->stackit()) {
- if (s->name().EqualTo("V+jets"))
- {
- h->SetLineColor(TColor::GetColor(222,90,106));
- h->SetFillColor(TColor::GetColor(222,90,106));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("W+jets"))
- {
- h->SetLineColor(TColor::GetColor(222,90,106));
- h->SetFillColor(TColor::GetColor(222,90,106));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("top"))
- {
- h->SetLineColor(TColor::GetColor(155,152,204));
- h->SetFillColor(TColor::GetColor(155,152,204));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("TTbar"))
- {
- h->SetLineColor(TColor::GetColor(155,152,204));
- h->SetFillColor(TColor::GetColor(155,152,204));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("SingleTop"))
- {
- h->SetLineColor(TColor::GetColor(0,84,159));
- h->SetFillColor(TColor::GetColor(0,84,159));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("Z+jets"))
- {
- h->SetLineColor(TColor::GetColor(248,206,104));
- h->SetFillColor(TColor::GetColor(248,206,104));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("Diboson"))
- {
- h->SetLineColor(TColor::GetColor(250,202,255));
- h->SetFillColor(TColor::GetColor(250,202,255));
- h->SetLineWidth(0);
- }
- else
- {
- h->SetLineColor(s->colorcode());
- h->SetFillColor(s->colorcode());
- h->SetLineWidth(0);
- }
- }
- m_histos[s->name()] = h;
- } else {
- mit->second->Add(h);
- }
- }
-
- //============================================================
- // COUNT EVENTS, RENORM TO DATA, CONSTRUCT THE TSTACK & LEGEND
- //============================================================
-
- TH1D *th1data = m_histos["data"];
- //TH1D *aqgc = m_histos["aQGC"];
- double maxval = -9e99;
-
- double ndata=1., renorm=1.;
- if (th1data) {
- ndata = th1data->Integral(1,th1data->GetNbinsX()+1);
- renorm = ndata/totevents;
- int maxbin = th1data->GetMaximumBin();
- maxval = std::max(maxval,th1data->GetBinContent(maxbin));
-
- cout << "Total MC = " << totevents << endl;
- cout << "data = " << ndata <SetFillColor(0);
- Leg->SetFillStyle(0);
- Leg->SetBorderSize(0);
- //Leg->SetTextSize(0.04);
- //Leg->SetNColumns(3);
-
- if (th1data){
- if (TString(cuttablefilename).Contains("Mu"))
- Leg->AddEntry(th1data, "Observed", "LP");
- else
- Leg->AddEntry(th1data, "Observed", "LP");
- }
-
- vector binErrSQ(pv.NBINS,0.);
-
- vector > v_legentries;
-
- TString oldsamplename;
-
- for (size_t isamp=1; isampname()==oldsamplename) continue;
-
- map::iterator mit = m_histos.find(s->name());
- TH1D *h = mit->second;
- //h->SetLineColor(kBlack);
- h->SetLineWidth( 3.);
- //h->SetFillColor(color );
- //h->SetFillStyle(style );
- h->SetTitleSize (0.055,"Y");
- h->SetTitleOffset(1.600,"Y");
- h->SetLabelOffset(0.014,"Y");
- h->SetLabelSize (0.050,"Y");
- h->SetLabelFont (42 ,"Y");
- h->SetTitleSize (0.055,"X");
- h->SetTitleOffset(1.300,"X");
- h->SetLabelOffset(0.014,"X");
- h->SetLabelSize (0.050,"X");
- h->SetLabelFont (42 ,"X");
- //h->SetMarkerStyle(20);
- //h->SetMarkerColor(color);
- h->SetMarkerSize (0.6);
- h->GetYaxis()->SetTitleFont(42);
- h->GetXaxis()->SetTitleFont(42);
- //h->SetTitle("");
-
- //if (s->stackit())
- // h->Scale(renorm);
- //else
- // h->Scale(ndata/h->Integral());
-
-// cout << s->name() << " = " << Form("%4g,%7g,%4g",
-// h->Integral(0,0),
-// h->Integral(1,h->GetNbinsX()+1),
-// h->Integral(h->GetNbinsX()+1,h->GetNbinsX()+1))
-// << endl;
- cout << s->name() << " = " << Form("%7g", h->Integral(1,h->GetNbinsX()+1)) << endl;
- Logfile << s->name() << " = " << Form("%7g", h->Integral(1,h->GetNbinsX()+1)) << endl;
-
- if(s->stackit()) {
- // Compose the stack
- hs->Add(h);
- th1tot->Add(h);
- m_stacked[s->name()] = true;
- for (int ibin=1; ibin <= pv.NBINS; ibin++)
- binErrSQ[ibin-1] += h->GetBinError(ibin)*h->GetBinError(ibin);
- }
- v_legentries.push_back(*mit);
-
- int maxbin = h->GetMaximumBin();
- maxval = std::max(maxval,h->GetBinContent(maxbin));
-
- oldsamplename=s->name();
- h->Write();
- }
-
- cout << "maxval " < >::reverse_iterator
- rit = v_legentries.rbegin();
- rit != v_legentries.rend();
- rit++)
- {
- if(rit->first=="aQGC" || rit->first=="WV_EWK")
- {
- if (int(ScaleSignal) == 1)
- Leg->AddEntry(rit->second, rit->first+TString("X5.00"), "L" ); // "F");
- else
- Leg->AddEntry(rit->second, rit->first, "L" ); // "F");
- //if(rit->first=="aQGCX100" || rit->first=="WV_EWKX100")
- }
- else
- Leg->AddEntry(rit->second, rit->first, "F" ); // "F");
- }
- TH1D* th1totClone = ( TH1D*) th1tot->Clone("th1totClone");
- th1totClone->SetMarkerStyle(0);
- th1totClone->SetFillStyle(3003);
- th1totClone->SetFillColor(11);
- th1totClone->SetLineColor(0);
-
- for(int ibin=1; ibin<=th1totClone->GetNbinsX(); ++ibin) {
- th1totClone->SetBinError(ibin, sqrt(binErrSQ[ibin-1]));
- }
-
- //============================================================
- // SETUP THE CANVAS
- //============================================================
-
-// gROOT->ProcessLine(".L tdrstyle.C");
- setTDRStyle();
- //tdrStyle->SetErrorX(0.5);
- //tdrStyle->SetPadRightMargin(0.05);
-
- //tdrStyle->SetLegendBorderSize(0);
-
- TCanvas* c1 = new TCanvas(pv.plotvar,pv.plotvar,10,10, 800, 600);
- TPad *d1, *d2;
-
- c1->SetFillColor (0);
- c1->SetBorderMode (0);
- c1->SetBorderSize (10);
- // Set margins to reasonable defaults
- c1->SetLeftMargin (0.18);
- c1->SetRightMargin (0.05);
- c1->SetTopMargin (0.08);
- c1->SetBottomMargin (0.15);
- // Setup a frame which makes sense
- c1->SetFrameFillStyle (0);
- c1->SetFrameLineStyle (0);
- c1->SetFrameBorderMode(0);
- c1->SetFrameBorderSize(10);
- c1->SetFrameFillStyle (0);
- c1->SetFrameLineStyle (0);
- c1->SetFrameBorderMode(0);
- c1->SetFrameBorderSize(10);
-
- if (th1data) {
- c1->Divide(1,2);
- d1 = (TPad*)c1->GetPad(1);
- d1->SetPad(0.01,0.30,0.95,0.99);
- //c1->cd();
- d2 = (TPad*)c1->GetPad(2);
- d2->SetPad(0.01,0.02,0.95,0.30);
- d1->cd();
- gPad->SetBottomMargin(0.0);
- }
-
- gPad->SetTopMargin(0.1);
- gPad->SetRightMargin(0.05);
- gPad->SetLeftMargin(0.14);
-
- gPad->SetLogy(0);
-
- if (th1tot->GetEntries())
- Leg->AddEntry(th1tot, "Stat. Uncertainty", "f");
-
- Leg->SetFillColor(0);
-
- TH1D* th1totempty = new TH1D("th1totempty", "th1totempty", pv.ANBINS, pv.AMINRange, pv.AMAXRange);
- if (th1data) {
- th1data->SetMarkerStyle(20);
- th1data->SetLineColor(kBlack);
- th1data->SetMarkerSize(1.3);
- th1data->SetLineWidth(3);
- }
-
- th1tot->SetFillStyle(3013);
- th1tot->SetFillColor(13);
- th1tot->SetLineColor(kBlack);
- th1tot->SetLineWidth(1);
- th1tot->SetMarkerStyle(0);
-
- char tmpc[100]; sprintf(tmpc,"Events");
- if (pv.slog==1) sprintf(tmpc,"Events/ %.1f",BINWIDTH);
- if (pv.slog==2) sprintf(tmpc,"Events/ %.3f",BINWIDTH);
- if (pv.slog==3) sprintf(tmpc,"Events/ ( %.0f GeV)",BINWIDTH);
- if (pv.slog==6) sprintf(tmpc,"Events/ ( %.1f rad)",BINWIDTH);
- th1totempty->SetYTitle(tmpc);
- // th1totempty->GetYaxis()->SetTitleSize(0.1);
- th1totempty->GetYaxis()->SetTitleOffset(1.2);
- th1totempty->GetYaxis()->SetLabelOffset(0.01);
- // th1totempty->GetYaxis()->CenterTitle(true);
- th1totempty->GetYaxis()->SetLabelSize(0.04);
- // th1totClone->Draw("e3");
-
- if (th1tot->GetEntries()) {
- th1tot->SetMinimum(0.1);
- th1totempty->SetMinimum(0.1);
- }
-
-// th1totempty->SetMaximum(2.5*maxval);
- th1totempty->SetMaximum(1.5*maxval);
- if(pv.slog==9) th1totempty->SetMaximum(1.5*maxval);
- //th1totempty->SetMaximum(350.);
-
- // Draw it all
-
- th1totempty->Draw();
-
- if (th1data) {
- th1data->SetMinimum(0.1);
- th1data->SetBinErrorOption(TH1D::kPoisson);
- th1data->Draw("e0same");
- }
-
- //th1tot->Draw("e2same");
-
- hs->SetMaximum(400.0);
- hs->Draw("samehist");
- if (pv.drawleg ==1) Leg->Draw();
-
- th1tot->Draw("e2same");
-
- if (th1data)
- th1data->Draw("e1same");
- //if(aqgc)
- // aqgc->Draw("same");
-
- // draw unstacked histos separately.
- oldsamplename.Clear();
- TH1D *h1 = new TH1D("h1","",100,0,100);
- TH1D *h2 = new TH1D("h2","",100,0,100);
- for (size_t isamp=0; isampname()==oldsamplename) continue;
- if (!s->stackit()) {
- map::iterator mit = m_histos.find(s->name());
- if (mit != m_histos.end()) {
- TH1D *h = mit->second;
- if (h && s->name()=="WV_EWK")
- //if (h && s->name()=="WV_EWKX100")
- {
- h->SetFillStyle(0.);
- //aqgc->SetLineStyle(11);
- h->SetLineWidth(3.);
- h->SetLineColor(kBlue+3);
- if (int(ScaleSignal) == 1){
- cout << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1)/5.00)/sqrt((h->Integral(1,h->GetNbinsX()+1)/5.00)+totevents) << endl;
- Logfile << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1)/5.00)/sqrt((h->Integral(1,h->GetNbinsX()+1)/5.00)+totevents) << endl;
- }
- else{
- cout << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- Logfile << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- }
- h->Draw("histsame");
- h1 = (TH1D*) h->Clone();
-
- }
- if (h && s->name()=="aQGC")
- //if (h && s->name()=="aQGCX100")
- {
- h->SetFillStyle(0.);
- //aqgc->SetLineStyle(11);
- h->SetLineWidth(3.);
- h->SetLineColor(kRed+3);
- cout << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- //cout << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1)/5.00)/sqrt((h->Integral(1,h->GetNbinsX()+1)/5.00)+totevents) << endl;
- Logfile << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- //Logfile << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1)/5.00)/sqrt((h->Integral(1,h->GetNbinsX()+1)/5.00)+totevents) << endl;
- h->Draw("histsame");
- h2 = (TH1D*) h->Clone();
- //h->Draw("e1same");
- }
- if (isData) h->Write();
- }
- }
- oldsamplename=s->name();
-
- }
-
- //cmspre(intLUMIinvpb/1000.0);
- CMS_lumi( d1, 4, 10 );
- // th1data->Draw("Axissame");
- gPad->RedrawAxis();
- TH1D * hhratio;
- TH1D *th1emptyclone;
- TBox *errbox;
-
- if (th1data) {
- d2->cd();
- //TH1D * hhratio = (TH1D*) th1data->Clone("hhratio") ;
- hhratio = (TH1D*) th1data->Clone("hhratio") ;
- hhratio->Sumw2();
- hhratio->SetStats(0);
-
- gPad->SetLeftMargin(0.14);
- gPad->SetTopMargin(0);
- gPad->SetRightMargin(0.05);
- gPad->SetFrameBorderSize(0);
- gPad->SetBottomMargin(0.3);
- gPad->SetTickx();
-
- hhratio->SetMarkerSize(1.25);
- // hhratio->GetYaxis()->SetRangeUser(0.48,1.52);
- hhratio->GetYaxis()->SetRangeUser(0.5,1.5);
- hhratio->GetXaxis()->SetTitle(pv.xlabel);
- hhratio->GetXaxis()->SetTitleOffset(0.9);
- hhratio->GetXaxis()->SetTitleSize(0.15);
- hhratio->GetXaxis()->SetLabelSize(0.15);
- hhratio->GetYaxis()->SetTitleSize(0.1);
- hhratio->GetYaxis()->SetTitleOffset(0.5);
- hhratio->GetYaxis()->CenterTitle(true);
- hhratio->GetYaxis()->SetLabelSize(0.1);
- cout << hhratio->GetNbinsX() << endl;
- cout << th1tot->GetNbinsX() << endl;
- hhratio->Divide(th1tot);
- double binError(0.0), mcbinentry(0.0), mcerror(0.0);
- for(int i=0; iGetNbinsX(); ++i) {
- binError = hhratio->GetBinError(i);
- mcerror = th1tot->GetBinError(i);
- mcbinentry = th1tot->GetBinContent(i);
- if(mcbinentry>0.) mcerror /= mcbinentry;
- else mcerror = 0.0;
- binError = sqrt(binError*binError + mcerror*mcerror);
- hhratio->SetBinError(i, binError);
- }
- th1emptyclone = new TH1D("th1emptyclone", "th1emptyclone", pv.ANBINS, pv.AMINRange, pv.AMAXRange);
- th1emptyclone->GetYaxis()->SetRangeUser(0.6,1.3999);
- th1emptyclone->GetXaxis()->SetTitle(pv.xlabel);
- th1emptyclone->GetXaxis()->SetTitleOffset(0.9);
- th1emptyclone->GetXaxis()->SetTitleSize(0.15);
- th1emptyclone->GetXaxis()->SetLabelSize(0.15);
- th1emptyclone->SetYTitle("Data/MC");
- th1emptyclone->GetYaxis()->SetTitleSize(0.13);
- th1emptyclone->GetXaxis()->SetNdivisions(505);
- th1emptyclone->GetYaxis()->SetNdivisions(505);
- th1emptyclone->GetYaxis()->SetTitleOffset(0.5);
- th1emptyclone->GetYaxis()->CenterTitle(true);
- th1emptyclone->GetYaxis()->SetLabelSize(0.1);
- th1emptyclone->Draw();
-
- //TBox *errbox = new TBox(pv.AMINRange,0.974,pv.AMAXRange,1.026); // lumi systematic uncertainty
- errbox = new TBox(pv.AMINRange,0.974,pv.AMAXRange,1.026); // lumi systematic uncertainty
- errbox->SetFillColor(kGray);
- errbox->Draw();
-
-#if 0
- TF1 *f1 = new TF1("f1", "pol1", pv.AMINRange, pv.AMAXRange);
- f1->SetParameters(1.0,0.0);
- f1->SetParameters(1,0.0);
- //f1->FixParameter(0,1);
- //f1->FixParameter(1,0);
- //cout<<" par1 "f1->GetParameter(0)<GetParameter(1)<SetLineWidth(2);
-
- TFitResultPtr r = hhratio->Fit("f1", "RBS");
- //TFitResultPtr r = hhratio->Fit(myFunc,"S");
- r->Print("V"); // print full information of fit including covariance matrix
-#endif
-
- hhratio->Draw("esame");
- TLine *line; line = new TLine(pv.AMINRange,1.0,pv.AMAXRange,1.0);
- line->SetLineStyle(1);
- line->SetLineWidth(1);
- line->SetLineColor(1);
- line->Draw();
- }
-
-
- c1->Print(outfile+".pdf");
- c1->Print(outfile+".png");
- c1->Print(outfile+".C");
- //c1->Print(outfile+".tex");
- //-----------------------------------------------------------------
- // Save log plot
- //-----------------------------------------------------------------
- TCanvas *c2 = new TCanvas("c2","c2",800,600);
- TPad *d3, *d4;
-
- c2->SetFillColor (0);
- c2->SetBorderMode (0);
- c2->SetBorderSize (10);
- // Set margins to reasonable defaults
- c2->SetLeftMargin (0.18);
- c2->SetRightMargin (0.05);
- c2->SetTopMargin (0.08);
- c2->SetBottomMargin (0.15);
- // Setup a frame which makes sense
- c2->SetFrameFillStyle (0);
- c2->SetFrameLineStyle (0);
- c2->SetFrameBorderMode(0);
- c2->SetFrameBorderSize(10);
- c2->SetFrameFillStyle (0);
- c2->SetFrameLineStyle (0);
- c2->SetFrameBorderMode(0);
- c2->SetFrameBorderSize(10);
-
- c2->Divide(1,2);
- d3 = (TPad*)c2->GetPad(1);
- d3->SetPad(0.01,0.30,0.95,0.99);
- //c1->cd();
- d4 = (TPad*)c2->GetPad(2);
- d4->SetPad(0.01,0.02,0.95,0.30);
- d3->cd();
- gPad->SetBottomMargin(0.0);
-
- gPad->SetTopMargin(0.1);
- gPad->SetRightMargin(0.05);
- gPad->SetLeftMargin(0.14);
-
- gPad->SetLogy(1);
-
- th1totempty->SetMaximum(100*maxval);
- th1totempty->SetMinimum(0.001);
- th1totempty->Draw();
-
- if (th1data) {
- th1data->SetMinimum(0.001);
- th1data->SetBinErrorOption(TH1D::kPoisson);
- th1data->Draw("e0same");
- }
-
- th1tot->Draw("e2same");
-
- hs->SetMinimum(0.001);
- hs->Draw("samehist");
- if (pv.drawleg ==1) Leg->Draw();
-
- th1tot->Draw("e2same");
- if (h1->GetEntries()>0) h1->Draw("histsame");
- if (h2->GetEntries()>0) h2->Draw("histsame");
- if (th1data)
- th1data->Draw("e1same");
-
- CMS_lumi( d3, 4, 10 );
- gPad->RedrawAxis();
- d4->cd();
- gPad->SetLeftMargin(0.14);
- gPad->SetTopMargin(0);
- gPad->SetRightMargin(0.05);
- gPad->SetFrameBorderSize(0);
- gPad->SetBottomMargin(0.3);
- gPad->SetTickx();
- th1emptyclone->Draw();
- errbox->Draw();
-
- hhratio->Draw("esame");
- TLine *line; line = new TLine(pv.AMINRange,1.0,pv.AMAXRange,1.0);
- line->SetLineStyle(1);
- line->SetLineWidth(1);
- line->SetLineColor(1);
- line->Draw();
-
- c2->Print(outfile+"_log.png");
- //-----------------------------------------------------------------
- // END: Save log plot
- //-----------------------------------------------------------------
-
- Logfile.close();
-#if 0
- c1->Print(outfile+".C");
- //gPad->WaitPrimitive();
- c1->Modified();
- c1->Update();
- c1->SaveAs(outfile+".pdf");
-#endif
- c1->Write();
- } // var loop
-
- //f.Write();
- f->Close();
-
-} // GetQCDShape
-
-//================================================================================
-/*
-void dibresNobtagElplots()
-{
- GetQCDShape("DibosonResolvedElCuts.txt",
- "DibosonResolvedElSamples13TeV.txt",
- commonplotvars);
-}
-
-//================================================================================
-
-
-void Nminus1_plots_met()
-{
- GetQCDShape("DibosonBoostedElCuts13TeV_WjetControlRegion_tight.txt",
- "DibosonBoostedElSamples13TeV.txt",
- met
- );
- GetQCDShape("DibosonBoostedMuCuts13TeV_WjetControlRegion_tight.txt",
- "DibosonBoostedMuSamples13TeV.txt",
- met
- );
- GetQCDShape("DibosonBoostedElCuts13TeV_TTBarControlRegion.txt",
- "DibosonBoostedElSamples13TeV.txt",
- met
- );
- GetQCDShape("DibosonBoostedMuCuts13TeV_TTBarControlRegion.txt",
- "DibosonBoostedMuSamples13TeV.txt",
- met
- );
-}
-*/
diff --git a/ControlPlots/HZZ2l2nu_Cuts_DrellYan.txt b/ControlPlots/HZZ2l2nu_Cuts_DrellYan.txt
new file mode 100644
index 0000000..d89e98c
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_DrellYan.txt
@@ -0,0 +1,13 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==0)"
+#"lepton pt" "((pTL1>40)&&(pTL2>24))"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+#"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+#"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+#"No b-tag" "(HZZ2l2qNu_nTightBtagJets==0)"
+#"MET_pt" "(MET_pt<30)"
+#"VBF category" "(HZZ2l2nu_ifVBF==0)"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion.txt b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion.txt
new file mode 100644
index 0000000..f3eeff2
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion.txt
@@ -0,0 +1,13 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==1)"
+"lepton pt" "((pTL1>40)&&(pTL2>24))"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+#"No b-tag" "(HZZ2l2qNu_nTightBtagJets==0)"
+"MET_pt" "(MET_pt<100)"
+#"VBF category" "(HZZ2l2nu_ifVBF==0)"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_AtLeast1BJet.txt b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_AtLeast1BJet.txt
new file mode 100644
index 0000000..72371f6
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_AtLeast1BJet.txt
@@ -0,0 +1,13 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==1)"
+"lepton pt" "((pTL1>40)&&(pTL2>24))"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+"No b-tag" "(HZZ2l2qNu_nTightBtagJets>=1)"
+#"MET_pt" "(MET_pt<100)"
+#"VBF category" "(HZZ2l2nu_ifVBF==0)"
+#"Zero jet category" "(HZZ2l2qNu_nJets==0)"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_1Jet.txt b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_1Jet.txt
new file mode 100644
index 0000000..a33c8b1
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_1Jet.txt
@@ -0,0 +1,13 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==1)"
+"lepton pt" "((pTL1>40)&&(pTL2>24))"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+"MET_pt" "(MET_pt<100)"
+#"VBF category" "(HZZ2l2nu_ifVBF==0)"
+"Zero jet category" "(HZZ2l2qNu_nJets==1)"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF.txt b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF.txt
new file mode 100644
index 0000000..001f1bd
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF.txt
@@ -0,0 +1,12 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==1)"
+"lepton pt" "((pTL1>40)&&(pTL2>24))"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+"MET_pt" "(MET_pt<100)"
+"VBF category" "(HZZ2l2nu_ifVBF==0)"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ZEROJet.txt b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ZEROJet.txt
new file mode 100644
index 0000000..e5d33cb
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ZEROJet.txt
@@ -0,0 +1,31 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+#####old cuts##############
+"electron channel" "(HZZ2l2qNu_isELE==1)"
+#"muon channel" "(HZZ2l2qNu_isELE==0)"
+"Mll" "(massZ1>76&&massZ1<106)"
+##"lepton pt" "((pTL1>35)&&(pTL2>25))"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+#"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+"MET_pt" "((MET_pt<100))"
+#"pTZ1" "(pTZ1>55)"
+"VBF category" "(HZZ2l2nu_ifVBF==0)"
+"Zero jet category" "(HZZ2l2qNu_nJets==0)"
+"HZZ2l2nu_minDPhi_METAK4" "HZZ2l2nu_minDPhi_METAK4>0.35"
+"single lepton trigger" "Triggers_HZZ2l2nu_SingleLep == 1"
+##########################
+"lepton pt" "((pTL1>70)&&(pTL2>50))"
+#"lepton pt" "((pTL1>70))"
+"z1 pt" "(pTZ1 > 90)"
+"HZZ2l2nu_ZZmT" "(HZZ2l2nu_ZZmT > 240)"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+#"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+#"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+#"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+#"PuppiMET_pt" "((PuppiMET_pt>50)&&(PuppiMET_pt<200))"
+#"VBF category" "(HZZ2l2nu_ifVBF==0)"
+#"Zero jet category" "(HZZ2l2qNu_nJets==0)"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ZEROJet_Muon.txt b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ZEROJet_Muon.txt
new file mode 100644
index 0000000..ae3cc7a
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ZEROJet_Muon.txt
@@ -0,0 +1,13 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==0)"
+"lepton pt" "((pTL1>40)&&(pTL2>24))"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+"MET_pt" "(MET_pt<100)"
+"VBF category" "(HZZ2l2nu_ifVBF==0)"
+"Zero jet category" "(HZZ2l2qNu_nJets==0)"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ge1Jet.txt b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ge1Jet.txt
new file mode 100644
index 0000000..d628402
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ge1Jet.txt
@@ -0,0 +1,13 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==1)"
+"lepton pt" "((pTL1>40)&&(pTL2>24))"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+"MET_pt" "(MET_pt<100)"
+"VBF category" "(HZZ2l2nu_ifVBF==0)"
+"Zero jet category" "(HZZ2l2qNu_nJets>=1)"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ge1Jet_Electron.txt b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ge1Jet_Electron.txt
new file mode 100644
index 0000000..c5b31b5
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ge1Jet_Electron.txt
@@ -0,0 +1,17 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==1)"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+"MET_pt" "(MET_pt<100)"
+"VBF category" "(HZZ2l2nu_ifVBF==0)"
+"Mll" "(massZ1>76&&massZ1<106)"
+#"HZZ2l2nu_minDPhi_METAK4" "HZZ2l2nu_minDPhi_METAK4>0.5"
+"greater than or equal to 1 jet category" "(HZZ2l2qNu_nJets>=1)"
+"single lepton trigger" "Triggers_HZZ2l2nu_SingleLep == 1"
+"lepton pt" "((pTL1>70)&&(pTL2>50))"
+"z1 pt" "(pTZ1 > 90)"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ge1Jet_Muon.txt b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ge1Jet_Muon.txt
new file mode 100644
index 0000000..da16681
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ge1Jet_Muon.txt
@@ -0,0 +1,16 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==0)"
+"lepton pt" "((pTL1>40)&&(pTL2>24))"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+"MET_pt" "(MET_pt<100)"
+"VBF category" "(HZZ2l2nu_ifVBF==0)"
+"Mll" "(massZ1>76&&massZ1<106)"
+"pTZ1" "(pTZ1>55)"
+"HZZ2l2nu_minDPhi_METAK4" "HZZ2l2nu_minDPhi_METAK4>0.5"
+"greater than or equal to 1 jet category" "(HZZ2l2qNu_nJets>=1)"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_ZeroJet.txt b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_ZeroJet.txt
new file mode 100644
index 0000000..f743265
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_ZeroJet.txt
@@ -0,0 +1,16 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==0)"
+"lepton pt" "((pTL1>40)&&(pTL2>24))"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+"MET_pt" "(MET_pt<100)"
+"Mll" "(massZ1>76&&massZ1<106)"
+"pTZ1" "(pTZ1>55)"
+######"HZZ2l2nu_minDPhi_METAK4" "HZZ2l2nu_minDPhi_METAK4>0.5"
+"VBF category" "(HZZ2l2nu_ifVBF==0)"
+"Zero jet category" "(HZZ2l2qNu_nJets==0)"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_ZeroJet_Electron.txt b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_ZeroJet_Electron.txt
new file mode 100644
index 0000000..e04fd79
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_ZeroJet_Electron.txt
@@ -0,0 +1,16 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==1)"
+"lepton pt" "((pTL1>40)&&(pTL2>24))"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+"MET_pt" "(MET_pt<100)"
+"Mll" "(massZ1>76&&massZ1<106)"
+"pTZ1" "(pTZ1>55)"
+"HZZ2l2nu_minDPhi_METAK4" "HZZ2l2nu_minDPhi_METAK4>0.5"
+"VBF category" "(HZZ2l2nu_ifVBF==0)"
+"Zero jet category" "(HZZ2l2qNu_nJets==0)"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_LowMET_VBF_ControlRegion.txt b/ControlPlots/HZZ2l2nu_Cuts_LowMET_VBF_ControlRegion.txt
new file mode 100644
index 0000000..ff83bd6
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_LowMET_VBF_ControlRegion.txt
@@ -0,0 +1,11 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==1)"
+"lepton pt" "((pTL1>40)&&(pTL2>24))"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+"MET_pt" "(MET_pt<60)"
+"VBF category" "(HZZ2l2nu_ifVBF==1)"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_LowMET_VBF_ControlRegion_Electron.txt b/ControlPlots/HZZ2l2nu_Cuts_LowMET_VBF_ControlRegion_Electron.txt
new file mode 100644
index 0000000..f1d1eff
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_LowMET_VBF_ControlRegion_Electron.txt
@@ -0,0 +1,17 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==1)"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+"MET_pt" "(MET_pt<100)"
+"VBF category" "(HZZ2l2nu_ifVBF==1)"
+"Mll" "(massZ1>76&&massZ1<106)"
+"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+#"HZZ2l2nu_minDPhi_METAK4" "HZZ2l2nu_minDPhi_METAK4>0.5"
+"single lepton trigger" "Triggers_HZZ2l2nu_SingleLep == 1"
+"lepton pt" "((pTL1>70)&&(pTL2>50))"
+"z1 pt" "(pTZ1 > 90)"
+############################################
diff --git a/ControlPlots/HZZ2l2nu_Cuts_LowMET_VBF_ControlRegion_Muon.txt b/ControlPlots/HZZ2l2nu_Cuts_LowMET_VBF_ControlRegion_Muon.txt
new file mode 100644
index 0000000..498b44d
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_LowMET_VBF_ControlRegion_Muon.txt
@@ -0,0 +1,15 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==0)"
+"lepton pt" "((pTL1>25)&&(pTL2>25))"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2nu event selection" "(passZZ2l2nuSelection==1)"
+"MET_pt" "(MET_pt<100)"
+"VBF category" "(HZZ2l2nu_ifVBF==1)"
+###"Mll" "(massZ1>76&&massZ1<106)"
+##"pTZ1" "(pTZ1>55)"
+#"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+##"HZZ2l2nu_minDPhi_METAK4" "HZZ2l2nu_minDPhi_METAK4>0.5"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_emuControlRegion_MedBTag_NoVBF_ge1Jet.txt b/ControlPlots/HZZ2l2nu_Cuts_emuControlRegion_MedBTag_NoVBF_ge1Jet.txt
new file mode 100644
index 0000000..795e2be
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_emuControlRegion_MedBTag_NoVBF_ge1Jet.txt
@@ -0,0 +1,14 @@
+# Name Cut string
+##########################################
+########### For electron: HZZ2l2qNu_isELE == 1
+"lepton pt" "((pTL1>40)&&(pTL2>24))"
+#"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+"MET_pt" "(MET_pt>50)"
+"Mll" "(massZ1>76&&massZ1<106)"
+"pTZ1" "(pTZ1>55)"
+#"HZZ2l2nu_minDPhi_METAK4" "HZZ2l2nu_minDPhi_METAK4>0.5"
+"VBF category" "(HZZ2l2nu_ifVBF==0)"
+"greater than or equal to 1 jet category" "(HZZ2l2qNu_nJets>=1)"
+"single lepton trigger" "Triggers_HZZ2l2nu_SingleLep == 1"
+### CR selection
+"pass emu selection" "passZZ2l2nu_emuCR_Selection==1"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_emuControlRegion_MedBTag_ZeroJet.txt b/ControlPlots/HZZ2l2nu_Cuts_emuControlRegion_MedBTag_ZeroJet.txt
new file mode 100644
index 0000000..a296b68
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_emuControlRegion_MedBTag_ZeroJet.txt
@@ -0,0 +1,16 @@
+# Name Cut string
+##########################################
+"lepton pt" "((pTL1>40)&&(pTL2>24))"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+"MET_pt" "(MET_pt>50)"
+"Mll" "(massZ1>76&&massZ1<106)"
+"pTZ1" "(pTZ1>55)"
+##"HZZ2l2nu_minDPhi_METAK4" "HZZ2l2nu_minDPhi_METAK4>0.5"
+#"VBF category" "(HZZ2l2nu_ifVBF==0)"
+"Zero jet category" "(HZZ2l2qNu_nJets==0)"
+"single lepton trigger" "Triggers_HZZ2l2nu_SingleLep == 1"
+###"2l2nu trigger" "Triggers_HZZ2l2nu == 1"
+### CR selection
+"pass emu selection" "passZZ2l2nu_emuCR_Selection==1"
diff --git a/ControlPlots/HZZ2l2nu_Cuts_emu_VBF_ControlRegion.txt b/ControlPlots/HZZ2l2nu_Cuts_emu_VBF_ControlRegion.txt
new file mode 100644
index 0000000..7df3fd8
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_Cuts_emu_VBF_ControlRegion.txt
@@ -0,0 +1,13 @@
+# Name Cut string
+##########################################
+"lepton pt" "((pTL1>40)&&(pTL2>24))"
+"MET_pt" "(MET_pt>50)"
+"VBF category" "(HZZ2l2nu_ifVBF==1)"
+"Mll" "(massZ1>76&&massZ1<106)"
+"No b-tag" "(HZZ2l2qNu_nMediumBtagJets==0)"
+#"HZZ2l2nu_minDPhi_METAK4" "HZZ2l2nu_minDPhi_METAK4>0.5"
+"single lepton trigger" "Triggers_HZZ2l2nu_SingleLep == 1"
+"z1 pt" "(pTZ1 > 55)"
+### CR selection
+"pass emu selection" "passZZ2l2nu_emuCR_Selection==1"
+############################################
diff --git a/ControlPlots/HZZ2l2nu_ELMuSamples13TeV_2024_04_11.txt b/ControlPlots/HZZ2l2nu_ELMuSamples13TeV_2024_04_11.txt
new file mode 100644
index 0000000..ceb67ae
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_ELMuSamples13TeV_2024_04_11.txt
@@ -0,0 +1,32 @@
+# name file_location xspb/lumipb otherscale nMCevents nMCNegEvents colorcode stackit
+data /eos/user/r/rasharma/nanoAOD_ntuples/HZZ2l2nu_v2/EGamma.root 59830 1 1 0 1 0
+Triboson /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WZZ_TuneCP5_13TeV-amcatnlo-pythia8_ext1-v2.root 0.05709 1 9994000.0 1 33 1
+Triboson /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WZZ_TuneCP5_13TeV-amcatnlo-pythia8.root 0.05709 1 300000.0 1 34 1
+Triboson /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ZZZ_TuneCP5_13TeV-amcatnlo-pythia8_ext1-v2.root 0.01476 1 9889000.0 1 37 1
+Triboson /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ZZZ_TuneCP5_13TeV-amcatnlo-pythia8.root 0.01476 1 250000.0 1 38 1
+W+jets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WJetsToLNu_HT-70To100_TuneCP5_13TeV-madgraphMLM-pythia8.root 1283.0 1 66220256.0 1 9 1
+W+jets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WJetsToLNu_HT-100To200_TuneCP5_13TeV-madgraphMLM-pythia8.root 1244.0 1 51408967.0 1 41 1
+W+jets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WJetsToLNu_HT-200To400_TuneCP5_13TeV-madgraphMLM-pythia8.root 337.8 1 58225632.0 1 42 1
+W+jets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WJetsToLNu_HT-400To600_TuneCP5_13TeV-madgraphMLM-pythia8.root 44.93 1 7444030.0 1 43 1
+W+jets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WJetsToLNu_HT-600To800_TuneCP5_13TeV-madgraphMLM-pythia8.root 11.19 1 7718765.0 1 44 1
+W+jets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WJetsToLNu_HT-800To1200_TuneCP5_13TeV-madgraphMLM-pythia8.root 4.926 1 7306187.0 1 45 1
+W+jets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WJetsToLNu_HT-1200To2500_TuneCP5_13TeV-madgraphMLM-pythia8.root 1.152 1 6481518.0 1 46 1
+Diboson /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WWTo2L2Nu_TuneCP5_13TeV-powheg-pythia8.root 11.09 1 9994000.0 1 47 1
+Diboson /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WWZ_4F_TuneCP5_13TeV-amcatnlo-pythia8_ext1-v2.root 0.1707 1 9994000.0 1 48 1
+Diboson /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WWZ_4F_TuneCP5_13TeV-amcatnlo-pythia8.root 0.1707 1 248000 1 49 1
+Diboson /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WZTo2Q2L_mllmin4p0_TuneCP5_13TeV-amcatnloFXFX-pythia8.root 6.419 1 28576996.0 1 31 1
+Diboson /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WZTo3LNu_5f_TuneCP5_13TeV-madgraphMLM-pythia8.root 5.257 1 38624209.0 1 32 1
+Diboson /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ZZTo2L2Nu_TuneCP5_13TeV_powheg_pythia8.root 0.9738 1 56886000.0 1 35 1
+Diboson /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ZZTo2Q2L_mllmin4p0_TuneCP5_13TeV-amcatnloFXFX-pythia8.root 3.696 1 29357938.0 1 36 1
+top /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ST_s-channel_4f_hadronicDecays.root 7.104 1 16259000.0 1 3 1
+top /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ST_s-channel_4f_leptonDecays.root 3.549 1 19365999.0 1 4 1
+top /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ST_tW_top_5f_inclusiveDecays.root 32.45 1 7956000.0 1 5 1
+top /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/TTWJetsToLNu.root 0.2163 1 10450000.0 1 6 1
+top /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/TTTo2L2Nu_TuneCP5_13TeV-powheg-pythia8.root 687.1 1 145020000.0 1 7 1
+top /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/TTZToLLNuNu.root 0.2439 1 19608000.0 1 8 1
+Z+jets /eos/user/r/rasharma/nanoAOD_ntuples/HZZ2l2nu_v2/WeightedDrellYan/DY_0TO50.root 1485 1 196207761.0 1 2 1
+Z+jets /eos/user/r/rasharma/nanoAOD_ntuples/HZZ2l2nu_v2/WeightedDrellYan/DY_50to100.root 397.4 1 122967660.0 1 2 1
+Z+jets /eos/user/r/rasharma/nanoAOD_ntuples/HZZ2l2nu_v2/WeightedDrellYan/DY_100to250.root 97.2 1 79527324.0 1 2 1
+Z+jets /eos/user/r/rasharma/nanoAOD_ntuples/HZZ2l2nu_v2/WeightedDrellYan/DY_250TO400.root 3.701 1 24195330.0 1 2 1
+Z+jets /eos/user/r/rasharma/nanoAOD_ntuples/HZZ2l2nu_v2/WeightedDrellYan/DY_400to650.root 0.5086 1 3936102.0 1 2 1
+Z+jets /eos/user/r/rasharma/nanoAOD_ntuples/HZZ2l2nu_v2/WeightedDrellYan/DY_650toInf.root 0.04728 1 3994997.0 1 2 1
diff --git a/ControlPlots/HZZ2l2nu_ElectronSamples13TeV_for_emu_CR.txt b/ControlPlots/HZZ2l2nu_ElectronSamples13TeV_for_emu_CR.txt
new file mode 100644
index 0000000..1e19151
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_ElectronSamples13TeV_for_emu_CR.txt
@@ -0,0 +1,37 @@
+# name file_location xspb/lumipb otherscale nMCevents nMCNegEvents colorcode stackit
+#data /eos/user/a/avijay/Mergedrootfiles_hzz_new/brandnew_data_noDuplicates.root 59816 1 1 0 1 0
+data /eos/user/a/avijay/data_190525_noDuplicates.root 59818 1 1 0 1 0
+#data /eos/user/a/avijay/HZZ_mergedrootfiles/egamma/egamma.root 59830 1 1 0 1 0
+Triboson /eos/user/a/avijay/Mergedrootfiles_hzz_new/WWZ_4F_ext.root 0.05709 1 9994000.0 1 33 1
+Triboson /eos/user/a/avijay/Mergedrootfiles_hzz_new/WWZ_4F.root 0.05709 1 300000.0 1 34 1
+Triboson /eos/user/a/avijay/Mergedrootfiles_hzz_new/ZZZ_ext.root 0.01476 1 9889000.0 1 37 1
+Triboson /eos/user/a/avijay/Mergedrootfiles_hzz_new/ZZZ.root 0.01476 1 250000.0 1 38 1
+WJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/WJetsToLNu_HT-70To100.root 1283.0 1 66220256.0 1 9 1
+WJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/WJetsToLNu_HT-100To200.root 1244.0 1 51408967.0 1 41 1
+WJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/WJetsToLNu_HT-200To400.root 337.8 1 58225632.0 1 42 1
+WJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/WJetsToLNu_HT-400To600.root 44.93 1 7444030.0 1 43 1
+WJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/WJetsToLNu_HT-600To800.root 11.19 1 7718765.0 1 44 1
+WJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/WJetsToLNu_HT-800To1200.root 4.926 1 7306187.0 1 45 1
+WJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/WJetsToLNu_HT-1200To2500.root 1.152 1 6481518.0 1 46 1
+Dibosons /eos/user/a/avijay/Mergedrootfiles_hzz_new/WWTo2L2Nu.root 11.09 1 9994000.0 1 47 1
+#Dibosons /eos/user/a/avijay/Mergedrootfiles_hzz_new/WWZ_4F_ext.root 0.1707 1 9994000.0 1 48 1
+#Dibosons /eos/user/a/avijay/Mergedrootfiles_hzz_new/WWZ_4F.root 0.1707 1 248000 1 49 1
+Dibosons /eos/user/a/avijay/Mergedrootfiles_hzz_new/WZTo2Q2L.root 6.419 1 28576996.0 1 31 1
+Dibosons /eos/user/a/avijay/Mergedrootfiles_hzz_new/WZTo3LNu_5f.root 5.257 1 38624209.0 1 32 1
+Dibosons /eos/user/a/avijay/Mergedrootfiles_hzz_new/ZZTo2L2Nu.root 0.9738 1 56886000.0 1 35 1
+Dibosons /eos/user/a/avijay/Mergedrootfiles_hzz_new/ZZTo2Q2L.root 3.696 1 29357938.0 1 36 1
+Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/ST_s-channel_4f_hadronicDecays.root 7.104 1 16259000.0 1 3 1
+Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/ST_s-channel_4f_leptonDecays.root 3.549 1 19365999.0 1 4 1
+Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/ST_tW_top_5f_inclusiveDecays.root 32.45 1 7956000.0 1 5 1
+Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/TTWJetsToLNu.root 0.2163 1 10450000.0 1 6 1
+#Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/TTJets.root 831.76 1 304895029.0 1 9 1
+Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/top_debugg/TTJets.root 831.76 1 304895029.0 1 9 1
+#Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/TTTo2L2Nu.root 687.1 1 145020000.0 1 7 1
+Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/top_debugg/TTTo2L2Nu.root 687.1 1 145020000.0 1 7 1
+Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/TTZToLLNuNu.root 0.2439 1 19608000.0 1 8 1
+DYJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/drellyan_ptz_0to50.root 1485 1 196207761.0 1 2 1
+DYJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/drellyan_ptz_50to100.root 397.4 1 122967660.0 1 2 1
+DYJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/drellyan_ptz_100to250.root 97.2 1 79527324.0 1 2 1
+DYJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/drellyan_ptz_250to400.root 3.701 1 24195330.0 1 2 1
+DYJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/drellyan_ptz_400to650.root 0.5086 1 3936102.0 1 2 1
+DYJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/drellyan_ptz_650toInf.root 0.04728 1 3994997.0 1 2 1
diff --git a/ControlPlots/HZZ2l2nu_ElectronSamples13TeV_for_emu_CR_test.txt b/ControlPlots/HZZ2l2nu_ElectronSamples13TeV_for_emu_CR_test.txt
new file mode 100644
index 0000000..f19b68d
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_ElectronSamples13TeV_for_emu_CR_test.txt
@@ -0,0 +1,37 @@
+# name file_location xspb/lumipb otherscale nMCevents nMCNegEvents colorcode stackit
+#data /eos/user/a/avijay/Mergedrootfiles_hzz_new/brandnew_data_noDuplicates.root 59816 1 1 0 1 0
+data /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/data/data_2018_noDuplicates.root 59583 1 1 0 1 0
+#data /eos/user/a/avijay/HZZ_mergedrootfiles/egamma/egamma.root 59830 1 1 0 1 0
+Triboson /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/WWZ_4F_ext.root 0.05709 1 9994000.0 1 33 1
+Triboson /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/WWZ_4F.root 0.05709 1 300000.0 1 34 1
+Triboson /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/ZZZ_ext.root 0.01476 1 9889000.0 1 37 1
+Triboson /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/ZZZ.root 0.01476 1 250000.0 1 38 1
+WJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/WJetsToLNu_HT-70To100.root 1283.0 1 66220256.0 1 9 1
+WJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/WJetsToLNu_HT-100To200.root 1244.0 1 51408967.0 1 41 1
+WJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/WJetsToLNu_HT-200To400.root 337.8 1 58225632.0 1 42 1
+WJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/WJetsToLNu_HT-400To600.root 44.93 1 7444030.0 1 43 1
+WJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/WJetsToLNu_HT-600To800.root 11.19 1 7718765.0 1 44 1
+WJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/WJetsToLNu_HT-800To1200.root 4.926 1 7306187.0 1 45 1
+WJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/WJetsToLNu_HT-1200To2500.root 1.152 1 6481518.0 1 46 1
+Dibosons /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/WWTo2L2Nu.root 11.09 1 9994000.0 1 47 1
+#Dibosons /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/WWZ_4F_ext.root 0.1707 1 9994000.0 1 48 1
+#Dibosons /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/WWZ_4F.root 0.1707 1 248000 1 49 1
+Dibosons /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/WZTo2Q2L.root 6.419 1 28576996.0 1 31 1
+Dibosons /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/WZTo3LNu_5f.root 5.257 1 38624209.0 1 32 1
+Dibosons /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/ZZTo2L2Nu.root 0.9738 1 56886000.0 1 35 1
+Dibosons /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/ZZTo2Q2L.root 3.696 1 29357938.0 1 36 1
+Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/ST_s-channel_4f_hadronicDecays.root 7.104 1 16259000.0 1 3 1
+Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/ST_s-channel_4f_leptonDecays.root 3.549 1 19365999.0 1 4 1
+Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/ST_tW_top_5f_inclusiveDecays.root 32.45 1 7956000.0 1 5 1
+Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/TTWJetsToLNu.root 0.2163 1 10450000.0 1 6 1
+#Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/TTJets.root 831.76 1 304895029.0 1 9 1
+Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/TTJets.root 831.76 1 304895029.0 1 9 1
+#Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/TTTo2L2Nu.root 687.1 1 145020000.0 1 7 1
+Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/TTTo2L2Nu.root 687.1 1 145020000.0 1 7 1
+Top /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/TTZToLLNuNu.root 0.2439 1 19608000.0 1 8 1
+DYJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/drellyan_ptz_0to50.root 1485 1 196207761.0 1 2 1
+DYJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/drellyan_ptz_50to100.root 397.4 1 122967660.0 1 2 1
+DYJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/drellyan_ptz_100to250.root 97.2 1 79527324.0 1 2 1
+DYJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/drellyan_ptz_250to400.root 3.701 1 24195330.0 1 2 1
+DYJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/drellyan_ptz_400to650.root 0.5086 1 3936102.0 1 2 1
+DYJets /eos/user/a/avijay/Mergedrootfiles_hzz_new/updated_files/drellyan_ptz_650toInf.root 0.04728 1 3994997.0 1 2 1
diff --git a/ControlPlots/HZZ2l2nu_MuonSamples13TeV_2024_04_11.txt b/ControlPlots/HZZ2l2nu_MuonSamples13TeV_2024_04_11.txt
new file mode 100644
index 0000000..2e257f8
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_MuonSamples13TeV_2024_04_11.txt
@@ -0,0 +1,32 @@
+# name file_location xspb/lumipb otherscale nMCevents nMCNegEvents colorcode stackit
+data /eos/user/r/rasharma/nanoAOD_ntuples/HZZ2l2nu_v2/SingleMuon.root 59830 1 1 0 1 0
+Triboson /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WZZ_TuneCP5_13TeV-amcatnlo-pythia8_ext1-v2.root 0.05709 1 9994000.0 1 33 1
+Triboson /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WZZ_TuneCP5_13TeV-amcatnlo-pythia8.root 0.05709 1 300000.0 1 34 1
+Triboson /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ZZZ_TuneCP5_13TeV-amcatnlo-pythia8_ext1-v2.root 0.01476 1 9889000.0 1 37 1
+Triboson /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ZZZ_TuneCP5_13TeV-amcatnlo-pythia8.root 0.01476 1 250000.0 1 38 1
+WJets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WJetsToLNu_HT-70To100_TuneCP5_13TeV-madgraphMLM-pythia8.root 1283.0 1 66220256.0 1 9 1
+WJets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WJetsToLNu_HT-100To200_TuneCP5_13TeV-madgraphMLM-pythia8.root 1244.0 1 51408967.0 1 41 1
+WJets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WJetsToLNu_HT-200To400_TuneCP5_13TeV-madgraphMLM-pythia8.root 337.8 1 58225632.0 1 42 1
+WJets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WJetsToLNu_HT-400To600_TuneCP5_13TeV-madgraphMLM-pythia8.root 44.93 1 7444030.0 1 43 1
+WJets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WJetsToLNu_HT-600To800_TuneCP5_13TeV-madgraphMLM-pythia8.root 11.19 1 7718765.0 1 44 1
+WJets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WJetsToLNu_HT-800To1200_TuneCP5_13TeV-madgraphMLM-pythia8.root 4.926 1 7306187.0 1 45 1
+WJets /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WJetsToLNu_HT-1200To2500_TuneCP5_13TeV-madgraphMLM-pythia8.root 1.152 1 6481518.0 1 46 1
+Dibosons /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WWTo2L2Nu_TuneCP5_13TeV-powheg-pythia8.root 11.09 1 9994000.0 1 47 1
+Dibosons /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WWZ_4F_TuneCP5_13TeV-amcatnlo-pythia8_ext1-v2.root 0.1707 1 9994000.0 1 48 1
+Dibosons /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WWZ_4F_TuneCP5_13TeV-amcatnlo-pythia8.root 0.1707 1 248000 1 49 1
+Dibosons /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WZTo2Q2L_mllmin4p0_TuneCP5_13TeV-amcatnloFXFX-pythia8.root 6.419 1 28576996.0 1 31 1
+Dibosons /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/WZTo3LNu_5f_TuneCP5_13TeV-madgraphMLM-pythia8.root 5.257 1 38624209.0 1 32 1
+Dibosons /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ZZTo2L2Nu_TuneCP5_13TeV_powheg_pythia8.root 0.9738 1 56886000.0 1 35 1
+Dibosons /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ZZTo2Q2L_mllmin4p0_TuneCP5_13TeV-amcatnloFXFX-pythia8.root 3.696 1 29357938.0 1 36 1
+Top /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ST_s-channel_4f_hadronicDecays.root 7.104 1 16259000.0 1 3 1
+Top /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ST_s-channel_4f_leptonDecays.root 3.549 1 19365999.0 1 4 1
+Top /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/ST_tW_top_5f_inclusiveDecays.root 32.45 1 7956000.0 1 5 1
+Top /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/TTWJetsToLNu.root 0.2163 1 10450000.0 1 6 1
+Top /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/TTTo2L2Nu_TuneCP5_13TeV-powheg-pythia8.root 687.1 1 145020000.0 1 7 1
+Top /eos/user/a/avijay/merge/CMS_FulllSimulation/Scripts/TTZToLLNuNu.root 0.2439 1 19608000.0 1 8 1
+DYJets /eos/user/r/rasharma/nanoAOD_ntuples/HZZ2l2nu_v2/WeightedDrellYan/DY_0TO50.root 1485 1 196207761.0 1 2 1
+DYJets /eos/user/r/rasharma/nanoAOD_ntuples/HZZ2l2nu_v2/WeightedDrellYan/DY_50to100.root 397.4 1 122967660.0 1 2 1
+DYJets /eos/user/r/rasharma/nanoAOD_ntuples/HZZ2l2nu_v2/WeightedDrellYan/DY_100to250.root 97.2 1 79527324.0 1 2 1
+DYJets /eos/user/r/rasharma/nanoAOD_ntuples/HZZ2l2nu_v2/WeightedDrellYan/DY_250TO400.root 3.701 1 24195330.0 1 2 1
+DYJets /eos/user/r/rasharma/nanoAOD_ntuples/HZZ2l2nu_v2/WeightedDrellYan/DY_400to650.root 0.5086 1 3936102.0 1 2 1
+DYJets /eos/user/r/rasharma/nanoAOD_ntuples/HZZ2l2nu_v2/WeightedDrellYan/DY_650toInf.root 0.04728 1 3994997.0 1 2 1
diff --git a/ControlPlots/HZZ2l2nu_MuonSamples13TeV_2024_06_27.txt b/ControlPlots/HZZ2l2nu_MuonSamples13TeV_2024_06_27.txt
new file mode 100644
index 0000000..ba26f29
--- /dev/null
+++ b/ControlPlots/HZZ2l2nu_MuonSamples13TeV_2024_06_27.txt
@@ -0,0 +1,33 @@
+# name file_location xspb/lumipb otherscale nMCevents nMCNegEvents colorcode stackit
+data /eos/user/a/avijay/HZZ_mergedrootfiles/singlemuon/singlemuon.root 59830 1 1 0 1 0
+Triboson /eos/user/a/avijay/HZZ_mergedrootfiles/WZZ_4F_ext.root 0.05709 1 9994000.0 1 33 1
+Triboson /eos/user/a/avijay/HZZ_mergedrootfiles/WZZ_4F.root 0.05709 1 300000.0 1 34 1
+Triboson /eos/user/a/avijay/HZZ_mergedrootfiles/ZZZ_ext.root 0.01476 1 9889000.0 1 37 1
+Triboson /eos/user/a/avijay/HZZ_mergedrootfiles/ZZZ.root 0.01476 1 250000.0 1 38 1
+WJets /eos/user/a/avijay/HZZ_mergedrootfiles/WJetsToLNu_HT-70To100.root 1283.0 1 66220256.0 1 9 1
+WJets /eos/user/a/avijay/HZZ_mergedrootfiles/WJetsToLNu_HT-100To200.root 1244.0 1 51408967.0 1 41 1
+WJets /eos/user/a/avijay/HZZ_mergedrootfiles/WJetsToLNu_HT-200To400.root 337.8 1 58225632.0 1 42 1
+WJets /eos/user/a/avijay/HZZ_mergedrootfiles/WJetsToLNu_HT-400To600.root 44.93 1 7444030.0 1 43 1
+WJets /eos/user/a/avijay/HZZ_mergedrootfiles/WJetsToLNu_HT-600To800.root 11.19 1 7718765.0 1 44 1
+WJets /eos/user/a/avijay/HZZ_mergedrootfiles/WJetsToLNu_HT-800To1200.root 4.926 1 7306187.0 1 45 1
+WJets /eos/user/a/avijay/HZZ_mergedrootfiles/WJetsToLNu_HT-1200To2500.root 1.152 1 6481518.0 1 46 1
+Dibosons /eos/user/a/avijay/HZZ_mergedrootfiles/WWTo2L2Nu.root 11.09 1 9994000.0 1 47 1
+Dibosons /eos/user/a/avijay/HZZ_mergedrootfiles/WWZ_4F_ext.root 0.1707 1 9994000.0 1 48 1
+Dibosons /eos/user/a/avijay/HZZ_mergedrootfiles/WWZ_4F.root 0.1707 1 248000 1 49 1
+Dibosons /eos/user/a/avijay/HZZ_mergedrootfiles/WZTo2Q2L.root 6.419 1 28576996.0 1 31 1
+Dibosons /eos/user/a/avijay/HZZ_mergedrootfiles/WZTo3LNu_5f.root 5.257 1 38624209.0 1 32 1
+Dibosons /eos/user/a/avijay/HZZ_mergedrootfiles/ZZTo2L2Nu.root 0.9738 1 56886000.0 1 35 1
+Dibosons /eos/user/a/avijay/HZZ_mergedrootfiles/ZZTo2Q2L.root 3.696 1 29357938.0 1 36 1
+Top /eos/user/a/avijay/HZZ_mergedrootfiles/ST_s-channel_4f_hadronicDecays.root 7.104 1 16259000.0 1 3 1
+Top /eos/user/a/avijay/HZZ_mergedrootfiles/ST_s-channel_4f_leptonicDecays.root 3.549 1 19365999.0 1 4 1
+Top /eos/user/a/avijay/HZZ_mergedrootfiles/ST_tW_top_5f_inclusiveDecays.root 32.45 1 7956000.0 1 5 1
+Top /eos/user/a/avijay/HZZ_mergedrootfiles/TTWJetsToLNu.root 0.2163 1 10450000.0 1 6 1
+Top /eos/user/a/avijay/HZZ_mergedrootfiles/TTJets.root 831.76 1 304895029.0 1 9 1
+Top /eos/user/a/avijay/HZZ_mergedrootfiles/TTTo2L2Nu.root 687.1 1 145020000.0 1 7 1
+Top /eos/user/a/avijay/HZZ_mergedrootfiles/TTZToLLNuNu.root 0.2439 1 19608000.0 1 8 1
+DYJets /eos/user/a/avijay/HZZ_mergedrootfiles/drellyan_ptz_0to50.root 1485 1 196207761.0 1 2 1
+DYJets /eos/user/a/avijay/HZZ_mergedrootfiles/drellyan_ptz_50to100.root 397.4 1 122967660.0 1 2 1
+DYJets /eos/user/a/avijay/HZZ_mergedrootfiles/drellyan_ptz_100to250.root 97.2 1 79527324.0 1 2 1
+DYJets /eos/user/a/avijay/HZZ_mergedrootfiles/drellyan_ptz_250to400.root 3.701 1 24195330.0 1 2 1
+DYJets /eos/user/a/avijay/HZZ_mergedrootfiles/drellyan_ptz_400to650.root 0.5086 1 3936102.0 1 2 1
+DYJets /eos/user/a/avijay/HZZ_mergedrootfiles/drellyan_ptz_650toInf.root 0.04728 1 3994997.0 1 2 1
diff --git a/ControlPlots/HZZ2l2q_Cuts.txt b/ControlPlots/HZZ2l2q_Cuts.txt
new file mode 100644
index 0000000..38becfd
--- /dev/null
+++ b/ControlPlots/HZZ2l2q_Cuts.txt
@@ -0,0 +1,13 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==1)"
+"lepton pt" "((pTL1>40)&&(pTL2>24))"
+"Di-lepton pT" "(pTZ1>100)"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2q event selection" "(passZZ2l2qSelection==1)"
+"Boosted category" "(isBoosted2l2q==1)"
+"65 GeV < massZ2 < 105 GeV" "((massZ2>40 && massZ2 < 70) || (massZ2>105 && massZ2 < 180))"
+#"pT4l > 500 GeV" "(pT4l>500)"
diff --git a/ControlPlots/HZZ2l2q_Cuts_Muon.txt b/ControlPlots/HZZ2l2q_Cuts_Muon.txt
new file mode 100644
index 0000000..b551b9c
--- /dev/null
+++ b/ControlPlots/HZZ2l2q_Cuts_Muon.txt
@@ -0,0 +1,13 @@
+# Name Cut string
+##########################################
+# For electron: HZZ2l2qNu_isELE == 1
+# For muon: HZZ2l2qNu_isELE == 0
+"electron channel" "(HZZ2l2qNu_isELE==0)"
+"lepton pt" "((pTL1>40)&&(pTL2>24))"
+"Di-lepton pT" "(pTZ1>100)"
+# HZZ2l2qNu_cutOppositeChargeFlag == 0 means it is opposite charge
+"Opposite charge" "(HZZ2l2qNu_cutOppositeChargeFlag==0)"
+"2l2q event selection" "(passZZ2l2qSelection==1)"
+"Boosted category" "(isBoosted2l2q==1)"
+"65 GeV < massZ2 < 105 GeV" "((massZ2>40 && massZ2 < 70) || (massZ2>105 && massZ2 < 180))"
+#"pT4l > 500 GeV" "(pT4l>500)"
diff --git a/ControlPlots/Limit_Script.py b/ControlPlots/Limit_Script.py
deleted file mode 100644
index b04af35..0000000
--- a/ControlPlots/Limit_Script.py
+++ /dev/null
@@ -1,183 +0,0 @@
-import os
-import sys
-
-MainRootMacro = 'myControlPlots.C'
-SampleFile = 'DibosonBoostedElMuSamples13TeV.txt'
-CutFile = 'DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt'
-VariableFile = 'controlplotvars_CHS_Limit.h'
-TemplateRunFIle = 'RunMacro_Limits_Templet.C'
-
-MCnameDict = [ "WV_EWK", "Z+jets", "Z+jets", "Diboson", "top", "TTbar", "SingleTop", "W+jets", "QCD" , "VV"]
-#MCnameDict = [ "aQGC", "WV_EWK", "Z+jets", "Z+jets", "Diboson", "top", "TTbar", "SingleTop", "W+jets", "QCD" , "VV"]
-
-CutFileDict_jes_up={"ungroomed_PuppiAK8_jet_pt" :"ungroomed_PuppiAK8_jet_pt_jes_up",
- "ungroomed_PuppiAK8_jet_eta" :"ungroomed_PuppiAK8_jet_eta_jes_up",
- "vbf_maxpt_j1_pt" :"vbf_maxpt_j1_pt_jes_up",
- "vbf_maxpt_j2_pt" :"vbf_maxpt_j2_pt_jes_up",
- "vbf_maxpt_jj_m" :"vbf_maxpt_jj_m_jes_up",
- "pfMET_Corr" :"pfMET_jes_up",
- "PuppiAK8_jet_mass_so_corr" :"ungroomed_PuppiAK8_jet_mass_jes_up",
- "vbf_maxpt_j2_eta" :"vbf_maxpt_j2_eta_jes_up",
- "vbf_maxpt_j1_eta" :"vbf_maxpt_j1_eta_jes_up",
- "vbf_maxpt_jj_m" :"vbf_maxpt_jj_m_jes_up",
- "BosonCentrality_type0" :"BosonCentrality_type0_jes_up",
- "ZeppenfeldWL_type0" :"ZeppenfeldWL_type0_jes_up",
- "vbf_maxpt_jj_Deta" :"vbf_maxpt_jj_Deta_jes_up",
- "mass_lvj_type0_PuppiAK8" :"mass_lvj_type0_PuppiAK8_jes_up",
- "ZeppenfeldWH" :"ZeppenfeldWH_jes_up"
- }
-CutFileDict_jes_dn={"ungroomed_PuppiAK8_jet_pt" :"ungroomed_PuppiAK8_jet_pt_jes_dn",
- "ungroomed_PuppiAK8_jet_eta" :"ungroomed_PuppiAK8_jet_eta_jes_dn",
- "vbf_maxpt_j1_pt" :"vbf_maxpt_j1_pt_jes_dn",
- "vbf_maxpt_j2_pt" :"vbf_maxpt_j2_pt_jes_dn",
- "vbf_maxpt_jj_m" :"vbf_maxpt_jj_m_jes_dn",
- "pfMET_Corr" :"pfMET_jes_dn",
- "PuppiAK8_jet_mass_so_corr" :"ungroomed_PuppiAK8_jet_mass_jes_dn",
- "vbf_maxpt_j2_eta" :"vbf_maxpt_j2_eta_jes_dn",
- "vbf_maxpt_j1_eta" :"vbf_maxpt_j1_eta_jes_dn",
- "vbf_maxpt_jj_m" :"vbf_maxpt_jj_m_jes_dn",
- "BosonCentrality_type0" :"BosonCentrality_type0_jes_dn",
- "ZeppenfeldWL_type0" :"ZeppenfeldWL_type0_jes_dn",
- "vbf_maxpt_jj_Deta" :"vbf_maxpt_jj_Deta_jes_dn",
- "mass_lvj_type0_PuppiAK8" :"mass_lvj_type0_PuppiAK8_jes_dn",
- "ZeppenfeldWH" :"ZeppenfeldWH_jes_dn"
- }
-CutFileDict_jer_up={
- #"ungroomed_PuppiAK8_jet_pt" :"ungroomed_PuppiAK8_jet_pt_jer_up",
- #"ungroomed_PuppiAK8_jet_eta" :"ungroomed_PuppiAK8_jet_eta_jer_up",
- #"vbf_maxpt_j1_pt" :"vbf_maxpt_j1_pt_jer_up",
- #"vbf_maxpt_j2_pt" :"vbf_maxpt_j2_pt_jer_up",
- #"vbf_maxpt_jj_m" :"vbf_maxpt_jj_m_jer_up",
- "pfMET_Corr" :"pfMET_Corr_jerup",
- #"PuppiAK8_jet_mass_so_corr" :"ungroomed_PuppiAK8_jet_mass_jer_up",
- #"vbf_maxpt_j2_eta" :"vbf_maxpt_j2_eta_jer_up",
- #"vbf_maxpt_j1_eta" :"vbf_maxpt_j1_eta_jer_up",
- #"vbf_maxpt_jj_m" :"vbf_maxpt_jj_m_jer_up",
- #"BosonCentrality_type0" :"BosonCentrality_type0_jer_up",
- "ZeppenfeldWL_type0" :"ZeppenfeldWL_type0_jer_up",
- #"ZeppenfeldWH" :"ZeppenfeldWH_jer_up",
- #"vbf_maxpt_jj_Deta" :"vbf_maxpt_jj_Deta_jer_up"
- "mass_lvj_type0_PuppiAK8" :"mass_lvj_type0_PuppiAK8_jer_up",
- }
-CutFileDict_jer_dn={
- #"ungroomed_PuppiAK8_jet_pt" :"ungroomed_PuppiAK8_jet_pt_jer_dn",
- #"ungroomed_PuppiAK8_jet_eta" :"ungroomed_PuppiAK8_jet_eta_jer_dn",
- #"vbf_maxpt_j1_pt" :"vbf_maxpt_j1_pt_jer_dn",
- #"vbf_maxpt_j2_pt" :"vbf_maxpt_j2_pt_jer_dn",
- #"vbf_maxpt_jj_m" :"vbf_maxpt_jj_m_jer_dn",
- "pfMET_Corr" :"pfMET_Corr_jerdn",
- #"PuppiAK8_jet_mass_so_corr" :"ungroomed_PuppiAK8_jet_mass_jer_dn",
- #"vbf_maxpt_j2_eta" :"vbf_maxpt_j2_eta_jer_dn",
- #"vbf_maxpt_j1_eta" :"vbf_maxpt_j1_eta_jer_dn",
- #"vbf_maxpt_jj_m" :"vbf_maxpt_jj_m_jer_dn",
- "BosonCentrality_type0" :"BosonCentrality_type0_jer_dn",
- "ZeppenfeldWL_type0" :"ZeppenfeldWL_type0_jer_dn",
- #"ZeppenfeldWH" :"ZeppenfeldWH_jer_dn",
- #"vbf_maxpt_jj_Deta" :"vbf_maxpt_jj_Deta_jer_dn"
- "mass_lvj_type0_PuppiAK8" :"mass_lvj_type0_PuppiAK8_jer_dn"
- }
-
-fileName = ""
-
-for suffix in ["_CMS_scale_jUp", "_CMS_scale_jDown", "_CMS_res_metUp", "_CMS_res_metDown", "_CMS_puUp", "_CMS_puDown", "_CMS_btagHFUp", "_CMS_btagHFDown", "_CMS_btagLFUp", "_CMS_btagLFDown" ]:
- ########
- # modify the sample file
- ########
- for i, var in enumerate(MCnameDict):
- if i == 0:
- command1 = "sed 's/\<"+var+"\>/"+var+suffix+"/g' "+SampleFile+ " > " + os.path.splitext(SampleFile)[0]+suffix+".txt"
- command2 = "sed 's/\<"+var+"\>/"+var+suffix+"/g' "+MainRootMacro+ " > " + os.path.splitext(MainRootMacro)[0]+suffix+".C"
- else:
- command1 = "sed -i 's/\<"+var+"\>/"+var+suffix+"/g' "+os.path.splitext(SampleFile)[0]+suffix+".txt"
- command2 = "sed -i 's/\<"+var+"\>/"+var+suffix+"/g' "+os.path.splitext(MainRootMacro)[0]+suffix+".C"
- os.system(command1)
- os.system(command2)
- fileName1 = os.path.splitext(SampleFile)[0]+suffix+".txt"
- fileName2 = os.path.splitext(SampleFile)[0]+suffix+".txt"
- os.system("sed -i 's/myControlPlots/"+os.path.splitext(MainRootMacro)[0]+suffix+"/g' "+os.path.splitext(MainRootMacro)[0]+suffix+".C")
- print "\nFile created: ",fileName1,"\t",fileName2
-
-
-print "\n\n============\n\n"
-
-
-###########
-# modify the cut file
-###########
-OutCutFileName = ["_CMS_scale_jUp", "_CMS_scale_jDown", "_CMS_res_metUp", "_CMS_res_metDown"]
-countCut = 0
-for cutvars in [CutFileDict_jes_up,CutFileDict_jes_dn, CutFileDict_jer_up, CutFileDict_jer_dn]:
- for i,key in enumerate(cutvars):
- #print i, key,"\t => ", cutvars[key]
- if i == 0:
- command = "sed 's/"+key+"/"+cutvars[key]+"/g' "+ CutFile + " > " + os.path.splitext(CutFile)[0]+OutCutFileName[countCut]+".txt"
- else:
- command = "sed -i 's/"+key+"/"+cutvars[key]+"/g' "+ os.path.splitext(CutFile)[0]+OutCutFileName[countCut]+".txt"
- os.system(command)
- fileName = os.path.splitext(CutFile)[0]+OutCutFileName[countCut]+".txt"
- countCut+=1
- print "\nFile created: ",fileName
-
-print "\n\n============\n\n"
-for i,suffix in enumerate(["_jes_up","_jes_dn", "_jer_up", "_jer_dn"]):
- os.system("sed 's/mass_lvj_type0_PuppiAK8/mass_lvj_type0_PuppiAK8"+suffix+"/g' " + VariableFile + " > " + "Variable"+suffix+".h")
- print "\nFile created: Variable"+suffix+".h"
-
-print "\n\n============\n\n"
-###########
-# modify the run file
-###########
-print "**"*40
-printVar = " Running for Nominal case "
-print "*\n*","\t\t",printVar,"\n*"
-print "**"*40
-
-command = "root -l -b -q RunMacro_Limits_Templet.C"
-
-os.system(command)
-for i,suffix in enumerate(["_jes_up","_jes_dn", "_jer_up", "_jer_dn"]):
- print "\n\n","**"*40,"\n*\n","*\t\t Running for ",suffix,"\n*\n","**"*40
- os.system("cp RunMacro_Limits_Templet.C RunMacro_Limits_"+suffix+".C")
- os.system("sed -i 's/controlplotvars_CHS_Limit.h/"+"Variable"+suffix+".h"+"/g' RunMacro_Limits_"+suffix+".C")
- os.system("sed -i 's/RunMacro_Limits_Templet/RunMacro_Limits_"+suffix+"/g' RunMacro_Limits_"+suffix+".C")
- os.system("sed -i 's/myControlPlots/"+os.path.splitext(MainRootMacro)[0]+OutCutFileName[i]+"/g' RunMacro_Limits_"+suffix+".C")
- os.system("sed -i 's/DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt/"+os.path.splitext(CutFile)[0]+OutCutFileName[i]+".txt" + "/g' RunMacro_Limits_"+suffix+".C")
- os.system("sed -i 's/DibosonBoostedElMuSamples13TeV.txt/"+os.path.splitext(SampleFile)[0]+OutCutFileName[i]+".txt" + "/g' RunMacro_Limits_"+suffix+".C")
- os.system("sed -i 's/RECREATE/UPDATE/g' RunMacro_Limits_"+suffix+".C")
- os.system("sed -i 's/1)/0)/g' RunMacro_Limits_"+suffix+".C")
- os.system("root -l -b -q RunMacro_Limits_"+suffix+".C")
-
-##################
-# for PU
-##################
-
-weights = {"pu_Weight_up":["pu_Weight","CMS_puUp"], "pu_Weight_down":["pu_Weight","CMS_puDown"], "btag0WgtUpHF":["btag0Wgt","CMS_btagHFUp"], "btag0WgtDownHF":["btag0Wgt","CMS_btagHFDown"], "btag0WgtUpLF":["btag0Wgt","CMS_btagLFUp"], "btag0WgtDownLF":["btag0Wgt","CMS_btagLFDown"]}
-
-for i,key in enumerate(weights):
- print "\n\n","**"*40,"\n*\n","*\t\t Running for ",key,"\t",weights[key][0],"\n*\n","**"*40
- print key,weights[key][0]
- os.system("sed -i 's/"+weights[key][0]+"/"+key+"/g' "+"myControlPlots_"+weights[key][1]+".C")
- os.system("sed 's/myControlPlots/myControlPlots_"+weights[key][1]+"/g' RunMacro_Limits_Templet.C > RunMacro_Limits_Templet_"+weights[key][1]+".C")
- os.system("sed -i 's/RECREATE/UPDATE/g' RunMacro_Limits_Templet_"+weights[key][1]+".C")
- os.system("sed -i 's/RunMacro_Limits_Templet/RunMacro_Limits_Templet_"+weights[key][1]+"/g' RunMacro_Limits_Templet_"+weights[key][1]+".C")
- os.system("sed -i 's/1)/0)/g' RunMacro_Limits_Templet_"+weights[key][1]+".C")
- os.system("sed -i 's/DibosonBoostedElMuSamples13TeV.txt/DibosonBoostedElMuSamples13TeV_"+weights[key][1]+".txt/g' RunMacro_Limits_Templet_"+weights[key][1]+".C")
- os.system("root -l -b -q RunMacro_Limits_Templet_"+weights[key][1]+".C")
-
-################
-#
-# Delete all created files
-#
-################
-for suffix in ["_CMS_scale_jUp", "_CMS_scale_jDown", "_CMS_res_metUp", "_CMS_res_metDown", "_CMS_puUp", "_CMS_puDown", "_CMS_btagHFUp", "_CMS_btagHFDown", "_CMS_btagLFUp", "_CMS_btagLFDown" ]:
- os.system("rm "+os.path.splitext(SampleFile)[0]+suffix+".txt")
-for i,name in enumerate(OutCutFileName):
- os.system("rm "+os.path.splitext(CutFile)[0]+OutCutFileName[i]+".txt")
-for suffix in ["_jes_up","_jes_dn", "_jer_up", "_jer_dn"]:
- os.system("rm Variable"+suffix+".h")
- os.system("rm RunMacro_Limits_"+suffix+".C")
-for i,key in enumerate(weights):
- os.system("rm myControlPlots_"+weights[key][1]+".C")
- os.system("rm RunMacro_Limits_Templet_"+weights[key][1]+".C")
-
-os.system("rm *.so *.pcm *.d")
diff --git a/ControlPlots/OutDir/.gitignore b/ControlPlots/OutDir/.gitignore
deleted file mode 100644
index efd6eff..0000000
--- a/ControlPlots/OutDir/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*.log
-*.pdf
-*.png
diff --git a/ControlPlots/Plot_aQGC.py b/ControlPlots/Plot_aQGC.py
deleted file mode 100644
index 3881156..0000000
--- a/ControlPlots/Plot_aQGC.py
+++ /dev/null
@@ -1,196 +0,0 @@
-import ROOT as r
-r.gROOT.SetBatch(True)
-clock = r.TStopwatch()
-clock.Start()
-
-r.gStyle.SetOptStat(0)
-import CMS_lumi, tdrstyle
-tdrstyle.setTDRStyle()
-
-
-def createRatio(h1, h2, xlabel, col):
- h3 = h1.Clone("h3")
- h3.SetLineColor(col)
- h3.SetMarkerColor(col)
- h3.SetMarkerStyle(21)
- h3.SetTitle("")
- h3.SetMinimum(0.5)
- h3.SetMaximum(1.5)
- # Set up plot for markers and errors
- #h3.Sumw2()
- h3.SetStats(0)
- h3.Divide(h2)
-
- # Adjust y-axis settings
- y = h3.GetYaxis()
- y.SetTitle("ratio (SM/aQGC)")
- y.SetNdivisions(505)
- y.SetTitleSize(20)
- y.SetTitleFont(43)
- y.SetTitleOffset(1.55)
- y.SetLabelFont(43)
- y.SetLabelSize(15)
-
- # Adjust x-axis settings
- x = h3.GetXaxis()
- x.SetTitle(xlabel)
- x.SetTitleSize(20)
- x.SetTitleFont(43)
- x.SetTitleOffset(4.0)
- x.SetLabelFont(43)
- x.SetLabelSize(15)
-
- return h3
-
-def createCanvasPads():
- c = r.TCanvas("c", "canvas", 600, 700)
- # Upper histogram plot is pad1
- pad1 = r.TPad("pad1", "pad1", 0.0, 0.3, 1.0, 1.0)
- pad1.SetBottomMargin(0) # joins upper and lower plot
- pad1.SetLeftMargin(0.1)
- pad1.SetRightMargin(0.03)
- pad1.SetLogy(1)
- pad1.SetGridx()
- pad1.SetTickx(1)
- pad1.SetTicky(1)
- pad1.Draw()
- # Lower ratio plot is pad2
- c.cd() # returns to main canvas before defining pad2
- pad2 = r.TPad("pad2", "pad2", 0.0, 0.00, 1.0, 0.3)
- #pad2.SetLogy(1)
- pad2.SetTopMargin(0) # joins upper and lower plot
- pad2.SetBottomMargin(0.25)
- pad2.SetLeftMargin(0.1)
- pad2.SetRightMargin(0.03)
- pad2.SetGridx()
- pad2.SetTickx(1)
- pad2.SetTicky(1)
- pad2.Draw()
-
- return c, pad1, pad2
-
-def getHistFromFile (tree, var, weight, nbin, xmin, xmax, xlabel, col, cut_string):
- hist = r.TH1F("hist", xlabel, nbin, xmin, xmax)
- #tree.Draw(var+ ">>hist","","")
- #tree.Draw(var+ ">>hist","genWeight*trig_eff_Weight*id_eff_Weight*pu_Weight*(((type==1) || (type==0)) && (l_pt2<0) && ((l_pt1>30.) && (abs(l_eta1)<2.5)) && ((ungroomed_PuppiAK8_jet_pt_jes_up>200)&&(abs(ungroomed_PuppiAK8_jet_eta_jes_up)<2.4)) && ((vbf_maxpt_j1_pt_jes_up>30) && (vbf_maxpt_j2_pt_jes_up>30)) && (vbf_maxpt_jj_m_jes_up>500) && (nBTagJet_loose==0) && (pfMET_jes_up>50) && ((PuppiAK8_jet_tau2tau1<0.55)) && ((ungroomed_PuppiAK8_jet_mass_jes_up>65) && (ungroomed_PuppiAK8_jet_mass_jes_up<105)) && (abs(vbf_maxpt_j2_eta_jes_up-vbf_maxpt_j1_eta_jes_up)>4.0) && (vbf_maxpt_jj_m_jes_up>800) && (BosonCentrality_type0_jes_up>1.0) && (abs(ZeppenfeldWL_type0_jes_up/vbf_maxpt_jj_Deta_jes_up)<0.3) && (abs(ZeppenfeldWH_jes_up/vbf_maxpt_jj_Deta_jes_up)<0.3))","")
- #tree.Draw(var+ ">>hist","genWeight*trig_eff_Weight*id_eff_Weight*pu_Weight*(((type==1) || (type==0)) && (l_pt2<0) && ((l_pt1>30.) && (abs(l_eta1)<2.5)) && ((ungroomed_PuppiAK8_jet_pt_jes_up>200)&&(abs(ungroomed_PuppiAK8_jet_eta_jes_up)<2.4)) && ((vbf_maxpt_j1_pt_jes_up>30) && (vbf_maxpt_j2_pt_jes_up>30)) && (vbf_maxpt_jj_m_jes_up>500) && (nBTagJet_loose==0) && (pfMET_jes_up>50) && ((PuppiAK8_jet_tau2tau1<0.55)) && ((ungroomed_PuppiAK8_jet_mass_jes_up>65) && (ungroomed_PuppiAK8_jet_mass_jes_up<105)) && (abs(vbf_maxpt_j2_eta_jes_up-vbf_maxpt_j1_eta_jes_up)>4.0) && (vbf_maxpt_jj_m_jes_up>800) && (BosonCentrality_type0_jes_up>1.0) && (abs(ZeppenfeldWL_type0_jes_up/vbf_maxpt_jj_Deta_jes_up)<0.3) && (abs(ZeppenfeldWH_jes_up/vbf_maxpt_jj_Deta_jes_up)<0.3))*17.92*35867.06/1706220.0","")
- #tree.Draw(var+ ">>hist","genWeight*trig_eff_Weight*id_eff_Weight*pu_Weight*(((type==1) || (type==0)) && (l_pt2<0) && ((l_pt1>30.) && (abs(l_eta1)<2.5)) && ((ungroomed_PuppiAK8_jet_pt_jes_up>200)&&(abs(ungroomed_PuppiAK8_jet_eta_jes_up)<2.4)) && ((vbf_maxpt_j1_pt_jes_up>30) && (vbf_maxpt_j2_pt_jes_up>30)) && (vbf_maxpt_jj_m_jes_up>500) && (nBTagJet_loose==0) && (pfMET_jes_up>50) && ((PuppiAK8_jet_tau2tau1<0.55)) && ((ungroomed_PuppiAK8_jet_mass_jes_up>65) && (ungroomed_PuppiAK8_jet_mass_jes_up<105)) && (abs(vbf_maxpt_j2_eta_jes_up-vbf_maxpt_j1_eta_jes_up)>4.0) && (vbf_maxpt_jj_m_jes_up>800) && (BosonCentrality_type0_jes_up>1.0) && (abs(ZeppenfeldWL_type0_jes_up/vbf_maxpt_jj_Deta_jes_up)<0.3) && (abs(ZeppenfeldWH_jes_up/vbf_maxpt_jj_Deta_jes_up)<0.3))*wSampleWeight*35867.1","")
- tree.Draw(var+ ">>hist","trig_eff_Weight")
- #tree.Draw(var+ ">>hist","wSampleWeight*35867.1","",10000)
- #tree.Draw(var+ ">>hist","LHEWeight["+str(weight)+"]/LHEWeight[0]", "", 10000)
- #tree.Draw(var+ ">>hist", "((LHEWeight["+str(weight)+"]*wSampleWeight*35867.1)/LHEWeight[0])*"+cut_string, "")
- #tree.Draw(var+ ">>hist", "((LHEWeight["+str(weight)+"])/LHEWeight[0])*"+cut_string, "")
- print "Entries : ",hist.Integral()
- tmp = 0.0;
- print "Entries (Before Scale) : ",hist.IntegralAndError(0,hist.GetNbinsX()+1,r.Double(tmp))
- #hist.Scale((17.92*35867.06)/(706220.0))
- print "Entries (After Scale) : ",hist.Integral(1,hist.GetNbinsX()+1)
- print "\n\n============"
- if not hist:
- print 'Failed to get hist from file'
- exit(0)
- hist.GetXaxis().SetTitle(xlabel)
- ylabel = "Events / %s GeV" % int(hist.GetBinWidth(1))
- hist.GetYaxis().SetTitle(ylabel)
- hist.SetLineColor(col)
- hist.SetMarkerColor(col)
- hist.SetDirectory(r.gROOT) # detach "hist" from the file
- return hist
-
-def CreatePlots(ttree, variables, outputFileName, xlabel="x-axis", nbin=20, minx=0, maxx=2400, nEvents=-1, cut_string = ""):
- colorArray = [1, 632, 416, 600, 400, 616, 432, 920, 800, 880, 820, 840, 860, 900, 940, 960, 980, 640, 660, 680, 700, 720, 740, 760]
- ## Define 3 histogram for three different samples
- aQGC_pars = { #"FS0": [(491, 490, 489, 488), ("SM", -20, -40, -60)],
- #"FS1": [(570, 569, 568, 567), ("SM", -10, -20, -30)],
- "FT0": [(995, 993), ("SM", -0.4)],
- #"FT1": [(1055, 1054, 1053, 1052), ("SM", -0.5, -1.0, -1.5)],
- #"FT2": [(1122, 1121, 1120, 1119), ("SM", -0.5, -1.0, -1.5)],
- #"FM0": [(646, 645, 644, 643), ("SM", -1, -2, -3)],
- #"FM1": [(722, 721, 720, 719), ("SM", -5, -10, -15)],
- #"FM6": [(798, 797, 796, 795), ("SM", -2, -4, -6)],
- #"FM7": [(900, 899, 898, 897), ("SM", -5, -10, -15)]
- }
- for i,par1 in enumerate(aQGC_pars):
- #leg = r.TLegend(0.6,0.70,0.9,0.95)
- leg = r.TLegend(0.10,0.00,0.50,0.35)
- hist1 = []
- ratio = []
- colorPick = 0
- print i, par1, aQGC_pars[par1][0]
- for j,par2 in enumerate(aQGC_pars[par1][0]):
- hist1.append(getHistFromFile(ttree, variables, par2, nbin, minx, maxx, xlabel, colorArray[colorPick], cut_string))
- #hist1[colorPick].Sumw2()
- #print "Entries (Before Scale) : ",hist1[colorPick].Integral()
- #hist1[colorPick].Scale(1/hist1[colorPick].Integral())
- #hist1[colorPick].Scale("wSampleWeight*35867.1")
- #print "Entries (After Scale) : ",hist1[colorPick].Integral()
- if j == 0:
- leg.AddEntry(hist1[colorPick], "SM","lpe")
- else:
- leg.AddEntry(hist1[colorPick], par1+"= "+str(aQGC_pars[par1][1][j])+"x10^{-12} TeV^{-4}","lpe")
- ratio.append(createRatio(hist1[0],hist1[colorPick], xlabel, colorArray[colorPick]))
- colorPick+=1
-
- canvas, pad1, pad2 = createCanvasPads()
-
- # Draw all hitogram using sames.
- pad1.cd()
- for a,list1 in enumerate(hist1):
- if a == 0:
- list1.Draw()
- else:
- list1.Draw("same")
- leg.Draw()
-
- pad2.cd()
-
- for a,list1 in enumerate(ratio):
- if a != 0:
- if a == 1:
- list1.Draw("ep")
- else:
- list1.Draw("ep same")
-
- l = r.TLine( minx, 1, maxx, 1 )
- l.SetLineStyle(3)
- l.Draw("same")
-
- #canvas.Draw()
- canvas.SaveAs(outputFileName+"_"+par1+".png")
- canvas.SaveAs(outputFileName+"_"+par1+".pdf")
-
-
-
-# Read three fils and their tree
-tfile = r.TFile("root:://cmseos.fnal.gov//eos/uscms/store/user/rasharma/SecondStep/WWTree_2018_01_03_14h54/HaddedFiles/WplusTo2JWminusToLNuJJ_EWK_LO_aQGC.root")
-#tfile = r.TFile("root:://cmseos.fnal.gov//eos/uscms/store/user/rasharma/SecondStep/WWTree_2018_01_03_14h54/HaddedFiles/WplusTo2JWminusToLNuJJ_EWK_LO_SM.root")
-
-ttree = tfile.Get("otree")
-
-# See which weights we are going to apply
-for n, event in enumerate(ttree):
- if n>0:
- break
- print "Weight Details for OnlyFT1_initialize: \tWeight = ",event.LHEWeight[491]
-
-
-Cut_String1 = "genWeight*trig_eff_Weight*id_eff_Weight*pu_Weight*(((type==1) || (type==0)) && (l_pt2<0) && ((l_pt1>30.) && (abs(l_eta1)<2.5)) && ((ungroomed_PuppiAK8_jet_pt>200)&&(abs(ungroomed_PuppiAK8_jet_eta)<2.4)) && ((vbf_maxpt_j1_pt>30) && (vbf_maxpt_j2_pt>30)) && (vbf_maxpt_jj_m>500) && (nBTagJet_loose==0) && (pfMET_Corr>50) && ((PuppiAK8_jet_tau2tau1<0.55)) && ((PuppiAK8_jet_mass_so>65) && (PuppiAK8_jet_mass_so<105)) && (abs(vbf_maxpt_j2_eta-vbf_maxpt_j1_eta)>4.0) && (vbf_maxpt_jj_m>800) && (BosonCentrality_type0>1.0) && (abs(ZeppenfeldWL_type0/vbf_maxpt_jj_Deta)<0.3) && (abs(ZeppenfeldWH/vbf_maxpt_jj_Deta)<0.3))"
-
-Cut_String2 = "genWeight*trig_eff_Weight*id_eff_Weight*pu_Weight*(((type==1) || (type==0)) && (l_pt2<0) && ((l_pt1>30.) && (abs(l_eta1)<2.5)) && ((ungroomed_PuppiAK8_jet_pt_jes_up>200)&&(abs(ungroomed_PuppiAK8_jet_eta_jes_up)<2.4)) && ((vbf_maxpt_j1_pt_jes_up>30) && (vbf_maxpt_j2_pt_jes_up>30)) && (vbf_maxpt_jj_m_jes_up>500) && (nBTagJet_loose==0) && (pfMET_jes_up>50) && ((PuppiAK8_jet_tau2tau1<0.55)) && ((ungroomed_PuppiAK8_jet_mass_jes_up>65) && (ungroomed_PuppiAK8_jet_mass_jes_up<105)) && (abs(vbf_maxpt_j2_eta_jes_up-vbf_maxpt_j1_eta_jes_up)>4.0) && (vbf_maxpt_jj_m_jes_up>800) && (BosonCentrality_type0_jes_up>1.0) && (abs(ZeppenfeldWL_type0_jes_up/vbf_maxpt_jj_Deta_jes_up)<0.3) && (abs(ZeppenfeldWH_jes_up/vbf_maxpt_jj_Deta_jes_up)<0.3))"
-
-#CreatePlots(ttree, variables, outputFileName, xlabel="x-axis", nbin=20, minx=0, maxx=2400, nEvents=5000):
-print "\n\n====================================\n=\n=\t\t For Nominal \n=\n====================================\n"
-#CreatePlots(ttree, "mass_lvj_type0", "m_WW", "m (WW): Nominal", 8, 0, 2400, -1, Cut_String1)
-print "\n\n====================================\n=\n=\t\t For JES Up \n=\n====================================\n"
-CreatePlots(ttree, "mass_lvj_type0_met_jes_up", "m_WW_jes_up", "m (WW): JES Up", 8, 0, 2400, -1, Cut_String2)
-#print "\n\n====================================\n=\n=\t\t For JES Down \n=\n====================================\n"
-#CreatePlots(ttree, "mass_lvj_type0_met_jes_dn", "m_WW_jes_dn", "m (WW): JES Down", 20, 0, 2400, -1)
-
-# Total 9 parameters:
-# For each parameters 4 histograms
-
-clock.Stop()
-
-print 'Tree loop profiling stats:'
-print 'Real Time used:', clock.RealTime(),"seconds"
-print 'CPU Time used:', clock.CpuTime()
diff --git a/ControlPlots/QCDEstimation.C b/ControlPlots/QCDEstimation.C
deleted file mode 100644
index 6da44aa..0000000
--- a/ControlPlots/QCDEstimation.C
+++ /dev/null
@@ -1,971 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "TROOT.h"
-#include "TLatex.h"
-#include "TTree.h"
-#include "TFile.h"
-#include "TH1D.h"
-#include "TH1F.h"
-#include "THStack.h"
-#include "TString.h"
-#include "TLegend.h"
-#include "TLine.h"
-#include "TPad.h"
-#include "TCanvas.h"
-#include "TCut.h"
-#include "TSystem.h"
-#include "TF1.h"
-#include "TFitResult.h"
-#include "TFitResultPtr.h"
-
-#include "tdrstyle.C"
-#include "utils.C" // Tokenize
-#include "CMS_lumi.C"
-
-#include
-
-
-typedef struct {
- int index;
- TString samplename;
- TString treefilename;
- double xsecpblumi;
- double otherscale;
- int nMCevents;
- int MCnegEvent;
- int colorcode;
- int stackit;
-}
-SampleInfo_t;
-
-//#include "controlplotvars_boosted.h"
-//#include "controlplotvars_common.h"
-#include "controlplotvars_CHS.h"
-#include "controlplotvars_CHS_2lep.h"
-//#include "controlplotvars_Puppi.h"
-//#include "controlplotvars_vbf.h"
-//#include "controlplotvars_mva.h"
-//#include "controlplotvars_Nminus1plot.h"
-//#include "controlplotvars_CHS_signal.h"
-//#include "controlplotvars_CHS_signal_2lep.h"
-//#include "controlplotvars_UpDn.h"
-
-
-
-using namespace std;
-
-double intLUMIinvpb;
-
-//=====================================================================================
-// SYNOPSIS:
-// 1. Prepare "InData" and "OutDir" directories; e.g., "ln -s . OutDir" to go to current dir
-// 2. Prepare "cuttable.txt" of cut names and cut strings
-// 3. root [0] .L QCDEstimation.C+
-// root [1] QCDEstimation("cuttable.txt","sampleFileName.txt")
-//
-// ====================================================================================
-// Self Function
-// ====================================================================================
-/*
-
-*/
-void cmspre(double intlumifbinv)
-{
- TLatex latex;
- latex.SetNDC();
- latex.SetTextSize(0.04);
-
- latex.SetTextAlign(31); // align right
- latex.DrawLatex(0.95,0.92,"#sqrt{s} = 13 TeV");
- latex.SetTextAlign(31); // align right
- latex.DrawLatex(0.73,0.93,Form("#int #font[12]{L} dt = %.1f fb^{-1}", (float)intlumifbinv));
-// latex.DrawLatex(0.65,0.93,Form("2012B", (float)intlumifbinv));
-
- latex.SetTextAlign(11); // align left
-// latex.DrawLatex(0.15,0.93,"CMS, #sqrt{s} = 7 TeV");//preliminary 2011");
- latex.SetTextSize(0.06);
- latex.DrawLatex(0.145,0.92,"CMS #bf{#it{preliminary}}");
-
-}
-
-//======================================================================
-
-void loadCutString(const char *filename, TString& cutstring)
-{
- FILE *fp = fopen(filename,"r");
- if (!fp) {
- cout << "Error, file " << TString(filename) << " not found." << endl;
- exit(-1);
- }
-
- char line[512];
-
- for (int i=0; !feof(fp) && fgets(line,512,fp); i++) {
- if (!strlen(line) || line[0]=='#') continue; // comments are welcome
-
- if (cutstring.Length()) cutstring += " && ";
-
- string strline(line);
- strline.pop_back(); // shed the \n
- vector fields;
-
- // expect columns with fields cutname, cutvalue, possible embedded spaces both
- // within and between, so " " or "\t" cannot be used as delimiters. Require quotes
- // instead.
- //
- Tokenize(strline,fields, "\"");
-
- //for (size_t j=0; jGet("otree"); if (!tree_) { cerr << "Couldn't find tree otree in file " << sinfo.treefilename << endl; return; }
- }
- ~Sample() { if (tree_) delete tree_; }
- TTree *Tree() const { return tree_; }
- TString name() const { return info_.samplename; }
- TString filename() const { return info_.treefilename; }
- bool stackit() const { return (info_.stackit != 0); }
- int colorcode() const { return info_.colorcode; }
- double otherscale() const { return info_.otherscale; }
- TH1D *Draw(const plotVar_t& pv, const TCut& cut, const TCut& cutSQ ) {
- if (!tree_) {
- cerr << "No tree to draw from." << endl;
- return 0;
- }
- double tmp = 0.;
- cout << "\tDrawing " << pv.plotvar << " for sample = " << info_.samplename << " ... ";
- TString hname = TString("th1")+ pv.outfile + Form("%d",info_.index);
- TH1D *histo = new TH1D(hname, hname, pv.NBINS, pv.MINRange, pv.MAXRange);
- assert(histo);
- histo->Sumw2();
- cout << tree_->Draw(pv.plotvar+TString(">>")+hname, cut, "goff") << " entries, ";
- histo->SetBinContent(pv.NBINS,histo->GetBinContent(pv.NBINS)+histo->GetBinContent(pv.NBINS+1));
- //cout << histo->Integral() << " " << tmp << " " << "weighted entries, (";
- cout << histo->IntegralAndError(0,histo->GetNbinsX()+1,tmp) << " " << tmp << " " << "weighted entries";
-
-#if 0
- if (strlen((const char *)cutSQ)) {
- hname = TString("th1") + pv.outfile + Form("%d",info_.index) + TString("SQ");
- TH1D *histoSQ = new TH1D(hname, hname, pv.NBINS, pv.MINRange, pv.MAXRange);
- tree_->Draw(pv.plotvar+TString(">>")+hname, cutSQ, "goff");
- for(int hi=1;hi<=pv.NBINS;hi++) {
- histo->SetBinError(hi,sqrt(histoSQ->GetBinContent(hi)));
- }
- delete histoSQ;
- }
-#endif
- if (info_.nMCevents) {
- //cout<<"\n===> Evetns = "<Scale((info_.xsecpblumi*info_.otherscale)/(info_.nMCevents - 2*info_.MCnegEvent));
- cout << ", " <IntegralAndError(1,histo->GetNbinsX(),tmp) << " " <Integral(1,histo->GetNbinsX()+1)*info_.xsecpblumi*info_.otherscale)/(info_.nMCevents - 2*info_.MCnegEvent) << " " << " scaled events in window";
- }
- cout << endl;
-
- return histo;
- }
-private:
- SampleInfo_t info_;
- TTree *tree_;
-};
-
-//======================================================================
-
-void loadSamples(const char *filename,vector& samples)
-{
- FILE *fp = fopen(filename,"r");
- if (!fp) {
- cout << "Error, file " << TString(filename) << " not found." << endl;
- exit(-1);
- }
-
- char line[512];
-
- intLUMIinvpb=-1; // obvious error condition
-
- for (int i=0; !feof(fp) && fgets(line,512,fp); i++) {
- if (!strlen(line) || line[0]=='#') continue; // comments are welcome
-
- string strline(line);
- strline.pop_back(); // shed the \n
- vector fields;
-
- // expect columns with fields cutname, cutvalue, possible embedded spaces both
- // within and between, so " " or "\t" cannot be used as delimiters. Require quotes
- // instead.
- //
- Tokenize(strline,fields, " \t");
-
- //for (size_t j=0; j " << s.treefilename << endl;
-
- if (!samples.size()) {
- if (s.samplename.EqualTo("data")) {
- intLUMIinvpb = s.xsecpblumi;
- s.xsecpblumi = 1;
- cout << "intLUMI = " << intLUMIinvpb << " pb^-1" << endl;
- } else {
- cerr << "First sample in the table must be 'data'" << endl;
- exit(-1);
- }
- } else {
- s.otherscale *= intLUMIinvpb;
- }
-
- samples.push_back(new Sample(s) );
- }
-} // loadSamples
-
-//======================================================================
-
-void QCDEstimation(const char *cuttablefilename,
- const char *samplefilename,
- const plotVar_t plotvars[] = commonplotvars_chs,
- const string OutRootFile = "testrk.root",
- const int ScaleSignal = 0,
- const string RecreateAppend = "RECREATE",
- const int isData = 1
- )
-// const plotVar_t plotvars[] = boostedplotvars )
-{
- //gROOT->ProcessLine(".L tdrstyle.C");
- if (int(ScaleSignal) != 1 && int(ScaleSignal) != 0)
- {
- std::cout << "=========================================\n\n" << endl;
- std::cerr << "Error: Scale Signal values should be 1 or 0.\n" << endl;
- exit(-1);
- }
-
- ofstream Logfile;
-
- TH1D::SetDefaultSumw2(1);
-
- //TFile *outDC = new TFile("htt_mt_inputs.root","RECREATE");
-
- TString unwtcutstring;
-
- loadCutString(cuttablefilename, unwtcutstring);
-
- TString blinddatacutstring = unwtcutstring + "&&(1)";
- // For blinding data uncomment this
- //TString blinddatacutstring = unwtcutstring + "&& (PuppiAK8_jet_mass_so<65 || PuppiAK8_jet_mass_so>105)&&(1)";
-
- // const char* the_cut = "1";
- // double BINWIDTH = ((MAXRange-MINRange)/NBINS);
-
- // Get the input trees:
-
- vector samples;
-
- loadSamples(samplefilename,samples);
-
- // Data
-
- Sample *sdata = samples[0];
-
- if (sdata->Tree())
- cout << "ndata =" << sdata->Tree()->GetEntries() <BaseName(cuttablefilename)).ReplaceAll(".txt","")+TString("_")+pv.outfile;
- Logfile.open (outfile+".log");
- TString temp = TString("Yield of Variable : ")+pv.outfile;
- const std::string spaces(temp.Length(), ' ');
- const std::string second = "* " + spaces + " *";
- const std::string first(second.size(), '*');
- Logfile << first << std::endl;
- Logfile << second << std::endl;
- Logfile << "* " << temp << " *" << std::endl;
- Logfile << second << std::endl;
- Logfile << first << std::endl;
-
- if ( !pv.plotvar.Length() ) break;
-
- cout << pv.plotvar << "\t"<Tree() &&
- sdata->Tree()->Draw(pv.plotvar,"","goff",1) == -1 ) { // check if the variable exists in the tree
- cout << "\t...can't be plotted!" << endl;
- continue;
- }
-
- //TCut the_cut(TString("btag0Wgt*genWeight*trig_eff_Weight2*id_eff_Weight2*pu_Weight*(")+unwtcutstring+TString(")"));
- TCut the_cut(TString("genWeight*trig_eff_Weight*id_eff_Weight*pu_Weight*(")+unwtcutstring+TString(")"));
-
- TCut nullcut("");
-
- cout << "the_cut = "<< the_cut << endl;
-
- const double BINWIDTH = ((pv.MAXRange-pv.MINRange)/pv.NBINS);
-
- map m_histos;
- map m_stacked;
-
- double totevents = 0.;
-
- //============================================================
- // DRAW THE VARIABLE FOR ALL SAMPLES, CREATE HISTOS
- //============================================================
-
- for (size_t isamp=0; isampname()] = false;
-
- TH1D *h;
-
- if (s->name().EqualTo("data")) {
- plotVar_t pvnosmear = pv;
- //pvnosmear.plotvar.ReplaceAll("_smeared",""); // no smearing for data!
- h = s->Draw(pvnosmear, TCut(blinddatacutstring), nullcut); // effwt*puwt==1 for data! -- NO IT DOESN'T NECESSARILY!
- }
- //else if (s->name().EqualTo("aQGCX100")){
- else if (s->name().EqualTo("aQGC")){
- if (int(ScaleSignal) == 1)
- { h = s->Draw(pv, the_cut*"100.0"*"(LHEWeight[994]/LHEWeight[0])", the_cut*"100.0"*"(LHEWeight[994]/LHEWeight[0])");
- cout<<"====> Scale Signal = " << ScaleSignal << endl;
- }
- else
- h = s->Draw(pv, the_cut*"(LHEWeight[994]/LHEWeight[0])", the_cut*"(LHEWeight[994]/LHEWeight[0])");
- if (s->stackit()) {
- totevents += h->Integral(1,h->GetNbinsX()+1);
- }
- }
- //else if (s->name().EqualTo("WV_EWKX100")){
- else if (s->name().EqualTo("WV_EWK")){
- if (int(ScaleSignal) == 1)
- h = s->Draw(pv, the_cut*"100.0", the_cut*"100.0");
- else
- h = s->Draw(pv, the_cut, the_cut);
- if (s->stackit()) {
- totevents += h->Integral(1,h->GetNbinsX()+1);
- }
- }
- else {
- h = s->Draw(pv, the_cut, the_cut);
- if (s->stackit()) {
- totevents += h->Integral(1,h->GetNbinsX()+1);
- }
- }
-
- if (!h) continue;
-
- map::iterator mit = m_histos.find(s->name());
- if (mit == m_histos.end()) {
- h->SetName(s->name());
- h->SetTitle(s->name());
- if (s->stackit()) {
- if (s->name().EqualTo("W+jets"))
- {
- h->SetLineColor(TColor::GetColor(222,90,106));
- h->SetFillColor(TColor::GetColor(222,90,106));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("top"))
- {
- h->SetLineColor(TColor::GetColor(155,152,204));
- h->SetFillColor(TColor::GetColor(155,152,204));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("TTbar"))
- {
- h->SetLineColor(TColor::GetColor(155,152,204));
- h->SetFillColor(TColor::GetColor(155,152,204));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("SingleTop"))
- {
- h->SetLineColor(TColor::GetColor(0,84,159));
- h->SetFillColor(TColor::GetColor(0,84,159));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("Z+jets"))
- {
- h->SetLineColor(TColor::GetColor(248,206,104));
- h->SetFillColor(TColor::GetColor(248,206,104));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("Diboson"))
- {
- h->SetLineColor(TColor::GetColor(250,202,255));
- h->SetFillColor(TColor::GetColor(250,202,255));
- h->SetLineWidth(0);
- }
- else
- {
- h->SetLineColor(s->colorcode());
- h->SetFillColor(s->colorcode());
- h->SetLineWidth(0);
- }
- }
- m_histos[s->name()] = h;
- } else {
- mit->second->Add(h);
- }
- }
-
- //============================================================
- // COUNT EVENTS, RENORM TO DATA, CONSTRUCT THE TSTACK & LEGEND
- //============================================================
-
- TH1D *th1data = m_histos["data"];
- //TH1D *aqgc = m_histos["aQGC"];
- double maxval = -9e99;
-
- double ndata=1., renorm=1.;
- if (th1data) {
- ndata = th1data->Integral(1,th1data->GetNbinsX()+1);
- renorm = ndata/totevents;
- int maxbin = th1data->GetMaximumBin();
- maxval = std::max(maxval,th1data->GetBinContent(maxbin));
-
- cout << "Total MC = " << totevents << endl;
- cout << "data = " << ndata <SetFillColor(0);
- Leg->SetFillStyle(0);
- Leg->SetBorderSize(0);
- //Leg->SetTextSize(0.04);
- //Leg->SetNColumns(3);
-
- if (th1data){
- if (TString(cuttablefilename).Contains("Mu"))
- Leg->AddEntry(th1data, "Observed", "LP");
- else
- Leg->AddEntry(th1data, "Observed", "LP");
- }
-
- vector binErrSQ(pv.NBINS,0.);
-
- vector > v_legentries;
-
- TString oldsamplename;
-
- for (size_t isamp=1; isampname()==oldsamplename) continue;
-
- map::iterator mit = m_histos.find(s->name());
- TH1D *h = mit->second;
- //h->SetLineColor(kBlack);
- h->SetLineWidth( 3.);
- //h->SetFillColor(color );
- //h->SetFillStyle(style );
- h->SetTitleSize (0.055,"Y");
- h->SetTitleOffset(1.600,"Y");
- h->SetLabelOffset(0.014,"Y");
- h->SetLabelSize (0.050,"Y");
- h->SetLabelFont (42 ,"Y");
- h->SetTitleSize (0.055,"X");
- h->SetTitleOffset(1.300,"X");
- h->SetLabelOffset(0.014,"X");
- h->SetLabelSize (0.050,"X");
- h->SetLabelFont (42 ,"X");
- //h->SetMarkerStyle(20);
- //h->SetMarkerColor(color);
- h->SetMarkerSize (0.6);
- h->GetYaxis()->SetTitleFont(42);
- h->GetXaxis()->SetTitleFont(42);
- //h->SetTitle("");
-
- //if (s->stackit())
- // h->Scale(renorm);
- //else
- // h->Scale(ndata/h->Integral());
-
-// cout << s->name() << " = " << Form("%4g,%7g,%4g",
-// h->Integral(0,0),
-// h->Integral(1,h->GetNbinsX()+1),
-// h->Integral(h->GetNbinsX()+1,h->GetNbinsX()+1))
-// << endl;
- cout << s->name() << " = " << Form("%7g", h->Integral(1,h->GetNbinsX()+1)) << endl;
- Logfile << s->name() << " = " << Form("%7g", h->Integral(1,h->GetNbinsX()+1)) << endl;
-
- if(s->stackit()) {
- // Compose the stack
- hs->Add(h);
- th1tot->Add(h);
- m_stacked[s->name()] = true;
- for (int ibin=1; ibin <= pv.NBINS; ibin++)
- binErrSQ[ibin-1] += h->GetBinError(ibin)*h->GetBinError(ibin);
- }
- v_legentries.push_back(*mit);
-
- int maxbin = h->GetMaximumBin();
- maxval = std::max(maxval,h->GetBinContent(maxbin));
-
- oldsamplename=s->name();
- h->Write();
- }
-
- cout << "maxval " < >::reverse_iterator
- rit = v_legentries.rbegin();
- rit != v_legentries.rend();
- rit++)
- {
- if(rit->first=="aQGC" || rit->first=="WV_EWK")
- {
- if (int(ScaleSignal) == 1)
- Leg->AddEntry(rit->second, rit->first+TString("X100"), "L" ); // "F");
- else
- Leg->AddEntry(rit->second, rit->first, "L" ); // "F");
- //if(rit->first=="aQGCX100" || rit->first=="WV_EWKX100")
- }
- else
- Leg->AddEntry(rit->second, rit->first, "F" ); // "F");
- }
- TH1D* th1totClone = ( TH1D*) th1tot->Clone("th1totClone");
- th1totClone->SetMarkerStyle(0);
- th1totClone->SetFillStyle(3003);
- th1totClone->SetFillColor(11);
- th1totClone->SetLineColor(0);
-
- for(int ibin=1; ibin<=th1totClone->GetNbinsX(); ++ibin) {
- th1totClone->SetBinError(ibin, sqrt(binErrSQ[ibin-1]));
- }
-
- //============================================================
- // SETUP THE CANVAS
- //============================================================
-
-// gROOT->ProcessLine(".L tdrstyle.C");
- setTDRStyle();
- //tdrStyle->SetErrorX(0.5);
- //tdrStyle->SetPadRightMargin(0.05);
-
- //tdrStyle->SetLegendBorderSize(0);
-
- TCanvas* c1 = new TCanvas(pv.plotvar,pv.plotvar,10,10, 800, 600);
- TPad *d1, *d2;
-
- c1->SetFillColor (0);
- c1->SetBorderMode (0);
- c1->SetBorderSize (10);
- // Set margins to reasonable defaults
- c1->SetLeftMargin (0.18);
- c1->SetRightMargin (0.05);
- c1->SetTopMargin (0.08);
- c1->SetBottomMargin (0.15);
- // Setup a frame which makes sense
- c1->SetFrameFillStyle (0);
- c1->SetFrameLineStyle (0);
- c1->SetFrameBorderMode(0);
- c1->SetFrameBorderSize(10);
- c1->SetFrameFillStyle (0);
- c1->SetFrameLineStyle (0);
- c1->SetFrameBorderMode(0);
- c1->SetFrameBorderSize(10);
-
- if (th1data) {
- c1->Divide(1,2);
- d1 = (TPad*)c1->GetPad(1);
- d1->SetPad(0.01,0.30,0.95,0.99);
- //c1->cd();
- d2 = (TPad*)c1->GetPad(2);
- d2->SetPad(0.01,0.02,0.95,0.30);
- d1->cd();
- gPad->SetBottomMargin(0.0);
- }
-
- gPad->SetTopMargin(0.1);
- gPad->SetRightMargin(0.05);
- gPad->SetLeftMargin(0.14);
-
- gPad->SetLogy(0);
-
- if (th1tot->GetEntries())
- Leg->AddEntry(th1tot, "Stat. Uncertainty", "f");
-
- Leg->SetFillColor(0);
-
- TH1D* th1totempty = new TH1D("th1totempty", "th1totempty", pv.ANBINS, pv.AMINRange, pv.AMAXRange);
- if (th1data) {
- th1data->SetMarkerStyle(20);
- th1data->SetLineColor(kBlack);
- th1data->SetMarkerSize(1.3);
- th1data->SetLineWidth(3);
- }
-
- th1tot->SetFillStyle(3013);
- th1tot->SetFillColor(13);
- th1tot->SetLineColor(kBlack);
- th1tot->SetLineWidth(1);
- th1tot->SetMarkerStyle(0);
-
- char tmpc[100]; sprintf(tmpc,"Events");
- if (pv.slog==1) sprintf(tmpc,"Events/ %.1f",BINWIDTH);
- if (pv.slog==2) sprintf(tmpc,"Events/ %.2f",BINWIDTH);
- if (pv.slog==3) sprintf(tmpc,"Events/ ( %.0f GeV)",BINWIDTH);
- if (pv.slog==6) sprintf(tmpc,"Events/ ( %.1f rad)",BINWIDTH);
- th1totempty->SetYTitle(tmpc);
- // th1totempty->GetYaxis()->SetTitleSize(0.1);
- th1totempty->GetYaxis()->SetTitleOffset(1.2);
- th1totempty->GetYaxis()->SetLabelOffset(0.01);
- // th1totempty->GetYaxis()->CenterTitle(true);
- th1totempty->GetYaxis()->SetLabelSize(0.04);
- // th1totClone->Draw("e3");
-
- if (th1tot->GetEntries()) {
- th1tot->SetMinimum(0.1);
- th1totempty->SetMinimum(0.1);
- }
-
-// th1totempty->SetMaximum(2.5*maxval);
-// th1totempty->SetMaximum(1.5*maxval);
-// if(pv.slog==9) th1totempty->SetMaximum(1.5*maxval);
- //th1totempty->SetMaximum(350.);
-
- // Draw it all
-
- th1totempty->Draw();
-
- if (th1data) {
- th1data->SetMinimum(0.1);
- th1data->SetBinErrorOption(TH1D::kPoisson);
- th1data->Draw("e0same");
- }
-
- //th1tot->Draw("e2same");
-
- hs->SetMaximum(400.0);
- //hs->Draw("samehist");
- if (pv.drawleg ==1) Leg->Draw();
-
- TH1D* hdiff = new TH1D("hdiff","", pv.NBINS, pv.MINRange, pv.MAXRange);
- hdiff = (TH1D*) th1data->Clone();
- hdiff->Add(th1tot,-1);
- hdiff->Draw();
- //th1tot->Draw("e2same");
-
-
- //if (th1data)
- // th1data->Draw("e1same");
- //if(aqgc)
- // aqgc->Draw("same");
-
- // draw unstacked histos separately.
- oldsamplename.Clear();
- TH1D *h1 = new TH1D("h1","",100,0,100);
- TH1D *h2 = new TH1D("h2","",100,0,100);
- for (size_t isamp=0; isampname()==oldsamplename) continue;
- if (!s->stackit()) {
- map::iterator mit = m_histos.find(s->name());
- if (mit != m_histos.end()) {
- TH1D *h = mit->second;
- if (h && s->name()=="WV_EWK")
- //if (h && s->name()=="WV_EWKX100")
- {
- h->SetFillStyle(0.);
- //aqgc->SetLineStyle(11);
- h->SetLineWidth(3.);
- h->SetLineColor(kBlue+3);
- if (int(ScaleSignal) == 1){
- cout << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1)/100.0)/sqrt((h->Integral(1,h->GetNbinsX()+1)/100.0)+totevents) << endl;
- Logfile << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1)/100.0)/sqrt((h->Integral(1,h->GetNbinsX()+1)/100.0)+totevents) << endl;
- }
- else{
- cout << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- Logfile << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- }
- h->Draw("histsame");
- h1 = (TH1D*) h->Clone();
-
- }
- if (h && s->name()=="aQGC")
- //if (h && s->name()=="aQGCX100")
- {
- h->SetFillStyle(0.);
- //aqgc->SetLineStyle(11);
- h->SetLineWidth(3.);
- h->SetLineColor(kRed+3);
- cout << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- //cout << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1)/100.0)/sqrt((h->Integral(1,h->GetNbinsX()+1)/100.0)+totevents) << endl;
- Logfile << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- //Logfile << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1)/100.0)/sqrt((h->Integral(1,h->GetNbinsX()+1)/100.0)+totevents) << endl;
- h->Draw("histsame");
- h2 = (TH1D*) h->Clone();
- //h->Draw("e1same");
- }
- if (isData) h->Write();
- }
- }
- oldsamplename=s->name();
-
- }
-
- //cmspre(intLUMIinvpb/1000.0);
- CMS_lumi( d1, 4, 10 );
- // th1data->Draw("Axissame");
- gPad->RedrawAxis();
- TH1D * hhratio;
- TH1D *th1emptyclone;
- TBox *errbox;
-
- /*
- if (th1data) {
- d2->cd();
- //TH1D * hhratio = (TH1D*) th1data->Clone("hhratio") ;
- hhratio = (TH1D*) th1data->Clone("hhratio") ;
- hhratio->Sumw2();
- hhratio->SetStats(0);
-
- gPad->SetLeftMargin(0.14);
- gPad->SetTopMargin(0);
- gPad->SetRightMargin(0.05);
- gPad->SetFrameBorderSize(0);
- gPad->SetBottomMargin(0.3);
- gPad->SetTickx();
-
- hhratio->SetMarkerSize(1.25);
- // hhratio->GetYaxis()->SetRangeUser(0.48,1.52);
- hhratio->GetYaxis()->SetRangeUser(0.5,1.5);
- hhratio->GetXaxis()->SetTitle(pv.xlabel);
- hhratio->GetXaxis()->SetTitleOffset(0.9);
- hhratio->GetXaxis()->SetTitleSize(0.15);
- hhratio->GetXaxis()->SetLabelSize(0.15);
- hhratio->GetYaxis()->SetTitleSize(0.1);
- hhratio->GetYaxis()->SetTitleOffset(0.5);
- hhratio->GetYaxis()->CenterTitle(true);
- hhratio->GetYaxis()->SetLabelSize(0.1);
- cout << hhratio->GetNbinsX() << endl;
- cout << th1tot->GetNbinsX() << endl;
- hhratio->Divide(th1tot);
- double binError(0.0), mcbinentry(0.0), mcerror(0.0);
- for(int i=0; iGetNbinsX(); ++i) {
- binError = hhratio->GetBinError(i);
- mcerror = th1tot->GetBinError(i);
- mcbinentry = th1tot->GetBinContent(i);
- if(mcbinentry>0.) mcerror /= mcbinentry;
- else mcerror = 0.0;
- binError = sqrt(binError*binError + mcerror*mcerror);
- hhratio->SetBinError(i, binError);
- }
- th1emptyclone = new TH1D("th1emptyclone", "th1emptyclone", pv.ANBINS, pv.AMINRange, pv.AMAXRange);
- th1emptyclone->GetYaxis()->SetRangeUser(0.6,1.3999);
- th1emptyclone->GetXaxis()->SetTitle(pv.xlabel);
- th1emptyclone->GetXaxis()->SetTitleOffset(0.9);
- th1emptyclone->GetXaxis()->SetTitleSize(0.15);
- th1emptyclone->GetXaxis()->SetLabelSize(0.15);
- th1emptyclone->SetYTitle("Data/MC");
- th1emptyclone->GetYaxis()->SetTitleSize(0.13);
- th1emptyclone->GetXaxis()->SetNdivisions(505);
- th1emptyclone->GetYaxis()->SetNdivisions(505);
- th1emptyclone->GetYaxis()->SetTitleOffset(0.5);
- th1emptyclone->GetYaxis()->CenterTitle(true);
- th1emptyclone->GetYaxis()->SetLabelSize(0.1);
- th1emptyclone->Draw();
-
- //TBox *errbox = new TBox(pv.AMINRange,0.974,pv.AMAXRange,1.026); // lumi systematic uncertainty
- errbox = new TBox(pv.AMINRange,0.974,pv.AMAXRange,1.026); // lumi systematic uncertainty
- errbox->SetFillColor(kGray);
- errbox->Draw();
-
-#if 0
- TF1 *f1 = new TF1("f1", "pol1", pv.AMINRange, pv.AMAXRange);
- f1->SetParameters(1.0,0.0);
- f1->SetParameters(1,0.0);
- //f1->FixParameter(0,1);
- //f1->FixParameter(1,0);
- //cout<<" par1 "f1->GetParameter(0)<GetParameter(1)<SetLineWidth(2);
-
- TFitResultPtr r = hhratio->Fit("f1", "RBS");
- //TFitResultPtr r = hhratio->Fit(myFunc,"S");
- r->Print("V"); // print full information of fit including covariance matrix
-#endif
-
- hhratio->Draw("esame");
- TLine *line; line = new TLine(pv.AMINRange,1.0,pv.AMAXRange,1.0);
- line->SetLineStyle(1);
- line->SetLineWidth(1);
- line->SetLineColor(1);
- line->Draw();
- }
- */
-
-
- c1->Print(outfile+".pdf");
- c1->Print(outfile+".png");
- c1->Print(outfile+".C");
- //c1->Print(outfile+".tex");
- //-----------------------------------------------------------------
- // Save log plot
- //-----------------------------------------------------------------
- TCanvas *c2 = new TCanvas("c2","c2",800,600);
- TPad *d3, *d4;
-
- c2->SetFillColor (0);
- c2->SetBorderMode (0);
- c2->SetBorderSize (10);
- // Set margins to reasonable defaults
- c2->SetLeftMargin (0.18);
- c2->SetRightMargin (0.05);
- c2->SetTopMargin (0.08);
- c2->SetBottomMargin (0.15);
- // Setup a frame which makes sense
- c2->SetFrameFillStyle (0);
- c2->SetFrameLineStyle (0);
- c2->SetFrameBorderMode(0);
- c2->SetFrameBorderSize(10);
- c2->SetFrameFillStyle (0);
- c2->SetFrameLineStyle (0);
- c2->SetFrameBorderMode(0);
- c2->SetFrameBorderSize(10);
-
- c2->Divide(1,2);
- d3 = (TPad*)c2->GetPad(1);
- d3->SetPad(0.01,0.30,0.95,0.99);
- //c1->cd();
- d4 = (TPad*)c2->GetPad(2);
- d4->SetPad(0.01,0.02,0.95,0.30);
- d3->cd();
- gPad->SetBottomMargin(0.0);
-
- gPad->SetTopMargin(0.1);
- gPad->SetRightMargin(0.05);
- gPad->SetLeftMargin(0.14);
-
- gPad->SetLogy(1);
-
- th1totempty->SetMaximum(100*maxval);
- th1totempty->Draw();
-
- if (th1data) {
- th1data->SetMinimum(0.1);
- th1data->SetBinErrorOption(TH1D::kPoisson);
- th1data->Draw("e0same");
- }
-
- th1tot->Draw("e2same");
-
- hs->SetMinimum(0.1);
- hs->Draw("samehist");
- if (pv.drawleg ==1) Leg->Draw();
-
- th1tot->Draw("e2same");
- if (h1->GetEntries()>0) h1->Draw("histsame");
- if (h2->GetEntries()>0) h2->Draw("histsame");
- if (th1data)
- th1data->Draw("e1same");
-
- CMS_lumi( d3, 4, 10 );
- gPad->RedrawAxis();
- d4->cd();
- gPad->SetLeftMargin(0.14);
- gPad->SetTopMargin(0);
- gPad->SetRightMargin(0.05);
- gPad->SetFrameBorderSize(0);
- gPad->SetBottomMargin(0.3);
- gPad->SetTickx();
- th1emptyclone->Draw();
- errbox->Draw();
-
- hhratio->Draw("esame");
- TLine *line; line = new TLine(pv.AMINRange,1.0,pv.AMAXRange,1.0);
- line->SetLineStyle(1);
- line->SetLineWidth(1);
- line->SetLineColor(1);
- line->Draw();
-
- c2->Print(outfile+"_log.png");
- //-----------------------------------------------------------------
- // END: Save log plot
- //-----------------------------------------------------------------
-
- Logfile.close();
-#if 0
- c1->Print(outfile+".C");
- //gPad->WaitPrimitive();
- c1->Modified();
- c1->Update();
- c1->SaveAs(outfile+".pdf");
-#endif
- c1->Write();
- } // var loop
-
- //f.Write();
- f->Close();
-
-} // QCDEstimation
diff --git a/ControlPlots/README.md b/ControlPlots/README.md
index 324e83e..668d462 100644
--- a/ControlPlots/README.md
+++ b/ControlPlots/README.md
@@ -11,10 +11,11 @@
# Set-up instructions
- cmsrel CMSSW_9_0_1
- cd CMSSW_9_0_1/src
+ ```bash
git clone git@github.com:osWW-VBS/ControlPlots.git
cd ControlPlots
+ source /cvmfs/sft.cern.ch/lcg/views/dev4cuda/latest/x86_64-el9-gcc11-opt/setup.sh
+ ```
* Prepare "InData" and "OutDir" directories; e.g.,
diff --git a/ControlPlots/ReArrangeSamples.py b/ControlPlots/ReArrangeSamples.py
deleted file mode 100644
index 9c245a4..0000000
--- a/ControlPlots/ReArrangeSamples.py
+++ /dev/null
@@ -1,93 +0,0 @@
-import os
-import sys
-import time
-import datetime
-
-#############################
-# common files
-#############################
-ControRegionToPlot = sys.argv[1] # top, wjet, zjet, all
-AddDirName = sys.argv[2] # This will be added in the directory name
-
-
-#commanSample = ['data','WV_EWK','aQGC']
-commanSample = ['data','WV_EWK']
-#commanSample = ['data']
-
-#SampleFile = 'DibosonBoostedElMuSamples13TeV_2018_01_07_12h02.txt' # with 30 GeV cut on b-jets
-SampleFile = 'DibosonBoostedElMuSamples13TeV_2018_02_16_08h33.txt' # 20 GeV cut on b-jets
-SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_IsoVarSaved_2018_02_26_18h33.txt' # QCD/other depending on iso cut
-SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_IsoVarSaved_2018_03_06_23h37.txt' # QCD/other depending on iso cut added three new variable for delta(met, jets)
-SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_IsoVarSaved_2018_03_09_13h06_Isolation.txt' # Isolation applied at pre-selection
-#SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_CleanedCode_Isolated_2018_03_12_22h09.txt' # Cleaned code (ISOLATED)
-#SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_CleanedCode_Isolated_NaNFixed_Btag20GeV_2018_03_15_21h34.txt' # cleaned and isolated
-SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_CleanedCode_Isolated_NaNFixed_Btag30GeV_2018_03_16_00h13.txt' # clened and isolated 30 GeV, loose b-tag weight
-#SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_CleanedCode_Isolated_NaNFixed_Btag30GeV_2018_03_16_03h34.txt' # cleaned and isolated 30GeV Medimum btag (only for TTBar CR
-
-variableFile = 'commonplotvars_chs'
-
-cppFile = 'myControlPlots.C'
-
-# Cut Files
-
-topCutFile = 'DibosonBoostedElMuCuts13TeV_TTBarControlRegion_CHS.txt'
-wjetCutFile = 'DibosonBoostedElMuCuts13TeV_WjetControlRegion_Tighter_CHS.txt'
-zjetCutFile = 'DibosonBoostedElMuCuts13TeV_ZjetControlRegion_Tighter_CHS.txt'
-qcdCutFile = 'DibosonBoostedElMuCuts13TeV_QCD_CHS.txt'
-qcdShapeCutFile = 'DibosonBoostedElMuCuts13TeV_QCD_Shape.txt'
-
-
-topArrangement= commanSample + ['Z+jets','Diboson','W+jets','SingleTop','TTbar','top']
-#topArrangement= commanSample + ['QCD','Z+jets','Diboson','W+jets','SingleTop','TTbar']
-wjetArrangement = commanSample + ['Z+jets','SingleTop','TTbar','top','Diboson','W+jets']
-#wjetArrangement = commanSample + ['Z+jets','SingleTop','TTbar','top','Diboson','W+jets']
-#wjetArrangement = commanSample + ['Z+jets','Diboson','QCD','SingleTop','TTbar','top','W+jets']
-zjetArrangement = commanSample + ['W+jets','Diboson','QCD','SingleTop','TTbar','top','Z+jets']
-qcdArrangement = commanSample + ['Z+jets','Diboson','SingleTop','TTbar','top','W+jets','V+jets']
-#qcdArrangement = commanSample + ['QCD']
-qcdShapeArrangement = commanSample + ['Z+jets','Diboson','SingleTop','TTbar','top','W+jets','V+jets','QCD']
-
-Dictionary = {"top":[topArrangement,topCutFile,"index_ttbar.php"],"wjet":[wjetArrangement,wjetCutFile,"index_wjet.php"],"zjet":[zjetArrangement,zjetCutFile,"index_zjet.php"],"qcd":[qcdArrangement,qcdCutFile,"index_qcd.php"],"qcds":[qcdShapeArrangement,qcdShapeCutFile,"index_qcds.php"]}
-
-print Dictionary[ControRegionToPlot]
-
-if ControRegionToPlot == "zjet":
- print "\n\nRemember to change the variable txt file. There you need to add variables related to 2 lepton case\n\n"
- variableFile = 'controlplotvars_CHS_2lep'
- cppFile = 'myControlPlots.C'
- time.sleep(30)
-
-if ControRegionToPlot == "qcd":
- SampleFile = 'DibosonBoostedElMuSamples13TeV_2018_02_23_12h07.txt' # QCD
- SampleFile = 'DibosonBoostedElMuSamples13TeV_2018_02_24_21h01_QCD_Iso3p0.txt' # QCD
- SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_IsoVarSaved_2018_02_26_13h34.txt' # QCD
- SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_IsoVarSaved_2018_02_26_18h33.txt' # QCD/other depending on iso cut
- SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_IsoVarSaved_2018_03_06_23h37.txt' # QCD/other depending on iso cut added three new variable for delta(met, jets)
- SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_IsoVarSaved_2018_03_09_13h15_AntiIsolation.txt' # Anti-Isolation applied at pre-selection
- SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_IsoVarSaved_2018_03_12_11h41_AntiIsolationWithUpperBound.txt'
-
-if ControRegionToPlot == "qcds": # For QCD Shape
- SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_QCD_Shape_2018_02_28_14h07.txt'# but of not applied trigger
- SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_QCD_Shape_2018_03_01_13h07.txt'
- SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_QCD_Shape_2018_03_01_21h23.txt'
-
-# delete if there is anything inside OutDir
-os.system('rm OutDir/*')
-
-sampleOutFile = open("DibosonBoostedElMuSamples13TeV.txt","w")
-for sample in Dictionary[ControRegionToPlot][0]:
- sampleInputFile = open(SampleFile,"r")
- for line in sampleInputFile:
- if line.split()[0] == sample:
- sampleOutFile.write(line)
-sampleOutFile.close()
-
-#os.system('cat DibosonBoostedElMuSamples13TeV.txt')
-print('root -l -b -q '+cppFile+'\(\\"'+Dictionary[ControRegionToPlot][1]+'\\",\\"DibosonBoostedElMuSamples13TeV.txt\\",'+variableFile+',\\"'+Dictionary[ControRegionToPlot][0][-1]+'_ControlRegion.root\\",0\)')
-os.system('root -l -b -q '+cppFile+'\(\\"'+Dictionary[ControRegionToPlot][1]+'\\",\\"DibosonBoostedElMuSamples13TeV.txt\\",'+variableFile+',\\"'+Dictionary[ControRegionToPlot][0][-1]+'_ControlRegion.root\\",1\)')
-os.system('mkdir -p '+ControRegionToPlot+'_ControlRegion_'+AddDirName+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M'))
-os.system('mv OutDir/* '+ControRegionToPlot+'_ControlRegion_'+AddDirName+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M')+"/")
-print "*"*20
-print('cp '+cppFile+' '+Dictionary[ControRegionToPlot][0][-2]+'_ControlRegion.root DibosonBoostedElMuSamples13TeV.txt ReArrangeSamples.py '+Dictionary[ControRegionToPlot][1]+' '+ControRegionToPlot+'_ControlRegion_'+AddDirName+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M'))
-os.system('cp '+cppFile+' '+Dictionary[ControRegionToPlot][0][-2]+'_ControlRegion.root DibosonBoostedElMuSamples13TeV.txt ReArrangeSamples.py '+Dictionary[ControRegionToPlot][1]+' '+ControRegionToPlot+'_ControlRegion_'+AddDirName+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M'))
-os.system('cp '+Dictionary[ControRegionToPlot][0][-1]+ ' ' +ControRegionToPlot+'_ControlRegion_'+AddDirName+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M') +'/index.php')
diff --git a/ControlPlots/ReArrangeSamples_Scan.py b/ControlPlots/ReArrangeSamples_Scan.py
deleted file mode 100644
index d5fb1c5..0000000
--- a/ControlPlots/ReArrangeSamples_Scan.py
+++ /dev/null
@@ -1,91 +0,0 @@
-import os
-import sys
-import time
-import datetime
-
-#############################
-# common files
-#############################
-ControRegionToPlot = sys.argv[1] # top, wjet, zjet, all
-AddDirName = sys.argv[2] # This will be added in the directory name
-
-
-#commanSample = ['data','WV_EWK','aQGC']
-#commanSample = ['data','WV_EWK']
-commanSample = ['data']
-
-#SampleFile = 'DibosonBoostedElMuSamples13TeV_2018_01_07_12h02.txt' # with 30 GeV cut on b-jets
-SampleFile = 'DibosonBoostedElMuSamples13TeV_2018_02_16_08h33.txt' # 20 GeV cut on b-jets
-SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_IsoVarSaved_2018_02_26_18h33.txt' # QCD/other depending on iso cut
-
-variableFile = 'commonplotvars_chs'
-
-cppFile = 'myControlPlots.C'
-
-# Cut Files
-
-topCutFile = 'DibosonBoostedElMuCuts13TeV_TTBarControlRegion_CHS.txt'
-wjetCutFile = 'DibosonBoostedElMuCuts13TeV_WjetControlRegion_Tighter_CHS.txt'
-zjetCutFile = 'DibosonBoostedElMuCuts13TeV_ZjetControlRegion_Tighter_CHS.txt'
-qcdCutFile = 'DibosonBoostedElMuCuts13TeV_QCD_CHS.txt'
-qcdShapeCutFile = 'DibosonBoostedElMuCuts13TeV_QCD_Shape.txt'
-
-
-topArrangement= commanSample + ['Z+jets','Diboson','W+jets','SingleTop','TTbar','top']
-#topArrangement= commanSample + ['QCD','Z+jets','Diboson','W+jets','SingleTop','TTbar']
-wjetArrangement = commanSample + ['Z+jets','SingleTop','TTbar','top','Diboson','W+jets']
-#wjetArrangement = commanSample + ['Z+jets','SingleTop','TTbar','top','Diboson','W+jets']
-#wjetArrangement = commanSample + ['Z+jets','Diboson','QCD','SingleTop','TTbar','top','W+jets']
-zjetArrangement = commanSample + ['W+jets','Diboson','QCD','SingleTop','TTbar','top','Z+jets']
-qcdArrangement = commanSample + ['Z+jets','Diboson','SingleTop','TTbar','top','W+jets','V+jets']
-#qcdArrangement = commanSample + ['QCD']
-qcdShapeArrangement = commanSample + ['Z+jets','Diboson','SingleTop','TTbar','top','W+jets','V+jets','QCD']
-
-Dictionary = {"top":[topArrangement,topCutFile],"wjet":[wjetArrangement,wjetCutFile],"zjet":[zjetArrangement,zjetCutFile],"qcd":[qcdArrangement,qcdCutFile],"qcds":[qcdShapeArrangement,qcdShapeCutFile]}
-
-print Dictionary[ControRegionToPlot]
-
-if ControRegionToPlot == "zjet":
- print "\n\nRemember to change the variable txt file. There you need to add variables related to 2 lepton case\n\n"
- variableFile = 'controlplotvars_CHS_2lep'
- cppFile = 'myControlPlots.C'
- time.sleep(30)
-
-if ControRegionToPlot == "qcd":
- SampleFile = 'DibosonBoostedElMuSamples13TeV_2018_02_23_12h07.txt' # QCD
- SampleFile = 'DibosonBoostedElMuSamples13TeV_2018_02_24_21h01_QCD_Iso3p0.txt' # QCD
- SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_IsoVarSaved_2018_02_26_13h34.txt' # QCD
- SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_IsoVarSaved_2018_02_26_18h33.txt' # QCD/other depending on iso cut
-
-if ControRegionToPlot == "qcds": # For QCD Shape
- SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_QCD_Shape_2018_02_28_14h07.txt'# but of not applied trigger
- SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_QCD_Shape_2018_03_01_13h07.txt'
- SampleFile = 'DibosonBoostedElMuSamples13TeV_WWTree_QCD_Shape_2018_03_01_21h23.txt'
-
-# delete if there is anything inside OutDir
-os.system('rm OutDir/*')
-
-sampleOutFile = open("DibosonBoostedElMuSamples13TeV.txt","w")
-for sample in Dictionary[ControRegionToPlot][0]:
- sampleInputFile = open(SampleFile,"r")
- for line in sampleInputFile:
- if line.split()[0] == sample:
- sampleOutFile.write(line)
-sampleOutFile.close()
-
-#leptonpt = [30, 50, 70, 90, 110]
-leptonpt = [60, 65,75,80,85]
-
-for lepPt in leptonpt:
- os.system("sed 's/l_pt1>30./l_pt1<"+str(lepPt)+"/g' "+Dictionary[ControRegionToPlot][1]+" > CutTxtFile.txt")
- os.system('cat CutTxtFile.txt')
- print('root -l -b -q '+cppFile+'\(\\"CutTxtFile.txt\\",\\"DibosonBoostedElMuSamples13TeV.txt\\",'+variableFile+',\\"'+Dictionary[ControRegionToPlot][0][-1]+'_ControlRegion.root\\",0\)')
- os.system('root -l -b -q '+cppFile+'\(\\"CutTxtFile.txt\\",\\"DibosonBoostedElMuSamples13TeV.txt\\",'+variableFile+',\\"'+Dictionary[ControRegionToPlot][0][-1]+'_ControlRegion.root\\",0\)')
- os.system('mkdir -p '+ControRegionToPlot+'_ControlRegion_'+str(lepPt)+"_"+AddDirName+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M'))
- os.system('mv OutDir/* '+ControRegionToPlot+'_ControlRegion_'+str(lepPt)+"_"+AddDirName+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M')+"/")
- os.system('cp '+cppFile+' '+Dictionary[ControRegionToPlot][0][-1]+'_ControlRegion.root DibosonBoostedElMuSamples13TeV.txt ReArrangeSamples.py CutTxtFile.txt '+ControRegionToPlot+'_ControlRegion_'+str(lepPt)+"_"+AddDirName+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M'))
- #print('root -l -b -q '+cppFile+'\(\\"'+Dictionary[ControRegionToPlot][1]+'\\",\\"DibosonBoostedElMuSamples13TeV.txt\\",'+variableFile+',\\"'+Dictionary[ControRegionToPlot][0][-1]+'_ControlRegion.root\\",0\)')
- #os.system('root -l -b -q '+cppFile+'\(\\"'+Dictionary[ControRegionToPlot][1]+'\\",\\"DibosonBoostedElMuSamples13TeV.txt\\",'+variableFile+',\\"'+Dictionary[ControRegionToPlot][0][-1]+'_ControlRegion.root\\",0\)')
- #os.system('mkdir -p '+ControRegionToPlot+'_ControlRegion_'+AddDirName+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M'))
- #os.system('mv OutDir/* '+ControRegionToPlot+'_ControlRegion_'+AddDirName+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M')+"/")
- #os.system('cp '+cppFile+' '+Dictionary[ControRegionToPlot][0][-1]+'_ControlRegion.root DibosonBoostedElMuSamples13TeV.txt ReArrangeSamples.py '+Dictionary[ControRegionToPlot][1]+' '+ControRegionToPlot+'_ControlRegion_'+AddDirName+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M'))
diff --git a/ControlPlots/RunMacro_2LEP.C b/ControlPlots/RunMacro_2LEP.C
deleted file mode 100644
index 2ffcb7a..0000000
--- a/ControlPlots/RunMacro_2LEP.C
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "controlplotvars_CHS_2lep.h"
-
-void RunMacro_2LEP()
-{
- gROOT->ProcessLine(".L myControlPlots.C+");
-//-------------------------------------
-// FOR W+Jet CR
-//-------------------------------------
- gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_2LEP_Tighter_CHS.txt\", \"DibosonBoostedElMuSamples13TeV.txt\", controlplotvars_CHS_2lep, \"LEP_ptScale_Down.root\", 0) ");
- //gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_2LEP_Tighter_CHS.txt\", \"ZV_DibosonBoostedElMuSamples13TeV.txt\", controlplotvars_CHS_2lep, \"LEP_ptScale_Nominal.root\", 0) ");
-
-}
diff --git a/ControlPlots/RunMacro_2l2q.C b/ControlPlots/RunMacro_2l2q.C
new file mode 100644
index 0000000..8c62970
--- /dev/null
+++ b/ControlPlots/RunMacro_2l2q.C
@@ -0,0 +1,14 @@
+#include "controlplotvars_CHS_2l2q.h"
+
+void RunMacro_2l2q()
+{
+ gROOT->ProcessLine(".L myControlPlots.C+");
+
+ TString OutPutPath = "/eos/user/r/rasharma/www/HighMassHiggsSearch/ControlPlots/BugFix/";
+
+ // For Electrons
+ gROOT->ProcessLine("myControlPlots(\"HZZ2l2q_Cuts.txt\", \"HZZ2l2nu_ELMuSamples13TeV_2024_04_11.txt\", controlplotvars_CHS_2l2q, \"Plots_2l2q_Ele.root\", \"" + OutPutPath +"\" \"Plots_2l2q_Ele\", 0) ");
+
+ // For Muons
+ gROOT->ProcessLine("myControlPlots(\"HZZ2l2q_Cuts_Muon.txt\", \"HZZ2l2nu_MuonSamples13TeV_2024_04_11.txt\", controlplotvars_CHS_2l2q, \"Plots_2l2q_Mu.root\", \"" + OutPutPath + "\" \"Plots_2l2q_Mu\", 1) ");
+}
diff --git a/ControlPlots/RunMacro_LEP.C b/ControlPlots/RunMacro_LEP.C
deleted file mode 100644
index 2ea57f9..0000000
--- a/ControlPlots/RunMacro_LEP.C
+++ /dev/null
@@ -1,9 +0,0 @@
-void RunMacro_LEP()
-{
- gROOT->ProcessLine(".L myControlPlots.C+");
-//-------------------------------------
-// FOR W+Jet CR
-//-------------------------------------
- gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_LEP_Tighter_CHS.txt\", \"DibosonBoostedElMuSamples13TeV.txt\", commonplotvars_chs , \"WVchannel_LEPptScale_Down.root\", 0) ");
-
-}
diff --git a/ControlPlots/RunMacro_Limits.C b/ControlPlots/RunMacro_Limits.C
deleted file mode 100644
index c31d5b9..0000000
--- a/ControlPlots/RunMacro_Limits.C
+++ /dev/null
@@ -1,41 +0,0 @@
-#include "controlplotvars_CHS_jes_up.h"
-#include "controlplotvars_CHS_jes_dn.h"
-
-void RunMacro_Limits()
-{
- gROOT->ProcessLine(".L myControlPlots.C+");
-
-//-------------------------------------
-// FOR Signal Region
-//-------------------------------------
-// OPTIONS FOR PROCESSLINE
-//
-// cut file, sample file, variable file, OutputRootfileName, 0/1 if 1 then scale signal by 100, RECREATE root file or UPDATE, 0/1 need data histo or not
-//
- //gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt\", \"DibosonBoostedElMuSamples13TeV.txt\", commonplotvars_chs , \"Nominal.root\" , 0 , \"RECREATE\" , 1) ");
- //gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_SignalRegion_jesUP_CHS.txt\", \"DibosonBoostedElMuSamples13TeV_jes_up.txt\", commonplotvars_chs_jes_up , \"Nominal.root\", 0 , \"UPDATE\", 0) ");
- gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_SignalRegion_jesUP_CHS.txt\", \"DibosonBoostedElMuSamples13TeV_jes_up.txt\", commonplotvars_chs_jes_up , \"jes_up.root\", 0 , \"RECREATE\") ");
- //gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_SignalRegion_jesDOWN_CHS.txt\", \"DibosonBoostedElMuSamples13TeV_jes_dn.txt\", commonplotvars_chs_jes_dn , \"Nominal.root\" , 0, \"UPDATE\", 0) ");
- //gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_SignalRegion_jesDOWN_CHS.txt\", \"DibosonBoostedElMuSamples13TeV_jes_dn.txt\", commonplotvars_chs_jes_dn , \"jes_dn.root\" , 1, \"RECREATE\") ");
- /*
- //
- //
- // Add PU up/dn
- //
- gROOT->Reset();
- system("sed 's/pu_Weight/pu_Weight_up/g' myControlPlots.C > myControlPlots_temp_up.C");
- system("sed -i 's/myControlPlots/myControlPlots_temp_up/g' myControlPlots_temp_up.C");
- gROOT->ProcessLine(".L myControlPlots_temp_up.C+");
- gROOT->ProcessLine("myControlPlots_temp_up(\"DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt\", \"DibosonBoostedElMuSamples13TeV_pu_up.txt\", commonplotvars_chs , \"Nominal.root\" , 0 , \"UPDATE\" , 0) ");
- system("rm myControlPlots_temp_up.C");
-
- gROOT->Reset();
- system("sed 's/pu_Weight/pu_Weight_down/g' myControlPlots.C > myControlPlots_temp_dn.C");
- system("sed -i 's/myControlPlots/myControlPlots_temp_dn/g' myControlPlots_temp_dn.C");
- gROOT->ProcessLine(".L myControlPlots_temp_dn.C+");
- gROOT->ProcessLine("myControlPlots_temp_dn(\"DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt\", \"DibosonBoostedElMuSamples13TeV_pu_dn.txt\", commonplotvars_chs , \"Nominal.root\" , 0 , \"UPDATE\" , 0) ");
- system("rm myControlPlots_temp_dn.C");
-
- */
-//-------------------------------------
-}
diff --git a/ControlPlots/RunMacro_Limits_Templet.C b/ControlPlots/RunMacro_Limits_Templet.C
deleted file mode 100644
index c3b2000..0000000
--- a/ControlPlots/RunMacro_Limits_Templet.C
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "controlplotvars_CHS_Limit.h"
-
-void RunMacro_Limits_Templet()
-{
- gROOT->ProcessLine(".L myControlPlots.C+");
-
- gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt\", \"DibosonBoostedElMuSamples13TeV.txt\", commonplotvars_chs_limit, \"combine_limit.root\" , 0 , \"RECREATE\" , 1) ");
-}
diff --git a/ControlPlots/RunMacro_LowMET.C b/ControlPlots/RunMacro_LowMET.C
new file mode 100644
index 0000000..84880cf
--- /dev/null
+++ b/ControlPlots/RunMacro_LowMET.C
@@ -0,0 +1,33 @@
+// #include "controlplotvars_CHS.h"
+#include "controlplotvars_CHS_VBF.h"
+
+void RunMacro_LowMET()
+{
+ gROOT->ProcessLine(".L myControlPlots.C+");
+ TString OutPutPath = "/eos/user/r/rasharma/www/HighMassHiggsSearch/ControlPlots/DrellYanFix/";
+
+ // TString OutPutPath = "/eos/user/r/rasharma/www/HighMassHiggsSearch/ControlPlots/BugFix/";
+
+ // For Electrons
+ // gROOT->ProcessLine("myControlPlots(\"HZZ2l2nu_Cuts_DrellYan.txt\", \"HZZ2l2nu_ELMuSamples13TeV_2024_04_11.txt\", controlplotvars_CHS, \"Met_LessThan30_Ele.root\", \"Met_LessThan30_Ele\", 0) ");
+ // gROOT->ProcessLine("myControlPlots(\"HZZ2l2nu_Cuts_LowMETControlRegion.txt\", \"HZZ2l2nu_ELMuSamples13TeV_2024_04_11.txt\", controlplotvars_CHS, \"OutDir_LowMet_MedBTag.root\", \"OutDir_LowMet_MedBTag\", 0) ");
+
+ // gROOT->ProcessLine("myControlPlots(\"HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_ZeroJet.txt\", \"HZZ2l2nu_ELMuSamples13TeV_2024_04_11.txt\", controlplotvars_CHS, \"OutDir_LowMet_MedBTag_ZeroJet.root\", \"OutDir_LowMet_MedBTag_ZeroJet\", 0) ");
+
+ // gROOT->ProcessLine("myControlPlots(\"HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_1Jet.txt\", \"HZZ2l2nu_ELMuSamples13TeV_2024_04_11.txt\", controlplotvars_CHS, \"OutDir_LowMet_MedBTag_1Jet.root\", \"OutDir_LowMet_MedBTag_1Jet\", 0) ");
+
+ // gROOT->ProcessLine("myControlPlots(\"HZZ2l2nu_Cuts_LowMETControlRegion_AtLeast1BJet.txt\", \"HZZ2l2nu_ELMuSamples13TeV_2024_04_11.txt\", controlplotvars_CHS, \"OutDir_LowMet_AtLeast1TightBJet.root\", \"OutDir_LowMet_AtLeast1TightBJet\", 0) ");
+
+ // gROOT->ProcessLine("myControlPlots(\"HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ZEROJet.txt\", \"HZZ2l2nu_ELMuSamples13TeV_2024_04_11.txt\", controlplotvars_CHS, \"OutDir_LowMet_NoVBF_ZeroJet.root\", \"OutDir_LowMet_NoVBF_ZeroJet\", 0) ");
+
+ // gROOT->ProcessLine("myControlPlots(\"HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ge1Jet.txt\", \"HZZ2l2nu_ELMuSamples13TeV_2024_04_11.txt\", controlplotvars_CHS, \"OutDir_LowMet_NoVBF_ge1Jet.root\", \"OutDir_LowMet_NoVBF_ge1Jet\", 0) ");
+
+ gROOT->ProcessLine("myControlPlots(\"HZZ2l2nu_Cuts_LowMET_VBF_ControlRegion.txt\", \"HZZ2l2nu_ELMuSamples13TeV_2024_04_11.txt\", controlplotvars_CHS_VBF, \"OutDir_VBF_DYWgt_MET60.root\", \"" + OutPutPath +"\" \"OutDir_VBF_DYWgt_MET60\", 0) ");
+
+ // For Muons
+ gROOT->ProcessLine("myControlPlots(\"HZZ2l2nu_Cuts_LowMET_VBF_ControlRegion_Muon.txt\", \"HZZ2l2nu_MuonSamples13TeV_2024_04_11.txt\", controlplotvars_CHS_VBF, \"OutDir_VBF_Muon_DYWgt_MET60.root\", \"" + OutPutPath +"\" \"OutDir_VBF_Muon_DYWgt_MET60\", 0) ");
+
+ // gROOT->ProcessLine("myControlPlots(\"HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ge1Jet_Muon.txt\", \"HZZ2l2nu_MuonSamples13TeV_2024_04_11.txt\", controlplotvars_CHS, \"OutDir_LowMet_NoVBF_ge1Jet_Muon.root\", \"OutDir_LowMet_NoVBF_ge1Jet_Muon\", 0) ");
+
+ // gROOT->ProcessLine("myControlPlots(\"HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_NoVBF_ZEROJet_Muon.txt\", \"HZZ2l2nu_MuonSamples13TeV_2024_04_11.txt\", controlplotvars_CHS, \"OutDir_LowMet_NoVBF_ZeroJet_Muon.root\", \"OutDir_LowMet_NoVBF_ZeroJet_Muon\", 0) ");
+}
diff --git a/ControlPlots/RunMacro_SigBkgComparison.C b/ControlPlots/RunMacro_SigBkgComparison.C
deleted file mode 100644
index 57344c2..0000000
--- a/ControlPlots/RunMacro_SigBkgComparison.C
+++ /dev/null
@@ -1,16 +0,0 @@
-void RunMacro_SigBkgComparison()
-{
- gROOT->ProcessLine(".L myControlPlots_SignalBkg_Comparison.C+");
-
-//-------------------------------------
-// FOR Signal Region
-//-------------------------------------
-// OPTIONS FOR PROCESSLINE
-//
-// cut file, sample file, variable file, OutputRootfileName, 0/1 if 1 then scale signal by 100, RECREATE root file or UPDATE
-//
- gROOT->ProcessLine("myControlPlots_SignalBkg_Comparison(\"DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt\", \"DibosonBoostedElMuSamples13TeV.txt\", commonplotvars_chs , \"SignalBackground_Comparison.root\", 1 ) ");
-//-------------------------------------
-
-//-------------------------------------
-}
diff --git a/ControlPlots/RunMacro_SigBkgComparison_Individual.C b/ControlPlots/RunMacro_SigBkgComparison_Individual.C
deleted file mode 100644
index 700ee0e..0000000
--- a/ControlPlots/RunMacro_SigBkgComparison_Individual.C
+++ /dev/null
@@ -1,17 +0,0 @@
-void RunMacro_SigBkgComparison_Individual()
-{
- gROOT->ProcessLine(".L myControlPlots_SignalBkg_Comparison_Individual.C+");
- //gROOT->ProcessLine(".L model.C+");
-
-//-------------------------------------
-// FOR Signal Region
-//-------------------------------------
- gROOT->ProcessLine("myControlPlots_SignalBkg_Comparison_Individual(\"DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt\", \"DibosonBoostedElMuSamples13TeV.txt\", commonplotvars_chs , \"SignalBKg_Comp_Individual.root\" ) ");
-
-
-//-------------------------------------
- //gROOT->ProcessLine("Wjet_loose()");
- //gROOT->ProcessLine("Wjet_tight()");
- //gROOT->ProcessLine("TopControl()");
- //gROOT->ProcessLine("Wjet_tighter()");
-}
diff --git a/ControlPlots/RunMacro_SignalRegion.C b/ControlPlots/RunMacro_SignalRegion.C
deleted file mode 100644
index 2133cab..0000000
--- a/ControlPlots/RunMacro_SignalRegion.C
+++ /dev/null
@@ -1,12 +0,0 @@
-void RunMacro_SignalRegion()
-{
- gROOT->ProcessLine(".L myControlPlots.C+");
-//-------------------------------------
-// FOR Signal Region
-//-------------------------------------
- //gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt\", \"DibosonBoostedElMuSamples13TeV_2019_03_27_16h16.txt\", commonplotvars_chs , \"SignalRegion.root\", 0) ");
- //gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt\", \"DibosonBoostedElMuSamples13TeV_2019_03_28_03h35_FullJetPho.txt\", commonplotvars_chs , \"SignalRegion.root\", 0) ");
- //gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt\", \"DibosonBoostedElMuSamples13TeV_2019_03_28_03h30_L1prefire_CleanJet_CleanPho.txt\", commonplotvars_chs , \"SignalRegion.root\", 0) ");
- gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt\", \"DibosonBoostedElMuSamples13TeV_2019_03_28_14h27.txt\", commonplotvars_chs , \"SignalRegion.root\", 0) ");
-
-}
diff --git a/ControlPlots/RunMacro_TTbar.C b/ControlPlots/RunMacro_TTbar.C
deleted file mode 100644
index 290ead6..0000000
--- a/ControlPlots/RunMacro_TTbar.C
+++ /dev/null
@@ -1,10 +0,0 @@
-void RunMacro_TTbar()
-{
- gROOT->ProcessLine(".L myControlPlots.C+");
-//-------------------------------------
-// FOR TTbar CR
-//-------------------------------------
- gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_TTBarControlRegion_CHS.txt\", \"DibosonBoostedElMuSamples13TeV_WWTree_CommonNtuple_For1and2Lepton_MuonPtScale_2018_07_24_10h36.txt\", commonplotvars_chs , \"TTbarControlRegion.root\", 0) ");
-
-
-}
diff --git a/ControlPlots/RunMacro_Wjet.C b/ControlPlots/RunMacro_Wjet.C
deleted file mode 100644
index 4b27dd8..0000000
--- a/ControlPlots/RunMacro_Wjet.C
+++ /dev/null
@@ -1,9 +0,0 @@
-void RunMacro_Wjet()
-{
- gROOT->ProcessLine(".L myControlPlots.C+");
-//-------------------------------------
-// FOR W+Jet CR
-//-------------------------------------
- gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_WjetControlRegion_Tighter_CHS.txt\", \"DibosonBoostedElMuSamples13TeV_2019_03_29_03h24.txt\", commonplotvars_chs , \"WjetControlRegion.root\", 0) ");
-
-}
diff --git a/ControlPlots/RunMacro_Zjet.C b/ControlPlots/RunMacro_Zjet.C
deleted file mode 100644
index a540342..0000000
--- a/ControlPlots/RunMacro_Zjet.C
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "controlplotvars_CHS_2lep.h"
-
-void RunMacro_Zjet()
-{
- gROOT->ProcessLine(".L myControlPlots.C+");
-//-------------------------------------
-// FOR W+Jet CR
-//-------------------------------------
- gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_ZjetControlRegion_Tighter_CHS.txt\", \"DibosonBoostedElMuSamples13TeV_2019_03_29_03h24.txt\", controlplotvars_CHS_2lep, \"ZjetControlRegion.root\", 0) ");
-
-}
diff --git a/ControlPlots/RunMacro_debug.C b/ControlPlots/RunMacro_debug.C
new file mode 100644
index 0000000..1a242ed
--- /dev/null
+++ b/ControlPlots/RunMacro_debug.C
@@ -0,0 +1,11 @@
+// #include "controlplotvars_CHS.h"
+//#include "controlplotvars_CHS_debug.h"
+#include "controlplotvars_CHS_testing.h"
+
+void RunMacro_debug()
+{
+ gROOT->ProcessLine(".L myControlPlots.C+");
+ TString OutPutPath = "/eos/user/a/avijay/emu_controlplot";
+
+ gROOT->ProcessLine("myControlPlots(\"HZZ2l2nu_Cuts_emuControlRegion_MedBTag_ZeroJet.txt\", \"HZZ2l2nu_ElectronSamples13TeV_for_emu_CR_test.txt\", controlplotvars_CHS_testing, \"test.root\", \"" + OutPutPath + "\" \"debugging\", 0) ");
+}
diff --git a/ControlPlots/RunMacro_debug_copy.C b/ControlPlots/RunMacro_debug_copy.C
new file mode 100644
index 0000000..54c9d55
--- /dev/null
+++ b/ControlPlots/RunMacro_debug_copy.C
@@ -0,0 +1,10 @@
+// #include "controlplotvars_CHS.h"
+#include "controlplotvars_CHS_debug.h"
+
+void RunMacro_debug_copy()
+{
+ gROOT->ProcessLine(".L myControlPlots.C+");
+ TString OutPutPath = "/eos/user/a/avijay/results_controlplot";
+
+ gROOT->ProcessLine("myControlPlots(\"HZZ2l2nu_Cuts_LowMETControlRegion_MedBTag_ZeroJet.txt\", \"HZZ2l2nu_ElectronSamples13TeV_for_emu_CR.txt\", controlplotvars_CHS_debug, \"emuCR_0jet_electron.root\", \"" + OutPutPath + "\" \"test_with_lowmet_0jet_electron\", 0) ");
+}
diff --git a/ControlPlots/RunMacro_mjj.C b/ControlPlots/RunMacro_mjj.C
deleted file mode 100644
index d634f60..0000000
--- a/ControlPlots/RunMacro_mjj.C
+++ /dev/null
@@ -1,8 +0,0 @@
-void RunMacro_mjj()
-{
- gROOT->ProcessLine(".L myControlPlots.C+");
-//-------------------------------------
-// FOR (mjj>800 && deta<4.0) or (mjj<800 && deta>4.0) CR
-//-------------------------------------
- gROOT->ProcessLine("myControlPlots(\"DibosonBoostedElMuCuts13TeV_MjjDetaControlRegion_CHS.txt\", \"DibosonBoostedElMuSamples13TeV.txt\", commonplotvars_chs, \"mjjDetajjControlRegion.root\", 1 ) ");
-}
diff --git a/ControlPlots/Submit_lpc_CondorJob.py b/ControlPlots/Submit_lpc_CondorJob.py
deleted file mode 100644
index a46667d..0000000
--- a/ControlPlots/Submit_lpc_CondorJob.py
+++ /dev/null
@@ -1,174 +0,0 @@
-#! /usr/bin/env python
-import os
-import glob
-import math
-from array import array
-import sys
-import time
-import subprocess
-import tarfile
-import datetime
-import commands
-
-currentDir = os.getcwd();
-CMSSWDir = currentDir+"/../";
-
-TestRun = 0
-# 0 => Signal, 1 => TTbar
-# 2 => Wjet, 3 => mjj
-# 4 => Limit
-WhichJob = 1
-#
-# Signal/bkg comparison
-#
-if WhichJob == 0:
- OUTDIR = 'SignalBkgComparison'
- RunFile = 'RunMacro_SigBkgComparison_Individual.C'
- JobName = 'SignalBkgComparison'
- CopyFiles = ['RunMacro_SigBkgComparison_Individual.C', 'DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt', 'DibosonBoostedElMuSamples13TeV.txt','SignalBKg_Comp_Individual.root']
-
-#
-# TTbar Control Region
-#
-if WhichJob == 1:
- OUTDIR = 'ControlPlots/TTbar_with_btagWeight'
- #OUTDIR = 'ControlPlots/TTbar_No_btagWeight'
- RunFile = 'RunMacro_TTbar.C'
- JobName = 'TTbar'
- CopyFiles = ['RunMacro_TTbar.C', 'DibosonBoostedElMuCuts13TeV_TTBarControlRegion_CHS.txt', 'DibosonBoostedElMuSamples13TeV.txt', 'myControlPlots.C', 'controlplotvars_CHS.h' , 'TTbarControlRegion.root']
-
-#
-# Wjet Control Region
-#
-if WhichJob == 2:
- OUTDIR = 'ControlPlots/Wjets_with_btagWeight'
- #OUTDIR = 'ControlPlots/Wjets_No_btagWeight'
- RunFile = 'RunMacro_Wjet.C'
- JobName = 'Wjets'
- CopyFiles = ['RunMacro_Wjet.C', 'DibosonBoostedElMuCuts13TeV_WjetControlRegion_Tighter_CHS.txt', 'DibosonBoostedElMuSamples13TeV.txt', 'myControlPlots.C', 'controlplotvars_CHS.h', 'WjetControlRegion.root']
-#
-# mjj Control Region
-#
-if WhichJob == 3:
- OUTDIR = 'ControlPlots/mjjdetajj'
- RunFile = 'RunMacro_mjj.C'
- JobName = 'mjjdetajj'
- CopyFiles = ['RunMacro_mjj.C', 'DibosonBoostedElMuCuts13TeV_MjjDetaControlRegion_CHS.txt', 'DibosonBoostedElMuSamples13TeV.txt', 'myControlPlots.C', 'controlplotvars_CHS.h', 'mjjDetajjControlRegion.root']
-#
-# Limits Control Region
-#
-if WhichJob == 4:
- OUTDIR = 'Limits'
- RunFile = 'RunMacro_Limits.C'
- JobName = 'Limits'
- CopyFiles = ['RunMacro_Limits.C', 'DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt','DibosonBoostedElMuCuts13TeV_SignalRegion_jesUP_CHS.txt', 'DibosonBoostedElMuCuts13TeV_SignalRegion_jerUP_CHS.txt', 'DibosonBoostedElMuCuts13TeV_SignalRegion_jerDOWN_CHS.txt', 'DibosonBoostedElMuCuts13TeV_SignalRegion_jesDOWN_CHS.txt', 'DibosonBoostedElMuSamples13TeV.txt', 'myControlPlots.C', 'controlplotvars_CHS.h']
-
-
-# Get date and time for output directory
-## ADD "test" IN OUTPUT FOLDER IF YOU ARE TESTING SO THAT LATER YOU REMEMBER TO WHICH DIRECTORY YOU HAVE TO REMOVE FROM EOS
-if TestRun:
- outputFolder = "/store/user/rasharma/ThirdStep_Distributions/"+OUTDIR+'/'+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M')+"_TEST/";
- OutputLogPath = "Logs/"+JobName+'/' + datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M') + "_TEST";
-else:
- outputFolder = "/store/user/rasharma/ThirdStep_Distributions/"+OUTDIR+'/'+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M');
- OutputLogPath = "Logs/"+JobName+'/' + datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M');
-
-
-print "Name of output dir: ",outputFolder
-# create a directory on eos
-os.system('xrdfs root://cmseos.fnal.gov/ mkdir ' + outputFolder)
-# create directory in pwd for log files
-os.system('mkdir -p ' + OutputLogPath)
-
-# Function to create a tar file
-def make_tarfile(output_filename, source_dir):
- with tarfile.open(output_filename, "w:gz") as tar:
- tar.add(source_dir, arcname=os.path.basename(source_dir))
-
-# Get CMSSW directory path and name
-cmsswDirPath = commands.getstatusoutput('echo ${CMSSW_BASE}')
-CMSSWRel = os.path.basename(cmsswDirPath[1])
-
-print "CMSSW release used : ",CMSSWRel
-
-# create tarball of present working CMSSW base directory
-os.system('rm CMSSW*.tgz')
-make_tarfile(CMSSWRel+".tgz", cmsswDirPath[1])
-
-# send the created tarball to eos
-os.system('xrdcp -f ' + CMSSWRel+".tgz" + ' root://cmseos.fnal.gov/'+outputFolder+"/" + CMSSWRel+".tgz")
-#with open("ThingsUpdated.txt","a") as myfile:
-# CmdOutput = subprocess.check_output('git log --pretty=format:"%h - %an, %cd : %s" -2')
-# myfile.write("=========================================\n\n")
-# myfile.write(CmdOutput)
-#myfile.close()
-#os.system('xrdcp -f *.txt root://cmseos.fnal.gov/' + outputFolder)
-#os.system('cp ThingsUpdated.txt ' + OutputLogPath)
-
-
-outJDL = open("runstep2condor.jdl","w");
-
-
-outJDL.write("Executable = runstep2condor.sh\n");
-outJDL.write("Universe = vanilla\n");
-#outJDL.write("Requirements =FileSystemDomain==\"fnal.gov\" && Arch==\"X86_64\"");
-outJDL.write("Notification = ERROR\n");
-outJDL.write("Should_Transfer_Files = YES\n");
-outJDL.write("WhenToTransferOutput = ON_EXIT\n");
-#outJDL.write("include : list-infiles.sh |\n");
-#outJDL.write("Transfer_Input_Files = "+inputlist+"\n");
-outJDL.write("x509userproxy = $ENV(X509_USER_PROXY)\n");
-
-outJDL.write("Output = "+OutputLogPath+"/"+JobName+".stdout\n");
-outJDL.write("Error = "+OutputLogPath+"/"+JobName+".stdout\n");
-#outJDL.write("Arguments = -n "+str(samples[i][1])+" -o WWTree_"+str(samples[i][1])+" -w "+str(samples[i][0])+" -no "+ str(samples[i][2]) + " -noNeg " + str(samples[i][3]) + " -lumi "+str(lumi)+" --ismc 1 -trig 1 -c lpc\n");
-outJDL.write("Queue\n");
-
-outJDL.close();
-
-
-command = "root -l -b -q "+RunFile
-
-outScript = open("runstep2condor.sh","w");
-outScript.write('#!/bin/bash');
-outScript.write("\n"+'echo "Starting job on " `date`');
-outScript.write("\n"+'echo "Running on: `uname -a`"');
-outScript.write("\n"+'echo "System software: `cat /etc/redhat-release`"');
-outScript.write("\n"+'source /cvmfs/cms.cern.ch/cmsset_default.sh');
-outScript.write("\n"+'### copy the input root files if they are needed only if you require local reading');
-outScript.write("\n"+'xrdcp -f root://cmseos.fnal.gov/'+outputFolder+"/" + CMSSWRel+".tgz .");
-outScript.write("\n"+'tar -xf '+ CMSSWRel +'.tgz' );
-outScript.write("\n"+'rm '+ CMSSWRel +'.tgz' );
-outScript.write("\n"+'cd ' + CMSSWRel + '/src/PlottingCodes/ControlPlots' );
-outScript.write("\n"+'echo "====> PWD: " ');
-outScript.write("\n"+'pwd');
-outScript.write("\n"+'echo "====> List files : " ');
-outScript.write("\n"+'ls OutDir/');
-outScript.write("\n"+'rm OutDir/*');
-outScript.write("\n"+'echo "============================================" ');
-outScript.write("\n"+'echo "====> List output files : " ');
-outScript.write("\n"+'ls OutDir/');
-outScript.write("\n"+'echo "============================================" ');
-outScript.write("\n"+'scramv1 b ProjectRename');
-outScript.write("\n"+'eval `scram runtime -sh`');
-outScript.write("\n"+command);
-outScript.write("\n"+'echo "====> List output files : " ');
-outScript.write("\n"+'ls OutDir/');
-outScript.write("\n"+'echo "xrdcp output for condor"');
-outScript.write("\n"+'for FILE in OutDir/*');
-outScript.write("\n"+'do');
-outScript.write("\n"+'\techo "xrdcp -r -f ${FILE} root://cmseos.fnal.gov/'+outputFolder+'/"');
-outScript.write("\n"+'\txrdcp -r -f ${FILE} root://cmseos.fnal.gov/'+outputFolder+'/ 2>&1');
-outScript.write("\n"+'done');
-for files in CopyFiles:
- outScript.write("\n"+'xrdcp -f '+files+' root://cmseos.fnal.gov/'+outputFolder+'/');
-outScript.write("\n"+'cd ${_CONDOR_SCRATCH_DIR}');
-outScript.write("\n"+'rm -rf ' + CMSSWRel);
-outScript.write("\n");
-outScript.close();
-os.system("chmod 777 runstep2condor.sh");
-
-print "===> Set Proxy Using:";
-print "\tvoms-proxy-init --voms cms --valid 168:00";
-print "\"condor_submit runstep2condor.jdl\" to submit";
-os.system("condor_submit runstep2condor.jdl")
diff --git a/ControlPlots/Submit_lpc_CondorJob_Limit.py b/ControlPlots/Submit_lpc_CondorJob_Limit.py
deleted file mode 100644
index 6446200..0000000
--- a/ControlPlots/Submit_lpc_CondorJob_Limit.py
+++ /dev/null
@@ -1,129 +0,0 @@
-#! /usr/bin/env python
-import os
-import glob
-import math
-from array import array
-import sys
-import time
-import subprocess
-import tarfile
-import datetime
-import commands
-
-currentDir = os.getcwd();
-CMSSWDir = currentDir+"/../";
-
-TestRun = 0
-OUTDIR = 'Limits'
-JobName = OUTDIR+'_mww000'
-CopyFiles = ['RunMacro_Limits.C', 'DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt','DibosonBoostedElMuCuts13TeV_SignalRegion_jesUP_CHS.txt', 'DibosonBoostedElMuCuts13TeV_SignalRegion_jerUP_CHS.txt', 'DibosonBoostedElMuCuts13TeV_SignalRegion_jerDOWN_CHS.txt', 'DibosonBoostedElMuCuts13TeV_SignalRegion_jesDOWN_CHS.txt', 'DibosonBoostedElMuSamples13TeV.txt', 'myControlPlots.C', 'controlplotvars_CHS.h']
-
-
-# Get date and time for output directory
-## ADD "test" IN OUTPUT FOLDER IF YOU ARE TESTING SO THAT LATER YOU REMEMBER TO WHICH DIRECTORY YOU HAVE TO REMOVE FROM EOS
-if TestRun:
- outputFolder = "/store/user/rasharma/ThirdStep_Distributions/"+OUTDIR+'/'+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M')+"_TEST/";
- OutputLogPath = "Logs/"+JobName+'/' + datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M') + "_TEST";
-else:
- outputFolder = "/store/user/rasharma/ThirdStep_Distributions/"+OUTDIR+'/'+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M');
- OutputLogPath = "Logs/"+JobName+'/' + datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M');
-
-
-print "Name of output dir: ",outputFolder
-# create a directory on eos
-os.system('xrdfs root://cmseos.fnal.gov/ mkdir ' + outputFolder)
-# create directory in pwd for log files
-os.system('mkdir -p ' + OutputLogPath)
-
-# Function to create a tar file
-def make_tarfile(output_filename, source_dir):
- with tarfile.open(output_filename, "w:gz") as tar:
- tar.add(source_dir, arcname=os.path.basename(source_dir))
-
-# Get CMSSW directory path and name
-cmsswDirPath = commands.getstatusoutput('echo ${CMSSW_BASE}')
-CMSSWRel = os.path.basename(cmsswDirPath[1])
-
-print "CMSSW release used : ",CMSSWRel
-
-# create tarball of present working CMSSW base directory
-os.system('rm CMSSW*.tgz')
-make_tarfile(CMSSWRel+".tgz", cmsswDirPath[1])
-
-# send the created tarball to eos
-os.system('xrdcp -f ' + CMSSWRel+".tgz" + ' root://cmseos.fnal.gov/'+outputFolder+"/" + CMSSWRel+".tgz")
-
-os.system('git diff myControlPlots.C > git_diff.patch')
-os.system('git diff DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt >> git_diff.patch')
-os.system('git diff controlplotvars_CHS_Limit.h >> git_diff.patch')
-os.system('git diff RunMacro_Limits_Templet.C >> git_diff.patch')
-os.system('git diff DibosonBoostedElMuSamples13TeV.txt >> git_diff.patch')
-
-os.system('xrdcp -f git_diff.patch root://cmseos.fnal.gov/'+outputFolder+'/git_diff.patch')
-
-outJDL = open("runstep2condor.jdl","w");
-
-
-outJDL.write("Executable = runstep2condor.sh\n");
-outJDL.write("Universe = vanilla\n");
-#outJDL.write("Requirements =FileSystemDomain==\"fnal.gov\" && Arch==\"X86_64\"");
-outJDL.write("Notification = ERROR\n");
-outJDL.write("Should_Transfer_Files = YES\n");
-outJDL.write("WhenToTransferOutput = ON_EXIT\n");
-#outJDL.write("include : list-infiles.sh |\n");
-#outJDL.write("Transfer_Input_Files = "+inputlist+"\n");
-outJDL.write("x509userproxy = $ENV(X509_USER_PROXY)\n");
-
-outJDL.write("Output = "+OutputLogPath+"/"+JobName+".stdout\n");
-outJDL.write("Error = "+OutputLogPath+"/"+JobName+".stdout\n");
-outJDL.write("Queue\n");
-
-outJDL.close();
-
-
-command = "python Limit_Script.py"
-
-outScript = open("runstep2condor.sh","w");
-outScript.write('#!/bin/bash');
-outScript.write("\n"+'echo "Starting job on " `date`');
-outScript.write("\n"+'echo "Running on: `uname -a`"');
-outScript.write("\n"+'echo "System software: `cat /etc/redhat-release`"');
-outScript.write("\n"+'source /cvmfs/cms.cern.ch/cmsset_default.sh');
-outScript.write("\n"+'### copy the input root files if they are needed only if you require local reading');
-outScript.write("\n"+'xrdcp -f root://cmseos.fnal.gov/'+outputFolder+"/" + CMSSWRel+".tgz .");
-outScript.write("\n"+'tar -xf '+ CMSSWRel +'.tgz' );
-outScript.write("\n"+'rm '+ CMSSWRel +'.tgz' );
-outScript.write("\n"+'cd ' + CMSSWRel + '/src/PlottingCodes/ControlPlots' );
-outScript.write("\n"+'echo "====> PWD: " ');
-outScript.write("\n"+'pwd');
-outScript.write("\n"+'echo "====> List files : " ');
-outScript.write("\n"+'ls');
-outScript.write("\n"+'rm OutDir/*');
-outScript.write("\n"+'echo "============================================" ');
-outScript.write("\n"+'echo "====> List output files : " ');
-outScript.write("\n"+'ls OutDir/');
-outScript.write("\n"+'echo "============================================" ');
-outScript.write("\n"+'scramv1 b ProjectRename');
-outScript.write("\n"+'eval `scram runtime -sh`');
-outScript.write("\n"+command);
-outScript.write("\n"+'echo "====> List output files : " ');
-outScript.write("\n"+'ls OutDir/');
-outScript.write("\n"+'echo "xrdcp output for condor"');
-outScript.write("\n"+'xrdcp -f combine_limit.root root://cmseos.fnal.gov/'+outputFolder+'/');
-outScript.write("\n"+'for FILE in OutDir/*');
-outScript.write("\n"+'do');
-outScript.write("\n"+'\techo "xrdcp -r -f ${FILE} root://cmseos.fnal.gov/'+outputFolder+'/"');
-outScript.write("\n"+'\txrdcp -r -f ${FILE} root://cmseos.fnal.gov/'+outputFolder+'/ 2>&1');
-outScript.write("\n"+'done');
-for files in CopyFiles:
- outScript.write("\n"+'xrdcp -f '+files+' root://cmseos.fnal.gov/'+outputFolder+'/');
-outScript.write("\n"+'cd ${_CONDOR_SCRATCH_DIR}');
-outScript.write("\n"+'rm -rf ' + CMSSWRel);
-outScript.write("\n");
-outScript.close();
-os.system("chmod 777 runstep2condor.sh");
-
-print "===> Set Proxy Using:";
-print "\tvoms-proxy-init --voms cms --valid 168:00";
-print "\"condor_submit runstep2condor.jdl\" to submit";
-os.system("condor_submit runstep2condor.jdl")
diff --git a/ControlPlots/Submit_lpc_CondorJob_Limit_Scan.py b/ControlPlots/Submit_lpc_CondorJob_Limit_Scan.py
deleted file mode 100644
index 156c239..0000000
--- a/ControlPlots/Submit_lpc_CondorJob_Limit_Scan.py
+++ /dev/null
@@ -1,150 +0,0 @@
-#! /usr/bin/env python
-import os
-import glob
-import math
-from array import array
-import sys
-import time
-import subprocess
-import tarfile
-import datetime
-import commands
-
-currentDir = os.getcwd();
-CMSSWDir = currentDir+"/../";
-
-TestRun = 0
-OUTDIR = 'Limits'
-JobName = OUTDIR
-CopyFiles = ['RunMacro_Limits.C', 'DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt','DibosonBoostedElMuCuts13TeV_SignalRegion_jesUP_CHS.txt', 'DibosonBoostedElMuCuts13TeV_SignalRegion_jerUP_CHS.txt', 'DibosonBoostedElMuCuts13TeV_SignalRegion_jerDOWN_CHS.txt', 'DibosonBoostedElMuCuts13TeV_SignalRegion_jesDOWN_CHS.txt', 'DibosonBoostedElMuSamples13TeV.txt', 'myControlPlots.C', 'controlplotvars_CHS.h']
-
-
-# Get date and time for output directory
-## ADD "test" IN OUTPUT FOLDER IF YOU ARE TESTING SO THAT LATER YOU REMEMBER TO WHICH DIRECTORY YOU HAVE TO REMOVE FROM EOS
-if TestRun:
- outputFolder = "/store/user/rasharma/ThirdStep_Distributions/"+OUTDIR+'/'+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M')+"_TEST/";
- OutputLogPath = "Logs/"+JobName+'/' + datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M') + "_TEST";
-else:
- outputFolder = "/store/user/rasharma/ThirdStep_Distributions/"+OUTDIR+'/'+datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M');
- OutputLogPath = "Logs/"+JobName+'/' + datetime.datetime.now().strftime('%Y_%m_%d_%Hh%M');
-
-
-print "Name of output dir: ",outputFolder
-# create a directory on eos
-os.system('xrdfs root://cmseos.fnal.gov/ mkdir ' + outputFolder)
-# create directory in pwd for log files
-os.system('mkdir -p ' + OutputLogPath)
-
-# Function to create a tar file
-def make_tarfile(output_filename, source_dir):
- with tarfile.open(output_filename, "w:gz") as tar:
- tar.add(source_dir, arcname=os.path.basename(source_dir))
-
-# Get CMSSW directory path and name
-cmsswDirPath = commands.getstatusoutput('echo ${CMSSW_BASE}')
-CMSSWRel = os.path.basename(cmsswDirPath[1])
-
-print "CMSSW release used : ",CMSSWRel
-
-mWW = [450]
-
-for mass in mWW:
-
- os.system("sed 's/0, 2400, 8/"+str(mass)+", 2400, 8/g' controlplotvars_CHS_Limit.h.condor > controlplotvars_CHS_Limit.h")
- print "\n\n","--"*20,"\n\n"
- os.system("cat controlplotvars_CHS_Limit.h")
- print "\n\n","--"*20,"\n\n"
- os.system("cp DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt.condor DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt")
- with open("DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt", "a") as myfile:
- myfile.write('"mass_lvj_type0>'+str(mass)+'"\t"(mass_lvj_type0>'+str(mass)+')"');
- os.system("cat DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt")
- print "\n\n","--"*20,"\n\n"
- os.system('xrdfs root://cmseos.fnal.gov/ mkdir ' + outputFolder + '/mWW_'+str(mass))
- os.system('mkdir -p ' + OutputLogPath+'/mWW_'+str(mass))
-
-
- # create tarball of present working CMSSW base directory
- os.system('rm CMSSW*.tgz')
- make_tarfile(CMSSWRel+".tgz", cmsswDirPath[1])
-
- # send the created tarball to eos
- os.system('xrdcp -f ' + CMSSWRel+".tgz" + ' root://cmseos.fnal.gov/'+outputFolder+ '/mWW_'+str(mass)+"/" + CMSSWRel+".tgz")
- os.system('xrdcp -f DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt root://cmseos.fnal.gov/'+outputFolder+ '/mWW_'+str(mass)+"/")
-
- os.system('git diff myControlPlots.C > git_diff.patch')
- os.system('git diff DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt >> git_diff.patch')
- os.system('git diff controlplotvars_CHS_Limit.h >> git_diff.patch')
- os.system('git diff RunMacro_Limits_Templet.C >> git_diff.patch')
- os.system('git diff DibosonBoostedElMuSamples13TeV.txt >> git_diff.patch')
-
- os.system('xrdcp -f git_diff.patch root://cmseos.fnal.gov/'+outputFolder+ '/mWW_'+str(mass)+'/git_diff.patch')
-
- outJDL = open("runstep2condor.jdl","w");
-
-
- outJDL.write("Executable = runstep2condor.sh\n");
- outJDL.write("Universe = vanilla\n");
- #outJDL.write("Requirements =FileSystemDomain==\"fnal.gov\" && Arch==\"X86_64\"");
- outJDL.write("Notification = ERROR\n");
- outJDL.write("Should_Transfer_Files = YES\n");
- outJDL.write("WhenToTransferOutput = ON_EXIT\n");
- #outJDL.write("include : list-infiles.sh |\n");
- #outJDL.write("Transfer_Input_Files = "+inputlist+"\n");
- outJDL.write("x509userproxy = $ENV(X509_USER_PROXY)\n");
-
- outJDL.write("Output = "+OutputLogPath+ '/mWW_'+str(mass)+"/"+JobName+".stdout\n");
- outJDL.write("Error = "+OutputLogPath+ '/mWW_'+str(mass)+"/"+JobName+".stdout\n");
- outJDL.write("Queue\n");
-
- outJDL.close();
-
-
- command = "python Limit_Script.py"
-
- outScript = open("runstep2condor.sh","w");
- outScript.write('#!/bin/bash');
- outScript.write("\n"+'echo "Starting job on " `date`');
- outScript.write("\n"+'echo "Running on: `uname -a`"');
- outScript.write("\n"+'echo "System software: `cat /etc/redhat-release`"');
- outScript.write("\n"+'source /cvmfs/cms.cern.ch/cmsset_default.sh');
- outScript.write("\n"+'### copy the input root files if they are needed only if you require local reading');
- outScript.write("\n"+'xrdcp -f root://cmseos.fnal.gov/'+outputFolder+ '/mWW_'+str(mass)+"/" + CMSSWRel+".tgz .");
- outScript.write("\n"+'tar -xf '+ CMSSWRel +'.tgz' );
- outScript.write("\n"+'rm '+ CMSSWRel +'.tgz' );
- outScript.write("\n"+'cd ' + CMSSWRel + '/src/PlottingCodes/ControlPlots' );
- outScript.write('\n'+' xrdcp -f root://cmseos.fnal.gov/'+outputFolder+ '/mWW_'+str(mass)+"/DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt .");
- outScript.write('\n'+'cat DibosonBoostedElMuCuts13TeV_SignalRegion_CHS.txt');
- outScript.write("\n"+'echo "====> PWD: " ');
- outScript.write("\n"+'pwd');
- outScript.write("\n"+'echo "====> List files : " ');
- outScript.write("\n"+'ls');
- outScript.write("\n"+'rm OutDir/*');
- outScript.write("\n"+'echo "============================================" ');
- outScript.write("\n"+'echo "====> List output files : " ');
- outScript.write("\n"+'ls OutDir/');
- outScript.write("\n"+'echo "============================================" ');
- outScript.write("\n"+'scramv1 b ProjectRename');
- outScript.write("\n"+'eval `scram runtime -sh`');
- outScript.write("\n"+command);
- outScript.write("\n"+'echo "====> List output files : " ');
- outScript.write("\n"+'ls OutDir/');
- outScript.write("\n"+'echo "xrdcp output for condor"');
- outScript.write("\n"+'echo "====> xrdcp -f combine_limit.root root://cmseos.fnal.gov/'+outputFolder+ '/mWW_'+str(mass)+'/"');
- outScript.write("\n"+'xrdcp -f combine_limit.root root://cmseos.fnal.gov/'+outputFolder+ '/mWW_'+str(mass)+'/combine_limit_'+str(mass)+'.root');
- outScript.write("\n"+'for FILE in OutDir/*');
- outScript.write("\n"+'do');
- outScript.write("\n"+'\techo "xrdcp -r -f ${FILE} root://cmseos.fnal.gov/'+outputFolder+ '/mWW_'+str(mass)+'/"');
- outScript.write("\n"+'\txrdcp -r -f ${FILE} root://cmseos.fnal.gov/'+outputFolder+ '/mWW_'+str(mass)+'/ 2>&1');
- outScript.write("\n"+'done');
- for files in CopyFiles:
- outScript.write("\n"+'xrdcp -f '+files+' root://cmseos.fnal.gov/'+outputFolder+ '/mWW_'+str(mass)+'/');
- outScript.write("\n"+'cd ${_CONDOR_SCRATCH_DIR}');
- outScript.write("\n"+'rm -rf ' + CMSSWRel);
- outScript.write("\n");
- outScript.close();
- os.system("chmod 777 runstep2condor.sh");
-
- print "===> Set Proxy Using:";
- print "\tvoms-proxy-init --voms cms --valid 168:00";
- print "\"condor_submit runstep2condor.jdl\" to submit";
- os.system("condor_submit runstep2condor.jdl")
diff --git a/ControlPlots/addWeightBranch.C b/ControlPlots/addWeightBranch.C
new file mode 100644
index 0000000..feb2aab
--- /dev/null
+++ b/ControlPlots/addWeightBranch.C
@@ -0,0 +1,99 @@
+#include
+#include
+#include
+#include
+
+void addWeightBranch(const char *filename = "/eos/user/a/avijay/HZZ_mergedrootfiles/drellyan_ptz_0to50.root")
+{
+ // Open the ROOT file
+ TFile* file = TFile::Open(filename, "UPDATE");
+ if (!file || file->IsZombie()) {
+ std::cerr << "Error opening file!" << std::endl;
+ return;
+ }
+
+ // Get the tree from the file
+ TTree* tree = dynamic_cast(file->Get("Events"));
+ if (!tree) {
+ std::cerr << "Tree not found!" << std::endl;
+ file->Close();
+ return;
+ }
+
+ // Create a variable to hold the weight and the number of jets
+ Float_t weight;
+ Int_t nJets;
+ Bool_t isELE; // Branch name "HZZ2l2qNu_isELE"
+
+ // Create a new branch for the weight
+ TBranch* weightBranch = tree->Branch("Weight_nJets_FromDataMC_ge1jet", &weight, "Weight_nJets_FromDataMC_ge1jet/F");
+
+ // Assume there is already a branch named "nJets" which holds the number of jets in each event
+ tree->SetBranchAddress("HZZ2l2qNu_nJets", &nJets);
+ tree->SetBranchAddress("HZZ2l2qNu_isELE", &isELE);
+
+ // Loop over all entries in the tree
+ Long64_t nEntries = tree->GetEntries();
+ for (Long64_t i = 0; i < nEntries; ++i) {
+ tree->GetEntry(i);
+
+ // if (i>500) break;
+
+ // Assign weights based on the number of jets
+ if (isELE) {
+ if (nJets == 1) weight = 0.8824074;
+ else if (nJets == 2) weight = 0.68684125;
+ else if (nJets == 3) weight = 0.76812147;
+ else if (nJets == 4) weight = 0.91860612;
+ else if (nJets == 5) weight = 1.10500528;
+ else if (nJets == 6) weight = 1.31654433;
+ else if (nJets == 7) weight = 1.64961608;
+ else if (nJets == 8) weight = 2.37517279;
+ else if (nJets >= 9) weight = 10.7921858 ;
+ else weight = 1.0; // Default weight for other cases (e.g., nJets < 2)
+ } // for ge1jet
+ /*if (isELE) {
+ if (nJets == 2) weight = 0.6134163135791069;
+ else if (nJets == 3) weight = 0.6998911097413478;
+ else if (nJets == 4) weight = 0.8684340959074924;
+ else if (nJets == 5) weight = 0.9863043200514038;
+ else if (nJets == 6) weight = 1.1559435285279487;
+ else if (nJets == 7) weight = 1.7876879342877086;
+ else if (nJets == 8) weight = 1.3072115933482635;
+ else if (nJets >= 9) weight = 0.758184751731264;
+ else weight = 1.0; // Default weight for other cases (e.g., nJets < 2)
+ }*/ // for VBF
+ else
+ {
+ if (nJets == 1) weight = 0.949076302;
+ else if (nJets == 2) weight = 0.733207624;
+ else if (nJets == 3) weight = 0.816821098;
+ else if (nJets == 4) weight = 0.990226448;
+ else if (nJets == 5) weight = 1.183387309;
+ else if (nJets == 6) weight = 1.422906636;
+ else if (nJets == 7) weight = 1.813024674;
+ else if (nJets == 8) weight = 1.25945774;
+ else if (nJets >= 9) weight = 1.796557795;
+ else weight = 1.0; // Default weight for other cases (e.g., nJets < 2)
+ } // for ge1jet
+ /*
+ {
+ if (nJets == 2) weight = 0.6482485565055438;
+ else if (nJets == 3) weight = 0.744610505216653;
+ else if (nJets == 4) weight = 0.9354411582643493;
+ else if (nJets == 5) weight = 1.1315308433742537;
+ else if (nJets == 6) weight = 1.2286138112624483;
+ else if (nJets == 7) weight = 1.7392576081209716;
+ else if (nJets == 8) weight = 1.585752698779711;
+ else if (nJets >= 9) weight = 2.970844765079073;
+ else weight = 1.0; // Default weight for other cases (e.g., nJets < 2)
+ }*/ //for VBF
+
+ // Fill the new branch with the computed weight
+ weightBranch->Fill();
+ }
+
+ // Write the changes to the file
+ tree->Write("", TObject::kOverwrite); // Overwrite the old tree
+ file->Close();
+}
diff --git a/ControlPlots/backupgit.cron b/ControlPlots/backupgit.cron
new file mode 100755
index 0000000..1123234
--- /dev/null
+++ b/ControlPlots/backupgit.cron
@@ -0,0 +1,3 @@
+git -C /afs/cern.ch/user/r/rasharma/work/nanoAODToolDev_H4l/plotting/ControlPlots/ControlPlots add .
+git -C /afs/cern.ch/user/r/rasharma/work/nanoAODToolDev_H4l/plotting/ControlPlots/ControlPlots commit -m "Updated CSV using cron jobs"
+git -C /afs/cern.ch/user/r/rasharma/work/nanoAODToolDev_H4l/plotting/ControlPlots/ControlPlots push origin Anusreevijay769-dev_HZZ_2l2q
diff --git a/ControlPlots/controlplotvars_CHS.h b/ControlPlots/controlplotvars_CHS.h
index 0cb2071..1786adb 100644
--- a/ControlPlots/controlplotvars_CHS.h
+++ b/ControlPlots/controlplotvars_CHS.h
@@ -3,140 +3,37 @@
#include "plotvar_t.h"
-const plotVar_t commonplotvars_chs[] = {
-//// plotvar MINRange MAXRange NBINS slog xlabel outfile AMINRange AMAXRange ANBINS drawleg
-////
-// { "nPV", 0, 50, 50, 1, "Number of primary vertices", "nPV", 0, 50, 50, 1},
-//------------ LEPTONS -------------------
-
-// { "l_pt1", 0, 390, 26, 3, "Lepton p_{T} (GeV)", "lepton_pt", 0, 390, 26, 1 },
-// { "l_eta1", -2.5, 2.5, 8, 1, "Lepton #eta", "lepton_eta", -2.5, 2.5, 8, 0 },
-// { "l_iso1", 0, 3.0, 15, 2, "Lepton isolation", "l_iso1", 0, 3.0, 15, 1},
-// { "l_phi1", -4.5, 4.5, 8, 6, "Lepton #phi", "lepton_phi", -4.5, 4.5, 8, 0 },
-// { "l_e1", 0, 500, 8, 3, "Lepton Energy", "lepton_e", 0, 500, 8, 0 },
-// { "l_charge1", -2, 2, 4, 1, "Lepton charge", "lepton_charge", -2.0, 2.0, 4, 0 },
-//
-////-------------- MET -------------------
-// { "pfMET_Corr", 0.0, 500, 20, 3, "pf MET (GeV)", "pfMET_Corr", 0.0, 500, 20, 0 },
-// { "pfMET_Corr_phi", -3.5, 3.5, 20, 6, "pf MET #phi", "pfMET_Corr_phi",-3.5, 3.5, 20, 0 },
-// //{ "nu_pz_type0", -500, 500, 25, 3, "Reconstructed Neutrino p_{Z}", "nu_pz_type0", -500, 500, 25, 1},
-//
-////-------------- AK8 Jet ------------
-// { "nGoodPuppiAK8jets", 0, 10, 10, 3, "Number of Good AK8 jets", "nGoodPuppiAK8jets", 0, 10, 10, 1 },
-// { "ungroomed_PuppiAK8_jet_pt", 200, 1200, 20, 3, "AK8 p_{T} (GeV)", "ungroomed_PuppiAK8_jet_pt", 200, 1200, 20, 1 },
-// { "ungroomed_PuppiAK8_jet_eta", -2.4, 2.4, 12, 1, "AK8 #eta", "ungroomed_PuppiAK8_jet_eta", -2.4, 2.4, 12, 0},
-// { "ungroomed_PuppiAK8_jet_phi", -3.4, 3.4, 12, 6, "AK8 #phi", "ungroomed_PuppiAK8_jet_phi", -3.4, 3.4, 12, 0},
-// { "ungroomed_PuppiAK8_jet_e", 0.0, 1000.0, 12, 3, "AK8 Energy", "ungroomed_PuppiAK8_jet_e", 0.0, 1000.0, 12, 0},
-//// { "ungroomed_PuppiAK8_jet_charge", -1.0, 1.0, 12, 1, "AK8 charge", "ungroomed_PuppiAK8_jet_charge", -1.0, 1.0, 12, 0},
-////// { "PuppiAK8_jet_mass", 40, 150, 11, 3, "AK8 mass (GeV)", "AK8_mass", 40.0, 150, 11, 1},
-////// { "PuppiAK8_jet_mass_pr", 40, 150, 11, 3, "AK8 pruned mass (GeV)", "AK8_mass_pr", 40.0, 150, 11, 1},
-// //{ "PuppiAK8_jet_mass_so_corr", 65, 105, 13, 3, "AK8 Softdrop mass (GeV)", "AK8_mass_so_LSB", 65, 105, 13, 1},
-// { "PuppiAK8_jet_mass_so_corr", 40, 150, 22, 3, "AK8 Softdrop mass (GeV)", "AK8_mass_so_22bin", 40.0, 150, 22, 1},
-// { "PuppiAK8_jet_mass_so_corr", 40, 150, 11, 3, "AK8 Softdrop mass (GeV)", "AK8_mass_so_11bin", 40.0, 150, 11, 1},
-////// { "PuppiAK8_jet_mass_tr", 40, 150, 11, 3, "AK8 tr mass (GeV)", "AK8_mass_tr", 40.0, 150, 11, 1},
-////// { "PuppiAK8_jet_mass", 65, 105, 5, 3, "AK8 mass (GeV)", "AK8_mass", 65, 105, 5, 1},
-////// { "PuppiAK8_jet_mass_pr", 65, 105, 5, 3, "AK8 pruned mass (GeV)", "AK8_mass_pr", 65, 105, 5, 1},
-////// { "PuppiAK8_jet_mass_tr", 65, 105, 5, 3, "AK8 tr mass (GeV)", "AK8_mass_tr", 65, 105, 5, 1},
-//// { "PuppiAK8_jet_sj1_pt", 0, 800, 25, 3, "AK8 SJ1 pT (GeV)", "PuppiAK8_jet_sj1_pt", 0, 800, 25, 1},
-//// { "PuppiAK8_jet_sj1_eta", -2.4, 2.4, 25, 1, "AK8 SJ1 #eta", "PuppiAK8_jet_sj1_eta", -2.4, 2.4, 25, 1},
-//// { "PuppiAK8_jet_sj1_phi", -3, 3, 25, 6, "AK8 SJ1 #phi", "PuppiAK8_jet_sj1_phi", -3, 3, 25, 1},
-//// { "PuppiAK8_jet_sj1_m", 0, 90, 25, 3, "AK8 SJ1 mass (GeV)", "PuppiAK8_jet_sj1_m", 0, 90, 25, 1},
-//// { "PuppiAK8_jet_sj1_q", -1, 1, 25, 1, "AK8 SJ1 charge", "PuppiAK8_jet_sj1_q", -1, 1, 25, 1},
-//// { "PuppiAK8_jet_sj2_pt", 0, 400, 25, 3, "AK8 SJ2 pT (GeV)", "PuppiAK8_jet_sj2_pt", 0, 400, 25, 1},
-//// { "PuppiAK8_jet_sj2_eta", -2.4, 2.4, 25, 1, "AK8 SJ2 #eta", "PuppiAK8_jet_sj2_eta", -2.4, 2.4, 25, 1},
-//// { "PuppiAK8_jet_sj2_phi", -3, 3, 25, 6, "AK8 SJ2 #phi", "PuppiAK8_jet_sj2_phi", -3, 3, 25, 1},
-//// { "PuppiAK8_jet_sj2_m", 0, 150, 25, 3, "AK8 SJ2 mass (GeV)", "PuppiAK8_jet_sj2_m", 0, 150, 25, 1},
-//// { "PuppiAK8_jet_sj2_q", -1, 1, 25, 1, "AK8 SJ2 charge", "PuppiAK8_jet_sj2_q", -1, 1, 25, 1},
-//// { "PuppiAK8_jet_sj1_q*PuppiAK8_jet_sj2_q", -20, 20, 25, 1, "AK8 (SJ1_q #times SJ2_q)", "PuppiAK8_SJ1J2_chargeMultiplication", -20, 20, 25, 1},
-////// { "PuppiAK8jet_qjet", 0, 2, 20, 1, "PuppiAK8jet_qjet", "PuppiAK8jet_qjet", 0, 2, 20, 1},
-// { "PuppiAK8_jet_tau2tau1", 0, 0.55, 10, 1, "AK8 #tau_{2}/#tau_{1}", "Puppi_AK8_jet_tau2tau1",0,0.55,10,0},
-//
-//
-////-------------- VBF Jet ------------
-// { "njets", 0, 10, 10, 1, "Number of VBF jets", "njets", 0, 10, 10, 1},
-// { "nBTagJet_loose", 0, 6, 6, 1, "number of VBF jets (Loose b-tag)", "nBTagJet_loose", 0, 6, 6, 1},
-// { "nBTagJet_medium", 0, 6, 6, 1, "number of VBF jets (medium b-tag)", "nBTagJet_medium", 0, 6, 6, 1},
-// { "vbf_maxpt_j1_eta", -5.0, 5.0, 20, 1, "Leading VBF Jet #eta", "vbf_maxpt_j1_eta", -5.0, 5.0, 20, 0},
-// { "vbf_maxpt_j2_eta", -5.0, 5.0, 20, 1, "Sub-Leading VBF Jet #eta", "vbf_maxpt_j2_eta", -5.0, 5.0, 20, 0},
-// { "vbf_maxpt_j2_pt", 30,330, 12, 3, "Sub-Leading VBF Jet p_{T}", "vbf_maxpt_j2_pt", 30,330,12,0 },
-// { "vbf_maxpt_j1_pt", 30, 630, 24, 3, "Leading VBF Jet p_{T}", "vbf_maxpt_j1_pt", 30,630,24,1 },
-// { "vbf_maxpt_jj_m", 500, 2500, 20, 3, "VBF M_{jj} GeV", "vbf_maxpt_jj_m", 500, 2500, 20, 1},
-// { "vbf_maxpt_jj_Deta", 0.0, 9, 18, 1, "VBF #Delta #eta", "vbf_maxpt_jj_Deta", 0.0,9, 18, 1 },
-//
-//
-////---------------- 4 body mass ---------------
-{ "mass_lvj_type0_PuppiAK8", 600, 2500, 4, 3, "M_{WW} (GeV)", "mass_lvj_type0_PuppiAK8_4bin", 600, 2500, 4, 1},
-// //{ "mt_lvj_type0_PuppiAK8", 600, 2500, 4, 3, "MT_{WW} (GeV)", "mt_lvj_type0_PuppiAK8_4bin", 600, 2500, 4, 1},
-// //{ "mass_lvj_type0_PuppiAK8", 600, 2500, 38, 3, "M_{WW} (GeV)", "mass_lvj_type0_PuppiAK8_38bin", 600, 2500, 38, 1},
-// //{ "mt_lvj_type0_PuppiAK8", 600, 2500, 38, 3, "MT_{WW} (GeV)", "mt_lvj_type0_PuppiAK8_38bin", 600, 2500, 38, 1},
-// { "mass_lvj_type0_PuppiAK8", 600, 2500, 19, 3, "M_{WW} (GeV)", "mass_lvj_type0_PuppiAK8_19bin", 600, 2500, 19, 1},
-// { "mt_lvj_type0_PuppiAK8", 600, 2500, 19, 3, "MT_{WW} (GeV)", "mt_lvj_type0_PuppiAK8_19bin", 600, 2500, 19, 1},
-// { "mass_lvj_type0_PuppiAK8", 600, 2500, 38, 3, "M_{WW} (GeV)", "mass_lvj_type0_PuppiAK8_38bin", 600, 2500, 38, 1},
-// { "mass_lvj_type0_PuppiAK8", 0.0, 2500, 50, 3, "M_{WW} (GeV)", "mass_lvj_type0_PuppiAK8_38bin", 0.0, 2500, 50, 1},
-////
-////////// Leptonic & Hadronic W-boson
-// { "v_pt_type0", 0, 800, 16, 3, "W p_{T} (GeV)", "v_pt", 0, 800, 16, 1 },
-// { "v_mt_type0", 0, 400, 8, 3, "W Transverse Mass (GeV)", "v_mt", 0, 400, 8, 0 },
-////
-//////---------- Other Variables ------------------------
-////
-// { "deltaR_lPuppiak8jet", 0, 7.0, 20, 1, "#Delta R(l,AK8 jet)", "deltaR_lPuppiak8jet", 0, 7.0, 20, 1},
-// { "deltaphi_METPuppiak8jet", 0, 3.14, 15, 1, "#Delta #phi(pfMET,AK8 jet)", "deltaphi_METPuppiak8jet", 0, 3.14, 15, 1},
-// { "deltaphi_METvbfJ1", 0, 3.14, 15, 1, "#Delta #phi(pfMET,jet1)", "deltaphi_METvbfJ1", 0, 3.14, 15, 1},
-// { "deltaphi_METvbfJ2", 0, 3.14, 15, 1, "#Delta #phi(pfMET,jet2)", "deltaphi_METvbfJ2", 0, 3.14, 15, 1},
-// { "deltaphi_METmin", 0, 3.14, 15, 1, "#Delta #phi(pfMET,jets)_{min}", "deltaphi_METmin", 0, 3.14, 15, 1},
-// { "deltaphi_VPuppiak8jet",0, 3.14, 15, 1, "#Delta #phi(Leptonic W,AK8 jet)", "deltaphi_VPuppiak8jet", 0, 3.14, 15, 1},
-// { "(ungroomed_PuppiAK8_jet_pt-l_pt1)/pfMET_Corr", 0, 10, 40, 1, "(AK8 p_{T} - Lepton p_{T})/pfMET", "AK8minusLeptonptByMet", 0, 10, 40, 1 },
-// { "vbf_maxpt_j2_pt/pfMET_Corr", 0, 5, 20, 1, "Sub-leading VBF p_{T}/pfMET", "SubLeadingVBFptByMet", 0, 5, 20, 1 },
-// { "vbf_maxpt_j1_pt/pfMET_Corr", 0, 15, 20, 1, "Leading VBF p_{T}/pfMET", "LeadingVBFptByMet", 0, 15, 20, 1 },
-// { "(vbf_maxpt_j1_pt+vbf_maxpt_j2_pt+ungroomed_PuppiAK8_jet_pt+l_pt1)/pfMET_Corr", 0, 30, 20, 1, "H_{T}/pfMET", "HTByMET", 0, 30, 20, 1 },
-// { "BDT_response", -1.0,1.0,20,1, "BDT Response", "BDT_response", -1.0, 1.0, 20, 1},
-// { "PuppiAK8jet_e3_sdb1/(PuppiAK8jet_e2_sdb1*PuppiAK8jet_e2_sdb1*PuppiAK8jet_e2_sdb1)", 0.05,3.5,25, 1, "D2", "d2_ECF", 0.05,3.5,25, 1},
-// { "PuppiAK8jet_e3_v2_sdb1/(PuppiAK8jet_e2_sdb1*PuppiAK8jet_e2_sdb1)", 0.00,0.5,25, 1, "N2", "n2_ECF", 0.00,0.5,25, 1},
-// { "l_pt1+ungroomed_PuppiAK8_jet_pt+vbf_maxpt_j1_pt+vbf_maxpt_j2_pt", 0, 1500, 15, 3, "HT", "ht", 0, 1500, 15, 1},
-//
-//
-// { "PtBalance_type0", 0, 1.0, 10, 1, "p_{T} Balance", "PtBalance_type0", 0, 1.0, 10, 1 },
-// { "BosonCentrality_type0", 1, 4.0, 10, 1, "Boson Centrality", "BosonCentrality_type0",1, 4.0, 10, 1 },
-////
-////// Angular variables
-//// //{ "LeptonProjection_run2", 0, 2, 10, 1, "LeptonProjection_run2" , "LeptonProjection_run2" ,0, 2, 10, 1},
-//// //{ "LeptonProjection_type2", 0, 2, 10, 1, "LeptonProjection_type2" , "LeptonProjection_type2" ,0, 2, 10, 1},
-//// { "LeptonProjection_type0", 0, 2, 10, 1, "Lepton Projection" , "LeptonProjection_type0" ,0, 2, 10, 1},
-//// //{ "ZeppenfeldWL_run2", -5, 5, 10, 1, "ZeppenfeldWL_run2" , "ZeppenfeldWL_run2" , -5, 5, 10, 0},
-//// //{ "ZeppenfeldWL_type2", -5, 5, 10, 1, "ZeppenfeldWL_type2" , "ZeppenfeldWL_type2" , -5, 5, 10, 0},
-//// { "ZeppenfeldWL_type0", -4, 4, 10, 1, "Zeppenfeld (with leptonic W)" , "ZeppenfeldWL_type0" , -4, 4, 10, 0},
-//// { "ZeppenfeldWH", -4, 4, 10, 1, "Zeppenfeld (with hadronic W)" , "ZeppenfeldWH" , -4, 4, 10, 0},
-// { "ZeppenfeldWL_type0/vbf_maxpt_jj_Deta", -0.3, 0.3, 10, 1, "ZeppenfeldWL/#Delta #eta jj" , "ZeppenfeldWL_type0_new" , -0.3, 0.3, 10, 1},
-// { "ZeppenfeldWH/vbf_maxpt_jj_Deta", -0.3, 0.3, 10, 1, "ZeppenfeldWH/#Delta #eta jj" , "ZeppenfeldWH_new" , -0.3, 0.3, 10, 1},
-//// //{ "RpT_run2", 0, 80, 10, 1, "RpT_run2" , "RpT_run2" , 0, 80, 10, 1},
-//// //{ "RpT_type2", 0, 80, 10, 1, "RpT_type2" , "RpT_type2", 0, 80, 10, 1},
-//// { "RpT_type0", 0, 80, 10, 1, "RpT" , "RpT_type0", 0, 80, 10, 1},
-//// { "WWRapidity", -2.5, 2.5, 10, 1, "WW Rapidity" , "TempWWRapidity" , -2.5, 2.5, 10, 0},
-// //{ "VBSCentrality_run2", 0, 3, 10, 1, "VBSCentrality_run2" , "VBSCentrality_run2" , 0, 3, 10, 1},
-// //{ "VBSCentrality_type2", 0, 3, 10, 1, "VBSCentrality_type2" , "VBSCentrality_type2" , 0, 3, 10, 1},
-// { "VBSCentrality_type0", 0, 3, 10, 1, "VBSCentrality" , "VBSCentrality_type0" , 0, 3, 10, 1},
-// //{ "costhetastar_run2", -1,1, 10, 1, "costhetastar_run2" , "costhetastar_run2" ,-1,1, 10, 1},
-// //{ "costhetastar_type2", -1,1, 10, 1, "costhetastar_type2" , "costhetastar_type2" ,-1,1, 10, 1},
-// { "costhetastar_type0", -1,1, 10, 6, "costhetastar" , "costhetastar_type0" ,-1,1, 10, 1},
-// //{ "costheta1_run2", -1,1, 10, 1, "costheta1_run2" , "costheta1_run2" ,-1,1, 10, 0},
-// //{ "costheta1_type2", -1,1, 10, 1, "costheta1_type2" , "costheta1_type2" ,-1,1, 10, 0},
-// { "costheta1_type0", -1,1, 10, 6, "costheta1" , "costheta1_type0" ,-1,1, 10, 0},
-// //{ "costheta2_run2", -1,1, 10, 6, "costheta2_run2" , "costheta2_run2" ,-1,1, 10, 0},
-// //{ "costheta2_type2", -1,1, 10, 6, "costheta2_type2" , "costheta2_type2" ,-1,1, 10, 0},
-// { "costheta2_type0", -1,1, 10, 6, "costheta2" , "costheta2_type0" ,-1,1, 10, 0},
-// //{ "phi_run2", -3.5, 3.5, 20, 6, "phi_run2" , "phi_run2" , -3.5, 3.5, 20, 0},
-// //{ "phi_type2", -3.5, 3.5, 20, 6, "phi_type2" , "phi_type2" , -3.5, 3.5, 20, 0},
-// { "phi_type0", -3.5, 3.5, 20, 6, "phi" , "phi_type0" , -3.5, 3.5, 20, 0},
-// //{ "phi1_run2", -3.5, 3.5, 20, 6, "phi1_run2" , "phi1_run2" , -3.5, 3.5, 20, 0},
-// //{ "phi1_type2", -3.5, 3.5, 20, 6, "phi1_type2" , "phi1_type2" , -3.5, 3.5, 20, 0},
-// { "phi1_type0", -3.5, 3.5, 20, 6, "phi1" , "phi1_type0" , -3.5, 3.5, 20, 0},
-// { "ungroomed_PuppiAK8_jet_pt/pfMET_Corr", 0, 15, 15, 3, "AK8 p_{T}/pfMET", "AK8ptByMet", 0, 15, 15, 1 },
-// { "l_pt1/pfMET_Corr", 0, 10, 20, 1, "Lepton p_{T}/pfMET", "LeptonptByMet", 0, 10, 20, 1 },
-// { "pfMET_Corr/(sqrt(vbf_maxpt_j1_pt+vbf_maxpt_j2_pt+ungroomed_PuppiAK8_jet_pt+l_pt1))", 0, 24, 12, 3, "s = E_{T}^{miss}/#sqrt{#sum E_{T}}", "s_dist", 0, 24, 12, 1 },
-
- { "", 0.0,0.0,0,0,"","",0.,0.,0,0 }
-};
+const plotVar_t controlplotvars_CHS[] = {
+ // plotvar MINRange MAXRange NBINS slog xlabel outfile AMINRange AMAXRange ANBINS drawleg
+ //
+ {"PV_npvsGood", 0, 100, 100, 1, "Number of good primary vertices", "PV_npvsGood", 0, 100, 100, 1},
+ {"massZ1", 0, 200, 50, 1, "Z_{ll} (GeV/C2)", "massZ1", 0, 200, 50, 1},
+ {"pTZ1", 0, 500, 20, 1, "Z_{ll} p_{T} (GeV/c)", "pTZ1", 0, 500, 20, 1},
+ {"etaZ1", -2.4, 2.4, 12, 1, "Z_{ll} #eta", "etaZ1", -2.4, 2.4, 12, 1},
+ {"phiZ1", -3.14, 3.14, 12, 6, "Z_{ll} #phi", "phiZ1", -3.14, 3.14, 12, 1},
+ {"pTL1", 0, 200, 26, 1, "Lepton1 (GeV/c)", "pTL1", 0, 200, 26, 1},
+ {"etaL1", -2.5, 2.5, 8, 1, "Lepton1 #eta", "etaL1", -2.5, 2.5, 8, 0},
+ {"phiL1", -3.14, 3.14, 8, 6, "Lepton1 #phi", "phiL1", -3.14, 3.14, 8, 0},
+ {"pTL2", 0, 120, 26, 1, "Lepton2 (GeV/c)", "pTL2", 0, 120, 26, 1},
+ {"etaL2", -2.5, 2.5, 8, 1, "Lepton2 #eta", "etaL2", -2.5, 2.5, 8, 0},
+ {"phiL2", -3.14, 3.14, 8, 6, "Lepton2 #phi", "phiL2", -3.14, 3.14, 8, 0},
+ {"MET_pt", 0, 2000, 80, 1, "MET_pt (GeV)", "MET_pt", 0, 2000, 80, 1},
+ {"MET_phi", -3.14, 3.14, 12, 6, "MET_phi", "MET_phi", -3.14, 3.14, 12, 1},
+ {"MET_sumEt", 0, 6000, 20, 1, "MET_sumEt (GeV)", "MET_sumEt", 0, 6000, 20, 1},
+ {"PuppiMET_pt", 0, 2000, 20, 1, "PuppiMET_pt (GeV)", "PuppiMET_pt", 0, 2000, 80, 1},
+ {"PuppiMET_phi", -3.14, 3.14, 12, 6, "PuppiMET_phi", "PuppiMET_phi", -3.14, 3.14, 12, 1},
+ {"PuppiMET_sumEt", 0, 6000, 20, 1, "PuppiMET_sumEt (GeV)", "PuppiMET_sumEt", 0, 6000, 20, 1},
+ {"HZZ2l2nu_ZZmT", 0, 1000, 20, 1, "HZZ2l2nu_ZZmT (GeV)", "HZZ2l2nu_ZZmT", 0, 1000, 20, 1},
+ {"HZZ2l2nu_ZZpT", 0, 1000, 20, 1, "HZZ2l2nu_ZZpT (GeV)", "HZZ2l2nu_ZZpT", 0, 1000, 20, 1},
+ {"HZZ2l2qNu_nJets", 0, 10, 10, 1, "HZZ2l2qNu_nJets", "HZZ2l2qNu_nJets", 0, 10, 10, 1},
+ {"HZZ2l2qNu_nTightBtagJets", 0, 10, 10, 1, "HZZ2l2qNu_nTightBtagJets", "HZZ2l2qNu_nTightBtagJets", 0, 10, 10, 1},
+ {"HZZ2l2qNu_nMediumBtagJets", 0, 10, 10, 1, "HZZ2l2qNu_nMediumBtagJets", "HZZ2l2qNu_nMediumBtagJets", 0, 10, 10, 1},
+ {"HZZ2l2qNu_nLooseBtagJets", 0, 10, 10, 1, "HZZ2l2qNu_nLooseBtagJets", "HZZ2l2qNu_nLooseBtagJets", 0, 10, 10, 1},
+ {"HZZ2l2nu_ifVBF", 0, 2, 2, 1, "HZZ2l2nu_ifVBF", "HZZ2l2nu_ifVBF", 0, 2, 2, 1},
+ {"HZZ2l2qNu_isELE", 0, 2, 2, 1, "HZZ2l2qNu_isELE", "HZZ2l2qNu_isELE", 0, 2, 2, 1},
+ {"HZZ2l2qNu_cutOppositeChargeFlag", 0, 2, 2, 1, "HZZ2l2qNu_cutOppositeChargeFlag", "HZZ2l2qNu_cutOppositeChargeFlag", 0, 2, 2, 1},
+ // don't delete the following line!
+ {"", 0.0, 0.0, 0, 0, "", "", 0., 0., 0, 0}};
#endif // _COMMONCONTROLPLOTVARS_CHS_H
diff --git a/ControlPlots/controlplotvars_CHS_2l2q.h b/ControlPlots/controlplotvars_CHS_2l2q.h
new file mode 100644
index 0000000..ac368a7
--- /dev/null
+++ b/ControlPlots/controlplotvars_CHS_2l2q.h
@@ -0,0 +1,49 @@
+#ifndef _COMMONCONTROLPLOTVARS_CHS_2L2Q_H
+#define _COMMONCONTROLPLOTVARS_CHS_2L2Q_H
+
+#include "plotvar_t.h"
+
+const plotVar_t controlplotvars_CHS_2l2q[] = {
+ // plotvar MINRange MAXRange NBINS slog xlabel outfile AMINRange AMAXRange ANBINS drawleg
+ //
+ {"PV_npvsGood", 0, 100, 100, 1, "Number of good primary vertices", "PV_npvsGood", 0, 100, 100, 1},
+ {"massZ1", 0, 200, 50, 1, "Z_{ll} (GeV/C2)", "massZ1", 0, 200, 50, 1},
+ {"pTZ1", 0, 500, 20, 1, "Z_{ll} p_{T} (GeV/c)", "pTZ1", 0, 500, 20, 1},
+ {"etaZ1", -2.4, 2.4, 12, 1, "Z_{ll} #eta", "etaZ1", -2.4, 2.4, 12, 1},
+ {"phiZ1", -3.14, 3.14, 12, 6, "Z_{ll} #phi", "phiZ1", -3.14, 3.14, 12, 1},
+ {"pTL1", 0, 500, 26, 1, "Lepton1 (GeV/c)", "pTL1", 0, 500, 26, 1},
+ {"etaL1", -2.5, 2.5, 8, 1, "Lepton1 #eta", "etaL1", -2.5, 2.5, 8, 0},
+ {"phiL1", -3.14, 3.14, 8, 6, "Lepton1 #phi", "phiL1", -3.14, 3.14, 8, 0},
+ {"pTL2", 0, 500, 26, 1, "Lepton2 (GeV/c)", "pTL2", 0, 500, 26, 1},
+ {"etaL2", -2.5, 2.5, 8, 1, "Lepton2 #eta", "etaL2", -2.5, 2.5, 8, 0},
+ {"phiL2", -3.14, 3.14, 8, 6, "Lepton2 #phi", "phiL2", -3.14, 3.14, 8, 0},
+ {"MET_pt", 0, 500, 40, 1, "MET_pt (GeV)", "MET_pt", 0, 500, 40, 1},
+ {"MET_phi", -3.14, 3.14, 12, 6, "MET_phi", "MET_phi", -3.14, 3.14, 12, 1},
+ {"MET_sumEt", 0, 6000, 20, 1, "MET_sumEt (GeV)", "MET_sumEt", 0, 6000, 20, 1},
+ {"PuppiMET_pt", 0, 2000, 20, 1, "PuppiMET_pt (GeV)", "PuppiMET_pt", 0, 2000, 80, 1},
+ {"PuppiMET_phi", -3.14, 3.14, 12, 6, "PuppiMET_phi", "PuppiMET_phi", -3.14, 3.14, 12, 1},
+ {"PuppiMET_sumEt", 0, 6000, 20, 1, "PuppiMET_sumEt (GeV)", "PuppiMET_sumEt", 0, 6000, 20, 1},
+ {"massZ2", 0, 200, 50, 1, "Z_{ll} (GeV/C2)", "massZ2", 0, 200, 50, 1},
+ {"pTZ2", 0, 500, 20, 1, "Z_{ll} p_{T} (GeV/c)", "pTZ2", 0, 500, 20, 1},
+ {"etaZ2", -2.4, 2.4, 12, 1, "Z_{ll} #eta", "etaZ2", -2.4, 2.4, 12, 1},
+ {"phiZ2", -3.14, 3.14, 12, 6, "Z_{ll} #phi", "phiZ2", -3.14, 3.14, 12, 1},
+ {"massZ2_2j", 0, 200, 50, 1, "Z_{ll} (GeV/C2)", "massZ2_2j", 0, 200, 50, 1},
+ {"phiZ2_2j", -3.14, 3.14, 12, 6, "Z_{ll} #phi", "phiZ2_2j", -3.14, 3.14, 12, 1},
+ {"etaZ2_2j", -2.4, 2.4, 12, 1, "Z_{ll} #eta", "etaZ2_2j", -2.4, 2.4, 12, 1},
+ {"pTZ2_2j", 0, 500, 20, 1, "Z_{ll} p_{T} (GeV/c)", "pTZ2_2j", 0, 500, 20, 1},
+ {"EneZ2_2j", 0, 500, 20, 1, "Z_{ll} Energy (GeV)", "EneZ2_2j", 0, 500, 20, 1},
+ {"HZZ2l2qNu_nJets", 0, 10, 10, 1, "HZZ2l2qNu_nJets", "HZZ2l2qNu_nJets", 0, 10, 10, 1},
+ {"HZZ2l2qNu_nTightBtagJets", 0, 10, 10, 1, "HZZ2l2qNu_nTightBtagJets", "HZZ2l2qNu_nTightBtagJets", 0, 10, 10, 1},
+ {"HZZ2l2qNu_nMediumBtagJets", 0, 10, 10, 1, "HZZ2l2qNu_nMediumBtagJets", "HZZ2l2qNu_nMediumBtagJets", 0, 10, 10, 1},
+ {"HZZ2l2qNu_nLooseBtagJets", 0, 10, 10, 1, "HZZ2l2qNu_nLooseBtagJets", "HZZ2l2qNu_nLooseBtagJets", 0, 10, 10, 1},
+
+
+ {"pT4l", 0, 500, 20, 1, "ZZ p_{T} (GeV/c)", "pT4l", 0, 500, 20, 1},
+ {"eta4l", -2.5, 2.5, 8, 1, "ZZ #eta", "eta4l", -2.5, 2.5, 8, 0},
+ {"phi4l", -3.14, 3.14, 8, 6, "ZZ #phi", "phi4l", -3.14, 3.14, 8, 0},
+ {"mass4l", 0, 1000, 40, 1, "ZZ mass (GeV/c^{2})", "mass4l", 0, 1000, 40, 1},
+
+ // don't delete the following line!
+ {"", 0.0, 0.0, 0, 0, "", "", 0., 0., 0, 0}};
+
+#endif // _COMMONCONTROLPLOTVARS_CHS_H
diff --git a/ControlPlots/controlplotvars_CHS_2lep.h b/ControlPlots/controlplotvars_CHS_2lep.h
deleted file mode 100644
index faf4e56..0000000
--- a/ControlPlots/controlplotvars_CHS_2lep.h
+++ /dev/null
@@ -1,105 +0,0 @@
-#ifndef _COMMONCONTROLPLOTVARS_CHS_2LEP_H
-#define _COMMONCONTROLPLOTVARS_CHS_2LEP_H
-
-#include "plotvar_t.h"
-
-const plotVar_t controlplotvars_CHS_2lep[] = {
-//// plotvar MINRange MAXRange NBINS slog xlabel outfile AMINRange AMAXRange ANBINS drawleg
-////
-//// LEPTONS
-//// { "mass_llj_PuppiAK8", 600, 2000, 38, 1, "M_{ww}" , "mass_llj_PuppiAK8_38Bins" , 600, 2000, 38, 0},
-//// { "mass_llj_PuppiAK8", 600, 2000, 19, 1, "M_{ww}" , "mass_llj_PuppiAK8_19Bins" , 600, 2000, 19, 0},
- { "mass_llj_PuppiAK8", 600, 2000, 4, 1, "M_{ww}" , "mass_llj_PuppiAK8_4Bins" , 600, 2000, 4, 0},
-////
-//// { "nPV", 0, 50, 50, 1, "Number of primary vertices", "nPV", 0, 50, 50, 1},
-////
-//// { "l_pt1", 50, 390, 12, 3, "Lepton p_{T} (GeV)", "lepton_pt1", 50, 390, 12, 1 },
-//// { "l_eta1", -2.5, 2.5, 8, 1, "Lepton #eta", "lepton_eta1", -2.5, 2.5, 8, 0 },
-//// { "l_phi1", -4.5, 4.5, 8, 6, "Lepton #phi", "lepton_phi1", -4.5, 4.5, 8, 0 },
-//// { "l_e1", 0, 500, 8, 3, "Lepton Energy", "lepton_e1", 0, 500, 8, 0 },
-//// { "l_charge1", -2, 2, 4, 1, "Lepton charge", "lepton_charge1", -2.0, 2.0, 4, 0 },
-////
-// { "l_pt2", 30, 330, 11, 3, "Sub-Leading Lepton p_{T} (GeV)", "lepton_pt", 30, 330, 11, 1 },
-//// { "l_eta2", -2.4, 2.4, 8, 1, "Sub-Leading Lepton #eta", "lepton_eta", -2.4, 2.4, 8, 0 },
-//// { "l_phi2", -4.5, 4.5, 8, 1, "Sub-Leading Lepton #phi", "lepton_phi", -4.5, 4.5, 8, 0 },
-//// { "l_e2", 0, 500, 8, 3, "Sub-Leading Lepton energy", "lepton_e", 0, 500, 8, 0 },
-//// { "l_charge2", -2, 2, 4, 1, "Sub-Leading Lepton #charge", "lepton_charge", -2.0, 2.0, 4, 0 },
-////
-////////// Leptonic & Hadronic W-boson
-// { "dilep_pt", 0,700, 10,3, "W_{lep} p_{T} (GeV)", "dilep_pt", 0,700, 10, 0},
-//// { "dilep_eta", -2.5,2.5, 20,1, "W_{lep}(#eta)", "dilep_eta", -2.5,2.5, 20, 0},
-// { "dilep_phi", -3.5,3.5, 10,1, "W_{lep} (#phi)", "dilep_phi", -3.5,3.5, 10, 0},
-//// { "dilep_m", 76,107, 6,3, "M_{ll} (GeV)", "dilep_m", 76,107, 6, 0},
-////
-//// { "ungroomed_PuppiAK8_jet_pt", 200, 800, 8, 3, "AK8 p_{T} (GeV)", "ungroomed_PuppiAK8_jet_pt", 200, 800, 8, 1 },
-//// { "ungroomed_PuppiAK8_jet_eta", -2.4, 2.4, 12, 1, "AK8 #eta", "ungroomed_PuppiAK8_jet_eta", -2.4, 2.4, 12, 0},
-//// { "ungroomed_PuppiAK8_jet_phi", -3.4, 3.4, 12, 6, "AK8 #phi", "ungroomed_PuppiAK8_jet_phi", -3.4, 3.4, 12, 0},
-//// { "ungroomed_PuppiAK8_jet_e", 0.0, 1000.0, 12, 3, "AK8 Energy", "ungroomed_PuppiAK8_jet_e", 0.0, 1000.0, 12, 0},
-//// { "ungroomed_PuppiAK8_jet_charge", -1.0, 1.0, 12, 1, "AK8 charge", "ungroomed_PuppiAK8_jet_charge", -1.0, 1.0, 12, 0},
-////// { "PuppiAK8_jet_mass", 40, 150, 11, 3, "AK8 mass (GeV)", "AK8_mass", 40.0, 150, 11, 1},
-////// { "PuppiAK8_jet_mass_pr", 40, 150, 11, 3, "AK8 pruned mass (GeV)", "AK8_mass_pr", 40.0, 150, 11, 1},
-//// { "PuppiAK8_jet_mass_so_corr", 40, 150, 22, 3, "AK8 Softdrop mass (GeV)", "AK8_mass_so", 40.0, 150, 22, 1},
-//// { "PuppiAK8_jet_mass_so_corr", 40, 150, 11, 3, "AK8 Softdrop mass (GeV)", "AK8_mass_so_11bin", 40.0, 150, 11, 1},
-////// { "PuppiAK8_jet_mass_tr", 40, 150, 11, 3, "AK8 tr mass (GeV)", "AK8_mass_tr", 40.0, 150, 11, 1},
-////// { "PuppiAK8_jet_mass", 65, 105, 5, 3, "AK8 mass (GeV)", "AK8_mass", 65, 105, 5, 1},
-////// { "PuppiAK8_jet_mass_pr", 65, 105, 5, 3, "AK8 pruned mass (GeV)", "AK8_mass_pr", 65, 105, 5, 1},
-////// { "PuppiAK8_jet_mass_so_corr", 65, 105, 5, 3, "AK8 Softdrop mass (GeV)", "AK8_mass_so", 65, 105, 5, 1},
-////// { "PuppiAK8_jet_mass_tr", 65, 105, 5, 3, "AK8 tr mass (GeV)", "AK8_mass_tr", 65, 105, 5, 1},
-////// { "PuppiAK8_jet_sj1_pt", 0, 800, 25, 3, "AK8 SJ1 pT (GeV)", "PuppiAK8_jet_sj1_pt", 0, 800, 25, 1},
-////// { "PuppiAK8_jet_sj1_eta", -2.4, 2.4, 25, 1, "AK8 SJ1 #eta", "PuppiAK8_jet_sj1_eta", -2.4, 2.4, 25, 1},
-////// { "PuppiAK8_jet_sj1_phi", -3, 3, 25, 6, "AK8 SJ1 #phi", "PuppiAK8_jet_sj1_phi", -3, 3, 25, 1},
-////// { "PuppiAK8_jet_sj1_m", 0, 90, 25, 3, "AK8 SJ1 mass (GeV)", "PuppiAK8_jet_sj1_m", 0, 90, 25, 1},
-////// { "PuppiAK8_jet_sj1_q", -1, 1, 25, 1, "AK8 SJ1 charge", "PuppiAK8_jet_sj1_q", -1, 1, 25, 1},
-////// { "PuppiAK8_jet_sj2_pt", 0, 400, 25, 3, "AK8 SJ2 pT (GeV)", "PuppiAK8_jet_sj2_pt", 0, 400, 25, 1},
-////// { "PuppiAK8_jet_sj2_eta", -2.4, 2.4, 25, 1, "AK8 SJ2 #eta", "PuppiAK8_jet_sj2_eta", -2.4, 2.4, 25, 1},
-////// { "PuppiAK8_jet_sj2_phi", -3, 3, 25, 6, "AK8 SJ2 #phi", "PuppiAK8_jet_sj2_phi", -3, 3, 25, 1},
-////// { "PuppiAK8_jet_sj2_m", 0, 80, 25, 3, "AK8 SJ2 mass (GeV)", "PuppiAK8_jet_sj2_m", 0, 80, 25, 1},
-////// { "PuppiAK8_jet_sj2_q", -1, 1, 25, 1, "AK8 SJ2 charge", "PuppiAK8_jet_sj2_q", -1, 1, 25, 1},
-////// { "PuppiAK8_jet_sj1_q*PuppiAK8_jet_sj2_q", -20, 20, 25, 1, "AK8 (SJ1_q #times SJ2_q)", "PuppiAK8_SJ1J2_chargeMultiplication", -20, 20, 25, 1},
-////// { "PuppiAK8jet_qjet", 0, 2, 20, 1, "PuppiAK8jet_qjet", "PuppiAK8jet_qjet", 0, 2, 20, 1},
-////
-////
-////// Number of jets
-//// { "njets", 0, 10, 10, 1, "Number of VBF jets", "njets", 0, 10, 10, 1},
-//// { "nBTagJet_loose", 0, 6, 6, 1, "number of VBF jets (Loose b-tag)", "nBTagJet_loose", 0, 6, 6, 1},
-//// { "nBTagJet_medium", 0, 6, 6, 1, "number of VBF jets (medium b-tag)", "nBTagJet_medium", 0, 6, 6, 1},
-////
-////
-//// { "PuppiAK8_jet_tau2tau1", 0, 0.55, 10, 1, "AK8 #tau_{2}/#tau_{1}", "Puppi_AK8_jet_tau2tau1",0,0.55,10,0},
-////// VBF JET
-////
-//// { "vbf_maxpt_j1_eta", -5.0, 5.0, 10, 1, "Leading VBF Jet #eta", "vbf_maxpt_j1_eta", -5.0, 5.0, 10, 0},
-//// { "vbf_maxpt_j2_eta", -5.0, 5.0, 10, 1, "Sub-Leading VBF Jet #eta", "vbf_maxpt_j2_eta", -5.0, 5.0, 10, 0},
-//// { "vbf_maxpt_j2_pt", 30,250, 12, 3, "Sub-Leading VBF Jet p_{T}", "vbf_maxpt_j2_pt", 30,250,12,0 },
-//// { "vbf_maxpt_j1_pt", 30, 630, 12, 3, "Leading VBF Jet p_{T}", "vbf_maxpt_j1_pt", 30,630,12,1 },
-//// { "vbf_maxpt_jj_m", 800, 2500, 10, 3, "VBF M_{jj} GeV", "vbf_maxpt_jj_m", 800, 2500, 10, 1},
-//// { "vbf_maxpt_jj_Deta", 4.0, 8, 8, 1, "VBF #Delta #eta", "vbf_maxpt_jj_Deta", 4.0,8, 8, 1 },
-////
-////
-////// Angular variables
-// { "deltaR_lPuppiak8jet", 0, 6.5, 10, 1, "#Delta R(leading lep,AK8)" , "deltaR_lPuppiak8jet" , 0, 6.5, 10, 0},
-// { "deltaR_l2Puppiak8jet", 1, 6.5, 10, 1, "#Delta R(sub-leading lep, AK8)" , "deltaR_l2Puppiak8jet" , 1, 6.5, 10, 0},
-// { "deltaR_VLepPuppiak8jet", 1, 6.5, 10, 1, "#Delta R(W_{lep}, AK8)" , "deltaR_VLepPuppiak8jet" , 1, 6.5, 10, 0},
-//// { "pt_llj_PuppiAK8", 0,1000, 10, 1, "p_{T} of ZV" , "pt_llj_PuppiAK8" , 0,1000, 10, 0},
-//// { "eta_llj_PuppiAK8", -2.5, 2.5, 10, 1, "#eta of ZV" , "eta_llj_PuppiAK8" , -2.5, 2.5, 10, 0},
-//// { "phi_llj_PuppiAK8", -4.5, 4.5, 10, 1, "#phi of ZV" , "phi_llj_PuppiAK8" , -4.5, 4.5, 10, 0},
-//// { "ZeppenfeldWH", -5, 5, 10, 1, "Zeppenfeld (with hadronic W)" , "ZeppenfeldWH" , -5, 5, 10, 0},
-//// { "PtBalance_2Lep", 0, 1.0, 10, 1, "p_{T} Balance", "PtBalance_2Lep", 0, 1.0, 10, 1 },
-//// { "BosonCentrality_2Lep", 0,4.0, 8, 1, "Boson Centrality", "BosonCentrality_2Lep",0,4.0, 8, 1 },
-//// { "costheta1_2Lep", -1,1, 10, 6, "costheta1" , "costheta1_2Lep" ,-1,1, 10, 0},
-//// { "costheta2_2Lep", -1,1, 10, 6, "costheta2" , "costheta2_2Lep" ,-1,1, 10, 0},
-//// { "costhetastar_2Lep", -1,1, 10, 6, "costhetastar" , "costhetastar_2Lep" ,-1,1, 10, 1},
-//// { "phi_2Lep", -3.5, 3.5, 10, 6, "phi" , "phi_2Lep" , -3.5, 3.5, 10, 0},
-//// { "phi1_2Lep", -3.5, 3.5, 10, 6, "phi1" , "phi1_2Lep" , -3.5, 3.5, 10, 0},
-//// { "VBSCentrality_2Lep", 0, 3, 10, 1, "VBSCentrality" , "VBSCentrality_2Lep" , 0, 3, 10, 1},
-//// { "RpT_2Lep", 0, 80, 10, 1, "RpT" , "RpT_2Lep", 0, 80, 10, 1},
-//// { "ZeppenfeldWL_2Lep", -5, 5, 10, 1, "Zeppenfeld (with leptonic W)" , "ZeppenfeldWL_2Lep" , -5, 5, 10, 0},
-//// { "LeptonProjection_2Lep", 0, 2, 10, 1, "Lepton Projection" , "LeptonProjection_2Lep" ,0, 2, 10, 1},
-// { "ZeppenfeldWL_2Lep/vbf_maxpt_jj_Deta", -1.0, 1.0, 10, 1, "ZeppenfeldWL/#Delta #eta jj" , "ZeppenfeldWL_2Lep_new" , -1.0, 1.0, 10, 1},
-//// { "ZeppenfeldWH/vbf_maxpt_jj_Deta", -1.0, 1.0, 10, 1, "ZeppenfeldWH/#Delta #eta jj" , "ZeppenfeldWH_new" , -1.0, 1.0, 10, 1},
-
- { "", 0.0,0.0,0,0,"","",0.,0.,0,0 }
-};
-
-
-#endif // _COMMONCONTROLPLOTVARS_CHS_H
diff --git a/ControlPlots/controlplotvars_CHS_Limit.h b/ControlPlots/controlplotvars_CHS_Limit.h
deleted file mode 100644
index ea35822..0000000
--- a/ControlPlots/controlplotvars_CHS_Limit.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _COMMONCONTROLPLOTVARS_CHS_LIMIT_H
-#define _COMMONCONTROLPLOTVARS_CHS_LIMIT_H
-
-#include "plotvar_t.h"
-
-const plotVar_t commonplotvars_chs_limit[] = {
-// plotvar MINRange MAXRange NBINS slog xlabel outfile AMINRange AMAXRange ANBINS drawleg
-//
-// LEPTONS
- { "mass_lvj_type0_PuppiAK8", 450, 2400, 4, 1, "WW invariant mass (GeV)", "mass_lvj_type0_PuppiAK8", 450, 2400, 4, 1},
-
- { "", 0.0,0.0,0,0,"","",0.,0.,0,0 }
-};
-
-
-#endif // _COMMONCONTROLPLOTVARS_CHS_H
diff --git a/ControlPlots/controlplotvars_CHS_VBF.h b/ControlPlots/controlplotvars_CHS_VBF.h
new file mode 100644
index 0000000..63c536f
--- /dev/null
+++ b/ControlPlots/controlplotvars_CHS_VBF.h
@@ -0,0 +1,54 @@
+#ifndef _COMMONCONTROLPLOTVARS_CHS_VBF_H
+#define _COMMONCONTROLPLOTVARS_CHS_VBF_H
+
+#include "plotvar_t.h"
+
+const plotVar_t controlplotvars_CHS_VBF[] = {
+ //// plotvar MINRange MAXRange NBINS slog xlabel outfile AMINRange AMAXRange ANBINS drawleg
+ ////
+ {"PV_npvsGood", 0, 100, 100, 1, "Number of good primary vertices", "PV_npvsGood", 0, 100, 100, 1},
+ {"massZ1", 0, 200, 50, 1, "Z_{ll} (GeV/C2)", "massZ1", 0, 200, 50, 1},
+ {"pTZ1", 0, 500, 20, 1, "Z_{ll} p_{T} (GeV/c)", "pTZ1", 0, 500, 20, 1},
+ {"etaZ1", -2.4, 2.4, 12, 1, "Z_{ll} #eta", "etaZ1", -2.4, 2.4, 12, 1},
+ {"phiZ1", -3.14, 3.14, 12, 6, "Z_{ll} #phi", "phiZ1", -3.14, 3.14, 12, 1},
+ {"pTL1", 0, 200, 26, 1, "Lepton1 (GeV/c)", "pTL1", 0, 200, 26, 1},
+ {"etaL1", -2.5, 2.5, 8, 1, "Lepton1 #eta", "etaL1", -2.5, 2.5, 8, 0},
+ {"phiL1", -3.14, 3.14, 8, 6, "Lepton1 #phi", "phiL1", -3.14, 3.14, 8, 0},
+ {"pTL2", 0, 120, 26, 1, "Lepton2 (GeV/c)", "pTL2", 0, 120, 26, 1},
+ {"etaL2", -2.5, 2.5, 8, 1, "Lepton2 #eta", "etaL2", -2.5, 2.5, 8, 0},
+ {"phiL2", -3.14, 3.14, 8, 6, "Lepton2 #phi", "phiL2", -3.14, 3.14, 8, 0},
+ {"MET_pt", 0, 150, 20, 1, "MET_pt (GeV)", "MET_pt", 0, 150, 20, 1},
+ {"MET_phi", -3.14, 3.14, 12, 6, "MET_phi", "MET_phi", -3.14, 3.14, 12, 1},
+ {"MET_sumEt", 0, 6000, 20, 1, "MET_sumEt (GeV)", "MET_sumEt", 0, 6000, 20, 1},
+ {"PuppiMET_pt", 0, 500, 20, 1, "PuppiMET_pt (GeV)", "PuppiMET_pt", 0, 500, 20, 1},
+ {"PuppiMET_phi", -3.14, 3.14, 12, 6, "PuppiMET_phi", "PuppiMET_phi", -3.14, 3.14, 12, 1},
+ {"PuppiMET_sumEt", 0, 6000, 20, 1, "PuppiMET_sumEt (GeV)", "PuppiMET_sumEt", 0, 6000, 20, 1},
+ {"HZZ2l2nu_ZZmT", 0, 1000, 20, 1, "HZZ2l2nu_ZZmT (GeV)", "HZZ2l2nu_ZZmT", 0, 1000, 20, 1},
+ {"HZZ2l2nu_ZZpT", 0, 1000, 20, 1, "HZZ2l2nu_ZZpT (GeV)", "HZZ2l2nu_ZZpT", 0, 1000, 20, 1},
+ {"HZZ2l2qNu_nJets", 0, 10, 10, 1, "HZZ2l2qNu_nJets", "HZZ2l2qNu_nJets", 0, 10, 10, 1},
+ {"HZZ2l2qNu_nTightBtagJets", 0, 10, 10, 1, "HZZ2l2qNu_nTightBtagJets", "HZZ2l2qNu_nTightBtagJets", 0, 10, 10, 1},
+ {"HZZ2l2qNu_nMediumBtagJets", 0, 10, 10, 1, "HZZ2l2qNu_nMediumBtagJets", "HZZ2l2qNu_nMediumBtagJets", 0, 10, 10, 1},
+ {"HZZ2l2qNu_nLooseBtagJets", 0, 10, 10, 1, "HZZ2l2qNu_nLooseBtagJets", "HZZ2l2qNu_nLooseBtagJets", 0, 10, 10, 1},
+ {"HZZ2l2nu_minDPhi_METAK4", 0, 5.0, 16, 1, "HZZ2l2nu_minDPhi_METAK4", "HZZ2l2nu_minDPhi_METAK4", 0, 5.0, 16, 1},
+ {"HZZ2l2nu_ifVBF", 0, 2, 2, 1, "HZZ2l2nu_ifVBF", "HZZ2l2nu_ifVBF", 0, 2, 2, 1},
+ {"HZZ2l2qNu_isELE", 0, 2, 2, 1, "HZZ2l2qNu_isELE", "HZZ2l2qNu_isELE", 0, 2, 2, 1},
+ {"HZZ2l2qNu_cutOppositeChargeFlag", 0, 2, 2, 1, "HZZ2l2qNu_cutOppositeChargeFlag", "HZZ2l2qNu_cutOppositeChargeFlag", 0, 2, 2, 1},
+ {"HZZ2l2nu_VBFdijet_mass", 500, 3000, 50, 1, "HZZ2l2nu_VBFdijet_mass (GeV)", "HZZ2l2nu_VBFdijet_mass", 500, 3000, 50, 1},
+ {"HZZ2l2nu_VBFdijet_pT", 0, 1000, 20, 1, "HZZ2l2nu_VBFdijet_pT (GeV)", "HZZ2l2nu_VBFdijet_pT", 0, 1000, 20, 1},
+ {"HZZ2l2nu_VBFdijet_E", 0, 3000, 100, 1, "HZZ2l2nu_VBFdijet_E (GeV)", "HZZ2l2nu_VBFdijet_E", 0, 3000, 100, 1},
+ {"HZZ2l2nu_VBFdEta_jj", 4, 10, 20, 1, "HZZ2l2nu_VBFdEta_jj", "HZZ2l2nu_VBFdEta_jj", 4, 10, 20, 1},
+ {"HZZ2l2nu_VBFdPhi_jj", 0, 3.14, 20, 1, "HZZ2l2nu_VBFdPhi_jj", "HZZ2l2nu_VBFdPhi_jj", 0, 3.14, 20, 1},
+ {"HZZ2l2nu_VBFdR_jj", 0, 10, 20, 1, "HZZ2l2nu_VBFdR_jj", "HZZ2l2nu_VBFdR_jj", 0, 10, 20, 1},
+ {"HZZ2l2nu_VBFjet1_pT", 0, 500, 20, 1, "HZZ2l2nu_VBFjet1_pT (GeV)", "HZZ2l2nu_VBFjet1_pT", 0, 500, 20, 1},
+ {"HZZ2l2nu_VBFjet1_eta", -5, 5, 20, 1, "HZZ2l2nu_VBFjet1_eta", "HZZ2l2nu_VBFjet1_eta", -5, 5, 20, 1},
+ {"HZZ2l2nu_VBFjet1_phi", -3.14, 3.14, 12, 6, "HZZ2l2nu_VBFjet1_phi", "HZZ2l2nu_VBFjet1_phi", -3.14, 3.14, 12, 1},
+ {"HZZ2l2nu_VBFjet1_mass", 0, 200, 20, 1, "HZZ2l2nu_VBFjet1_mass (GeV)", "HZZ2l2nu_VBFjet1_mass", 0, 200, 20, 1},
+ {"HZZ2l2nu_VBFjet2_pT", 0, 500, 20, 1, "HZZ2l2nu_VBFjet2_pT (GeV)", "HZZ2l2nu_VBFjet2_pT", 0, 500, 20, 1},
+ {"HZZ2l2nu_VBFjet2_eta", -5, 5, 20, 1, "HZZ2l2nu_VBFjet2_eta", "HZZ2l2nu_VBFjet2_eta", -5, 5, 20, 1},
+ {"HZZ2l2nu_VBFjet2_phi", -3.14, 3.14, 12, 6, "HZZ2l2nu_VBFjet2_phi", "HZZ2l2nu_VBFjet2_phi", -3.14, 3.14, 12, 1},
+ {"HZZ2l2nu_VBFjet2_mass", 0, 200, 20, 1, "HZZ2l2nu_VBFjet2_mass (GeV)", "HZZ2l2nu_VBFjet2_mass", 0, 200, 20, 1},
+
+ // don't delete the following line!
+ {"", 0.0, 0.0, 0, 0, "", "", 0., 0., 0, 0}};
+
+#endif // _COMMONCONTROLPLOTVARS_CHS_VBF_H
diff --git a/ControlPlots/controlplotvars_CHS_debug.h b/ControlPlots/controlplotvars_CHS_debug.h
new file mode 100644
index 0000000..74d39c3
--- /dev/null
+++ b/ControlPlots/controlplotvars_CHS_debug.h
@@ -0,0 +1,94 @@
+#ifndef _COMMONCONTROLPLOTVARS_CHS_DEBUG_H
+#define _COMMONCONTROLPLOTVARS_CHS_DEBUG_H
+
+#include "plotvar_t.h"
+
+const plotVar_t controlplotvars_CHS_debug[] = {
+ // plotvar MINRange MAXRange NBINS slog xlabel outfile AMINRange AMAXRange ANBINS drawleg
+ //{"PV_npvsGood", 0, 100, 100, 1, "Number of good primary vertices", "PV_npvsGood", 0, 100, 100, 1},
+ {"massZ1", 60, 120, 30, 1, "Z_{ll} (GeV/C2)", "massZ1", 60, 120, 30, 1},
+ {"pTZ1", 0, 500, 20, 1, "Z_{ll} p_{T} (GeV/c)", "pTZ1", 0, 500, 20, 1},
+ {"MET_pt", 0, 200, 40, 1, "MET_pt (GeV)", "MET_pt", 0, 200, 40, 1},
+ {"HZZ2l2nu_ZZmT", 20, 200, 36, 1, "HZZ2l2nu_ZZmT (GeV)", "HZZ2l2nu_ZZmT", 20, 200, 36, 1},
+ {"HZZ2l2nu_ZZpT", 0, 200, 40, 1, "HZZ2l2nu_ZZpT (GeV)", "HZZ2l2nu_ZZpT", 0, 200, 40, 1},
+ {"pTL1", 0, 400, 40, 1, "Lepton1 (GeV/c)", "pTL1", 0, 400, 40, 1},
+ {"pTL2", 0, 400, 40, 1, "Lepton2 (GeV/c)", "pTL2", 0, 400, 40, 1},
+ {"etaL1", -2.5, 2.5, 50, 1, "Lepton1 #eta", "etaL1", -2.5, 2.5, 50, 0},
+ {"etaL2", -2.5, 2.5, 50, 1, "Lepton2 #eta", "etaL2", -2.5, 2.5, 50, 0},
+ {"HZZ2l2qNu_nJets", 0, 10, 10, 1, "HZZ2l2qNu_nJets", "HZZ2l2qNu_nJets", 0, 10, 10, 1},
+ //{"HZZ2l2qNu_nTightBtagJets", 0, 10, 10, 1, "HZZ2l2qNu_nTightBtagJets", "HZZ2l2qNu_nTightBtagJets", 0, 10, 10, 1},
+ {"HZZ2l2qNu_nMediumBtagJets", 0, 10, 10, 1, "HZZ2l2qNu_nMediumBtagJets", "HZZ2l2qNu_nMediumBtagJets", 0, 10, 10, 1},
+ //{"HZZ2l2qNu_nLooseBtagJets", 0, 10, 10, 1, "HZZ2l2qNu_nLooseBtagJets", "HZZ2l2qNu_nLooseBtagJets", 0, 10, 10, 1},
+ //{"HZZ2l2nu_minDPhi_METAK4", -3, 3, 30, 1, "HZZ2l2nu_minDPhi_METAK4", "HZZ2l2nu_minDPhi_METAK4", -3, 3, 30, 1},
+ {"HZZ2l2nu_ifVBF", 0, 2, 2, 1, "HZZ2l2nu_ifVBF", "HZZ2l2nu_ifVBF", 0, 2, 2, 1},
+ {"HZZ2l2qNu_isELE", 0, 2, 2, 1, "HZZ2l2qNu_isELE", "HZZ2l2qNu_isELE", 0, 2, 2, 1},
+ {"HZZ2l2qNu_cutOppositeChargeFlag", 0, 2, 2, 1, "HZZ2l2qNu_cutOppositeChargeFlag", "HZZ2l2qNu_cutOppositeChargeFlag", 0, 2, 2, 1},
+ {"HZZ2l2nu_VBFdijet_mass", 500, 3000, 50, 1, "HZZ2l2nu_VBFdijet_mass (GeV)", "HZZ2l2nu_VBFdijet_mass", 500, 3000, 50, 1},
+ {"HZZ2l2nu_VBFdijet_pT", 0, 1000, 20, 1, "HZZ2l2nu_VBFdijet_pT (GeV)", "HZZ2l2nu_VBFdijet_pT", 0, 1000, 20, 1},
+ {"HZZ2l2nu_VBFdijet_E", 0, 3000, 100, 1, "HZZ2l2nu_VBFdijet_E (GeV)", "HZZ2l2nu_VBFdijet_E", 0, 3000, 100, 1},
+ {"HZZ2l2nu_VBFdEta_jj", 4, 10, 20, 1, "HZZ2l2nu_VBFdEta_jj", "HZZ2l2nu_VBFdEta_jj", 4, 10, 20, 1},
+ {"HZZ2l2nu_VBFdPhi_jj", 0, 3.14, 20, 1, "HZZ2l2nu_VBFdPhi_jj", "HZZ2l2nu_VBFdPhi_jj", 0, 3.14, 20, 1},
+ {"HZZ2l2nu_VBFdR_jj", 0, 10, 20, 1, "HZZ2l2nu_VBFdR_jj", "HZZ2l2nu_VBFdR_jj", 0, 10, 20, 1},
+ {"HZZ2l2nu_VBFjet1_pT", 0, 500, 20, 1, "HZZ2l2nu_VBFjet1_pT (GeV)", "HZZ2l2nu_VBFjet1_pT", 0, 500, 20, 1},
+ {"HZZ2l2nu_VBFjet1_eta", -5, 5, 20, 1, "HZZ2l2nu_VBFjet1_eta", "HZZ2l2nu_VBFjet1_eta", -5, 5, 20, 1},
+ {"HZZ2l2nu_VBFjet1_phi", -3.14, 3.14, 12, 6, "HZZ2l2nu_VBFjet1_phi", "HZZ2l2nu_VBFjet1_phi", -3.14, 3.14, 12, 1},
+ {"HZZ2l2nu_VBFjet1_mass", 0, 200, 20, 1, "HZZ2l2nu_VBFjet1_mass (GeV)", "HZZ2l2nu_VBFjet1_mass", 0, 200, 20, 1},
+ {"HZZ2l2nu_VBFjet2_pT", 0, 500, 20, 1, "HZZ2l2nu_VBFjet2_pT (GeV)", "HZZ2l2nu_VBFjet2_pT", 0, 500, 20, 1},
+ {"HZZ2l2nu_VBFjet2_eta", -5, 5, 20, 1, "HZZ2l2nu_VBFjet2_eta", "HZZ2l2nu_VBFjet2_eta", -5, 5, 20, 1},
+ {"HZZ2l2nu_VBFjet2_phi", -3.14, 3.14, 12, 6, "HZZ2l2nu_VBFjet2_phi", "HZZ2l2nu_VBFjet2_phi", -3.14, 3.14, 12, 1},
+ {"HZZ2l2nu_VBFjet2_mass", 0, 200, 20, 1, "HZZ2l2nu_VBFjet2_mass (GeV)", "HZZ2l2nu_VBFjet2_mass", 0, 200, 20, 1},
+ //////////////////////////////
+ {"PV_npvsGood", 0, 100, 100, 1, "Number of good primary vertices", "PV_npvsGood", 0, 100, 100, 1},
+ //{"massZ1", 0, 200, 50, 1, "Z_{ll} (GeV/C2)", "massZ1", 0, 200, 50, 1},
+ //{"pTZ1", 0, 500, 20, 1, "Z_{ll} p_{T} (GeV/c)", "pTZ1", 0, 500, 20, 1},
+/* {"etaZ1", -2.4, 2.4, 12, 1, "Z_{ll} #eta", "etaZ1", -2.4, 2.4, 12, 1},
+ {"phiZ1", -3.14, 3.14, 12, 6, "Z_{ll} #phi", "phiZ1", -3.14, 3.14, 12, 1},
+ {"pTL1", 0, 200, 26, 1, "Lepton1 (GeV/c)", "pTL1", 0, 200, 26, 1},
+ {"etaL1", -2.5, 2.5, 8, 1, "Lepton1 #eta", "etaL1", -2.5, 2.5, 8, 0},
+ {"phiL1", -3.14, 3.14, 8, 6, "Lepton1 #phi", "phiL1", -3.14, 3.14, 8, 0},
+ {"pTL2", 0, 120, 26, 1, "Lepton2 (GeV/c)", "pTL2", 0, 120, 26, 1},
+ {"etaL2", -2.5, 2.5, 8, 1, "Lepton2 #eta", "etaL2", -2.5, 2.5, 8, 0},
+ {"phiL2", -3.14, 3.14, 8, 6, "Lepton2 #phi", "phiL2", -3.14, 3.14, 8, 0}, */
+ //{"MET_pt", 0, 150, 20, 1, "MET_pt (GeV)", "MET_pt", 0, 150, 20, 1},
+ //{"MET_phi", -3.14, 3.14, 12, 6, "MET_phi", "MET_phi", -3.14, 3.14, 12, 1},
+ //{"MET_sumEt", 0, 6000, 20, 1, "MET_sumEt (GeV)", "MET_sumEt", 0, 6000, 20, 1},
+ // {"PuppiMET_pt", 0, 150, 20, 1, "PuppiMET_pt (GeV)", "PuppiMET_pt", 0, 150, 20, 1},
+ //{"PuppiMET_phi", -3.14, 3.14, 12, 6, "PuppiMET_phi", "PuppiMET_phi", -3.14, 3.14, 12, 1},
+ //{"PuppiMET_sumEt", 0, 6000, 20, 1, "PuppiMET_sumEt (GeV)", "PuppiMET_sumEt", 0, 6000, 20, 1},
+ //Hi//{"HZZ2l2nu_ZZmT", 0, 1000, 20, 1, "HZZ2l2nu_ZZmT (GeV)", "HZZ2l2nu_ZZmT", 0, 1000, 20, 1},
+ //{"HZZ2l2nu_ZZpT", 0, 1000, 20, 1, "HZZ2l2nu_ZZpT (GeV)", "HZZ2l2nu_ZZpT", 0, 1000, 20, 1},
+ //{"HZZ2l2qNu_nJets", 0, 10, 10, 1, "HZZ2l2qNu_nJets", "HZZ2l2qNu_nJets", 0, 10, 10, 1},
+ /*{"HZZ2l2qNu_nTightBtagJets", 0, 10, 10, 1, "HZZ2l2qNu_nTightBtagJets", "HZZ2l2qNu_nTightBtagJets", 0, 10, 10, 1},
+ {"HZZ2l2qNu_nMediumBtagJets", 0, 10, 10, 1, "HZZ2l2qNu_nMediumBtagJets", "HZZ2l2qNu_nMediumBtagJets", 0, 10, 10, 1},
+ {"HZZ2l2qNu_nLooseBtagJets", 0, 10, 10, 1, "HZZ2l2qNu_nLooseBtagJets", "HZZ2l2qNu_nLooseBtagJets", 0, 10, 10, 1},
+ {"HZZ2l2nu_minDPhi_METAK4", 0, 5.0, 16, 1, "HZZ2l2nu_minDPhi_METAK4", "HZZ2l2nu_minDPhi_METAK4", 0, 5.0, 16, 1},
+ {"HZZ2l2nu_ifVBF", 0, 2, 2, 1, "HZZ2l2nu_ifVBF", "HZZ2l2nu_ifVBF", 0, 2, 2, 1},
+ {"HZZ2l2qNu_isELE", 0, 2, 2, 1, "HZZ2l2qNu_isELE", "HZZ2l2qNu_isELE", 0, 2, 2, 1},
+ {"HZZ2l2qNu_cutOppositeChargeFlag", 0, 2, 2, 1, "HZZ2l2qNu_cutOppositeChargeFlag", "HZZ2l2qNu_cutOppositeChargeFlag", 0, 2, 2, 1},*/
+ {"pTj1", 0, 200, 26, 1, "jet1 (GeV/c)", "pTj1", 0, 200, 26, 1},
+ {"pTj2", 0, 200, 26, 1, "jet1 (GeV/c)", "pTj2", 0, 200, 26, 1},
+ {"etaj1", -2.5, 2.5, 8, 1, "jet 1 #eta", "etaj1", -2.5, 2.5, 8, 0},
+ {"etaj2", -2.5, 2.5, 8, 1, "jet 1 #eta", "etaj2", -2.5, 2.5, 8, 0},
+ {"phij1", -3.14, 3.14, 8, 6, "jet1 #phi", "phij1", -3.14, 3.14, 8, 0},
+ {"phij2", -3.14, 3.14, 8, 6, "jet2 #phi", "phij2", -3.14, 3.14, 8, 0},
+ {"mj1", 0, 200, 50, 1, "jet 1 (GeV/C2)", "mj1", 0, 200, 50, 1},
+ {"mj2", 0, 200, 50, 1, "jet 2 (GeV/C2)", "mj2", 0, 200, 50, 1},
+ //
+ //{"HZZ2l2nu_VBFdijet_mass", 500, 3000, 50, 1, "HZZ2l2nu_VBFdijet_mass (GeV)", "HZZ2l2nu_VBFdijet_mass", 500, 3000, 50, 1},
+ /*{"HZZ2l2nu_VBFdijet_pT", 0, 1000, 20, 1, "HZZ2l2nu_VBFdijet_pT (GeV)", "HZZ2l2nu_VBFdijet_pT", 0, 1000, 20, 1},
+ {"HZZ2l2nu_VBFdijet_E", 0, 3000, 100, 1, "HZZ2l2nu_VBFdijet_E (GeV)", "HZZ2l2nu_VBFdijet_E", 0, 3000, 100, 1},*/
+ // {"HZZ2l2nu_VBFdEta_jj", 4, 10, 20, 1, "HZZ2l2nu_VBFdEta_jj", "HZZ2l2nu_VBFdEta_jj", 4, 10, 20, 1},
+ /* {"HZZ2l2nu_VBFdPhi_jj", 0, 3.14, 20, 1, "HZZ2l2nu_VBFdPhi_jj", "HZZ2l2nu_VBFdPhi_jj", 0, 3.14, 20, 1},
+ {"HZZ2l2nu_VBFdR_jj", 0, 10, 20, 1, "HZZ2l2nu_VBFdR_jj", "HZZ2l2nu_VBFdR_jj", 0, 10, 20, 1},
+ {"HZZ2l2nu_VBFjet1_pT", 0, 500, 20, 1, "HZZ2l2nu_VBFjet1_pT (GeV)", "HZZ2l2nu_VBFjet1_pT", 0, 500, 20, 1},
+ {"HZZ2l2nu_VBFjet1_eta", -5, 5, 20, 1, "HZZ2l2nu_VBFjet1_eta", "HZZ2l2nu_VBFjet1_eta", -5, 5, 20, 1},
+ {"HZZ2l2nu_VBFjet1_phi", -3.14, 3.14, 12, 6, "HZZ2l2nu_VBFjet1_phi", "HZZ2l2nu_VBFjet1_phi", -3.14, 3.14, 12, 1},
+ {"HZZ2l2nu_VBFjet1_mass", 0, 200, 20, 1, "HZZ2l2nu_VBFjet1_mass (GeV)", "HZZ2l2nu_VBFjet1_mass", 0, 200, 20, 1},
+ {"HZZ2l2nu_VBFjet2_pT", 0, 500, 20, 1, "HZZ2l2nu_VBFjet2_pT (GeV)", "HZZ2l2nu_VBFjet2_pT", 0, 500, 20, 1},
+ {"HZZ2l2nu_VBFjet2_eta", -5, 5, 20, 1, "HZZ2l2nu_VBFjet2_eta", "HZZ2l2nu_VBFjet2_eta", -5, 5, 20, 1},
+ {"HZZ2l2nu_VBFjet2_phi", -3.14, 3.14, 12, 6, "HZZ2l2nu_VBFjet2_phi", "HZZ2l2nu_VBFjet2_phi", -3.14, 3.14, 12, 1},
+ {"HZZ2l2nu_VBFjet2_mass", 0, 200, 20, 1, "HZZ2l2nu_VBFjet2_mass (GeV)", "HZZ2l2nu_VBFjet2_mass", 0, 200, 20, 1},*/
+ // don't delete the following line!
+ {"", 0.0, 0.0, 0, 0, "", "", 0., 0., 0, 0}};
+
+#endif // _COMMONCONTROLPLOTVARS_CHS_VBF_H
diff --git a/ControlPlots/cron_ram.sh b/ControlPlots/cron_ram.sh
new file mode 100644
index 0000000..a7e45d3
--- /dev/null
+++ b/ControlPlots/cron_ram.sh
@@ -0,0 +1,8 @@
+while true; do
+ echo "Running git add, commit and push"
+ git -C /afs/cern.ch/user/r/rasharma/work/nanoAODToolDev_H4l/plotting/ControlPlots/ControlPlots add .
+ git -C /afs/cern.ch/user/r/rasharma/work/nanoAODToolDev_H4l/plotting/ControlPlots/ControlPlots commit -m "Updated CSV using cron jobs"
+ git -C /afs/cern.ch/user/r/rasharma/work/nanoAODToolDev_H4l/plotting/ControlPlots/ControlPlots push origin Anusreevijay769-dev_HZZ_2l2q
+ sleep 60 # Sleeps for 14400 seconds or 4 hours
+done
+
diff --git a/ControlPlots/index.php b/ControlPlots/index.php
new file mode 100644
index 0000000..566cefd
--- /dev/null
+++ b/ControlPlots/index.php
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+";
+print " Subdirs ";
+if (file_exists("../index.php")) {
+ print "[..] ";
+}
+$subdirs = glob('*', GLOB_ONLYDIR);
+if (count($subdirs) != 0 ) {
+ foreach($subdirs as $dir) {
+ print "[".$dir."] ";
+ }
+}
+print "";
+?>
+
+
+
+ Cut text file: link
+
+
+\n";
+ print "
";
+ print "
";
+ $others = array();
+ foreach ($other_exts as $ex) {
+ $other_filename = str_replace('.png', $ex, $filename);
+ if (file_exists($other_filename)) {
+ array_push($others, "
[" . $ex . "] ");
+ if ($ex != '.txt') array_push($displayed, $other_filename);
+ }
+ }
+ if ($others) print "
Also as ".implode(', ',$others)."
";
+ print "
";
+ }
+}
+?>
+
+
+
+
+
+foreach (glob("*") as $filename) {
+ if ($_GET['noplots'] || !in_array($filename, $displayed)) {
+ if (isset($_GET['match']) && !fnmatch('*'.$_GET['match'].'*', $filename)) continue;
+ if (is_dir($filename)) {
+ print "[DIR] $filename ";
+ } else {
+ print "$filename ";
+ }
+ }
+}
+?>
+
+
+
+
diff --git a/ControlPlots/myControlPlots.C b/ControlPlots/myControlPlots.C
index a768fc2..a2de480 100644
--- a/ControlPlots/myControlPlots.C
+++ b/ControlPlots/myControlPlots.C
@@ -1,63 +1,50 @@
-#include
+// #include
#include
#include
#include
-#include
+// #include
#include
-#include
-#include "TROOT.h"
-#include "TLatex.h"
+// #include
+// #include "TROOT.h"
+// #include "TLatex.h"
#include "TTree.h"
#include "TFile.h"
#include "TH1D.h"
-#include "TH1F.h"
+// #include "TBox.h"
+// #include "TH1F.h"
#include "THStack.h"
-#include "TString.h"
+// #include "TString.h"
#include "TLegend.h"
-#include "TLine.h"
-#include "TPad.h"
+// #include "TLine.h"
+// #include "TPad.h"
#include "TCanvas.h"
#include "TCut.h"
#include "TSystem.h"
-#include "TF1.h"
-#include "TFitResult.h"
-#include "TFitResultPtr.h"
+// #include "TF1.h"
+// #include "TFitResult.h"
+// #include "TFitResultPtr.h"
+#include "TError.h"
#include "tdrstyle.C"
#include "utils.C" // Tokenize
#include "CMS_lumi.C"
-#include
+// #include
+typedef struct
+{
+ int index;
+ TString samplename;
+ TString treefilename;
+ double xsecpblumi;
+ double otherscale;
+ int nMCevents;
+ int MCnegEvent;
+ int colorcode;
+ int stackit;
+} SampleInfo_t;
-typedef struct {
- int index;
- TString samplename;
- TString treefilename;
- double xsecpblumi;
- double otherscale;
- int nMCevents;
- int MCnegEvent;
- int colorcode;
- int stackit;
-}
-SampleInfo_t;
-
-//#include "controlplotvars_boosted.h"
-//#include "controlplotvars_common.h"
#include "controlplotvars_CHS.h"
-#include "controlplotvars_CHS_2lep.h"
-//#include "controlplotvars_Puppi.h"
-//#include "controlplotvars_vbf.h"
-//#include "controlplotvars_mva.h"
-//#include "controlplotvars_Nminus1plot.h"
-//#include "controlplotvars_CHS_signal.h"
-//#include "controlplotvars_CHS_signal_2lep.h"
-//#include "controlplotvars_UpDn.h"
-
-
-
-using namespace std;
double intLUMIinvpb;
@@ -71,966 +58,967 @@ double intLUMIinvpb;
// ====================================================================================
// Self Function
// ====================================================================================
-/*
-*/
void cmspre(double intlumifbinv)
{
- TLatex latex;
- latex.SetNDC();
- latex.SetTextSize(0.04);
-
- latex.SetTextAlign(31); // align right
- latex.DrawLatex(0.95,0.92,"#sqrt{s} = 13 TeV");
- latex.SetTextAlign(31); // align right
- latex.DrawLatex(0.73,0.93,Form("#int #font[12]{L} dt = %.1f fb^{-1}", (float)intlumifbinv));
-// latex.DrawLatex(0.65,0.93,Form("2012B", (float)intlumifbinv));
-
- latex.SetTextAlign(11); // align left
-// latex.DrawLatex(0.15,0.93,"CMS, #sqrt{s} = 7 TeV");//preliminary 2011");
- latex.SetTextSize(0.06);
- latex.DrawLatex(0.145,0.92,"CMS #bf{#it{preliminary}}");
-
+ TLatex latex;
+ latex.SetNDC();
+ latex.SetTextSize(0.04);
+
+ latex.SetTextAlign(31); // align right
+ latex.DrawLatex(0.95, 0.92, "#sqrt{s} = 13 TeV");
+ latex.SetTextAlign(31); // align right
+ latex.DrawLatex(0.73, 0.93, Form("#int #font[12]{L} dt = %.1f fb^{-1}", (float)intlumifbinv));
+
+ latex.SetTextAlign(11); // align left
+ latex.SetTextSize(0.06);
+ latex.DrawLatex(0.145, 0.92, "CMS #bf{#it{preliminary}}");
}
//======================================================================
-void loadCutString(const char *filename, TString& cutstring)
+void loadCutString(const char *filename, TString &cutstring)
{
- FILE *fp = fopen(filename,"r");
- if (!fp) {
- cout << "Error, file " << TString(filename) << " not found." << endl;
- exit(-1);
- }
+ FILE *fp = fopen(filename, "r");
+ if (!fp)
+ {
+ std::cout << "Error, file " << TString(filename) << " not found." << std::endl;;;
+ exit(-1);
+ }
- char line[512];
+ char line[512];
- for (int i=0; !feof(fp) && fgets(line,512,fp); i++) {
- if (!strlen(line) || line[0]=='#') continue; // comments are welcome
+ for (int i = 0; !feof(fp) && fgets(line, 512, fp); i++)
+ {
+ if (!strlen(line) || line[0] == '#')
+ continue; // comments are welcome
- if (cutstring.Length()) cutstring += " && ";
+ if (cutstring.Length())
+ cutstring += " && ";
- string strline(line);
- strline.pop_back(); // shed the \n
- vector fields;
+ std::string strline(line);
+ strline.pop_back(); // shed the \n
+ std::vector fields;
- // expect columns with fields cutname, cutvalue, possible embedded spaces both
- // within and between, so " " or "\t" cannot be used as delimiters. Require quotes
- // instead.
- //
- Tokenize(strline,fields, "\"");
+ // expect columns with fields cutname, cutvalue, possible embedded spaces both
+ // within and between, so " " or "\t" cannot be used as delimiters. Require quotes
+ // instead.
+ //
+ Tokenize(strline, fields, "\"");
- //for (size_t j=0; jGet("otree"); if (!tree_) { cerr << "Couldn't find tree otree in file " << sinfo.treefilename << endl; return; }
- }
- ~Sample() { if (tree_) delete tree_; }
- TTree *Tree() const { return tree_; }
- TString name() const { return info_.samplename; }
- TString filename() const { return info_.treefilename; }
- bool stackit() const { return (info_.stackit != 0); }
- int colorcode() const { return info_.colorcode; }
- double otherscale() const { return info_.otherscale; }
- TH1D *Draw(const plotVar_t& pv, const TCut& cut, const TCut& cutSQ ) {
- if (!tree_) {
- cerr << "No tree to draw from." << endl;
- return 0;
+ Sample(const SampleInfo_t &sinfo)
+ {
+ info_ = sinfo;
+ tree_ = 0;
+ // std::cout << "sample = " << name_ << std::endl;;
+ TFile *f = new TFile(sinfo.treefilename, "READ");
+ if (!f)
+ {
+ std::cerr << "Couldn't find file " << sinfo.treefilename << std::endl;;
+ return;
+ }
+ // TFile *f = TFile::Open("root://cmsxrootd.fnal.gov/"+sinfo.treefilename, "READ"); if (!f) { std::cerr << "Couldn't find file " << sinfo.treefilename << std::endl;; return; }
+ // tree_ = (TTree *)f->Get("otree"); if (!tree_) { std::cerr << "Couldn't find tree otree in file " << sinfo.treefilename << std::endl;; return; }
+ tree_ = (TTree *)f->Get("Events");
+ if (!tree_)
+ {
+ std::cerr << "Couldn't find tree Events in file " << sinfo.treefilename << std::endl;;
+ return;
+ }
}
- double tmp = 0.;
- cout << "\tDrawing " << pv.plotvar << " for sample = " << info_.samplename << " ... ";
- TString hname = TString("th1")+ pv.outfile + Form("%d",info_.index);
- TH1D *histo = new TH1D(hname, hname, pv.NBINS, pv.MINRange, pv.MAXRange);
- assert(histo);
- histo->Sumw2();
- cout << tree_->Draw(pv.plotvar+TString(">>")+hname, cut, "goff") << " entries, ";
- histo->SetBinContent(pv.NBINS,histo->GetBinContent(pv.NBINS)+histo->GetBinContent(pv.NBINS+1));
- //cout << histo->Integral() << " " << tmp << " " << "weighted entries, (";
- cout << histo->IntegralAndError(0,histo->GetNbinsX()+1,tmp) << " " << tmp << " " << "weighted entries";
-
-#if 0
- if (strlen((const char *)cutSQ)) {
- hname = TString("th1") + pv.outfile + Form("%d",info_.index) + TString("SQ");
- TH1D *histoSQ = new TH1D(hname, hname, pv.NBINS, pv.MINRange, pv.MAXRange);
- tree_->Draw(pv.plotvar+TString(">>")+hname, cutSQ, "goff");
- for(int hi=1;hi<=pv.NBINS;hi++) {
- histo->SetBinError(hi,sqrt(histoSQ->GetBinContent(hi)));
- }
- delete histoSQ;
+ ~Sample()
+ {
+ if (tree_)
+ delete tree_;
}
-#endif
- if (info_.nMCevents) {
- //cout<<"\n===> Evetns = "<Scale((info_.xsecpblumi*info_.otherscale)/(info_.nMCevents - 2*info_.MCnegEvent));
- cout << ", " <IntegralAndError(1,histo->GetNbinsX(),tmp) << " " <Integral(1,histo->GetNbinsX()+1)*info_.xsecpblumi*info_.otherscale)/(info_.nMCevents - 2*info_.MCnegEvent) << " " << " scaled events in window";
+ TTree *Tree() const { return tree_; }
+ TString name() const { return info_.samplename; }
+ TString filename() const { return info_.treefilename; }
+ bool stackit() const { return (info_.stackit != 0); }
+ int colorcode() const { return info_.colorcode; }
+ double otherscale() const { return info_.otherscale; }
+ TH1D *Draw(const plotVar_t &pv, const TCut &cut, const TCut &cutSQ)
+ {
+ if (!tree_)
+ {
+ std::cerr << "No tree to draw from." << std::endl;;
+ return 0;
+ }
+ double tmp = 0.;
+ std::cout << "\tDrawing " << pv.plotvar << " for sample = " << info_.samplename << " ... ";
+ TString hname = TString("th1") + pv.outfile + Form("%d", info_.index);
+ TH1D *histo = new TH1D(hname, hname, pv.NBINS, pv.MINRange, pv.MAXRange);
+ assert(histo);
+ histo->Sumw2();
+ std::cout << tree_->Draw(pv.plotvar + TString(">>") + hname, cut, "goff") << " entries, ";
+ histo->SetBinContent(pv.NBINS, histo->GetBinContent(pv.NBINS) + histo->GetBinContent(pv.NBINS + 1));
+ // std::cout << histo->Integral() << " " << tmp << " " << "weighted entries, (";
+ std::cout << histo->IntegralAndError(0, histo->GetNbinsX() + 1, tmp) << " " << tmp << " "
+ << "weighted entries";
+
+ if (info_.nMCevents)
+ {
+ // std::cout<<"\n===> Evetns = "<Scale((info_.xsecpblumi * info_.otherscale) / (info_.nMCevents - 2 * info_.MCnegEvent));
+ std::cout << ", " << histo->IntegralAndError(1, histo->GetNbinsX(), tmp) << " " << tmp << " " << (histo->Integral(1, histo->GetNbinsX() + 1) * info_.xsecpblumi * info_.otherscale) / (info_.nMCevents - 2 * info_.MCnegEvent) << " "
+ << " scaled events in window";
+ }
+ std::cout << std::endl;;
+
+ return histo;
}
- cout << endl;
- return histo;
- }
private:
- SampleInfo_t info_;
- TTree *tree_;
+ SampleInfo_t info_;
+ TTree *tree_;
};
//======================================================================
-void loadSamples(const char *filename,vector& samples)
+void loadSamples(const char *filename, std::vector &samples)
{
- FILE *fp = fopen(filename,"r");
- if (!fp) {
- cout << "Error, file " << TString(filename) << " not found." << endl;
- exit(-1);
- }
-
- char line[512];
-
- intLUMIinvpb=-1; // obvious error condition
-
- for (int i=0; !feof(fp) && fgets(line,512,fp); i++) {
- if (!strlen(line) || line[0]=='#') continue; // comments are welcome
-
- string strline(line);
- strline.pop_back(); // shed the \n
- vector fields;
-
- // expect columns with fields cutname, cutvalue, possible embedded spaces both
- // within and between, so " " or "\t" cannot be used as delimiters. Require quotes
- // instead.
- //
- Tokenize(strline,fields, " \t");
-
- //for (size_t j=0; j " << s.treefilename << endl;
-
- if (!samples.size()) {
- if (s.samplename.EqualTo("data")) {
- intLUMIinvpb = s.xsecpblumi;
- s.xsecpblumi = 1;
- cout << "intLUMI = " << intLUMIinvpb << " pb^-1" << endl;
- } else {
- cerr << "First sample in the table must be 'data'" << endl;
- exit(-1);
- }
- } else {
- s.otherscale *= intLUMIinvpb;
+ FILE *fp = fopen(filename, "r");
+ if (!fp)
+ {
+ std::cout << "Error, file " << TString(filename) << " not found." << std::endl;;
+ exit(-1);
}
- samples.push_back(new Sample(s) );
- }
-} // loadSamples
+ char line[512];
+
+ intLUMIinvpb = -1; // obvious error condition
+
+ for (int i = 0; !feof(fp) && fgets(line, 512, fp); i++)
+ {
+ if (!strlen(line) || line[0] == '#')
+ continue; // comments are welcome
+
+ std::string strline(line);
+ strline.pop_back(); // shed the \n
+ std::vector fields;
+
+ // expect columns with fields cutname, cutvalue, possible embedded spaces both
+ // within and between, so " " or "\t" cannot be used as delimiters. Require quotes
+ // instead.
+ //
+ Tokenize(strline, fields, " \t");
+
+ // for (size_t j=0; j " << s.treefilename << std::endl;;
+
+ if (!samples.size())
+ {
+ if (s.samplename.EqualTo("data"))
+ {
+ intLUMIinvpb = s.xsecpblumi;
+ s.xsecpblumi = 1;
+ std::cout << "intLUMI = " << intLUMIinvpb << " pb^-1" << std::endl;;
+ }
+ else
+ {
+ std::cerr << "First sample in the table must be 'data'" << std::endl;;
+ exit(-1);
+ }
+ }
+ else
+ {
+ s.otherscale *= intLUMIinvpb;
+ }
+
+ samples.push_back(new Sample(s));
+ }
+} // loadSamples
//======================================================================
void myControlPlots(const char *cuttablefilename,
- const char *samplefilename,
- const plotVar_t plotvars[] = commonplotvars_chs,
- const string OutRootFile = "testrk.root",
- const int ScaleSignal = 0,
- const string RecreateAppend = "RECREATE",
- const int isData = 1
- )
-// const plotVar_t plotvars[] = boostedplotvars )
+ const char *samplefilename,
+ const plotVar_t plotvars[] = controlplotvars_CHS,
+ const std::string OutRootFile = "testrk.root",
+ const std::string OutDir = "OutDir",
+ const int ScaleSignal = 0,
+ const std::string RecreateAppend = "RECREATE",
+ const int isData = 1)
{
- //gROOT->ProcessLine(".L tdrstyle.C");
- if (int(ScaleSignal) != 1 && int(ScaleSignal) != 0)
- {
- std::cout << "=========================================\n\n" << endl;
- std::cerr << "Error: Scale Signal values should be 1 or 0.\n" << endl;
- exit(-1);
- }
-
- ofstream Logfile;
-
- TH1D::SetDefaultSumw2(1);
-
- //TFile *outDC = new TFile("htt_mt_inputs.root","RECREATE");
-
- TString unwtcutstring;
-
- loadCutString(cuttablefilename, unwtcutstring);
-
- TString blinddatacutstring = unwtcutstring + "&&(1)";
- // For blinding data uncomment this
- //TString blinddatacutstring = unwtcutstring + "&& (PuppiAK8_jet_mass_so<65 || PuppiAK8_jet_mass_so>105)&&(1)";
-
- // const char* the_cut = "1";
- // double BINWIDTH = ((MAXRange-MINRange)/NBINS);
-
- // Get the input trees:
-
- vector samples;
-
- loadSamples(samplefilename,samples);
-
- // Data
-
- Sample *sdata = samples[0];
-
- if (sdata->Tree())
- cout << "ndata =" << sdata->Tree()->GetEntries() <BaseName(cuttablefilename)).ReplaceAll(".txt","")+TString("_")+pv.outfile;
- Logfile.open (outfile+".log");
- TString temp = TString("Yield of Variable : ")+pv.outfile;
- const std::string spaces(temp.Length(), ' ');
- const std::string second = "* " + spaces + " *";
- const std::string first(second.size(), '*');
- Logfile << first << std::endl;
- Logfile << second << std::endl;
- Logfile << "* " << temp << " *" << std::endl;
- Logfile << second << std::endl;
- if (int(ScaleSignal) == 1)
- Logfile << "* \t signal is scaled by 50..." <Tree() &&
- sdata->Tree()->Draw(pv.plotvar,"","goff",1) == -1 ) { // check if the variable exists in the tree
- cout << "\t...can't be plotted!" << endl;
- continue;
- }
-
- //
- // ONE LEPTON CUTS
- //
- //TCut the_cut(TString("L1_PrefweightUp*btag0Wgt*genWeight*trig_eff_Weight*id_eff_Weight*pu_Weight*(")+unwtcutstring+TString(")"));
- //TCut the_cut(TString("L1_PrefweightDown*btag0Wgt*genWeight*trig_eff_Weight*id_eff_Weight*pu_Weight*(")+unwtcutstring+TString(")"));
- TCut the_cut(TString("L1_Prefweight*btag0Wgt*genWeight*trig_eff_Weight*id_eff_Weight*pu_Weight*(")+unwtcutstring+TString(")"));
- //TCut the_cut(TString("trig_eff_Weight*btag0Wgt*genWeight*id_eff_Weight*pu_Weight*(")+unwtcutstring+TString(")"));
- //TCut the_cut(TString("btag1Wgt*genWeight*trig_eff_Weight*id_eff_Weight*pu_Weight*(")+unwtcutstring+TString(")")); // For Top control region
- //
- // TWO LEPTON CASE
- //
- //TCut the_cut(TString("totalEventWeight_2Lep*btag0Wgt*(")+unwtcutstring+TString(")"));
-
- TCut nullcut("");
-
- cout << "the_cut = "<< the_cut << endl;
-
- const double BINWIDTH = ((pv.MAXRange-pv.MINRange)/pv.NBINS);
-
- map m_histos;
- map m_stacked;
-
- double totevents = 0.;
-
- //============================================================
- // DRAW THE VARIABLE FOR ALL SAMPLES, CREATE HISTOS
- //============================================================
-
- for (size_t isamp=0; isampname()] = false;
-
- TH1D *h;
-
- if (s->name().EqualTo("data")) {
- plotVar_t pvnosmear = pv;
- //pvnosmear.plotvar.ReplaceAll("_smeared",""); // no smearing for data!
- h = s->Draw(pvnosmear, TCut(blinddatacutstring), nullcut); // effwt*puwt==1 for data! -- NO IT DOESN'T NECESSARILY!
- }
- //else if (s->name().EqualTo("aQGCX100")){
- else if (s->name().EqualTo("aQGC")){
- if (int(ScaleSignal) == 1)
- { h = s->Draw(pv, the_cut*"50"*"(LHEWeight[1121]/LHEWeight[0])", the_cut*"50"*"(LHEWeight[1121]/LHEWeight[0])");
- cout<<"====> Scale Signal = " << ScaleSignal << endl;
- }
- else
- h = s->Draw(pv, the_cut*"(LHEWeight[1121]/LHEWeight[0])", the_cut*"(LHEWeight[1121]/LHEWeight[0])");
- if (s->stackit()) {
- totevents += h->Integral(1,h->GetNbinsX()+1);
- }
- }
- //else if (s->name().EqualTo("WV_EWKX100")){
- else if (s->name().EqualTo("WV_EWK")){
- if (int(ScaleSignal) == 1)
- h = s->Draw(pv, the_cut*"50", the_cut*"50");
- else
- h = s->Draw(pv, the_cut, the_cut);
- if (s->stackit()) {
- totevents += h->Integral(1,h->GetNbinsX()+1);
- }
- }
- else {
- h = s->Draw(pv, the_cut, the_cut);
- if (s->stackit()) {
- totevents += h->Integral(1,h->GetNbinsX()+1);
- }
- }
-
- if (!h) continue;
-
- map::iterator mit = m_histos.find(s->name());
- if (mit == m_histos.end()) {
- h->SetName(s->name());
- h->SetTitle(s->name());
- if (s->stackit()) {
- if (s->name().EqualTo("V+jets"))
- {
- h->SetLineColor(TColor::GetColor(222,90,106));
- h->SetFillColor(TColor::GetColor(222,90,106));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("W+jets"))
- {
- h->SetLineColor(TColor::GetColor(222,90,106));
- h->SetFillColor(TColor::GetColor(222,90,106));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("top"))
- {
- h->SetLineColor(TColor::GetColor(155,152,204));
- h->SetFillColor(TColor::GetColor(155,152,204));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("TTbar"))
- {
- h->SetLineColor(TColor::GetColor(155,152,204));
- h->SetFillColor(TColor::GetColor(155,152,204));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("SingleTop"))
- {
- h->SetLineColor(TColor::GetColor(0,84,159));
- h->SetFillColor(TColor::GetColor(0,84,159));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("Z+jets"))
- {
- h->SetLineColor(TColor::GetColor(248,206,104));
- h->SetFillColor(TColor::GetColor(248,206,104));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("Diboson"))
- {
- h->SetLineColor(TColor::GetColor(250,202,255));
- h->SetFillColor(TColor::GetColor(250,202,255));
- h->SetLineWidth(0);
- }
- else
- {
- h->SetLineColor(s->colorcode());
- h->SetFillColor(s->colorcode());
- h->SetLineWidth(0);
- }
- }
- m_histos[s->name()] = h;
- } else {
- mit->second->Add(h);
- }
+ gErrorIgnoreLevel = kError;
+
+ if (int(ScaleSignal) != 1 && int(ScaleSignal) != 0)
+ {
+ std::cout << "=========================================\n\n"
+ << std::endl;;
+ std::cerr << "Error: Scale Signal values should be 1 or 0.\n"
+ << std::endl;;
+ exit(-1);
}
- //============================================================
- // COUNT EVENTS, RENORM TO DATA, CONSTRUCT THE TSTACK & LEGEND
- //============================================================
+ std::ofstream Logfile;
- TH1D *th1data = m_histos["data"];
- //TH1D *aqgc = m_histos["aQGC"];
- double maxval = -9e99;
-
- double ndata=1., renorm=1.;
- if (th1data) {
- ndata = th1data->Integral(1,th1data->GetNbinsX()+1);
- renorm = ndata/totevents;
- int maxbin = th1data->GetMaximumBin();
- maxval = std::max(maxval,th1data->GetBinContent(maxbin));
-
- cout << "Total MC = " << totevents << endl;
- cout << "data = " << ndata <SetFillColor(0);
- Leg->SetFillStyle(0);
- Leg->SetBorderSize(0);
- //Leg->SetTextSize(0.04);
- //Leg->SetNColumns(3);
-
- if (th1data){
- if (TString(cuttablefilename).Contains("Mu"))
- Leg->AddEntry(th1data, "Observed", "LP");
- else
- Leg->AddEntry(th1data, "Observed", "LP");
- }
+ // TFile *outDC = new TFile("htt_mt_inputs.root","RECREATE");
- vector binErrSQ(pv.NBINS,0.);
-
- vector > v_legentries;
-
- TString oldsamplename;
-
- for (size_t isamp=1; isampname()==oldsamplename) continue;
-
- map::iterator mit = m_histos.find(s->name());
- TH1D *h = mit->second;
- //h->SetLineColor(kBlack);
- h->SetLineWidth( 3.);
- //h->SetFillColor(color );
- //h->SetFillStyle(style );
- h->SetTitleSize (0.055,"Y");
- h->SetTitleOffset(1.600,"Y");
- h->SetLabelOffset(0.014,"Y");
- h->SetLabelSize (0.050,"Y");
- h->SetLabelFont (42 ,"Y");
- h->SetTitleSize (0.055,"X");
- h->SetTitleOffset(1.300,"X");
- h->SetLabelOffset(0.014,"X");
- h->SetLabelSize (0.050,"X");
- h->SetLabelFont (42 ,"X");
- //h->SetMarkerStyle(20);
- //h->SetMarkerColor(color);
- h->SetMarkerSize (0.6);
- h->GetYaxis()->SetTitleFont(42);
- h->GetXaxis()->SetTitleFont(42);
- //h->SetTitle("");
-
- //if (s->stackit())
- // h->Scale(renorm);
- //else
- // h->Scale(ndata/h->Integral());
-
-// cout << s->name() << " = " << Form("%4g,%7g,%4g",
-// h->Integral(0,0),
-// h->Integral(1,h->GetNbinsX()+1),
-// h->Integral(h->GetNbinsX()+1,h->GetNbinsX()+1))
-// << endl;
- cout << s->name() << " = " << Form("%7g", h->Integral(1,h->GetNbinsX()+1)) << endl;
- Logfile << s->name() << " = " << Form("%7g", h->Integral(1,h->GetNbinsX()+1)) << endl;
-
- if(s->stackit()) {
- // Compose the stack
- hs->Add(h);
- th1tot->Add(h);
- m_stacked[s->name()] = true;
- for (int ibin=1; ibin <= pv.NBINS; ibin++)
- binErrSQ[ibin-1] += h->GetBinError(ibin)*h->GetBinError(ibin);
- }
- v_legentries.push_back(*mit);
-
- int maxbin = h->GetMaximumBin();
- maxval = std::max(maxval,h->GetBinContent(maxbin));
-
- oldsamplename=s->name();
- h->Write();
- }
+ TString unwtcutstring;
- cout << "maxval " < >::reverse_iterator
- rit = v_legentries.rbegin();
- rit != v_legentries.rend();
- rit++)
- {
- if(rit->first=="aQGC")
- {
- if (int(ScaleSignal) == 1)
- Leg->AddEntry(rit->second, rit->first+TString("X50"), "L" ); // "F");
- else
- Leg->AddEntry(rit->second, rit->first+TString("(FT2=-0.5)"), "L" ); // "F");
- //if(rit->first=="aQGCX100" || rit->first=="WV_EWKX100")
- }
- else if(rit->first=="WV_EWK")
- {
- if (int(ScaleSignal) == 1)
- Leg->AddEntry(rit->second, rit->first+TString("X50"), "L" ); // "F");
- else
- Leg->AddEntry(rit->second, rit->first, "L" ); // "F");
- //if(rit->first=="aQGCX100" || rit->first=="WV_EWKX100")
- }
- else
- Leg->AddEntry(rit->second, rit->first, "F" ); // "F");
- }
- TH1D* th1totClone = ( TH1D*) th1tot->Clone("th1totClone");
- th1totClone->SetMarkerStyle(0);
- th1totClone->SetFillStyle(3003);
- th1totClone->SetFillColor(11);
- th1totClone->SetLineColor(0);
-
- for(int ibin=1; ibin<=th1totClone->GetNbinsX(); ++ibin) {
- th1totClone->SetBinError(ibin, sqrt(binErrSQ[ibin-1]));
- }
+ loadCutString(cuttablefilename, unwtcutstring);
- //============================================================
- // SETUP THE CANVAS
- //============================================================
+ TString blinddatacutstring = unwtcutstring + "&&(1)";
+ // For blinding data uncomment this
+ // TString blinddatacutstring = unwtcutstring + "&& (PuppiAK8_jet_mass_so<65 || PuppiAK8_jet_mass_so>105)&&(1)";
-// gROOT->ProcessLine(".L tdrstyle.C");
- setTDRStyle();
- //tdrStyle->SetErrorX(0.5);
- //tdrStyle->SetPadRightMargin(0.05);
-
- //tdrStyle->SetLegendBorderSize(0);
-
- TCanvas* c1 = new TCanvas(pv.plotvar,pv.plotvar,10,10, 800, 600);
- TPad *d1, *d2;
-
- c1->SetFillColor (0);
- c1->SetBorderMode (0);
- c1->SetBorderSize (10);
- // Set margins to reasonable defaults
- c1->SetLeftMargin (0.18);
- c1->SetRightMargin (0.05);
- c1->SetTopMargin (0.08);
- c1->SetBottomMargin (0.15);
- // Setup a frame which makes sense
- c1->SetFrameFillStyle (0);
- c1->SetFrameLineStyle (0);
- c1->SetFrameBorderMode(0);
- c1->SetFrameBorderSize(10);
- c1->SetFrameFillStyle (0);
- c1->SetFrameLineStyle (0);
- c1->SetFrameBorderMode(0);
- c1->SetFrameBorderSize(10);
-
- if (th1data) {
- c1->Divide(1,2);
- d1 = (TPad*)c1->GetPad(1);
- d1->SetPad(0.01,0.30,0.95,0.99);
- //c1->cd();
- d2 = (TPad*)c1->GetPad(2);
- d2->SetPad(0.01,0.02,0.95,0.30);
- d1->cd();
- gPad->SetBottomMargin(0.0);
- }
+ // const char* the_cut = "1";
+ // double BINWIDTH = ((MAXRange-MINRange)/NBINS);
- gPad->SetTopMargin(0.1);
- gPad->SetRightMargin(0.05);
- gPad->SetLeftMargin(0.14);
+ // Get the input trees:
- gPad->SetLogy(0);
+ std::vector samples;
- if (th1tot->GetEntries())
- Leg->AddEntry(th1tot, "Stat. Uncertainty", "f");
+ loadSamples(samplefilename, samples);
- Leg->SetFillColor(0);
+ // Data
+ Sample *sdata = samples[0];
- TH1D* th1totempty = new TH1D("th1totempty", "th1totempty", pv.ANBINS, pv.AMINRange, pv.AMAXRange);
- if (th1data) {
- th1data->SetMarkerStyle(20);
- th1data->SetLineColor(kBlack);
- th1data->SetMarkerSize(1.3);
- th1data->SetLineWidth(3);
- }
+ if (sdata->Tree())
+ std::cout << "ndata =" << sdata->Tree()->GetEntries() << std::endl;;
+ TFile *f;
- th1tot->SetFillStyle(3013);
- th1tot->SetFillColor(13);
- th1tot->SetLineColor(kBlack);
- th1tot->SetLineWidth(1);
- th1tot->SetMarkerStyle(0);
-
- char tmpc[100]; sprintf(tmpc,"Events");
- if (pv.slog==1) sprintf(tmpc,"Events/ %.1f",BINWIDTH);
- if (pv.slog==2) sprintf(tmpc,"Events/ %.3f",BINWIDTH);
- if (pv.slog==3) sprintf(tmpc,"Events/ ( %.0f GeV)",BINWIDTH);
- if (pv.slog==6) sprintf(tmpc,"Events/ ( %.1f rad)",BINWIDTH);
- th1totempty->SetYTitle(tmpc);
- // th1totempty->GetYaxis()->SetTitleSize(0.1);
- th1totempty->GetYaxis()->SetTitleOffset(1.2);
- th1totempty->GetYaxis()->SetLabelOffset(0.01);
- // th1totempty->GetYaxis()->CenterTitle(true);
- th1totempty->GetYaxis()->SetLabelSize(0.04);
- // th1totClone->Draw("e3");
-
- if (th1tot->GetEntries()) {
- th1tot->SetMinimum(0.1);
- th1totempty->SetMinimum(0.1);
+ if (strcmp(RecreateAppend.c_str(), "RECREATE") == 0)
+ {
+ f = new TFile(OutRootFile.c_str(), "RECREATE");
+ std::cout << "RECREATE file " << OutRootFile.c_str() << std::endl;;
}
-
-// th1totempty->SetMaximum(2.5*maxval);
- th1totempty->SetMaximum(1.9*maxval);
- if(pv.slog==9) th1totempty->SetMaximum(1.9*maxval);
- //th1totempty->SetMaximum(350.);
-
- // Draw it all
-
- th1totempty->Draw();
-
- if (th1data) {
- th1data->SetMinimum(0.1);
- th1data->SetBinErrorOption(TH1D::kPoisson);
- th1data->Draw("e0same");
- }
-
- //th1tot->Draw("e2same");
-
- hs->SetMaximum(400.0);
- hs->Draw("samehist");
- if (pv.drawleg ==1) Leg->Draw();
-
- th1tot->Draw("e2same");
-
- if (th1data)
- th1data->Draw("e1same");
- //if(aqgc)
- // aqgc->Draw("same");
-
- // draw unstacked histos separately.
- oldsamplename.Clear();
- TH1D *h1 = new TH1D("h1","",100,0,100);
- TH1D *h2 = new TH1D("h2","",100,0,100);
- for (size_t isamp=0; isampname()==oldsamplename) continue;
- if (!s->stackit()) {
- map::iterator mit = m_histos.find(s->name());
- if (mit != m_histos.end()) {
- TH1D *h = mit->second;
- if (h && s->name()=="WV_EWK")
- //if (h && s->name()=="WV_EWKX100")
- {
- h->SetFillStyle(0.);
- //aqgc->SetLineStyle(11);
- h->SetLineWidth(3.);
- h->SetLineColor(kBlue+3);
- if (int(ScaleSignal) == 1){
- cout << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1)/50)/sqrt((h->Integral(1,h->GetNbinsX()+1)/50)+totevents) << endl;
- Logfile << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1)/50)/sqrt((h->Integral(1,h->GetNbinsX()+1)/50)+totevents) << endl;
- }
- else{
- cout << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- Logfile << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- }
- h->Draw("histsame");
- h1 = (TH1D*) h->Clone();
-
- }
- if (h && s->name()=="aQGC")
- //if (h && s->name()=="aQGCX100")
- {
- h->SetFillStyle(0.);
- //aqgc->SetLineStyle(11);
- h->SetLineWidth(3.);
- h->SetLineColor(kRed+3);
- //cout << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- cout << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1)/50)/sqrt((h->Integral(1,h->GetNbinsX()+1)/50)+totevents) << endl;
- //Logfile << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- Logfile << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1)/50)/sqrt((h->Integral(1,h->GetNbinsX()+1)/50)+totevents) << endl;
- h->Draw("histsame");
- h2 = (TH1D*) h->Clone();
- //h->Draw("e1same");
- }
- if (isData) h->Write();
- }
- }
- oldsamplename=s->name();
-
- }
-
- //cmspre(intLUMIinvpb/1000.0);
- CMS_lumi( d1, 4, 10 );
- // th1data->Draw("Axissame");
- gPad->RedrawAxis();
- TH1D * hhratio;
- TH1D *th1emptyclone;
- TBox *errbox;
-
- if (th1data) {
- d2->cd();
- //TH1D * hhratio = (TH1D*) th1data->Clone("hhratio") ;
- hhratio = (TH1D*) th1data->Clone("hhratio") ;
- hhratio->Sumw2();
- hhratio->SetStats(0);
-
- gPad->SetLeftMargin(0.14);
- gPad->SetTopMargin(0);
- gPad->SetRightMargin(0.05);
- gPad->SetFrameBorderSize(0);
- gPad->SetBottomMargin(0.3);
- gPad->SetTickx();
-
- hhratio->SetMarkerSize(1.25);
- // hhratio->GetYaxis()->SetRangeUser(0.48,1.52);
- hhratio->GetYaxis()->SetRangeUser(0.5,1.5);
- hhratio->GetXaxis()->SetTitle(pv.xlabel);
- hhratio->GetXaxis()->SetTitleOffset(0.9);
- hhratio->GetXaxis()->SetTitleSize(0.15);
- hhratio->GetXaxis()->SetLabelSize(0.15);
- hhratio->GetYaxis()->SetTitleSize(0.1);
- hhratio->GetYaxis()->SetTitleOffset(0.5);
- hhratio->GetYaxis()->CenterTitle(true);
- hhratio->GetYaxis()->SetLabelSize(0.1);
- cout << hhratio->GetNbinsX() << endl;
- cout << th1tot->GetNbinsX() << endl;
- hhratio->Divide(th1tot);
- double binError(0.0), mcbinentry(0.0), mcerror(0.0);
- for(int i=0; iGetNbinsX(); ++i) {
- binError = hhratio->GetBinError(i);
- mcerror = th1tot->GetBinError(i);
- mcbinentry = th1tot->GetBinContent(i);
- if(mcbinentry>0.) mcerror /= mcbinentry;
- else mcerror = 0.0;
- binError = sqrt(binError*binError + mcerror*mcerror);
- hhratio->SetBinError(i, binError);
- }
- th1emptyclone = new TH1D("th1emptyclone", "th1emptyclone", pv.ANBINS, pv.AMINRange, pv.AMAXRange);
- th1emptyclone->GetYaxis()->SetRangeUser(0.1,2.8000);
- th1emptyclone->GetXaxis()->SetTitle(pv.xlabel);
- th1emptyclone->GetXaxis()->SetTitleOffset(0.9);
- th1emptyclone->GetXaxis()->SetTitleSize(0.15);
- th1emptyclone->GetXaxis()->SetLabelSize(0.15);
- th1emptyclone->SetYTitle("Data/MC");
- th1emptyclone->GetYaxis()->SetTitleSize(0.13);
- th1emptyclone->GetXaxis()->SetNdivisions(505);
- th1emptyclone->GetYaxis()->SetNdivisions(505);
- th1emptyclone->GetYaxis()->SetTitleOffset(0.5);
- th1emptyclone->GetYaxis()->CenterTitle(true);
- th1emptyclone->GetYaxis()->SetLabelSize(0.1);
- th1emptyclone->Draw();
-
- //TBox *errbox = new TBox(pv.AMINRange,0.974,pv.AMAXRange,1.026); // lumi systematic uncertainty
- errbox = new TBox(pv.AMINRange,0.974,pv.AMAXRange,1.026); // lumi systematic uncertainty
- errbox->SetFillColor(kGray);
- errbox->Draw();
-
-#if 0
- TF1 *f1 = new TF1("f1", "pol1", pv.AMINRange, pv.AMAXRange);
- f1->SetParameters(1.0,0.0);
- f1->SetParameters(1,0.0);
- //f1->FixParameter(0,1);
- //f1->FixParameter(1,0);
- //cout<<" par1 "f1->GetParameter(0)<GetParameter(1)<SetLineWidth(2);
-
- TFitResultPtr r = hhratio->Fit("f1", "RBS");
- //TFitResultPtr r = hhratio->Fit(myFunc,"S");
- r->Print("V"); // print full information of fit including covariance matrix
-#endif
-
- hhratio->Draw("esame");
- TLine *line1; line1 = new TLine(pv.AMINRange,0.5,pv.AMAXRange,0.5);
- line1->SetLineStyle(2);
- line1->SetLineWidth(1);
- line1->SetLineColor(1);
- line1->Draw();
- TLine *line2; line2 = new TLine(pv.AMINRange,1.0,pv.AMAXRange,1.0);
- line2->SetLineStyle(2);
- line2->SetLineWidth(1);
- line2->SetLineColor(1);
- line2->Draw();
- TLine *line3; line3 = new TLine(pv.AMINRange,1.5,pv.AMAXRange,1.5);
- line3->SetLineStyle(2);
- line3->SetLineWidth(1);
- line3->SetLineColor(1);
- line3->Draw();
+ else if (strcmp(RecreateAppend.c_str(), "UPDATE") == 0)
+ {
+ f = new TFile(OutRootFile.c_str(), "UPDATE");
+ std::cout << "UPDATE file " << OutRootFile.c_str() << std::endl;;
}
-
-
- c1->Print(outfile+".pdf");
- c1->Print(outfile+".png");
- c1->Print(outfile+".root");
- c1->Print(outfile+".C");
- //c1->Print(outfile+".tex");
- //-----------------------------------------------------------------
- // Save log plot
- //-----------------------------------------------------------------
- TCanvas *c2 = new TCanvas("c2","c2",800,600);
- TPad *d3, *d4;
-
- c2->SetFillColor (0);
- c2->SetBorderMode (0);
- c2->SetBorderSize (10);
- // Set margins to reasonable defaults
- c2->SetLeftMargin (0.18);
- c2->SetRightMargin (0.05);
- c2->SetTopMargin (0.08);
- c2->SetBottomMargin (0.15);
- // Setup a frame which makes sense
- c2->SetFrameFillStyle (0);
- c2->SetFrameLineStyle (0);
- c2->SetFrameBorderMode(0);
- c2->SetFrameBorderSize(10);
- c2->SetFrameFillStyle (0);
- c2->SetFrameLineStyle (0);
- c2->SetFrameBorderMode(0);
- c2->SetFrameBorderSize(10);
-
- c2->Divide(1,2);
- d3 = (TPad*)c2->GetPad(1);
- d3->SetPad(0.01,0.30,0.95,0.99);
- //c1->cd();
- d4 = (TPad*)c2->GetPad(2);
- d4->SetPad(0.01,0.02,0.95,0.30);
- d3->cd();
- gPad->SetBottomMargin(0.0);
-
- gPad->SetTopMargin(0.1);
- gPad->SetRightMargin(0.05);
- gPad->SetLeftMargin(0.14);
-
- gPad->SetLogy(1);
-
- th1totempty->SetMaximum(800*maxval);
- th1totempty->SetMinimum(0.001);
- th1totempty->Draw();
-
- if (th1data) {
- th1data->SetMinimum(0.001);
- th1data->SetBinErrorOption(TH1D::kPoisson);
- th1data->Draw("e0same");
+ else
+ {
+ std::cout << "=========================================\n\n"
+ << std::endl;;
+ std::cerr << "Error: Root file option can either be RECREATE or UPDATE...\n"
+ << std::endl;;
+ exit(-1);
}
+ //============================================================
+ // VARIABLE LOOP
+ //============================================================
- th1tot->Draw("e2same");
-
- hs->SetMinimum(0.001);
- hs->Draw("samehist");
- if (pv.drawleg ==1) Leg->Draw();
-
- th1tot->Draw("e2same");
- if (h1->GetEntries()>0) h1->Draw("histsame");
- if (h2->GetEntries()>0) h2->Draw("histsame");
- if (th1data)
- th1data->Draw("e1same");
-
- CMS_lumi( d3, 4, 10 );
- gPad->RedrawAxis();
- d4->cd();
- gPad->SetLeftMargin(0.14);
- gPad->SetTopMargin(0);
- gPad->SetRightMargin(0.05);
- gPad->SetFrameBorderSize(0);
- gPad->SetBottomMargin(0.3);
- gPad->SetTickx();
- th1emptyclone->Draw();
- errbox->Draw();
-
- hhratio->Draw("esame");
- TLine *line; line = new TLine(pv.AMINRange,1.0,pv.AMAXRange,1.0);
- line->SetLineStyle(1);
- line->SetLineWidth(1);
- line->SetLineColor(1);
- line->Draw();
-
- c2->Print(outfile+"_log.png");
- //-----------------------------------------------------------------
- // END: Save log plot
- //-----------------------------------------------------------------
-
- Logfile.close();
-#if 0
- c1->Print(outfile+".C");
- //gPad->WaitPrimitive();
- c1->Modified();
- c1->Update();
- c1->SaveAs(outfile+".pdf");
-#endif
- c1->Write();
- } // var loop
-
- //f.Write();
- f->Close();
-
-} // myControlPlots
-
-//================================================================================
-/*
-void dibresNobtagElplots()
-{
- myControlPlots("DibosonResolvedElCuts.txt",
- "DibosonResolvedElSamples13TeV.txt",
- commonplotvars);
-}
-
-//================================================================================
-
-
-void Nminus1_plots_met()
-{
- myControlPlots("DibosonBoostedElCuts13TeV_WjetControlRegion_tight.txt",
- "DibosonBoostedElSamples13TeV.txt",
- met
- );
- myControlPlots("DibosonBoostedMuCuts13TeV_WjetControlRegion_tight.txt",
- "DibosonBoostedMuSamples13TeV.txt",
- met
- );
- myControlPlots("DibosonBoostedElCuts13TeV_TTBarControlRegion.txt",
- "DibosonBoostedElSamples13TeV.txt",
- met
- );
- myControlPlots("DibosonBoostedMuCuts13TeV_TTBarControlRegion.txt",
- "DibosonBoostedMuSamples13TeV.txt",
- met
- );
-}
-*/
+ for (int ivar = 0;; ivar++)
+ {
+ plotVar_t pv = plotvars[ivar];
+ // Create OutDir
+ gSystem->mkdir(OutDir.c_str(), kTRUE);
+ // copy file index.php from current directory to OutDir
+ gSystem->CopyFile("index.php", TString(OutDir) + TString("/index.php"));
+
+ TString outfile = TString(OutDir) + TString("/") + TString(gSystem->BaseName(cuttablefilename)).ReplaceAll(".txt", "") + TString("_") + pv.outfile;
+ Logfile.open(outfile + ".log");
+ TString temp = TString("Yield of Variable : ") + pv.outfile;
+ const std::string spaces(temp.Length(), ' ');
+ const std::string second = "* " + spaces + " *";
+ const std::string first(second.size(), '*');
+ Logfile << first << std::endl;;
+ Logfile << second << std::endl;;
+ Logfile << "* " << temp << " *" << std::endl;;
+ Logfile << second << std::endl;;
+ if (int(ScaleSignal) == 1)
+ Logfile << "* \t signal is scaled by 50..." << std::endl;;
+ Logfile << second << std::endl;;
+ Logfile << first << std::endl;;
+
+ if (!pv.plotvar.Length())
+ break;
+
+ std::cout << pv.plotvar << "\t" << pv.MINRange << "\t" << pv.MAXRange << "\t" << pv.NBINS << "\tTHE CUT " << std::endl;;
+
+ if (!pv.plotvar.Contains("_smeared"))
+ if (sdata->Tree() &&
+ sdata->Tree()->Draw(pv.plotvar, "", "goff", 1) == -1)
+ { // check if the variable exists in the tree
+ std::cout << "\t...can't be plotted!" << std::endl;;
+ continue;
+ }
+
+ //
+ // ONE LEPTON CUTS
+ //
+ // TCut the_cut(TString("L1_PrefweightUp*btag0Wgt*genWeight*trig_eff_Weight*id_eff_Weight*pu_Weight*(")+unwtcutstring+TString(")"));
+ // TCut the_cut(TString("L1_PrefweightDown*btag0Wgt*genWeight*trig_eff_Weight*id_eff_Weight*pu_Weight*(")+unwtcutstring+TString(")"));
+ // TCut the_cut(TString("*(") + unwtcutstring + TString(")"));
+ //TCut the_cut(TString("1*(") + unwtcutstring + TString(")")); // PV weight not added
+
+ TCut the_cut(TString("puWeight*(") + unwtcutstring + TString(")")); //####AV###
+ // TCut the_cut(TString("trig_eff_Weight*btag0Wgt*genWeight*id_eff_Weight*pu_Weight*(")+unwtcutstring+TString(")"));
+ // TCut the_cut(TString("btag1Wgt*genWeight*trig_eff_Weight*id_eff_Weight*pu_Weight*(")+unwtcutstring+TString(")")); // For Top control region
+
+ TCut nullcut("");
+
+ std::cout << "the_cut = " << the_cut << std::endl;;
+
+ const double BINWIDTH = ((pv.MAXRange - pv.MINRange) / pv.NBINS);
+
+ map m_histos;
+ map m_stacked;
+
+ double totevents = 0.;
+
+ //============================================================
+ // DRAW THE VARIABLE FOR ALL SAMPLES, CREATE HISTOS
+ //============================================================
+
+ for (size_t isamp = 0; isamp < samples.size(); isamp++)
+ {
+ Sample *s = samples[isamp];
+
+ m_stacked[s->name()] = false;
+
+ TH1D *h;
+
+ if (s->name().EqualTo("data"))
+ {
+ plotVar_t pvnosmear = pv;
+ // pvnosmear.plotvar.ReplaceAll("_smeared",""); // no smearing for data!
+ h = s->Draw(pvnosmear, TCut(blinddatacutstring), nullcut); // effwt*puwt==1 for data! -- NO IT DOESN'T NECESSARILY!
+ }
+ // else if (s->name().EqualTo("aQGCX100")){
+ else if (s->name().EqualTo("aQGC"))
+ {
+ if (int(ScaleSignal) == 1)
+ {
+ h = s->Draw(pv, the_cut * "50" * "(LHEWeight[1121]/LHEWeight[0])", the_cut * "50" * "(LHEWeight[1121]/LHEWeight[0])");
+ std::cout << "====> Scale Signal = " << ScaleSignal << std::endl;;
+ }
+ else
+ h = s->Draw(pv, the_cut * "(LHEWeight[1121]/LHEWeight[0])", the_cut * "(LHEWeight[1121]/LHEWeight[0])");
+ if (s->stackit())
+ {
+ totevents += h->Integral(1, h->GetNbinsX() + 1);
+ }
+ }
+ // else if (s->name().EqualTo("WV_EWKX100")){
+ else if (s->name().EqualTo("WV_EWK"))
+ {
+ if (int(ScaleSignal) == 1)
+ h = s->Draw(pv, the_cut * "50", the_cut * "50");
+ else
+ h = s->Draw(pv, the_cut, the_cut);
+ if (s->stackit())
+ {
+ totevents += h->Integral(1, h->GetNbinsX() + 1);
+ }
+ }
+ //else if (s->name().EqualTo("Z+jets"))
+ else if (s->name().EqualTo("DYJets"))
+ {
+ // add additional cut to the cut string: Weight_nJets_FromDataMC
+ //h = s->Draw(pv, the_cut* "Weight_nJets_FromDataMC", the_cut* "Weight_nJets_FromDataMC"); //##AV##
+ //h = s->Draw(pv, the_cut* "Weight_nJets_FromDataMC_ge1jet", the_cut* "Weight_nJets_FromDataMC_ge1jet"); //##AV##
+ //std::cout << "\t\t==> Updated cut: " << the_cut* "Weight_nJets_FromDataMC" << std::endl;;
+ h = s->Draw(pv, the_cut, the_cut); //uncommented ##AV##
+ if (s->stackit())
+ {
+ totevents += h->Integral(1, h->GetNbinsX() + 1);
+ }
+ }
+ else
+ {
+ h = s->Draw(pv, the_cut, the_cut);
+ if (s->stackit())
+ {
+ totevents += h->Integral(1, h->GetNbinsX() + 1);
+ }
+ }
+
+ if (!h)
+ continue;
+
+ map::iterator mit = m_histos.find(s->name());
+ if (mit == m_histos.end())
+ {
+ h->SetName(s->name());
+ h->SetTitle(s->name());
+ if (s->stackit())
+ {
+ if (s->name().EqualTo("Triboson"))
+ {
+ h->SetLineColor(TColor::GetColor(222, 90, 106));
+ h->SetFillColor(TColor::GetColor(222, 90, 106));
+ h->SetLineWidth(0);
+ }
+ else if (s->name().EqualTo("W+jets"))
+ {
+ h->SetLineColor(TColor::GetColor(222, 90, 106));
+ h->SetFillColor(TColor::GetColor(222, 90, 106));
+ h->SetLineWidth(0);
+ }
+ else if (s->name().EqualTo("top"))
+ {
+ h->SetLineColor(TColor::GetColor(155, 152, 204));
+ h->SetFillColor(TColor::GetColor(155, 152, 204));
+ h->SetLineWidth(0);
+ }
+ else if (s->name().EqualTo("TTbar"))
+ {
+ h->SetLineColor(TColor::GetColor(155, 152, 204));
+ h->SetFillColor(TColor::GetColor(155, 152, 204));
+ h->SetLineWidth(0);
+ }
+ else if (s->name().EqualTo("SingleTop"))
+ {
+ h->SetLineColor(TColor::GetColor(0, 84, 159));
+ h->SetFillColor(TColor::GetColor(0, 84, 159));
+ h->SetLineWidth(0);
+ }
+ else if (s->name().EqualTo("Z+jets"))
+ {
+ h->SetLineColor(TColor::GetColor(248, 206, 104));
+ h->SetFillColor(TColor::GetColor(248, 206, 104));
+ h->SetLineWidth(0);
+ }
+ else if (s->name().EqualTo("Diboson"))
+ {
+ h->SetLineColor(TColor::GetColor(250, 202, 255));
+ h->SetFillColor(TColor::GetColor(250, 202, 255));
+ h->SetLineWidth(0);
+ }
+ else
+ {
+ h->SetLineColor(s->colorcode());
+ h->SetFillColor(s->colorcode());
+ h->SetLineWidth(0);
+ }
+ }
+ m_histos[s->name()] = h;
+ }
+ else
+ {
+ mit->second->Add(h);
+ }
+ }
+
+ //============================================================
+ // COUNT EVENTS, RENORM TO DATA, CONSTRUCT THE TSTACK & LEGEND
+ //============================================================
+
+ TH1D *th1data = m_histos["data"];
+ // TH1D *aqgc = m_histos["aQGC"];
+ double maxval = -9e99;
+
+ double ndata = 1., renorm = 1.;
+ if (th1data)
+ {
+ ndata = th1data->Integral(1, th1data->GetNbinsX() + 1);
+ renorm = ndata / totevents;
+ int maxbin = th1data->GetMaximumBin();
+ maxval = std::max(maxval, th1data->GetBinContent(maxbin));
+
+ std::cout << "Total MC = " << totevents << std::endl;;
+ std::cout << "data = " << ndata << std::endl;;
+ std::cout << "data/MC = " << renorm << std::endl;;
+ Logfile << "Total MC = " << totevents << std::endl;;
+ Logfile << "data = " << ndata << std::endl;;
+ Logfile << "data/MC = " << renorm << std::endl;;
+ }
+
+ // Setup the stack and total
+ THStack *hs = new THStack("hs", "MC contribution");
+ TH1D *th1tot = new TH1D("th1tot", "th1tot", pv.NBINS, pv.MINRange, pv.MAXRange);
+
+ // Set up the legend
+ float legX0 = 0.65, legX1 = 0.99, legY0 = 0.54, legY1 = 0.88;
+ TLegend *Leg = new TLegend(legX0, legY0, legX1, legY1);
+ Leg->SetFillColor(0);
+ Leg->SetFillStyle(0);
+ Leg->SetBorderSize(0);
+
+ if (th1data)
+ {
+ if (TString(cuttablefilename).Contains("Mu"))
+ Leg->AddEntry(th1data, "Observed", "LP");
+ else
+ Leg->AddEntry(th1data, "Observed", "LP");
+ }
+
+ std::vector binErrSQ(pv.NBINS, 0.);
+
+ std::vector> v_legentries;
+
+ TString oldsamplename;
+
+ for (size_t isamp = 1; isamp < samples.size(); isamp++)
+ {
+ Sample *s = samples[isamp];
+ if (s->name() == oldsamplename)
+ continue;
+
+ map::iterator mit = m_histos.find(s->name());
+ TH1D *h = mit->second;
+ h->SetLineWidth(3.);
+ h->SetTitleSize(0.055, "Y");
+ h->SetTitleOffset(1.600, "Y");
+ h->SetLabelOffset(0.014, "Y");
+ h->SetLabelSize(0.050, "Y");
+ h->SetLabelFont(42, "Y");
+ h->SetTitleSize(0.055, "X");
+ h->SetTitleOffset(1.300, "X");
+ h->SetLabelOffset(0.014, "X");
+ h->SetLabelSize(0.050, "X");
+ h->SetLabelFont(42, "X");
+ h->SetMarkerSize(0.6);
+ h->GetYaxis()->SetTitleFont(42);
+ h->GetXaxis()->SetTitleFont(42);
+
+ std::cout << s->name() << " = " << Form("%7g", h->Integral(1, h->GetNbinsX() + 1)) << std::endl;;
+ Logfile << s->name() << " = " << Form("%7g", h->Integral(1, h->GetNbinsX() + 1)) << std::endl;;
+
+ if (s->stackit())
+ {
+ // Compose the stack
+ hs->Add(h);
+ th1tot->Add(h);
+ m_stacked[s->name()] = true;
+ for (int ibin = 1; ibin <= pv.NBINS; ibin++)
+ binErrSQ[ibin - 1] += h->GetBinError(ibin) * h->GetBinError(ibin);
+ }
+ v_legentries.push_back(*mit);
+
+ int maxbin = h->GetMaximumBin();
+ maxval = std::max(maxval, h->GetBinContent(maxbin));
+
+ oldsamplename = s->name();
+ h->Write();
+ }
+
+ std::cout << "maxval " << maxval << std::endl;;
+
+ // Reverse the order for the legend
+ for (std::vector>::reverse_iterator
+ rit = v_legentries.rbegin();
+ rit != v_legentries.rend();
+ rit++)
+ {
+ if (rit->first == "aQGC")
+ {
+ if (int(ScaleSignal) == 1)
+ Leg->AddEntry(rit->second, rit->first + TString("X50"), "L"); // "F");
+ else
+ Leg->AddEntry(rit->second, rit->first + TString("(FT2=-0.5)"), "L"); // "F");
+ }
+ else if (rit->first == "WV_EWK")
+ {
+ if (int(ScaleSignal) == 1)
+ Leg->AddEntry(rit->second, rit->first + TString("X50"), "L"); // "F");
+ else
+ Leg->AddEntry(rit->second, rit->first, "L"); // "F");
+ }
+ else
+ Leg->AddEntry(rit->second, rit->first, "F"); // "F");
+ }
+ TH1D *th1totClone = (TH1D *)th1tot->Clone("th1totClone");
+ th1totClone->SetMarkerStyle(0);
+ th1totClone->SetFillStyle(3003);
+ th1totClone->SetFillColor(11);
+ th1totClone->SetLineColor(0);
+
+ for (int ibin = 1; ibin <= th1totClone->GetNbinsX(); ++ibin)
+ {
+ th1totClone->SetBinError(ibin, sqrt(binErrSQ[ibin - 1]));
+ }
+
+ //============================================================
+ // SETUP THE CANVAS
+ //============================================================
+ setTDRStyle();
+
+ TCanvas *c1 = new TCanvas(pv.plotvar, pv.plotvar, 10, 10, 800, 600);
+ TPad *d1;
+ TPad *d2;
+
+ c1->SetFillColor(0);
+ c1->SetBorderMode(0);
+ c1->SetBorderSize(10);
+ // Set margins to reasonable defaults
+ c1->SetLeftMargin(0.18);
+ c1->SetRightMargin(0.05);
+ c1->SetTopMargin(0.08);
+ c1->SetBottomMargin(0.15);
+ // Setup a frame which makes sense
+ c1->SetFrameFillStyle(0);
+ c1->SetFrameLineStyle(0);
+ c1->SetFrameBorderMode(0);
+ c1->SetFrameBorderSize(10);
+ c1->SetFrameFillStyle(0);
+ c1->SetFrameLineStyle(0);
+ c1->SetFrameBorderMode(0);
+ c1->SetFrameBorderSize(10);
+
+ if (th1data)
+ {
+ c1->Divide(1, 2);
+ d1 = (TPad *)c1->GetPad(1);
+ d1->SetPad(0.01, 0.30, 0.95, 0.99);
+ // c1->cd();
+ d2 = (TPad *)c1->GetPad(2);
+ d2->SetPad(0.01, 0.02, 0.95, 0.30);
+ d1->cd();
+ gPad->SetBottomMargin(0.0);
+ }
+
+ gPad->SetTopMargin(0.1);
+ gPad->SetRightMargin(0.05);
+ gPad->SetLeftMargin(0.14);
+
+ gPad->SetLogy(0);
+
+ if (th1tot->GetEntries())
+ Leg->AddEntry(th1tot, "Stat. Uncertainty", "f");
+
+ Leg->SetFillColor(0);
+
+ TH1D *th1totempty = new TH1D("th1totempty", "th1totempty", pv.ANBINS, pv.AMINRange, pv.AMAXRange);
+ if (th1data)
+ {
+ th1data->SetMarkerStyle(20);
+ th1data->SetLineColor(kBlack);
+ th1data->SetMarkerSize(1.3);
+ th1data->SetLineWidth(3);
+ }
+
+ th1tot->SetFillStyle(3013);
+ th1tot->SetFillColor(13);
+ th1tot->SetLineColor(kBlack);
+ th1tot->SetLineWidth(1);
+ th1tot->SetMarkerStyle(0);
+
+ char tmpc[100];
+ sprintf(tmpc, "Events");
+ if (pv.slog == 1)
+ sprintf(tmpc, "Events/ %.1f", BINWIDTH);
+ if (pv.slog == 2)
+ sprintf(tmpc, "Events/ %.3f", BINWIDTH);
+ if (pv.slog == 3)
+ sprintf(tmpc, "Events/ ( %.0f GeV)", BINWIDTH);
+ if (pv.slog == 6)
+ sprintf(tmpc, "Events/ ( %.1f rad)", BINWIDTH);
+ th1totempty->SetYTitle(tmpc);
+ th1totempty->GetYaxis()->SetTitleOffset(1.2);
+ th1totempty->GetYaxis()->SetLabelOffset(0.01);
+ th1totempty->GetYaxis()->SetLabelSize(0.04);
+
+ if (th1tot->GetEntries())
+ {
+ th1tot->SetMinimum(0.1);
+ th1totempty->SetMinimum(0.1);
+ }
+
+ // th1totempty->SetMaximum(2.5*maxval);
+ th1totempty->SetMaximum(1.9 * maxval);
+ if (pv.slog == 9)
+ th1totempty->SetMaximum(1.9 * maxval);
+ // th1totempty->SetMaximum(350.);
+
+ // Draw it all
+
+ th1totempty->Draw();
+
+ if (th1data)
+ {
+ th1data->SetMinimum(0.1);
+ th1data->SetBinErrorOption(TH1D::kPoisson);
+ th1data->Draw("e0same");
+ }
+
+ // th1tot->Draw("e2same");
+
+ hs->SetMaximum(400.0);
+ hs->Draw("samehist");
+ if (pv.drawleg == 1)
+ Leg->Draw();
+
+ th1tot->Draw("e2same");
+
+ if (th1data)
+ th1data->Draw("e1same");
+ // if(aqgc)
+ // aqgc->Draw("same");
+
+ // draw unstacked histos separately.
+ oldsamplename.Clear();
+ TH1D *h1 = new TH1D("h1", "", 100, 0, 100);
+ TH1D *h2 = new TH1D("h2", "", 100, 0, 100);
+ for (size_t isamp = 0; isamp < samples.size(); isamp++)
+ {
+ Sample *s = samples[isamp];
+ assert(s);
+ if (s->name() == oldsamplename)
+ continue;
+ if (!s->stackit())
+ {
+ map::iterator mit = m_histos.find(s->name());
+ if (mit != m_histos.end())
+ {
+ TH1D *h = mit->second;
+ if (h && s->name() == "WV_EWK")
+ // if (h && s->name()=="WV_EWKX100")
+ {
+ h->SetFillStyle(0.);
+ // aqgc->SetLineStyle(11);
+ h->SetLineWidth(3.);
+ h->SetLineColor(kBlue + 3);
+ if (int(ScaleSignal) == 1)
+ {
+ std::cout << "Significance (SM EWK) = " << (h->Integral(1, h->GetNbinsX() + 1) / 50) / sqrt((h->Integral(1, h->GetNbinsX() + 1) / 50) + totevents) << std::endl;;
+ Logfile << "Significance (SM EWK) = " << (h->Integral(1, h->GetNbinsX() + 1) / 50) / sqrt((h->Integral(1, h->GetNbinsX() + 1) / 50) + totevents) << std::endl;;
+ }
+ else
+ {
+ std::cout << "Significance (SM EWK) = " << (h->Integral(1, h->GetNbinsX() + 1)) / sqrt((h->Integral(1, h->GetNbinsX() + 1)) + totevents) << std::endl;;
+ Logfile << "Significance (SM EWK) = " << (h->Integral(1, h->GetNbinsX() + 1)) / sqrt((h->Integral(1, h->GetNbinsX() + 1)) + totevents) << std::endl;;
+ }
+ h->Draw("histsame");
+ h1 = (TH1D *)h->Clone();
+ }
+ if (h && s->name() == "aQGC")
+ // if (h && s->name()=="aQGCX100")
+ {
+ h->SetFillStyle(0.);
+ // aqgc->SetLineStyle(11);
+ h->SetLineWidth(3.);
+ h->SetLineColor(kRed + 3);
+ // std::cout << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << std::endl;;
+ std::cout << "Significance (aQGC) = " << (h->Integral(1, h->GetNbinsX() + 1) / 50) / sqrt((h->Integral(1, h->GetNbinsX() + 1) / 50) + totevents) << std::endl;;
+ // Logfile << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << std::endl;;
+ Logfile << "Significance (aQGC) = " << (h->Integral(1, h->GetNbinsX() + 1) / 50) / sqrt((h->Integral(1, h->GetNbinsX() + 1) / 50) + totevents) << std::endl;;
+ h->Draw("histsame");
+ h2 = (TH1D *)h->Clone();
+ // h->Draw("e1same");
+ }
+ if (isData)
+ h->Write();
+ }
+ }
+ oldsamplename = s->name();
+ }
+
+ // cmspre(intLUMIinvpb/1000.0);
+ CMS_lumi(d1, 4, 10);
+ // th1data->Draw("Axissame");
+ gPad->RedrawAxis();
+ TH1D *hhratio;
+ TH1D *th1emptyclone;
+ TBox *errbox;
+
+ if (th1data)
+ {
+ d2->cd();
+ // TH1D * hhratio = (TH1D*) th1data->Clone("hhratio") ;
+ hhratio = (TH1D *)th1data->Clone("hhratio");
+ hhratio->Sumw2();
+ hhratio->SetStats(0);
+
+ gPad->SetLeftMargin(0.14);
+ gPad->SetTopMargin(0);
+ gPad->SetRightMargin(0.05);
+ gPad->SetFrameBorderSize(0);
+ gPad->SetBottomMargin(0.3);
+ gPad->SetTickx();
+
+ hhratio->SetMarkerSize(1.25);
+ // hhratio->GetYaxis()->SetRangeUser(0.48,1.52);
+ hhratio->GetYaxis()->SetRangeUser(0.5, 1.5);
+ hhratio->GetXaxis()->SetTitle(pv.xlabel);
+ hhratio->GetXaxis()->SetTitleOffset(0.9);
+ hhratio->GetXaxis()->SetTitleSize(0.15);
+ hhratio->GetXaxis()->SetLabelSize(0.15);
+ hhratio->GetYaxis()->SetTitleSize(0.1);
+ hhratio->GetYaxis()->SetTitleOffset(0.5);
+ hhratio->GetYaxis()->CenterTitle(true);
+ hhratio->GetYaxis()->SetLabelSize(0.1);
+ std::cout << hhratio->GetNbinsX() << std::endl;;
+ std::cout << th1tot->GetNbinsX() << std::endl;;
+ hhratio->Divide(th1tot);
+ double binError(0.0), mcbinentry(0.0), mcerror(0.0);
+ for (int i = 0; i < hhratio->GetNbinsX(); ++i)
+ {
+ binError = hhratio->GetBinError(i);
+ mcerror = th1tot->GetBinError(i);
+ mcbinentry = th1tot->GetBinContent(i);
+ if (mcbinentry > 0.)
+ mcerror /= mcbinentry;
+ else
+ mcerror = 0.0;
+ binError = sqrt(binError * binError + mcerror * mcerror);
+ hhratio->SetBinError(i, binError);
+ }
+ th1emptyclone = new TH1D("th1emptyclone", "th1emptyclone", pv.ANBINS, pv.AMINRange, pv.AMAXRange);
+ th1emptyclone->GetYaxis()->SetRangeUser(0.1, 2.8000);
+ th1emptyclone->GetXaxis()->SetTitle(pv.xlabel);
+ th1emptyclone->GetXaxis()->SetTitleOffset(0.9);
+ th1emptyclone->GetXaxis()->SetTitleSize(0.15);
+ th1emptyclone->GetXaxis()->SetLabelSize(0.15);
+ th1emptyclone->SetYTitle("Data/MC");
+ th1emptyclone->GetYaxis()->SetTitleSize(0.13);
+ th1emptyclone->GetXaxis()->SetNdivisions(505);
+ th1emptyclone->GetYaxis()->SetNdivisions(505);
+ th1emptyclone->GetYaxis()->SetTitleOffset(0.5);
+ th1emptyclone->GetYaxis()->CenterTitle(true);
+ th1emptyclone->GetYaxis()->SetLabelSize(0.1);
+ th1emptyclone->Draw();
+
+ // TBox *errbox = new TBox(pv.AMINRange,0.974,pv.AMAXRange,1.026); // lumi systematic uncertainty
+ errbox = new TBox(pv.AMINRange, 0.974, pv.AMAXRange, 1.026); // lumi systematic uncertainty
+ errbox->SetFillColor(kGray);
+ errbox->Draw();
+
+ hhratio->Draw("esame");
+ TLine *line1;
+ line1 = new TLine(pv.AMINRange, 0.5, pv.AMAXRange, 0.5);
+ line1->SetLineStyle(2);
+ line1->SetLineWidth(1);
+ line1->SetLineColor(1);
+ line1->Draw();
+ TLine *line2;
+ line2 = new TLine(pv.AMINRange, 1.0, pv.AMAXRange, 1.0);
+ line2->SetLineStyle(2);
+ line2->SetLineWidth(1);
+ line2->SetLineColor(1);
+ line2->Draw();
+ TLine *line3;
+ line3 = new TLine(pv.AMINRange, 1.5, pv.AMAXRange, 1.5);
+ line3->SetLineStyle(2);
+ line3->SetLineWidth(1);
+ line3->SetLineColor(1);
+ line3->Draw();
+ }
+
+ c1->Print(outfile + ".pdf");
+ c1->Print(outfile + ".png");
+ c1->Print(outfile + ".root");
+ c1->Print(outfile + ".C");
+ // c1->Print(outfile+".tex");
+ //-----------------------------------------------------------------
+ // Save log plot
+ //-----------------------------------------------------------------
+ TCanvas *c2 = new TCanvas("c2", "c2", 800, 600);
+ TPad *d3, *d4;
+
+ c2->SetFillColor(0);
+ c2->SetBorderMode(0);
+ c2->SetBorderSize(10);
+ // Set margins to reasonable defaults
+ c2->SetLeftMargin(0.18);
+ c2->SetRightMargin(0.05);
+ c2->SetTopMargin(0.08);
+ c2->SetBottomMargin(0.15);
+ // Setup a frame which makes sense
+ c2->SetFrameFillStyle(0);
+ c2->SetFrameLineStyle(0);
+ c2->SetFrameBorderMode(0);
+ c2->SetFrameBorderSize(10);
+ c2->SetFrameFillStyle(0);
+ c2->SetFrameLineStyle(0);
+ c2->SetFrameBorderMode(0);
+ c2->SetFrameBorderSize(10);
+
+ c2->Divide(1, 2);
+ d3 = (TPad *)c2->GetPad(1);
+ d3->SetPad(0.01, 0.30, 0.95, 0.99);
+ // c1->cd();
+ d4 = (TPad *)c2->GetPad(2);
+ d4->SetPad(0.01, 0.02, 0.95, 0.30);
+ d3->cd();
+ gPad->SetBottomMargin(0.0);
+
+ gPad->SetTopMargin(0.1);
+ gPad->SetRightMargin(0.05);
+ gPad->SetLeftMargin(0.14);
+
+ gPad->SetLogy(1);
+
+ th1totempty->SetMaximum(800 * maxval);
+ th1totempty->SetMinimum(0.001);
+ th1totempty->Draw();
+
+ if (th1data)
+ {
+ th1data->SetMinimum(0.001);
+ th1data->SetBinErrorOption(TH1D::kPoisson);
+ th1data->Draw("e0same");
+ }
+
+ th1tot->Draw("e2same");
+
+ hs->SetMinimum(0.001);
+ hs->Draw("samehist");
+ if (pv.drawleg == 1)
+ Leg->Draw();
+
+ th1tot->Draw("e2same");
+ if (h1->GetEntries() > 0)
+ h1->Draw("histsame");
+ if (h2->GetEntries() > 0)
+ h2->Draw("histsame");
+ if (th1data)
+ th1data->Draw("e1same");
+
+ CMS_lumi(d3, 4, 10);
+ gPad->RedrawAxis();
+ d4->cd();
+ gPad->SetLeftMargin(0.14);
+ gPad->SetTopMargin(0);
+ gPad->SetRightMargin(0.05);
+ gPad->SetFrameBorderSize(0);
+ gPad->SetBottomMargin(0.3);
+ gPad->SetTickx();
+ th1emptyclone->Draw();
+ errbox->Draw();
+
+ hhratio->Draw("esame");
+ TLine *line;
+ line = new TLine(pv.AMINRange, 1.0, pv.AMAXRange, 1.0);
+ line->SetLineStyle(1);
+ line->SetLineWidth(1);
+ line->SetLineColor(1);
+ line->Draw();
+
+ c2->Print(outfile + "_log.png");
+ //-----------------------------------------------------------------
+ // END: Save log plot
+ //-----------------------------------------------------------------
+
+ Logfile.close();
+ c1->Write();
+ } // var loop
+
+ // f.Write();
+ f->Close();
+
+} // myControlPlots
diff --git a/ControlPlots/myControlPlots_SignalBkg_Comparison.C b/ControlPlots/myControlPlots_SignalBkg_Comparison.C
deleted file mode 100644
index 2419211..0000000
--- a/ControlPlots/myControlPlots_SignalBkg_Comparison.C
+++ /dev/null
@@ -1,765 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "TROOT.h"
-#include "TLatex.h"
-#include "TTree.h"
-#include "TFile.h"
-#include "TH1D.h"
-#include "TH1F.h"
-#include "THStack.h"
-#include "TString.h"
-#include "TLegend.h"
-#include "TLine.h"
-#include "TPad.h"
-#include "TCanvas.h"
-#include "TCut.h"
-#include "TSystem.h"
-#include "TF1.h"
-#include "TFitResult.h"
-#include "TFitResultPtr.h"
-
-#include "tdrstyle.C"
-#include "utils.C" // Tokenize
-#include "CMS_lumi.C"
-
-#include
-
-
-typedef struct {
- int index;
- TString samplename;
- TString treefilename;
- double xsecpblumi;
- double otherscale;
- int nMCevents;
- int MCnegEvent;
- int colorcode;
- int stackit;
-}
-SampleInfo_t;
-
-//#include "controlplotvars_boosted.h"
-//#include "controlplotvars_common.h"
-#include "controlplotvars_CHS.h"
-//#include "controlplotvars_Puppi.h"
-//#include "controlplotvars_vbf.h"
-//#include "controlplotvars_mva.h"
-//#include "controlplotvars_Nminus1plot.h"
-//#include "controlplotvars_CHS_signal.h"
-
-
-
-
-
-using namespace std;
-
-double intLUMIinvpb;
-
-//=====================================================================================
-// SYNOPSIS:
-// 1. Prepare "InData" and "OutDir" directories; e.g., "ln -s . OutDir" to go to current dir
-// 2. Prepare "cuttable.txt" of cut names and cut strings
-// 3. root [0] .L myControlPlots.C+
-// root [1] myControlPlots("cuttable.txt","sampleFileName.txt")
-//
-// ====================================================================================
-// Self Function
-// ====================================================================================
-/*
-
-*/
-void cmspre(double intlumifbinv)
-{
- TLatex latex;
- latex.SetNDC();
- latex.SetTextSize(0.04);
-
- latex.SetTextAlign(31); // align right
- latex.DrawLatex(0.95,0.92,"#sqrt{s} = 13 TeV");
- latex.SetTextAlign(31); // align right
- latex.DrawLatex(0.73,0.93,Form("#int #font[12]{L} dt = %.1f fb^{-1}", (float)intlumifbinv));
-// latex.DrawLatex(0.65,0.93,Form("2012B", (float)intlumifbinv));
-
- latex.SetTextAlign(11); // align left
-// latex.DrawLatex(0.15,0.93,"CMS, #sqrt{s} = 7 TeV");//preliminary 2011");
- latex.SetTextSize(0.06);
- latex.DrawLatex(0.145,0.92,"CMS #bf{#it{preliminary}}");
-
-}
-
-//======================================================================
-
-void loadCutString(const char *filename, TString& cutstring)
-{
- FILE *fp = fopen(filename,"r");
- if (!fp) {
- cout << "Error, file " << TString(filename) << " not found." << endl;
- exit(-1);
- }
-
- char line[512];
-
- for (int i=0; !feof(fp) && fgets(line,512,fp); i++) {
- if (!strlen(line) || line[0]=='#') continue; // comments are welcome
-
- if (cutstring.Length()) cutstring += " && ";
-
- string strline(line);
- strline.pop_back(); // shed the \n
- vector fields;
-
- // expect columns with fields cutname, cutvalue, possible embedded spaces both
- // within and between, so " " or "\t" cannot be used as delimiters. Require quotes
- // instead.
- //
- Tokenize(strline,fields, "\"");
-
- //for (size_t j=0; jGet("otree"); if (!tree_) { cerr << "Couldn't find tree otree in file " << sinfo.treefilename << endl; return; }
- }
- ~Sample() { if (tree_) delete tree_; }
- TTree *Tree() const { return tree_; }
- TString name() const { return info_.samplename; }
- TString filename() const { return info_.treefilename; }
- bool stackit() const { return (info_.stackit != 0); }
- int colorcode() const { return info_.colorcode; }
- double otherscale() const { return info_.otherscale; }
- TH1 *Draw(const plotVar_t& pv, const TCut& cut, const TCut& cutSQ ) {
- if (!tree_) {
- cerr << "No tree to draw from." << endl;
- return 0;
- }
- double tmp = 0;
- cout << "\tDrawing " << pv.plotvar << " for sample = " << info_.samplename << " ... ";
- TString hname = TString("th1")+ pv.outfile + Form("%d",info_.index);
- TH1 *histo = new TH1D(hname, hname, pv.NBINS, pv.MINRange, pv.MAXRange);
- assert(histo);
- histo->Sumw2();
- cout << tree_->Draw(pv.plotvar+TString(">>")+hname, cut, "goff") << " entries, ";
- histo->SetBinContent(pv.NBINS,histo->GetBinContent(pv.NBINS)+histo->GetBinContent(pv.NBINS+1));
- //cout << histo->Integral() << " " << tmp << " " << "weighted entries, (";
- cout << histo->IntegralAndError(0,histo->GetNbinsX()+1,tmp) << " " << tmp << " " << "weighted entries";
-
- if (info_.nMCevents) {
- //cout<<"\n===> Evetns = "<Scale((info_.xsecpblumi*info_.otherscale)/(info_.nMCevents - 2*info_.MCnegEvent));
- cout << ", " <IntegralAndError(1,histo->GetNbinsX(),tmp) << " " <Integral(1,histo->GetNbinsX()+1)*info_.xsecpblumi*info_.otherscale)/(info_.nMCevents - 2*info_.MCnegEvent) << " " << " scaled events in window";
- }
- cout << endl;
-
- return histo;
- }
-private:
- SampleInfo_t info_;
- TTree *tree_;
-};
-
-//======================================================================
-
-void loadSamples(const char *filename,vector& samples)
-{
- FILE *fp = fopen(filename,"r");
- if (!fp) {
- cout << "Error, file " << TString(filename) << " not found." << endl;
- exit(-1);
- }
-
- char line[512];
-
- intLUMIinvpb=-1; // obvious error condition
-
- for (int i=0; !feof(fp) && fgets(line,512,fp); i++) {
- if (!strlen(line) || line[0]=='#') continue; // comments are welcome
-
- string strline(line);
- strline.pop_back(); // shed the \n
- vector fields;
-
- // expect columns with fields cutname, cutvalue, possible embedded spaces both
- // within and between, so " " or "\t" cannot be used as delimiters. Require quotes
- // instead.
- //
- Tokenize(strline,fields, " \t");
-
- //for (size_t j=0; j " << s.treefilename << endl;
-
- if (!samples.size()) {
- if (s.samplename.EqualTo("data")) {
- intLUMIinvpb = s.xsecpblumi;
- s.xsecpblumi = 1;
- cout << "intLUMI = " << intLUMIinvpb << " pb^-1" << endl;
- } else {
- cerr << "First sample in the table must be 'data'" << endl;
- exit(-1);
- }
- } else {
- s.otherscale *= intLUMIinvpb;
- }
-
- samples.push_back(new Sample(s) );
- }
-} // loadSamples
-
-//======================================================================
-
-void myControlPlots_SignalBkg_Comparison(const char *cuttablefilename,
- const char *samplefilename,
- const plotVar_t plotvars[] = commonplotvars_chs,
- const string OutRootFile = "testrk.root",
- const int ScaleSignal = 0
- )
-{
- if (int(ScaleSignal) != 1 && int(ScaleSignal) != 0)
- {
- std::cout << "=========================================\n\n" << endl;
- std::cerr << "Error: Scale Signal values should be 1 or 0.\n" << endl;
- exit(-1);
- }
- ofstream Logfile;
-
- TH1::SetDefaultSumw2(1);
-
- //TFile *outDC = new TFile("htt_mt_inputs.root","RECREATE");
-
- TString unwtcutstring;
-
- loadCutString(cuttablefilename, unwtcutstring);
-
- TString blinddatacutstring = unwtcutstring + "&&(1)";
-
-
- // Get the input trees:
-
- vector samples;
-
- loadSamples(samplefilename,samples);
-
-
- //TFile f("plotvar_histo.root", "RECREATE");
- TFile f(OutRootFile.c_str(), "RECREATE");
-
- //============================================================
- // VARIABLE LOOP
- //============================================================
-
- for (int ivar=0; ; ivar++) {
-
- plotVar_t pv = plotvars[ivar];
-
- TString outfile = TString("OutDir/")+TString(gSystem->BaseName(cuttablefilename)).ReplaceAll(".txt","")+TString("_")+pv.outfile;
- Logfile.open (outfile+".log");
- TString temp = TString("Yield of Variable : ")+pv.outfile;
- const std::string spaces(temp.Length(), ' ');
- const std::string second = "* " + spaces + " *";
- const std::string first(second.size(), '*');
- Logfile << first << std::endl;
- Logfile << second << std::endl;
- Logfile << "* " << temp << " *" << std::endl;
- Logfile << second << std::endl;
- Logfile << first << std::endl;
-
- if ( !pv.plotvar.Length() ) break;
-
- cout << pv.plotvar << "\t"< m_histos;
- map m_stacked;
-
- double totevents = 0.;
-
- //============================================================
- // DRAW THE VARIABLE FOR ALL SAMPLES, CREATE HISTOS
- //============================================================
-
- // start loop from 1 to skip data
- TH1D *h1 = new TH1D();
- TH1D *h2 = new TH1D();
- for (size_t isamp=1; isampname()] = false;
-
- TH1 *h;
-
- if (s->name().EqualTo("data")) {
- plotVar_t pvnosmear = pv;
- h = s->Draw(pvnosmear, TCut(blinddatacutstring), nullcut); // effwt*puwt==1 for data! -- NO IT DOESN'T NECESSARILY!
- }
- else if (s->name().EqualTo("aQGC")){
- if (int(ScaleSignal) == 1)
- {
- h = s->Draw(pv, the_cut*"1.0*(LHEWeight[1121]/LHEWeight[0])", the_cut*"1.0*(LHEWeight[1121]/LHEWeight[0])");
- }
- else
- h = s->Draw(pv, the_cut*"(LHEWeight[1121]/LHEWeight[0])", the_cut*"(LHEWeight[1121]/LHEWeight[0])");
- if (s->stackit()) {
- totevents += h->Integral(1,h->GetNbinsX()+1);
- }
- }
- else if (s->name().EqualTo("WV_EWK")){
- if (int(ScaleSignal) == 1)
- h = s->Draw(pv, the_cut*"1.0", the_cut*"1.0");
- else
- h = s->Draw(pv, the_cut, the_cut);
- if (s->stackit()) {
- totevents += h->Integral(1,h->GetNbinsX()+1);
- }
- }
- else {
- h = s->Draw(pv, the_cut, the_cut);
- if (s->stackit()) {
- totevents += h->Integral(1,h->GetNbinsX()+1);
- }
- }
-
- if (!h) continue;
-
- map::iterator mit = m_histos.find(s->name());
- if (mit == m_histos.end()) {
- h->SetName(s->name());
- h->SetTitle(s->name());
- if (s->stackit()) {
- if (s->name().EqualTo("W+jets"))
- {
- h->SetLineColor(TColor::GetColor(222,90,106));
- h->SetFillColor(TColor::GetColor(222,90,106));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("top"))
- {
- h->SetLineColor(TColor::GetColor(155,152,204));
- h->SetFillColor(TColor::GetColor(155,152,204));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("Z+jets"))
- {
- h->SetLineColor(TColor::GetColor(248,206,104));
- h->SetFillColor(TColor::GetColor(248,206,104));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("Diboson"))
- {
- h->SetLineColor(TColor::GetColor(250,202,255));
- h->SetFillColor(TColor::GetColor(250,202,255));
- h->SetLineWidth(0);
- }
- else
- {
- h->SetLineColor(s->colorcode());
- h->SetFillColor(s->colorcode());
- h->SetLineWidth(0);
- }
- }
- m_histos[s->name()] = h;
- } else {
- mit->second->Add(h);
- }
- }
-
- //============================================================
- // COUNT EVENTS, RENORM TO DATA, CONSTRUCT THE TSTACK & LEGEND
- //============================================================
-
- double ndata=1., renorm=1.;
-
- cout << "Total MC = " << totevents << endl;
- Logfile << "Total MC = " << totevents << endl;
-
- // Setup the stack and total
- THStack* hs = new THStack("hs","MC contribution");
- TH1D *th1tot = new TH1D("th1tot", "th1tot", pv.NBINS, pv.MINRange, pv.MAXRange);
-
- // Set up the legend
-
- float legX0=0.65, legX1=0.99, legY0=0.54, legY1=0.88;
- //float legX0=0.17, legX1=0.95, legY0=0.7, legY1=0.88;
- // float legX0=0.52, legX1=0.89, legY0=0.54, legY1=0.88;
- // float legX0=0.18, legX1=0.52, legY0=0.4, legY1=0.88;
- TLegend * Leg = new TLegend( legX0, legY0, legX1, legY1);
- Leg->SetFillColor(0);
- Leg->SetFillStyle(0);
- Leg->SetBorderSize(0);
- //Leg->SetTextSize(0.04);
- //Leg->SetNColumns(3);
-
-
- vector binErrSQ(pv.NBINS,0.);
-
- vector > v_legentries;
-
- TString oldsamplename;
- double maxval = -9e99;
-
- // start loop from 1 to skip data
- for (size_t isamp=1; isampname()==oldsamplename) continue;
-
- map::iterator mit = m_histos.find(s->name());
- TH1 *h = mit->second;
- //h->SetLineColor(kBlack);
- h->SetLineWidth( 3.);
- //h->SetFillColor(color );
- //h->SetFillStyle(style );
- h->SetTitleSize (0.055,"Y");
- h->SetTitleOffset(1.600,"Y");
- h->SetLabelOffset(0.014,"Y");
- h->SetLabelSize (0.050,"Y");
- h->SetLabelFont (42 ,"Y");
- h->SetTitleSize (0.055,"X");
- h->SetTitleOffset(1.300,"X");
- h->SetLabelOffset(0.014,"X");
- h->SetLabelSize (0.050,"X");
- h->SetLabelFont (42 ,"X");
- //h->SetMarkerStyle(20);
- //h->SetMarkerColor(color);
- h->SetMarkerSize (0.6);
- h->GetYaxis()->SetTitleFont(42);
- h->GetXaxis()->SetTitleFont(42);
- //h->SetTitle("");
-
- cout << s->name() << " = " << Form("%7g", h->Integral(1,h->GetNbinsX()+1)) << endl;
- Logfile << s->name() << " = " << Form("%7g", h->Integral(1,h->GetNbinsX()+1)) << endl;
-
- if(s->stackit()) {
- // Compose the stack
- hs->Add(h);
- th1tot->Add(h);
- m_stacked[s->name()] = true;
- for (int ibin=1; ibin <= pv.NBINS; ibin++)
- binErrSQ[ibin-1] += h->GetBinError(ibin)*h->GetBinError(ibin);
- }
- v_legentries.push_back(*mit);
-
- // Added this if to ignore the maximum range of aQGC distribution
- // Since if we take it then the histogram rescale very bad so that we can't see other histos
- if (h && s->name()!="aQGC")
- {
- int maxbin = h->GetMaximumBin();
- maxval = std::max(maxval,h->GetBinContent(maxbin));
- }
-
- oldsamplename=s->name();
- h->Write();
- }
-
- cout << "maxval " < >::reverse_iterator
- rit = v_legentries.rbegin();
- rit != v_legentries.rend();
- rit++)
- {
- if(rit->first=="aQGC" || rit->first=="WV_EWK")
- {
- if (int(ScaleSignal) == 1)
- Leg->AddEntry(rit->second, rit->first+TString("*5"), "L" ); // "F");
- else
- Leg->AddEntry(rit->second, rit->first, "L" ); // "F");
- }
- else
- Leg->AddEntry(rit->second, rit->first, "F" ); // "F");
- }
- //cout<<" Debug.... 1" << endl;
- TH1D* th1totClone = ( TH1D*) th1tot->Clone("th1totClone");
- th1totClone->SetMarkerStyle(0);
- th1totClone->SetFillStyle(3003);
- th1totClone->SetFillColor(11);
- th1totClone->SetLineColor(0);
-
- for(int ibin=1; ibin<=th1totClone->GetNbinsX(); ++ibin) {
- th1totClone->SetBinError(ibin, sqrt(binErrSQ[ibin-1]));
- }
- //cout<<" Debug.... 2" << endl;
-
- //============================================================
- // SETUP THE CANVAS
- //============================================================
-
-// gROOT->ProcessLine(".L tdrstyle.C");
- setTDRStyle();
- //tdrStyle->SetErrorX(0.5);
- //tdrStyle->SetPadRightMargin(0.05);
-
- //tdrStyle->SetLegendBorderSize(0);
-
- TCanvas* c1 = new TCanvas(pv.plotvar,pv.plotvar,10,10, 800, 800);
- TPad *d1, *d2;
-
- c1->SetFillColor (0);
- c1->SetBorderMode (0);
- c1->SetBorderSize (10);
- // Set margins to reasonable defaults
- c1->SetLeftMargin (0.18);
- c1->SetRightMargin (0.05);
- c1->SetTopMargin (0.08);
- c1->SetBottomMargin (0.15);
- // Setup a frame which makes sense
- c1->SetFrameFillStyle (0);
- c1->SetFrameLineStyle (0);
- c1->SetFrameBorderMode(0);
- c1->SetFrameBorderSize(10);
- c1->SetFrameFillStyle (0);
- c1->SetFrameLineStyle (0);
- c1->SetFrameBorderMode(0);
- c1->SetFrameBorderSize(10);
-
- c1->Divide(1,2);
- d1 = (TPad*)c1->GetPad(1);
- d1->SetPad(0.01,0.02,0.95,0.99);
- //c1->cd();
- d2 = (TPad*)c1->GetPad(2);
- d2->SetPad(0.01,0.00,0.95,0.02);
- //cout<<" Debug.... 3" << endl;
- d1->cd();
- gPad->SetBottomMargin(0.14);
-
- //cout<<" Debug.... 4" << endl;
- gPad->SetTopMargin(0.1);
- gPad->SetRightMargin(0.05);
- gPad->SetLeftMargin(0.14);
-
- gPad->SetLogy(0);
-
- if (th1tot->GetEntries())
- Leg->AddEntry(th1tot, "Stat. Uncertainty", "f");
-
- Leg->SetFillColor(0);
-
- TH1* th1totempty = new TH1D("th1totempty", "th1totempty", pv.ANBINS, pv.AMINRange, pv.AMAXRange);
-
- th1tot->SetFillStyle(3013);
- th1tot->SetFillColor(13);
- th1tot->SetLineColor(kBlack);
- th1tot->SetLineWidth(1);
- th1tot->SetMarkerStyle(0);
-
- char tmpc[100]; sprintf(tmpc,"Events");
- if (pv.slog==1) sprintf(tmpc,"Events/ %.1f",BINWIDTH);
- if (pv.slog==2) sprintf(tmpc,"Events/ %.2f",BINWIDTH);
- if (pv.slog==3) sprintf(tmpc,"Events/ %.0f GeV",BINWIDTH);
- if (pv.slog==6) sprintf(tmpc,"Events/ %.1f rad",BINWIDTH);
- th1totempty->SetYTitle(tmpc);
- // th1totempty->GetYaxis()->SetTitleSize(0.1);
- th1totempty->GetYaxis()->SetTitleOffset(1.2);
- th1totempty->GetYaxis()->SetLabelOffset(0.01);
- // th1totempty->GetYaxis()->CenterTitle(true);
- th1totempty->GetYaxis()->SetLabelSize(0.04);
- // th1totClone->Draw("e3");
-
- if (th1tot->GetEntries()) {
- th1tot->SetMinimum(0.1);
- th1totempty->SetMinimum(0.1);
- }
-
-// th1totempty->SetMaximum(2.5*maxval);
- th1totempty->SetMaximum(2.8*maxval);
- if(pv.slog==1) th1totempty->SetMaximum(2.8*maxval);
- th1totempty->GetXaxis()->SetTitle(pv.xlabel);
-
- // Draw it all
-
- th1totempty->Draw();
-
-
-
- //hs->SetMaximum(400.0);
- hs->Draw("samehist");
- hs->GetXaxis()->SetTitle(pv.xlabel);
- if (pv.drawleg ==1) Leg->Draw();
-
- th1tot->Draw("e2same");
-
- //if(aqgc)
- // aqgc->Draw("same");
- Logfile << endl << endl;
- Logfile << "Significance (For SM) = (nSig/1) / sqrt(nSig/1 + nTotalBkg)" << endl;
- Logfile << "Significance (For aQGC) = (nSig) / sqrt(nSig + nTotalBkg)" << endl;
-
- // draw unstacked histos separately.
- oldsamplename.Clear();
- // start loop from 1 to skip data
- for (size_t isamp=1; isampname()==oldsamplename) continue;
- if (!s->stackit()) {
- map::iterator mit = m_histos.find(s->name());
- if (mit != m_histos.end()) {
- TH1 *h = mit->second;
- //if (h) h->Draw("histsame"); // To get line for data...
- if (h && s->name()=="WV_EWK")
- {
- h->SetFillStyle(0.);
- //aqgc->SetLineStyle(11);
- h->SetLineWidth(3.);
- h->SetLineColor(kBlue+3);
- Logfile << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1)/1.)/sqrt((h->Integral(1,h->GetNbinsX()+1)/1.)+totevents) << endl;
- cout << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1)/1.)/sqrt((h->Integral(1,h->GetNbinsX()+1)/1.)+totevents) << endl;
- //h->Scale(th1tot->Integral(1,th1tot->GetNbinsX()+1)/h->Integral(1,h->GetNbinsX()+1));
- h->Draw("histsame");
- h1 = (TH1D*) h->Clone();
-
- }
- if (h && s->name()=="aQGC")
- {
- h->SetFillStyle(0.);
- //aqgc->SetLineStyle(11);
- h->SetLineWidth(3.);
- h->SetLineColor(kRed+3);
- cout << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- Logfile << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- //h->Scale(th1tot->Integral(1,th1tot->GetNbinsX()+1)/h->Integral(1,h->GetNbinsX()+1));
- h->Draw("histsame");
- h2 = (TH1D*) h->Clone();
- //h->Draw("e1same");
- }
- //h->Write();
- }
- }
- oldsamplename=s->name();
- }
- //cout<<" Debug.... 1" << endl;
-
- //cmspre(intLUMIinvpb/500.0);
- CMS_lumi( d1, 4, 10 );
- //cout<<" Debug.... 2" << endl;
-// gPad->RedrawAxis();
- //cout<<" Debug.... 3" << endl;
-
-
-
- c1->Print(outfile+".pdf");
- c1->Print(outfile+".png");
- c1->Delete();
- Logfile.close();
- //-----------------------------------------------------------------
- // Save log plot
- //-----------------------------------------------------------------
- TCanvas *c2 = new TCanvas("c2","c2",800,800);
- //TPad *d3, *d4;
-
- c2->SetFillColor (0);
- c2->SetBorderMode (0);
- c2->SetBorderSize (10);
- // Set margins to reasonable defaults
- c2->SetLeftMargin (0.18);
- c2->SetRightMargin (0.05);
- c2->SetTopMargin (0.08);
- c2->SetBottomMargin (0.15);
- // Setup a frame which makes sense
- c2->SetFrameFillStyle (0);
- c2->SetFrameLineStyle (0);
- c2->SetFrameBorderMode(0);
- c2->SetFrameBorderSize(10);
- c2->SetFrameFillStyle (0);
- c2->SetFrameLineStyle (0);
- c2->SetFrameBorderMode(0);
- c2->SetFrameBorderSize(10);
-
- //c2->Divide(1,2);
- //d3 = (TPad*)c2->GetPad(1);
- //d3->SetPad(0.01,0.02,0.95,0.99);
- ////c1->cd();
- //d4 = (TPad*)c2->GetPad(2);
- //d4->SetPad(0.01,0.00,0.95,0.02);
- //d3->cd();
- //gPad->SetBottomMargin(0.0);
-
- //gPad->SetTopMargin(0.1);
- //gPad->SetRightMargin(0.05);
- //gPad->SetLeftMargin(0.14);
-
- //gPad->SetLogy(1);
- c2->SetLogy(1);
-
- th1totempty->SetMaximum(500.*maxval);
- th1totempty->Draw();
-
-
- th1tot->Draw("e2same");
-
- hs->SetMinimum(0.1);
- hs->Draw("hist");
-
- if (h1->GetEntries()>0) h1->Draw("histsame");
- if (h2->GetEntries()>0) h2->Draw("histsame");
-
- if (pv.drawleg ==1) Leg->Draw();
-// CMS_lumi( d3, 4, 10 );
- //gPad->RedrawAxis();
- //d4->cd();
- //gPad->SetLeftMargin(0.14);
- //gPad->SetTopMargin(0);
- //gPad->SetRightMargin(0.05);
- //gPad->SetFrameBorderSize(0);
- //gPad->SetBottomMargin(0.0);
- //gPad->SetTickx();
-
-
- c2->Print(outfile+"_log.png");
- //-----------------------------------------------------------------
- // END: Save log plot
- //-----------------------------------------------------------------
-
-#if 0
- c1->Print(outfile+".C");
- //gPad->WaitPrimitive();
- c1->Modified();
- c1->Update();
- c1->SaveAs(outfile+".pdf");
-#endif
- c1->Write();
- } // var loop
-
- //f.Write();
- f.Close();
-
-} // myControlPlots_SignalBkg_Comparison
diff --git a/ControlPlots/myControlPlots_SignalBkg_Comparison_Individual.C b/ControlPlots/myControlPlots_SignalBkg_Comparison_Individual.C
deleted file mode 100644
index a86ff63..0000000
--- a/ControlPlots/myControlPlots_SignalBkg_Comparison_Individual.C
+++ /dev/null
@@ -1,716 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "TROOT.h"
-#include "TLatex.h"
-#include "TTree.h"
-#include "TFile.h"
-#include "TH1D.h"
-#include "TH1F.h"
-#include "THStack.h"
-#include "TString.h"
-#include "TLegend.h"
-#include "TLine.h"
-#include "TPad.h"
-#include "TCanvas.h"
-#include "TCut.h"
-#include "TSystem.h"
-#include "TF1.h"
-#include "TFitResult.h"
-#include "TFitResultPtr.h"
-
-#include "tdrstyle.C"
-#include "utils.C" // Tokenize
-#include "CMS_lumi.C"
-
-#include
-
-
-typedef struct {
- int index;
- TString samplename;
- TString treefilename;
- double xsecpblumi;
- double otherscale;
- int nMCevents;
- int MCnegEvent;
- int colorcode;
- int stackit;
-}
-SampleInfo_t;
-
-//#include "controlplotvars_boosted.h"
-//#include "controlplotvars_common.h"
-#include "controlplotvars_CHS.h"
-//#include "controlplotvars_Puppi.h"
-//#include "controlplotvars_vbf.h"
-//#include "controlplotvars_mva.h"
-//#include "controlplotvars_Nminus1plot.h"
-//#include "controlplotvars_CHS_signal.h"
-
-
-
-
-
-using namespace std;
-
-double intLUMIinvpb;
-
-//=====================================================================================
-// SYNOPSIS:
-// 1. Prepare "InData" and "OutDir" directories; e.g., "ln -s . OutDir" to go to current dir
-// 2. Prepare "cuttable.txt" of cut names and cut strings
-// 3. root [0] .L myControlPlots.C+
-// root [1] myControlPlots("cuttable.txt","sampleFileName.txt")
-//
-// ====================================================================================
-// Self Function
-// ====================================================================================
-/*
-
-*/
-void cmspre(double intlumifbinv)
-{
- TLatex latex;
- latex.SetNDC();
- latex.SetTextSize(0.04);
-
- latex.SetTextAlign(31); // align right
- latex.DrawLatex(0.95,0.92,"#sqrt{s} = 13 TeV");
- latex.SetTextAlign(31); // align right
- latex.DrawLatex(0.73,0.93,Form("#int #font[12]{L} dt = %.1f fb^{-1}", (float)intlumifbinv));
-// latex.DrawLatex(0.65,0.93,Form("2012B", (float)intlumifbinv));
-
- latex.SetTextAlign(11); // align left
-// latex.DrawLatex(0.15,0.93,"CMS, #sqrt{s} = 7 TeV");//preliminary 2011");
- latex.SetTextSize(0.06);
- latex.DrawLatex(0.145,0.92,"CMS #bf{#it{preliminary}}");
-
-}
-
-//======================================================================
-
-void loadCutString(const char *filename, TString& cutstring)
-{
- FILE *fp = fopen(filename,"r");
- if (!fp) {
- cout << "Error, file " << TString(filename) << " not found." << endl;
- exit(-1);
- }
-
- char line[512];
-
- for (int i=0; !feof(fp) && fgets(line,512,fp); i++) {
- if (!strlen(line) || line[0]=='#') continue; // comments are welcome
-
- if (cutstring.Length()) cutstring += " && ";
-
- string strline(line);
- strline.pop_back(); // shed the \n
- vector fields;
-
- // expect columns with fields cutname, cutvalue, possible embedded spaces both
- // within and between, so " " or "\t" cannot be used as delimiters. Require quotes
- // instead.
- //
- Tokenize(strline,fields, "\"");
-
- //for (size_t j=0; jGet("otree"); if (!tree_) { cerr << "Couldn't find tree otree in file " << sinfo.treefilename << endl; return; }
- }
- ~Sample() { if (tree_) delete tree_; }
- TTree *Tree() const { return tree_; }
- TString name() const { return info_.samplename; }
- TString filename() const { return info_.treefilename; }
- bool stackit() const { return (info_.stackit != 0); }
- int colorcode() const { return info_.colorcode; }
- double otherscale() const { return info_.otherscale; }
- TH1 *Draw(const plotVar_t& pv, const TCut& cut, const TCut& cutSQ ) {
- if (!tree_) {
- cerr << "No tree to draw from." << endl;
- return 0;
- }
- double tmp = 0;
- cout << "\tDrawing " << pv.plotvar << " for sample = " << info_.samplename << " ... ";
- TString hname = TString("th1")+ pv.outfile + Form("%d",info_.index);
- TH1 *histo = new TH1D(hname, hname, pv.NBINS, pv.MINRange, pv.MAXRange);
- assert(histo);
- histo->Sumw2();
- cout << tree_->Draw(pv.plotvar+TString(">>")+hname, cut, "goff") << " entries, ";
- histo->SetBinContent(pv.NBINS,histo->GetBinContent(pv.NBINS)+histo->GetBinContent(pv.NBINS+1));
- //cout << histo->Integral() << " " << tmp << " " << "weighted entries, (";
- cout << histo->IntegralAndError(0,histo->GetNbinsX()+1,tmp) << " " << tmp << " " << "weighted entries";
-
- if (info_.nMCevents) {
- //cout<<"\n===> Evetns = "<Scale((info_.xsecpblumi*info_.otherscale)/(info_.nMCevents - 2*info_.MCnegEvent));
- if (histo->Integral(1,histo->GetNbinsX()+1) != 0)
- histo->Scale(1.0/histo->Integral(1,histo->GetNbinsX()+1)); // Normalize to Unity considering the overflow bin.
- else
- histo->Scale(1.0); // Normalize to Unity considering the overflow bin.
- cout << ", " <IntegralAndError(1,histo->GetNbinsX(),tmp) << " " <Integral(1,histo->GetNbinsX()+1)*info_.xsecpblumi*info_.otherscale)/(info_.nMCevents - 2*info_.MCnegEvent) << " " << " scaled events in window";
- }
- cout << endl;
-
- return histo;
- }
-private:
- SampleInfo_t info_;
- TTree *tree_;
-};
-
-//======================================================================
-
-void loadSamples(const char *filename,vector& samples)
-{
- FILE *fp = fopen(filename,"r");
- if (!fp) {
- cout << "Error, file " << TString(filename) << " not found." << endl;
- exit(-1);
- }
-
- char line[512];
-
- intLUMIinvpb=-1; // obvious error condition
-
- for (int i=0; !feof(fp) && fgets(line,512,fp); i++) {
- if (!strlen(line) || line[0]=='#') continue; // comments are welcome
-
- string strline(line);
- strline.pop_back(); // shed the \n
- vector fields;
-
- // expect columns with fields cutname, cutvalue, possible embedded spaces both
- // within and between, so " " or "\t" cannot be used as delimiters. Require quotes
- // instead.
- //
- Tokenize(strline,fields, " \t");
-
- //for (size_t j=0; j " << s.treefilename << endl;
-
- if (!samples.size()) {
- if (s.samplename.EqualTo("data")) {
- intLUMIinvpb = s.xsecpblumi;
- s.xsecpblumi = 1;
- cout << "intLUMI = " << intLUMIinvpb << " pb^-1" << endl;
- } else {
- cerr << "First sample in the table must be 'data'" << endl;
- exit(-1);
- }
- } else {
- s.otherscale *= intLUMIinvpb;
- }
-
- samples.push_back(new Sample(s) );
- }
-} // loadSamples
-
-//======================================================================
-
-void myControlPlots_SignalBkg_Comparison_Individual(const char *cuttablefilename,
- const char *samplefilename,
- const plotVar_t plotvars[] = commonplotvars_chs,
- const string OutRootFile = "testrk.root"
- )
-{
- ofstream Logfile;
-
- TH1::SetDefaultSumw2(1);
-
- //TFile *outDC = new TFile("htt_mt_inputs.root","RECREATE");
-
- TString unwtcutstring;
-
- loadCutString(cuttablefilename, unwtcutstring);
-
- TString blinddatacutstring = unwtcutstring + "&&(1)";
-
-
- // Get the input trees:
-
- vector samples;
-
- loadSamples(samplefilename,samples);
-
-
- //TFile f("plotvar_histo.root", "RECREATE");
- TFile f(OutRootFile.c_str(), "RECREATE");
-
- //============================================================
- // VARIABLE LOOP
- //============================================================
-
- for (int ivar=0; ; ivar++) {
-
- plotVar_t pv = plotvars[ivar];
-
- TString outfile = TString("OutDir/")+TString(gSystem->BaseName(cuttablefilename)).ReplaceAll(".txt","")+TString("_")+pv.outfile;
- Logfile.open (outfile+".log");
- TString temp = TString("Yield of Variable : ")+pv.outfile;
- const std::string spaces(temp.Length(), ' ');
- const std::string second = "* " + spaces + " *";
- const std::string first(second.size(), '*');
- Logfile << first << std::endl;
- Logfile << second << std::endl;
- Logfile << "* " << temp << " *" << std::endl;
- Logfile << second << std::endl;
- Logfile << first << std::endl;
-
- if ( !pv.plotvar.Length() ) break;
-
- cout << pv.plotvar << "\t"< m_histos;
- map m_stacked;
-
- double totevents = 0.;
-
- //============================================================
- // DRAW THE VARIABLE FOR ALL SAMPLES, CREATE HISTOS
- //============================================================
-
- // start loop from 1 to skip data
- for (size_t isamp=1; isampname()] = false;
-
- TH1 *h;
-
- if (s->name().EqualTo("data")) {
- plotVar_t pvnosmear = pv;
- h = s->Draw(pvnosmear, TCut(blinddatacutstring), nullcut); // effwt*puwt==1 for data! -- NO IT DOESN'T NECESSARILY!
- }
- else if (s->name().EqualTo("aQGC")){
- h = s->Draw(pv, the_cut*"(LHEWeight[993]/LHEWeight[0])", the_cut*"(LHEWeight[993]/LHEWeight[0])");
- if (s->stackit()) {
- totevents += h->Integral(1,h->GetNbinsX()+1);
- }
- }
- else {
- h = s->Draw(pv, the_cut, the_cut);
- if (s->stackit()) {
- totevents += h->Integral(1,h->GetNbinsX()+1);
- }
- }
-
- if (!h) continue;
-
- map::iterator mit = m_histos.find(s->name());
- if (mit == m_histos.end()) {
- h->SetName(s->name());
- h->SetTitle(s->name());
- if (s->stackit()) {
- if (s->name().EqualTo("W+jets"))
- {
- h->SetLineColor(TColor::GetColor(222,90,106));
-// h->SetFillColor(TColor::GetColor(222,90,106));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("top"))
- {
- h->SetLineColor(TColor::GetColor(155,152,204));
-// h->SetFillColor(TColor::GetColor(155,152,204));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("TTbar"))
- {
- h->SetLineColor(TColor::GetColor(155,152,204));
-// h->SetFillColor(TColor::GetColor(155,152,204));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("SingleTop"))
- {
- h->SetLineColor(TColor::GetColor(0,84,159));
-// h->SetFillColor(TColor::GetColor(0,84,159));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("Z+jets"))
- {
- h->SetLineColor(TColor::GetColor(248,206,104));
-// h->SetFillColor(TColor::GetColor(248,206,104));
- h->SetLineWidth(0);
- }
- else if(s->name().EqualTo("Diboson"))
- {
- h->SetLineColor(TColor::GetColor(250,202,255));
-// h->SetFillColor(TColor::GetColor(250,202,255));
- h->SetLineWidth(0);
- }
- else
- {
- h->SetLineColor(s->colorcode());
-// h->SetFillColor(s->colorcode());
- h->SetLineWidth(0);
- }
- }
- m_histos[s->name()] = h;
- } else {
- mit->second->Add(h);
- }
- }
-
- //============================================================
- // COUNT EVENTS, RENORM TO DATA, CONSTRUCT THE TSTACK & LEGEND
- //============================================================
-
- double ndata=1., renorm=1.;
-
- cout << "Total MC = " << totevents << endl;
- Logfile << "Total MC = " << totevents << endl;
-
- // Setup the stack and total
- THStack* hs = new THStack("hs","MC contribution");
- TH1D *th1tot = new TH1D("th1tot", "th1tot", pv.NBINS, pv.MINRange, pv.MAXRange);
-
- // Set up the legend
-
- float legX0=0.65, legX1=0.99, legY0=0.54, legY1=0.88;
- //float legX0=0.17, legX1=0.95, legY0=0.7, legY1=0.88;
- // float legX0=0.52, legX1=0.89, legY0=0.54, legY1=0.88;
- // float legX0=0.18, legX1=0.52, legY0=0.4, legY1=0.88;
- TLegend * Leg = new TLegend( legX0, legY0, legX1, legY1);
- Leg->SetFillColor(0);
- Leg->SetFillStyle(0);
- Leg->SetBorderSize(0);
- //Leg->SetTextSize(0.04);
- //Leg->SetNColumns(3);
-
-
- vector binErrSQ(pv.NBINS,0.);
-
- vector > v_legentries;
-
- TString oldsamplename;
- double maxval = -9e99;
-
- // start loop from 1 to skip data
- for (size_t isamp=1; isampname()==oldsamplename) continue;
-
- map::iterator mit = m_histos.find(s->name());
- TH1 *h = mit->second;
- //h->SetLineColor(kBlack);
- h->SetLineWidth( 3.);
- //h->SetFillColor(color );
- //h->SetFillStyle(style );
- h->SetTitleSize (0.055,"Y");
- h->SetTitleOffset(1.600,"Y");
- h->SetLabelOffset(0.014,"Y");
- h->SetLabelSize (0.050,"Y");
- h->SetLabelFont (42 ,"Y");
- h->SetTitleSize (0.055,"X");
- h->SetTitleOffset(1.300,"X");
- h->SetLabelOffset(0.014,"X");
- h->SetLabelSize (0.050,"X");
- h->SetLabelFont (42 ,"X");
- //h->SetMarkerStyle(20);
- //h->SetMarkerColor(color);
- h->SetMarkerSize (0.6);
- h->GetYaxis()->SetTitleFont(42);
- h->GetXaxis()->SetTitleFont(42);
- //h->SetTitle("");
-
- cout << s->name() << " = " << Form("%7g", h->Integral(1,h->GetNbinsX()+1)) << endl;
- Logfile << s->name() << " = " << Form("%7g", h->Integral(1,h->GetNbinsX()+1)) << endl;
-
- if(s->stackit()) {
- // Compose the stack
- hs->Add(h);
- th1tot->Add(h);
- m_stacked[s->name()] = true;
- for (int ibin=1; ibin <= pv.NBINS; ibin++)
- binErrSQ[ibin-1] += h->GetBinError(ibin)*h->GetBinError(ibin);
- }
- v_legentries.push_back(*mit);
-
- // Added this if to ignore the maximum range of aQGC distribution
- // Since if we take it then the histogram rescale very bad so that we can't see other histos
- if (h && s->name()!="aQGC")
- {
- int maxbin = h->GetMaximumBin();
- maxval = std::max(maxval,h->GetBinContent(maxbin));
- }
-
- oldsamplename=s->name();
- h->Write();
- }
-
- cout << "maxval " < >::reverse_iterator
- rit = v_legentries.rbegin();
- rit != v_legentries.rend();
- rit++)
- {
- if(rit->first=="aQGC" || rit->first=="WV(EWK)")
- Leg->AddEntry(rit->second, rit->first, "L" ); // "F");
- else
- Leg->AddEntry(rit->second, rit->first, "L" ); // "F");
- }
- //cout<<" Debug.... 1" << endl;
- TH1D* th1totClone = ( TH1D*) th1tot->Clone("th1totClone");
- th1totClone->SetMarkerStyle(0);
- th1totClone->SetFillStyle(3003);
- th1totClone->SetFillColor(11);
- th1totClone->SetLineColor(0);
-
- for(int ibin=1; ibin<=th1totClone->GetNbinsX(); ++ibin) {
- th1totClone->SetBinError(ibin, sqrt(binErrSQ[ibin-1]));
- }
- //cout<<" Debug.... 2" << endl;
-
- //============================================================
- // SETUP THE CANVAS
- //============================================================
-
-// gROOT->ProcessLine(".L tdrstyle.C");
- setTDRStyle();
- //tdrStyle->SetErrorX(0.5);
- //tdrStyle->SetPadRightMargin(0.05);
-
- //tdrStyle->SetLegendBorderSize(0);
-
- TCanvas* c1 = new TCanvas(pv.plotvar,pv.plotvar,10,10, 800, 800);
- TPad *d1, *d2;
-
- c1->SetFillColor (0);
- c1->SetBorderMode (0);
- c1->SetBorderSize (10);
- // Set margins to reasonable defaults
- c1->SetLeftMargin (0.18);
- c1->SetRightMargin (0.05);
- c1->SetTopMargin (0.08);
- c1->SetBottomMargin (0.15);
- // Setup a frame which makes sense
- c1->SetFrameFillStyle (0);
- c1->SetFrameLineStyle (0);
- c1->SetFrameBorderMode(0);
- c1->SetFrameBorderSize(10);
- c1->SetFrameFillStyle (0);
- c1->SetFrameLineStyle (0);
- c1->SetFrameBorderMode(0);
- c1->SetFrameBorderSize(10);
-
- c1->Divide(1,2);
- d1 = (TPad*)c1->GetPad(1);
- d1->SetPad(0.01,0.02,0.95,0.99);
- //c1->cd();
- d2 = (TPad*)c1->GetPad(2);
- d2->SetPad(0.01,0.00,0.95,0.02);
- //cout<<" Debug.... 3" << endl;
- d1->cd();
- gPad->SetBottomMargin(0.14);
-
- //cout<<" Debug.... 4" << endl;
- gPad->SetTopMargin(0.1);
- gPad->SetRightMargin(0.05);
- gPad->SetLeftMargin(0.14);
-
- gPad->SetLogy(0);
-
-// if (th1tot->GetEntries())
-// Leg->AddEntry(th1tot, "Stat. Uncertainty", "f");
-
- Leg->SetFillColor(0);
-
- TH1* th1totempty = new TH1D("th1totempty", "th1totempty", pv.ANBINS, pv.AMINRange, pv.AMAXRange);
-
- th1tot->SetFillStyle(3013);
- th1tot->SetFillColor(13);
- th1tot->SetLineColor(kBlack);
- th1tot->SetLineWidth(1);
- th1tot->SetMarkerStyle(0);
-
- char tmpc[100]; sprintf(tmpc,"Events");
- if (pv.slog==1) sprintf(tmpc,"Events/ %.1f",BINWIDTH);
- if (pv.slog==2) sprintf(tmpc,"Events/ %.2f",BINWIDTH);
- if (pv.slog==3) sprintf(tmpc,"Events/ %.0f GeV",BINWIDTH);
- if (pv.slog==6) sprintf(tmpc,"Events/ %.1f rad",BINWIDTH);
- th1totempty->SetYTitle(tmpc);
- // th1totempty->GetYaxis()->SetTitleSize(0.1);
- th1totempty->GetYaxis()->SetTitleOffset(1.2);
- th1totempty->GetYaxis()->SetLabelOffset(0.01);
- // th1totempty->GetYaxis()->CenterTitle(true);
- th1totempty->GetYaxis()->SetLabelSize(0.04);
- // th1totClone->Draw("e3");
-
- if (th1tot->GetEntries()) {
- th1tot->SetMinimum(0.1);
- th1totempty->SetMinimum(0.1);
- }
-
-// th1totempty->SetMaximum(2.5*maxval);
- th1totempty->SetMaximum(1.8*maxval);
- if(pv.slog==1) th1totempty->SetMaximum(1.8*maxval);
- th1totempty->GetXaxis()->SetTitle(pv.xlabel);
-
- // Draw it all
-
- th1totempty->Draw();
-
-
-
- //hs->SetMaximum(400.0);
- hs->Draw("samehist nostack");
- hs->GetXaxis()->SetTitle(pv.xlabel);
- if (pv.drawleg ==1) Leg->Draw();
-
- //th1tot->Draw("e2same");
-
- //if(aqgc)
- // aqgc->Draw("same");
- Logfile << endl << endl;
- Logfile << "Significance (For SM) = (nSig/100) / sqrt(nSig/100 + nTotalBkg)" << endl;
- Logfile << "Significance (For aQGC) = (nSig) / sqrt(nSig + nTotalBkg)" << endl;
-
- // draw unstacked histos separately.
- oldsamplename.Clear();
- // start loop from 1 to skip data
- for (size_t isamp=1; isampname()==oldsamplename) continue;
- if (!s->stackit()) {
- map::iterator mit = m_histos.find(s->name());
- if (mit != m_histos.end()) {
- TH1 *h = mit->second;
- //if (h) h->Draw("histsame"); // To get line for data...
- if (h && s->name()=="WV(EWK)")
- {
- h->SetFillStyle(0.);
- //aqgc->SetLineStyle(11);
- h->SetLineWidth(3.);
- h->SetLineColor(kRed);
- //h->SetLineColor(kBlue+3);
- Logfile << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1)/100.)/sqrt((h->Integral(1,h->GetNbinsX()+1)/100.)+totevents) << endl;
- cout << "Significance (SM EWK) = " << (h->Integral(1,h->GetNbinsX()+1)/100.)/sqrt((h->Integral(1,h->GetNbinsX()+1)/100.)+totevents) << endl;
- //h->Scale(th1tot->Integral(1,th1tot->GetNbinsX()+1)/h->Integral(1,h->GetNbinsX()+1));
- h->Draw("histsame");
-
- }
- if (h && s->name()=="aQGC")
- {
- h->SetFillStyle(0.);
- //aqgc->SetLineStyle(11);
- h->SetLineWidth(3.);
- h->SetLineColor(kBlack);
- //h->SetLineColor(kRed+5);
- cout << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- Logfile << "Significance (aQGC) = " << (h->Integral(1,h->GetNbinsX()+1))/sqrt((h->Integral(1,h->GetNbinsX()+1))+totevents) << endl;
- //h->Scale(th1tot->Integral(1,th1tot->GetNbinsX()+1)/h->Integral(1,h->GetNbinsX()+1));
- h->Draw("histsame");
- //h->Draw("e1same");
- }
- //h->Write();
- }
- }
- oldsamplename=s->name();
- }
- //cout<<" Debug.... 1" << endl;
-
- //cmspre(intLUMIinvpb/1000.0);
- CMS_lumi( d1, 4, 10 );
- //cout<<" Debug.... 2" << endl;
-// gPad->RedrawAxis();
- //cout<<" Debug.... 3" << endl;
-
-
-
- c1->Print(outfile+".pdf");
- c1->Print(outfile+".png");
- Logfile.close();
-#if 0
- c1->Print(outfile+".C");
- //gPad->WaitPrimitive();
- c1->Modified();
- c1->Update();
- c1->SaveAs(outfile+".pdf");
-#endif
- c1->Write();
- } // var loop
-
- //f.Write();
-
-} // myControlPlots_SignalBkg_Comparison_Individual
-
-/*
-//================================================================================
-
-void dibresNobtagElplots()
-{
- myControlPlots_SignalBkg_Comparison_Individual("DibosonResolvedElCuts.txt",
- "DibosonResolvedElSamples13TeV.txt",
- commonplotvars);
-}
-
-//================================================================================
-
-
-void Nminus1_plots_met()
-{
- myControlPlots_SignalBkg_Comparison_Individual("DibosonBoostedElCuts13TeV_WjetControlRegion_tight.txt",
- "DibosonBoostedElSamples13TeV.txt",
- met
- );
- myControlPlots_SignalBkg_Comparison_Individual("DibosonBoostedMuCuts13TeV_WjetControlRegion_tight.txt",
- "DibosonBoostedMuSamples13TeV.txt",
- met
- );
- myControlPlots_SignalBkg_Comparison_Individual("DibosonBoostedElCuts13TeV_TTBarControlRegion.txt",
- "DibosonBoostedElSamples13TeV.txt",
- met
- );
- myControlPlots_SignalBkg_Comparison_Individual("DibosonBoostedMuCuts13TeV_TTBarControlRegion.txt",
- "DibosonBoostedMuSamples13TeV.txt",
- met
- );
-}
-*/
diff --git a/ControlPlots/newControlPlots.C b/ControlPlots/newControlPlots.C
new file mode 100644
index 0000000..5ed86de
--- /dev/null
+++ b/ControlPlots/newControlPlots.C
@@ -0,0 +1,85 @@
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "controlplotvars_CHS_debug.h" // Header with plot variable definitions
+
+struct Sample {
+ std::string name;
+ std::string fileLocation;
+ double xsecOrLumi;
+ double otherScale;
+ long long nMCEvents;
+ long long nMCNegEvents;
+ int colorCode;
+ bool stackIt;
+};
+
+std::vector LoadSamples(const char* filename) {
+ std::vector samples;
+ std::ifstream infile(filename);
+ std::string line;
+ while (std::getline(infile, line)) {
+ if (line[0] == '#' || line.empty()) continue;
+ std::istringstream iss(line);
+ Sample sample;
+ iss >> sample.name >> sample.fileLocation >> sample.xsecOrLumi >> sample.otherScale
+ >> sample.nMCEvents >> sample.nMCNegEvents >> sample.colorCode >> sample.stackIt;
+ samples.push_back(sample);
+ }
+ return samples;
+}
+
+void ProcessSamples(const std::vector& samples) {
+ TFile* outputFile = new TFile("comparison_plots.root", "RECREATE");
+
+ // Loop over each sample
+ for (const auto& sample : samples) {
+ TFile* inputFile = TFile::Open(sample.fileLocation.c_str(), "READ");
+ if (!inputFile || inputFile->IsZombie()) {
+ std::cerr << "Failed to open file: " << sample.fileLocation << std::endl;
+ continue;
+ }
+
+ TTree* tree = static_cast(inputFile->Get("Events"));
+ if (!tree) {
+ std::cerr << "Tree 'Events' not found in file: " << sample.fileLocation << std::endl;
+ inputFile->Close();
+ continue;
+ }
+
+ // Loop over each variable
+ for (const auto &var : controlplotvars_CHS_debug)
+ {
+ if (std::string(var.plotvar) == "") break;
+
+ // Creating histogram for each variable and sample
+ std::string histName = sample.name + "_" + var.plotvar;
+ TH1F* hist = new TH1F(histName.c_str(), (var.xlabel + std::string(" (") + sample.name + ")").c_str(), var.NBINS, var.MINRange, var.MAXRange);
+ hist->SetLineColor(sample.colorCode);
+ hist->SetFillColor(sample.colorCode * (sample.stackIt ? 1 : 0)); // Fill color only if stacking
+ tree->Draw(TString::Format("%s>>%s", var.plotvar, histName.c_str()), "", "goff");
+ hist->Write();
+ }
+
+ inputFile->Close();
+ }
+
+ outputFile->Close();
+}
+
+void DataMCComparison() {
+ auto samples = LoadSamples("HZZ2l2nu_MuonSamples13TeV_2024_04_11.txt");
+ ProcessSamples(samples);
+}
diff --git a/ControlPlots/readTree.C b/ControlPlots/readTree.C
deleted file mode 100644
index c7bf4e6..0000000
--- a/ControlPlots/readTree.C
+++ /dev/null
@@ -1,28 +0,0 @@
-// A simple TTreeReader use: read data from hsimple.root (written by hsimple.C)
-#include "TFile.h"
-#include "TH1F.h"
-#include "TTreeReader.h"
-#include "TTreeReaderValue.h"
-void readTree() {
- // Create a histogram for the values we read.
- TH1F *h1 = new TH1F("h1", "ntuple", 100, 0, 2400);
- // Open the file containing the tree.
- //TFile *myFile = TFile::Open("root:://cmseos.fnal.gov//eos/uscms/store/user/rasharma/SecondStep/WWTree_2018_01_03_14h54/HaddedFiles/WplusTo2JWminusToLNuJJ_EWK_LO_SM.root");
- TFile *myFile = TFile::Open("root:://cmseos.fnal.gov//eos/uscms/store/user/rasharma/SecondStep/WWTree_2018_01_06_20h00/HaddedFiles/TTToSemilepton.root");
- // Create a TTreeReader for the tree, for instance by passing the
- // TTree's name and the TDirectory / TFile it is in.
- TTreeReader myReader("otree", myFile);
- // The branch "px" contains floats; access them as myPx.
- TTreeReaderValue myPx(myReader, "mass_lvj_type0");
- TTreeReaderValue btag(myReader, "btag0Wgt");
- //TTreeReaderValue vbf(myReader, "isVBF");
- // Loop over all entries of the TTree or TChain.
- while (myReader.Next()) {
- // Just access the data as if myPx and myPy were iterators (note the '*'
- // in front of them):
- h1->Fill(*btag);
- //if (isnan(btag))
- //cout<<"btag0Wgt is nan"<Draw();
-}
diff --git a/ControlPlots/setup.sh b/ControlPlots/setup.sh
new file mode 100755
index 0000000..177a992
--- /dev/null
+++ b/ControlPlots/setup.sh
@@ -0,0 +1 @@
+source /cvmfs/sft.cern.ch/lcg/views/dev4cuda/latest/x86_64-el9-gcc11-opt/setup.sh
diff --git a/ControlPlots/tdrstyle.py b/ControlPlots/tdrstyle.py
deleted file mode 100644
index ea18525..0000000
--- a/ControlPlots/tdrstyle.py
+++ /dev/null
@@ -1,152 +0,0 @@
-import ROOT as rt
-
-def tdrGrid( gridOn):
- tdrStyle.SetPadGridX(gridOn)
- tdrStyle.SetPadGridY(gridOn)
-
-#fixOverlay: Redraws the axis
-def fixOverlay(): gPad.RedrawAxis()
-
-def setTDRStyle():
- tdrStyle = rt.TStyle("tdrStyle","Style for P-TDR")
-
- #for the canvas:
- tdrStyle.SetCanvasBorderMode(0)
- tdrStyle.SetCanvasColor(rt.kWhite)
- tdrStyle.SetCanvasDefH(600) #Height of canvas
- tdrStyle.SetCanvasDefW(600) #Width of canvas
- tdrStyle.SetCanvasDefX(0) #POsition on screen
- tdrStyle.SetCanvasDefY(0)
-
-
- tdrStyle.SetPadBorderMode(0)
- #tdrStyle.SetPadBorderSize(Width_t size = 1)
- tdrStyle.SetPadColor(rt.kWhite)
- tdrStyle.SetPadGridX(False)
- tdrStyle.SetPadGridY(False)
- tdrStyle.SetGridColor(0)
- tdrStyle.SetGridStyle(3)
- tdrStyle.SetGridWidth(1)
-
-#For the frame:
- tdrStyle.SetFrameBorderMode(0)
- tdrStyle.SetFrameBorderSize(1)
- tdrStyle.SetFrameFillColor(0)
- tdrStyle.SetFrameFillStyle(0)
- tdrStyle.SetFrameLineColor(1)
- tdrStyle.SetFrameLineStyle(1)
- tdrStyle.SetFrameLineWidth(1)
-
-#For the histo:
- #tdrStyle.SetHistFillColor(1)
- #tdrStyle.SetHistFillStyle(0)
- tdrStyle.SetHistLineColor(1)
- tdrStyle.SetHistLineStyle(0)
- tdrStyle.SetHistLineWidth(1)
- #tdrStyle.SetLegoInnerR(Float_t rad = 0.5)
- #tdrStyle.SetNumberContours(Int_t number = 20)
-
- tdrStyle.SetEndErrorSize(2)
- #tdrStyle.SetErrorMarker(20)
- #tdrStyle.SetErrorX(0.)
-
- tdrStyle.SetMarkerStyle(20)
-
-#For the fit/function:
- tdrStyle.SetOptFit(1)
- tdrStyle.SetFitFormat("5.4g")
- tdrStyle.SetFuncColor(2)
- tdrStyle.SetFuncStyle(1)
- tdrStyle.SetFuncWidth(1)
-
-#For the date:
- tdrStyle.SetOptDate(0)
- # tdrStyle.SetDateX(Float_t x = 0.01)
- # tdrStyle.SetDateY(Float_t y = 0.01)
-
-# For the statistics box:
- tdrStyle.SetOptFile(0)
- tdrStyle.SetOptStat(0) # To display the mean and RMS: SetOptStat("mr")
- tdrStyle.SetStatColor(rt.kWhite)
- tdrStyle.SetStatFont(42)
- tdrStyle.SetStatFontSize(0.025)
- tdrStyle.SetStatTextColor(1)
- tdrStyle.SetStatFormat("6.4g")
- tdrStyle.SetStatBorderSize(1)
- tdrStyle.SetStatH(0.1)
- tdrStyle.SetStatW(0.15)
- # tdrStyle.SetStatStyle(Style_t style = 1001)
- # tdrStyle.SetStatX(Float_t x = 0)
- # tdrStyle.SetStatY(Float_t y = 0)
-
-# Margins:
- tdrStyle.SetPadTopMargin(0.05)
- tdrStyle.SetPadBottomMargin(0.13)
- tdrStyle.SetPadLeftMargin(0.22)
- tdrStyle.SetPadRightMargin(0.12)
-
-# For the Global title:
-
- tdrStyle.SetOptTitle(0)
- tdrStyle.SetTitleFont(42)
- tdrStyle.SetTitleColor(1)
- tdrStyle.SetTitleTextColor(1)
- tdrStyle.SetTitleFillColor(10)
- tdrStyle.SetTitleFontSize(0.03)
- # tdrStyle.SetTitleH(0) # Set the height of the title box
- # tdrStyle.SetTitleW(0) # Set the width of the title box
- # tdrStyle.SetTitleX(0) # Set the position of the title box
- # tdrStyle.SetTitleY(0.985) # Set the position of the title box
- # tdrStyle.SetTitleStyle(Style_t style = 1001)
- # tdrStyle.SetTitleBorderSize(2)
-
-# For the axis titles:
-
- tdrStyle.SetTitleColor(1, "XYZ")
- tdrStyle.SetTitleFont(42, "XYZ")
- tdrStyle.SetTitleSize(0.04, "XYZ")
- # tdrStyle.SetTitleXSize(Float_t size = 0.02) # Another way to set the size?
- # tdrStyle.SetTitleYSize(Float_t size = 0.02)
- tdrStyle.SetTitleXOffset(0.75)
- tdrStyle.SetTitleYOffset(1.10)
- # tdrStyle.SetTitleOffset(1.1, "Y") # Another way to set the Offset
-
-# For the axis labels:
-
- tdrStyle.SetLabelColor(1, "XYZ")
- tdrStyle.SetLabelFont(42, "XYZ")
- tdrStyle.SetLabelOffset(0.007, "XYZ")
- tdrStyle.SetLabelSize(0.03, "XYZ")
-
-# For the axis:
-
- tdrStyle.SetAxisColor(1, "XYZ")
- tdrStyle.SetStripDecimals(True)
- tdrStyle.SetTickLength(0.03, "XYZ")
- tdrStyle.SetNdivisions(510, "XYZ")
- tdrStyle.SetPadTickX(1) # To get tick marks on the opposite side of the frame
- tdrStyle.SetPadTickY(1)
-
-# Change for log plots:
- tdrStyle.SetOptLogx(0)
- tdrStyle.SetOptLogy(0)
- tdrStyle.SetOptLogz(0)
-
-# Postscript options:
- tdrStyle.SetPaperSize(20.,20.)
- # tdrStyle.SetLineScalePS(Float_t scale = 3)
- # tdrStyle.SetLineStyleString(Int_t i, const char* text)
- # tdrStyle.SetHeaderPS(const char* header)
- # tdrStyle.SetTitlePS(const char* pstitle)
-
- # tdrStyle.SetBarOffset(Float_t baroff = 0.5)
- # tdrStyle.SetBarWidth(Float_t barwidth = 0.5)
- # tdrStyle.SetPaintTextFormat(const char* format = "g")
- # tdrStyle.SetPalette(Int_t ncolors = 0, Int_t* colors = 0)
- # tdrStyle.SetTimeOffset(Double_t toffset)
- # tdrStyle.SetHistMinimumZero(kTRUE)
-
- tdrStyle.SetHatchesLineWidth(5)
- tdrStyle.SetHatchesSpacing(0.05)
-
- tdrStyle.cd()
diff --git a/ControlPlots/utils.C b/ControlPlots/utils.C
index a8041a1..8921261 100644
--- a/ControlPlots/utils.C
+++ b/ControlPlots/utils.C
@@ -85,7 +85,7 @@ void Tokenize(const std::string& str,
pos = src.find_first_of(delimiters, lastPos);
}
- //cout << "tokens.size() = " << tokens.size() <& outpaths)
+void expandGlob(const std::string& globstr,
+ std::vector& outpaths)
{
glob_t globbuf;
int stat = glob (globstr.c_str(), GLOB_MARK, NULL, &globbuf);
if (stat) {
switch (stat) {
- case GLOB_NOMATCH: cerr << "No file matching glob pattern "; break;
- case GLOB_NOSPACE: cerr << "glob ran out of memory "; break;
- case GLOB_ABORTED: cerr << "glob read error "; break;
- default: cerr << "unknown glob error stat=" << stat << " "; break;
+ case GLOB_NOMATCH: std::cerr << "No file matching glob pattern "; break;
+ case GLOB_NOSPACE: std::cerr << "glob ran out of memory "; break;
+ case GLOB_ABORTED: std::cerr << "glob read error "; break;
+ default: std::cerr << "unknown glob error stat=" << stat << " "; break;
}
- cerr << globstr << endl;
+ std::cerr << globstr << std::endl;
exit(-1);
}
-
+
for (size_t i=0; i
+
+
+
+
+
+
+
+ CMS_lumi module — plotting macro 0.0.1 documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ plotting macro
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
CMS_lumi module
+
+
+CMS_lumi.CMS_lumi( pad , iPeriod , iPosX ) [source]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/build/html/GetEntries.html b/docs/build/html/GetEntries.html
new file mode 100644
index 0000000..9bab0cd
--- /dev/null
+++ b/docs/build/html/GetEntries.html
@@ -0,0 +1,202 @@
+
+
+
+
+
+
+
+
+
+
+ GetEntries module — plotting macro 0.0.1 documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ plotting macro
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
GetEntries module
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/build/html/Print_AQGC_par.html b/docs/build/html/Print_AQGC_par.html
new file mode 100644
index 0000000..16877a9
--- /dev/null
+++ b/docs/build/html/Print_AQGC_par.html
@@ -0,0 +1,212 @@
+
+
+
+
+
+
+
+
+
+
+ Print_AQGC_par module — plotting macro 0.0.1 documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ plotting macro
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Print_AQGC_par module
+
+
+Print_AQGC_par.getPlotArgs( ) [source]
+
+
+
+
+Print_AQGC_par.main( ) [source]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/build/html/_modules/CMS_lumi.html b/docs/build/html/_modules/CMS_lumi.html
new file mode 100644
index 0000000..de4436c
--- /dev/null
+++ b/docs/build/html/_modules/CMS_lumi.html
@@ -0,0 +1,353 @@
+
+
+
+
+
+
+
+
+
+
+ CMS_lumi — plotting macro 0.0.1 documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ plotting macro
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Source code for CMS_lumi
+import ROOT as rt
+
+# CMS_lumi
+# Initiated by: Gautier Hamel de Monchenault (Saclay)
+# Translated in Python by: Joshua Hardenbrook (Princeton)
+#
+
+cmsText = "CMS" ;
+cmsTextFont = 61
+
+writeExtraText = True
+extraText = "Very Preliminary"
+extraTextFont = 52
+
+lumiTextSize = 0.5
+lumiTextOffset = 0.2
+
+cmsTextSize = 0.5
+cmsTextOffset = 0.1
+
+relPosX = 0.045
+relPosY = 0.035
+relExtraDY = 1.2
+
+extraOverCmsTextSize = 0.76
+
+lumi_13TeV = "20.1 fb^{-1}"
+lumi_8TeV = "19.7 fb^{-1}"
+lumi_7TeV = "5.1 fb^{-1}"
+
+drawLogo = False
+
+[docs] def CMS_lumi ( pad , iPeriod , iPosX ):
+
outOfFrame = False
+
if ( iPosX / 10 == 0 ): outOfFrame = True
+
+
alignY_ = 3
+
alignX_ = 2
+
if ( iPosX / 10 == 0 ): alignX_ = 1
+
if ( iPosX == 0 ): alignY_ = 1
+
if ( iPosX / 10 == 1 ): alignX_ = 1
+
if ( iPosX / 10 == 2 ): alignX_ = 2
+
if ( iPosX / 10 == 3 ): alignX_ = 2
+
align_ = 10 * alignX_ + alignY_
+
+
H = pad . GetWh ()
+
W = pad . GetWw ()
+
l = pad . GetLeftMargin ()
+
t = pad . GetTopMargin ()
+
r = pad . GetRightMargin ()
+
b = pad . GetBottomMargin ()
+
e = 0.025
+
+
pad . cd ()
+
+
lumiText = ""
+
if ( iPeriod == 1 ):
+
lumiText += lumi_7TeV
+
lumiText += " (7 TeV)"
+
elif ( iPeriod == 2 ):
+
lumiText += lumi_8TeV
+
lumiText += " (8 TeV)"
+
+
elif ( iPeriod == 3 ):
+
lumiText = lumi_8TeV
+
lumiText += " (8 TeV)"
+
lumiText += " + "
+
lumiText += lumi_7TeV
+
lumiText += " (7 TeV)"
+
elif ( iPeriod == 4 ):
+
lumiText += lumi_13TeV
+
lumiText += " (13 TeV)"
+
elif ( iPeriod == 7 ):
+
if ( outOfFrame ): lumiText += "#scale[0.85]{"
+
lumiText += lumi_13TeV
+
lumiText += " (13 TeV)"
+
lumiText += " + "
+
lumiText += lumi_8TeV
+
lumiText += " (8 TeV)"
+
lumiText += " + "
+
lumiText += lumi_7TeV
+
lumiText += " (7 TeV)"
+
if ( outOfFrame ): lumiText += "}"
+
elif ( iPeriod == 12 ):
+
lumiText += "8 TeV"
+
+
print lumiText
+
+
latex = rt . TLatex ()
+
latex . SetNDC ()
+
latex . SetTextAngle ( 0 )
+
latex . SetTextColor ( rt . kBlack )
+
+
extraTextSize = extraOverCmsTextSize * cmsTextSize
+
+
latex . SetTextFont ( 42 )
+
latex . SetTextAlign ( 31 )
+
latex . SetTextSize ( lumiTextSize * t )
+
+
latex . DrawLatex ( 1 - r , 1 - t + lumiTextOffset * t , lumiText )
+
+
if ( outOfFrame ):
+
latex . SetTextFont ( cmsTextFont )
+
latex . SetTextAlign ( 11 )
+
latex . SetTextSize ( cmsTextSize * t )
+
latex . DrawLatex ( l , 1 - t + lumiTextOffset * t , cmsText )
+
+
pad . cd ()
+
+
posX_ = 0
+
if ( iPosX % 10 <= 1 ):
+
posX_ = l + relPosX * ( 1 - l - r )
+
elif ( iPosX % 10 == 2 ):
+
posX_ = l + 0.5 * ( 1 - l - r )
+
elif ( iPosX % 10 == 3 ):
+
posX_ = 0.92 - r - relPosX * ( 1 - l - r )
+
+
posY_ = 1 - t - relPosY * ( 1 - t - b )
+
+
if ( not outOfFrame ):
+
if ( drawLogo ):
+
posX_ = l + 0.045 * ( 1 - l - r ) * W / H
+
posY_ = 1 - t - 0.045 * ( 1 - t - b )
+
xl_0 = posX_
+
yl_0 = posY_ - 0.15
+
xl_1 = posX_ + 0.15 * H / W
+
yl_1 = posY_
+
CMS_logo = rt . TASImage ( "CMS-BW-label.png" )
+
pad_logo = rt . TPad ( "logo" , "logo" , xl_0 , yl_0 , xl_1 , yl_1 )
+
pad_logo . Draw ()
+
pad_logo . cd ()
+
CMS_logo . Draw ( "X" )
+
pad_logo . Modified ()
+
pad . cd ()
+
else :
+
latex . SetTextFont ( cmsTextFont )
+
latex . SetTextSize ( cmsTextSize * t )
+
latex . SetTextAlign ( align_ )
+
latex . DrawLatex ( posX_ , posY_ , cmsText )
+
if ( writeExtraText ) :
+
latex . SetTextFont ( extraTextFont )
+
latex . SetTextAlign ( align_ )
+
latex . SetTextSize ( extraTextSize * t )
+
latex . DrawLatex ( posX_ , posY_ - relExtraDY * cmsTextSize * t , extraText )
+
elif ( writeExtraText ):
+
if ( iPosX == 0 ):
+
posX_ = l + relPosX * ( 1 - l - r )
+
posY_ = 1 - t + lumiTextOffset * t
+
+
latex . SetTextFont ( extraTextFont )
+
latex . SetTextSize ( extraTextSize * t )
+
latex . SetTextAlign ( align_ )
+
latex . DrawLatex ( posX_ , posY_ , extraText )
+
+
pad . Update ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/build/html/_modules/Print_AQGC_par.html b/docs/build/html/_modules/Print_AQGC_par.html
new file mode 100644
index 0000000..c5f04cf
--- /dev/null
+++ b/docs/build/html/_modules/Print_AQGC_par.html
@@ -0,0 +1,226 @@
+
+
+
+
+
+
+
+
+
+
+ Print_AQGC_par — plotting macro 0.0.1 documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ plotting macro
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Source code for Print_AQGC_par
+#!/usr/bin/env python
+import ROOT
+import CMS_lumi , tdrstyle
+import argparse
+import plot_functions as plotter
+
+ROOT . gROOT . SetBatch ( True )
+ROOT . gStyle . SetOptStat ( 0 )
+ROOT . gStyle . SetOptFit ( 0 )
+
+[docs] def main ():
+
plot_info = getPlotArgs ()
+
print plot_info
+
print " \n ======= Start Makeing plots ================= \n "
+
+
print " \n ========= plot FT0 =========== \n "
+
plotter . PrintaQGC_parameters ( plot_info , "" )
+
+[docs] def getPlotArgs ():
+
parser = plotter . getBasicParser ()
+
parser . add_argument ( "-n" , "--file_name" , nargs = '+' , type = str , required = False ,
+
help = "Name of root file where plots are stored" )
+
parser . add_argument ( "--is_data" , action = 'store_true' ,
+
help = "Plot histogram with data points" )
+
return vars ( parser . parse_args ())
+
+if __name__ == "__main__" :
+ main ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/build/html/_modules/index.html b/docs/build/html/_modules/index.html
new file mode 100644
index 0000000..743e715
--- /dev/null
+++ b/docs/build/html/_modules/index.html
@@ -0,0 +1,201 @@
+
+
+
+
+
+
+
+
+
+
+ Overview: module code — plotting macro 0.0.1 documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ plotting macro
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Docs »
+
+ Overview: module code
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
All modules for which code is available
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/build/html/_modules/make_aQGC_plots.html b/docs/build/html/_modules/make_aQGC_plots.html
new file mode 100644
index 0000000..f439e1c
--- /dev/null
+++ b/docs/build/html/_modules/make_aQGC_plots.html
@@ -0,0 +1,230 @@
+
+
+
+
+
+
+
+
+
+
+ make_aQGC_plots — plotting macro 0.0.1 documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ plotting macro
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Source code for make_aQGC_plots
+#!/usr/bin/env python
+import ROOT
+import CMS_lumi , tdrstyle
+import argparse
+import plot_functions as plotter
+
+ROOT . gROOT . SetBatch ( True )
+ROOT . gStyle . SetOptStat ( 0 )
+ROOT . gStyle . SetOptFit ( 0 )
+
+[docs] def main ():
+
plot_info = getPlotArgs ()
+
print plot_info
+
print " \n ======= Start Makeing plots ================= \n "
+
+
#canvas = ROOT.TCanvas("c2","c2",50,50,800,800)
+
#plotter.getHistFromFile(plot_info, 0, 1, 1)
+
#canvas.Print(plot_info["output_file"])
+
plotter . CompHistFromTwoFile ( plot_info )
+ #plotter.CompHistFromTwoBranchSameFile(plot_info)
+
+
+[docs] def getPlotArgs ():
+
parser = plotter . getBasicParser ()
+
parser . add_argument ( "-n" , "--file_name" , nargs = '+' , type = str , required = False ,
+
help = "Name of root file where plots are stored" )
+
parser . add_argument ( "--is_data" , action = 'store_true' ,
+
help = "Plot histogram with data points" )
+
return vars ( parser . parse_args ())
+
+if __name__ == "__main__" :
+ main ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/build/html/_modules/plot_functions.html b/docs/build/html/_modules/plot_functions.html
new file mode 100644
index 0000000..b881fb4
--- /dev/null
+++ b/docs/build/html/_modules/plot_functions.html
@@ -0,0 +1,700 @@
+
+
+
+
+
+
+
+
+
+
+ plot_functions — plotting macro 0.0.1 documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ plotting macro
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Source code for plot_functions
+#!/usr/bin/env python
+import ROOT as ROOT
+import CMS_lumi , tdrstyle
+import argparse
+
+
+############# Define Legend, Canvas, ##########################
+
+[docs] def getLegends ( pos , ncol , nvar , fontsize ):
+
if pos == "tr" :
+
legend = ROOT . TLegend ( . 70 - ( 0.15 * ( ncol - 1 )), 0.80 - ( 0.02 * ( nvar / ncol - 1 )) , . 95 , . 920 )
+
elif pos == "tl" :
+
legend = ROOT . TLegend ( 0.11 , 0.85 - ( 0.02 * ( nvar / ncol - 1 )) , . 80 + ( 0.15 * ( ncol - 1 )) , . 920 )
+
elif pos == "tc" :
+
legend = ROOT . TLegend ( 0.30 , 0.80 - ( 0.02 * ( nvar / ncol - 1 )) , . 80 , . 920 )
+
elif pos == "bl" :
+
legend = ROOT . TLegend ( 0.11 , 0.25 + ( 0.02 * ( nvar / ncol - 1 )) , . 60 + ( 0.15 * ( ncol - 1 )) , . 130 )
+
elif pos == "bc" :
+
legend = ROOT . TLegend ( 0.30 , 0.25 + ( 0.02 * ( nvar / ncol - 1 )) , . 80 , . 130 )
+
elif pos == "br" :
+
legend = ROOT . TLegend ( . 45 - ( 0.15 * ( ncol - 1 )), 0.25 + ( 0.02 * ( nvar / ncol - 1 )) , . 95 , . 130 )
+
else :
+
print "Invalid default position: Switching to default legend position top-right"
+
legend = ROOT . TLegend ( . 85 - ( 0.15 * ( ncol - 1 )), 0.88 - ( 0.02 * ( nvar / ncol - 1 )) , . 50 , . 950 )
+
legend . SetFillColor ( ROOT . kWhite )
+
legend . SetFillStyle ( 0 )
+
legend . SetTextSize ( fontsize )
+
legend . SetNColumns ( ncol )
+
return legend
+
+[docs] def getCanvas ():
+
H_ref = 600 ;
+
W_ref = 600 ;
+
W = W_ref
+
H = H_ref
+
+
T = 0.08 * H_ref
+
B = 0.12 * H_ref
+
L = 0.18 * W_ref
+
R = 0.01 * W_ref
+
+
canvas = ROOT . TCanvas ( "c2" , "c2" , 50 , 50 , W , H )
+
canvas . SetFillColor ( 0 )
+
canvas . SetBorderMode ( 0 )
+
canvas . SetFrameFillStyle ( 0 )
+
canvas . SetFrameBorderMode ( 0 )
+
canvas . SetLeftMargin ( L / W * 0.6 )
+
canvas . SetRightMargin ( R / W * 5 )
+
canvas . SetTopMargin ( T / H )
+
canvas . SetBottomMargin ( B / H )
+
canvas . SetTickx ( 0 )
+
canvas . SetTicky ( 0 )
+
return canvas
+
+[docs] def setHistAttributes ( hist , plot_info , line_color , fill_color ):
+
#hist.SetFillColor(fill_color)
+
hist . SetLineColor ( line_color )
+
hist . SetMarkerColor ( line_color )
+
#colorArray = [1, 632, 416, 600, 400, 616, 432, 920, 800, 880, 820, 840, 860, 900, 940, 960, 980, 640, 660, 680, 700, 720, 740, 760]
+
#stl=1
+
#if(line_color==1):
+
# stl=1
+
#if(line_color==632):
+
# stl=2
+
#if(line_color==416):
+
# stl=3
+
#if(line_color==600):
+
# stl=4
+
#hist.SetMarkerStyle(stl)
+
#hist.SetMarkerSize(1.5)
+
#hist.SetLineWidth(2)
+
hist . SetTitleOffset ( 1.3 , "x" )
+
hist . SetTitleOffset ( 1.3 , "y" )
+
if plot_info [ "rebin" ] != 0 :
+
if type ( hist ) != "<class '__main__.TH2F'>" :
+
hist . Rebin ( plot_info [ "rebin" ])
+
else :
+
print 'Rebin only defined for 1D hist. Use --rebin2D instead.'
+
if plot_info [ "xmin" ] < plot_info [ "xmax" ]:
+
hist . GetXaxis () . SetRangeUser ( plot_info [ "xmin" ], plot_info [ "xmax" ])
+
if plot_info [ "ymin" ] < plot_info [ "ymax" ]:
+
#hist.GetYaxis().SetRangeUser(plot_info["ymin"], plot_info["ymax"])
+
#hist.SetMinimum(plot_info["ymin"])
+
hist . SetMaximum ( plot_info [ "ymax" ])
+ #hist.SetMaximum(30)
+
+ #hist.GetYaxis().SetTitle(plot_info["ylabel"])
+
+[docs] def createRatio ( h1 , h2 , col ): # h1/h2
+
h3 = h1 . Clone ( "h3" )
+
h3 . SetLineColor ( col )
+
h3 . SetMarkerColor ( col )
+
h3 . SetMarkerStyle ( 21 )
+
h3 . SetTitle ( "" )
+
h3 . SetMinimum ( 0.0 )
+
h3 . SetMaximum ( 1.10 )
+
# Set up plot for markers and errors
+
#h3.Sumw2()
+
h3 . SetStats ( 0 )
+
h3 . Divide ( h2 )
+
+
# Adjust y-axis settings
+
y = h3 . GetYaxis ()
+
y . SetTitle ( "ratio (SM/aQGC)" )
+
y . SetNdivisions ( 505 )
+
y . SetTitleSize ( 20 )
+
y . SetTitleFont ( 43 )
+
y . SetTitleOffset ( 1.55 )
+
y . SetLabelFont ( 43 )
+
y . SetLabelSize ( 15 )
+
+
# Adjust x-axis settings
+
x = h3 . GetXaxis ()
+
x . SetTitle ( "mT (WW) GeV" )
+
x . SetTitleSize ( 20 )
+
x . SetTitleFont ( 43 )
+
x . SetTitleOffset ( 4.0 )
+
x . SetLabelFont ( 43 )
+
x . SetLabelSize ( 15 )
+
+
return h3
+
+[docs] def createCanvasPads (): # Create Canvas having two pads
+
c = r . TCanvas ( "c" , "canvas" , 600 , 700 )
+
# Upper histogram plot is pad1
+
pad1 = r . TPad ( "pad1" , "pad1" , 0.0 , 0.3 , 1.0 , 1.0 )
+
pad1 . SetBottomMargin ( 0 ) # joins upper and lower plot
+
pad1 . SetLeftMargin ( 0.1 )
+
pad1 . SetRightMargin ( 0.03 )
+
pad1 . SetLogy ( 1 )
+
pad1 . SetGridx ()
+
pad1 . SetTickx ( 1 )
+
pad1 . SetTicky ( 1 )
+
pad1 . Draw ()
+
# Lower ratio plot is pad2
+
c . cd () # returns to main canvas before defining pad2
+
pad2 = r . TPad ( "pad2" , "pad2" , 0.0 , 0.00 , 1.0 , 0.3 )
+
#pad2.SetLogy(1)
+
pad2 . SetTopMargin ( 0 ) # joins upper and lower plot
+
pad2 . SetBottomMargin ( 0.25 )
+
pad2 . SetLeftMargin ( 0.1 )
+
pad2 . SetRightMargin ( 0.03 )
+
pad2 . SetGridx ()
+
pad2 . SetTickx ( 1 )
+
pad2 . SetTicky ( 1 )
+
pad2 . Draw ()
+
+
return c , pad1 , pad2
+# i == File Number, j == variable number, k == color number
+[docs] def getHistFromFile ( plot_info , i , j , k ):
+
print " \n ===> weight = " , plot_info [ "weight" ], " \n\n "
+
file = ROOT . TFile ( plot_info [ "file_name" ][ i ])
+
print "File Name: " , plot_info [ "file_name" ][ i ]
+
if not file :
+
print 'Failed to open %s ' % plot_info [ "file_name" ][ i ]
+
exit ( 0 )
+
if plot_info [ "tree_var" ][ j ] == "" :
+
print 'Branch name is blank. Please check!!!'
+
exit ( 0 )
+
tree = file . Get ( plot_info [ "tree_folder" ] + plot_info [ "tree_name" ])
+
hist = ROOT . TH1F ( "hist" , "Test" , plot_info [ "nbin" ], plot_info [ "xmin" ], plot_info [ "xmax" ])
+
#tree.Draw(plot_info["tree_var"][j] + ">>hist",plot_info["weight1"])
+
if plot_info [ "weight" ] == "" :
+
tree . Draw ( plot_info [ "tree_var" ][ j ] + ">>hist" , plot_info [ "cut" ], "" )
+
#if j == 0:
+
# cut = "AK4_jj_DeltaEta_gen"
+
# #cut = ""
+
# tree.Draw(plot_info["tree_var"][j] + ">>hist",cut)
+
#if j == 1:
+
# cut = "vbf_maxpt_jj_Deta<1.0"
+
# tree.Draw(plot_info["tree_var"][j] + ">>hist",cut)
+
else :
+
for n , event in enumerate ( tree ):
+
if n > 0 :
+
break
+
#indices1 = [i for i, s in enumerate(event.LHEWeightIDs) if aQGC_par in s]
+
print "Weight Details: ID = " , event . LHEWeightIDs [ 491 ], " \t Weight = " , event . LHEWeights [ 491 ]
+
tree . Draw ( plot_info [ "tree_var" ][ j ] + ">>hist" , plot_info [ "weight" ][ 0 ] + "*(" + plot_info [ "cut" ] + ")" , "" )
+
print plot_info [ "weight" ][ 0 ] + "*(" + plot_info [ "cut" ] + ")"
+
if not hist :
+
print 'Failed to get hist from file'
+
exit ( 0 )
+
colorArray = [ 1 , 632 , 416 , 600 , 400 , 616 , 432 , 920 , 800 , 880 , 820 , 840 , 860 , 900 , 940 , 960 , 980 , 640 , 660 , 680 , 700 , 720 , 740 , 760 ]
+
setHistAttributes ( hist , plot_info , colorArray [ k ], 0 )
+
hist . SetDirectory ( ROOT . gROOT ) # detach "hist" from the file
+
return hist
+
+[docs] def getHistFromFileaQGC ( plot_info , key1 , ColNum ):
+
file1 = ROOT . TFile ( plot_info [ "file_name" ][ 0 ])
+
if not file1 :
+
print 'Failed to open %s ' % plot_info [ "file_name" ][ 0 ]
+
exit ( 0 )
+
tree1 = file1 . Get ( plot_info [ "tree_folder" ] + plot_info [ "tree_name" ])
+
hist1 = ROOT . TH1F ( "hist1" , "Test" , plot_info [ "nbin" ], plot_info [ "xmin" ], plot_info [ "xmax" ])
+
if plot_info [ "cut" ] == "" :
+
tree1 . Draw ( plot_info [ "tree_var" ][ 0 ] + ">>hist1" , "LHEWeights[" + str ( key1 ) + "]" , "" , 50000 )
+
else :
+
tree1 . Draw ( plot_info [ "tree_var" ][ 0 ] + ">>hist1" , "LHEWeights[" + str ( key1 ) + "]" + "*(" + plot_info [ "cut" ] + ")" , "" , 50000 )
+
print "Number of events = " , hist1 . GetEntries ()
+
print "Integral of hist = " , hist1 . Integral ()
+
#hist1.Scale(1/hist1.Integral())
+
#colorArray = ["ROOT.kBlack", "ROOT.kGray", "ROOT.KRed", "ROOT.kGreen", "ROOT.kBlue", "ROOT.kYellow", "ROOT.kMagenta", "ROOT.kCyan", "ROOT.Orange", "ROOT.kViolet", "ROOT.kSpring", "ROOT.kTeal", "ROOT.kAzure", "ROOT.kPink"]
+
#colorArray = [ROOT.kBlack, ROOT.kGray, ROOT.KRed, ROOT.kGreen, ROOT.kBlue, ROOT.kYellow, ROOT.kMagenta, ROOT.kCyan, ROOT.Orange, ROOT.kViolet, ROOT.kSpring, ROOT.kTeal, ROOT.kAzure, ROOT.kPink]
+
colorArray = [ 1 , 920 , 632 , 416 , 600 , 400 , 616 , 432 , 800 , 880 , 820 , 840 , 860 , 900 , 940 , 960 ]
+
setHistAttributes ( hist1 , plot_info , colorArray [ ColNum ], 0 )
+
hist1 . SetDirectory ( 0 ) # detatch hist1 from the file
+
return hist1 ;
+
+##################################################################
+
+################ aQGC Specific Function ##################
+[docs] def PrintaQGC_parameters ( plot_info , aQGC_par ):
+
file = ROOT . TFile ( plot_info [ "file_name" ][ 0 ])
+
if not file :
+
print 'Failed to open %s ' % plot_info [ "file_name" ][ 0 ]
+
exit ( 0 )
+
tree = file . Get ( plot_info [ "tree_folder" ] + plot_info [ "tree_name" ])
+
FT0_key = []
+
FT0_val = []
+
for n , event in enumerate ( tree ):
+
if n > 0 :
+
break
+
indices1 = [ i for i , s in enumerate ( event . LHEWeightIDs ) if aQGC_par in s ]
+
+
#for i in range(0,len(indices1), len(indices1)/6):
+
for i in range ( 0 , len ( indices1 )):
+
print indices1 [ i ], " \t " , event . LHEWeightIDs [ indices1 [ i ]]
+
+[docs] def getaQGC_parameters ( plot_info , aQGC_par ):
+
file = ROOT . TFile ( plot_info [ "file_name" ][ 0 ])
+
if not file :
+
print 'Failed to open %s ' % plot_info [ "file_name" ][ 0 ]
+
exit ( 0 )
+
tree = file . Get ( plot_info [ "tree_folder" ] + plot_info [ "tree_name" ])
+
FT0_key = []
+
FT0_val = []
+
for n , event in enumerate ( tree ):
+
if n > 0 :
+
break
+
indices1 = [ i for i , s in enumerate ( event . LHEWeightIDs ) if aQGC_par in s ]
+
+
#for i in range(0,len(indices1), len(indices1)/6):
+
for i in range ( len ( indices1 ) / 2 , len ( indices1 )):
+
FT0_key . append ( indices1 [ i ])
+
FT0_val . append ( event . LHEWeightIDs [ indices1 [ i ]])
+
indices1s = [ i for i , s in enumerate ( event . LHEWeightIDs ) if aQGC_par . replace ( "_m" , "_0p0" ) in s ]
+
FT0_key . append ( indices1s [ 0 ])
+
FT0_val . append ( event . LHEWeightIDs [ indices1s [ 0 ]] + " (SM)" )
+
return FT0_key , FT0_val
+
+[docs] def aQGC_plotting ( plot_info , aQGC_key , aQGC_val , outputNameString , skip ):
+
print "size of aQGC parameter: " , len ( aQGC_key )
+
print "==> Key: " , aQGC_key
+
print "==> Val: " , aQGC_val
+
if len ( aQGC_key ) == 0 :
+
print 'Error: No aQGC parameter for this input root file'
+
exit ( 0 )
+
+
c2 = getCanvas ()
+
setTDRStyle ( c2 , 1 , 13 , "No" )
+
legend = getLegends ( plot_info [ "legPos" ], 2 , len ( aQGC_key ) / skip , plot_info [ "legFontSize" ])
+
+
hist1 = []
+
new_aQGC_val = []
+
for i in range ( 0 , len ( aQGC_key ), skip ):
+
print "Working on hist number : " , i
+
hist1 . append ( getHistFromFileaQGC ( plot_info , aQGC_key [ i ] , i / skip ))
+
new_aQGC_val . append ( aQGC_val [ i ])
+
for a , list1 in enumerate ( hist1 ):
+
#print a,list1
+
list1 . GetXaxis () . SetTitle ( plot_info [ "xlabel" ])
+
if plot_info [ "ylabel" ] == "" :
+
plot_info [ "ylabel" ] = "Events / %s GeV" % int ( list1 . GetBinWidth ( 1 ))
+
list1 . GetYaxis () . SetTitle ( plot_info [ "ylabel" ])
+
if new_aQGC_val [ a ] . find ( "SM" ) == - 1 :
+
legend . AddEntry ( list1 , new_aQGC_val [ a ] . replace ( "_m" , " = -" ) . replace ( "p" , "." ) . replace ( "_0" , " = 0" ), "lpe" )
+
else :
+
legend . AddEntry ( list1 , "SM" , "lpe" )
+
if i == 0 :
+
list1 . Draw ()
+
else :
+
list1 . Draw ( "sames" )
+
+
legend . Draw ( "same" )
+
if plot_info [ "logy" ]:
+
c2 . SetLogy ()
+
if plot_info [ "logx" ]:
+
c2 . SetLogx ()
+
if plot_info [ "grid" ]:
+
c2 . SetGrid ()
+
#setTDRStyle(c2, 1, 13, plot_info["printCMS"])
+
setTDRStyle ( c2 , 1 , 13 , "No" )
+
hist1 [ 0 ] . GetXaxis () . SetTitle ( plot_info [ "xlabel" ])
+
if plot_info [ "ylabel" ] == "" :
+
plot_info [ "ylabel" ] = "Events / %s GeV" % int ( hist1 [ 0 ] . GetBinWidth ( 1 ))
+
hist1 [ 0 ] . GetYaxis () . SetTitle ( plot_info [ "ylabel" ])
+
c2 . SaveAs ( str ( outputNameString ) + plot_info [ "output_file" ])
+
+
+##################################################################
+
+
+
+[docs] def CompHistFromTwoBranchSameFile ( plot_info ):
+
c1 = getCanvas ()
+
setTDRStyle ( c1 , 1 , 13 , "No" )
+
legend = getLegends ( plot_info [ "legPos" ], 2 , len ( plot_info [ "tree_var" ]), plot_info [ "legFontSize" ])
+
+
hist1 = []
+
new_aQGC_val = []
+
for i in range ( 0 , len ( plot_info [ "tree_var" ])):
+
print "Working on hist number : " , i
+
hist1 . append ( getHistFromFile ( plot_info , 0 , i , i ))
+
print "======= \n "
+
# below pattern is for the legend...
+
if ( plot_info [ "leg" ][ i ] != "" ):
+
new_aQGC_val . append ( plot_info [ "leg" ][ i ])
+
else :
+
new_aQGC_val . append ( plot_info [ "tree_var" ][ i ])
+
maximumY = 0.0
+
for a , list1 in enumerate ( hist1 ):
+
list1 . Sumw2 ()
+
list1 . GetXaxis () . SetTitle ( plot_info [ "xlabel" ])
+
if plot_info [ "ylabel" ] == "" :
+
plot_info [ "ylabel" ] = "Events / %s GeV" % int ( list1 . GetBinWidth ( 1 ))
+
list1 . GetYaxis () . SetTitle ( plot_info [ "ylabel" ])
+
list1 . Scale ( 1 / list1 . Integral ())
+
legend . AddEntry ( list1 , new_aQGC_val [ a ], "lpe" )
+
if ( list1 . GetMaximum () > maximumY ):
+
maximumY = list1 . GetMaximum () * 1.5
+
list1 . SetMaximum ( maximumY )
+
if i == 0 :
+
list1 . Draw ()
+
else :
+
list1 . Draw ( "sames" )
+
legend . Draw ()
+
if plot_info [ "logy" ]:
+
c1 . SetLogy ()
+
if plot_info [ "logx" ]:
+
c1 . SetLogx ()
+
if plot_info [ "grid" ]:
+
c1 . SetGrid ()
+
c1 . SaveAs ( plot_info [ "output_file" ])
+
+[docs] def CompHistFromTwoFile ( plot_info ):
+
c1 = getCanvas ()
+
setTDRStyle ( c1 , 1 , 13 , "No" )
+
legend = getLegends ( plot_info [ "legPos" ], 1 , len ( plot_info [ "file_name" ]), plot_info [ "legFontSize" ])
+
hist = []
+
for i in range ( 0 , len ( plot_info [ "file_name" ])):
+
print "working on file number : " , i
+
# Below if condition is for specific perpose
+
if i == 1 :
+
plot_info [ "weight" ] = ""
+
print "weight = " , plot_info [ "weight" ], " \n\n "
+
hist . append ( getHistFromFile ( plot_info , i , 0 , i ))
+
+
for a , list1 in enumerate ( hist ):
+
list1 . Sumw2 ()
+
list1 . GetXaxis () . SetTitle ( plot_info [ "xlabel" ])
+
if plot_info [ "ylabel" ] == "" :
+
plot_info [ "ylabel" ] = "Events / %s GeV" % int ( list1 . GetBinWidth ( 1 ))
+
list1 . GetYaxis () . SetTitle ( plot_info [ "ylabel" ])
+
list1 . Scale ( 1.0 / list1 . Integral ())
+
#list1.Scale((36.0*174.0)/list1.Integral())
+
#print "Print Bin Number = ",list1.GetXaxis().FindBin(1100)
+
#print "HISTO: ",list1
+
print "Total Integral = " , list1 . Integral ()
+
#list1.Fit("gaus")
+
#print "Integral (2000,6000) = ",list1.Integral(list1.GetXaxis().FindBin(2000),list1.GetXaxis().FindBin(6000))
+
legend . AddEntry ( list1 , plot_info [ "leg" ][ a ], "lpe" )
+
if i == 0 :
+
list1 . Draw ()
+
else :
+
list1 . Draw ( "sames" )
+
legend . Draw ()
+
if plot_info [ "logy" ]:
+
c1 . SetLogy ()
+
if plot_info [ "logx" ]:
+
c1 . SetLogx ()
+
if plot_info [ "grid" ]:
+
c1 . SetGrid ()
+
c1 . SaveAs ( plot_info [ "output_file" ])
+
+[docs] def addHistToStack ( hist_stack , plot_info , hist_opts , line_color , fill_color ):
+
hist = getHistFromFile ( plot_info )
+
setHistAttributes ( hist , plot_info , line_color , fill_color )
+
hist_stack . Add ( hist , hist_opts )
+[docs] def makePlot ( hist , hist_opts , plot_info ):
+
#legend = ROOT.TLegend(.5 ,.65 ,.885 ,.875)
+
canvas = getCanvas ()
+
setTDRStyle ( canvas , 1 , 13 , plot_info [ "printCMS" ])
+
if plot_info [ "logy" ]:
+
canvas . SetLogy ()
+
if plot_info [ "logx" ]:
+
canvas . SetLogx ()
+
#draw the lumi text on the canvas
+
hist . Draw ( hist_opts )
+
setTDRStyle ( canvas , 1 , 13 , plot_info [ "printCMS" ])
+
hist . GetXaxis () . SetTitle ( plot_info [ "xlabel" ])
+
if plot_info [ "ylabel" ] == "" :
+
plot_info [ "ylabel" ] = "Events / %s GeV" % int ( hist . GetBinWidth ( 1 ))
+
#hist.GetYaxis().SetTitle(plot_info["ylabel"])
+
#hist.SetTitleOffset(1.3, "y")
+
#hist.SetTitleOffset(1.1, "x")
+
canvas . cd ()
+
canvas . Update ()
+
canvas . RedrawAxis ()
+
#frame = canvas.GetFrame()
+
#frame.Draw()
+
#legend.SetFillColor(ROOT.kWhite)
+
#legend.AddEntry(hist, legendName)
+
+
#legend.Draw("same")
+
canvas . Print ( plot_info [ "output_file" ])
+[docs] def makeStackPlots ( stacked , unstacked , hist_opts , plot_info ):
+
#legend = ROOT.TLegend(.5 ,.65 ,.885 ,.875)
+
canvas = getCanvas ()
+
if plot_info [ "logy" ]:
+
canvas . SetLogy ()
+
if plot_info [ "logx" ]:
+
canvas . SetLogx ()
+
#draw the lumi text on the canvas
+
hist1 . Draw ( hist_opts )
+
hist1 . GetXaxis () . SetTitle ( plot_info [ "xlabel" ])
+
if plot_info [ "ylabel" ] == "" :
+
plot_info [ "ylabel" ] = "Events / %s GeV" % int ( hist . GetBinWidth ( 1 ))
+
hist1 . GetYaxis () . SetTitle ( plot_info [ "ylabel" ])
+
hist1 . SetTitleOffset ( 1.3 , "y" )
+
hist . SetTitleOffset ( 1.1 , "x" )
+
setTDRStyle ( canvas , 1 , 13 , plot_info [ "printCMS" ])
+
canvas . cd ()
+
canvas . Update ()
+
canvas . RedrawAxis ()
+
#frame = canvas.GetFrame()
+
#frame.Draw()
+
#legend.SetFillColor(ROOT.kWhite)
+
#legend.AddEntry(hist, legendName)
+
+
#legend.Draw("same")
+
canvas . Print ( plot_info [ "output_file" ])
+
+[docs] def setTDRStyle ( canvas , luminosity , energy , printCMS ):
+
tdrstyle . setTDRStyle ()
+
if printCMS == "right" or printCMS == "left" :
+
if energy == 13 :
+
CMS_lumi . lumi_13TeV = " %s fb^{-1}" % luminosity
+
if printCMS == "left" :
+
iPos = 11
+
else :
+
iPos = 13
+
CMS_lumi . writeExtraText = 1
+
CMS_lumi . extraText = "Preliminary"
+
CMS_lumi . CMS_lumi ( canvas , 4 , iPos )
+[docs] def getBasicParser ():
+
parser = argparse . ArgumentParser ()
+
#parser.add_argument('-n', '--file_name', type=str, required=True,
+
# help="Name of root file in which histogram is stored.")
+
parser . add_argument ( '-o' , '--output_file' , type = str , required = True ,
+
help = "Name of produced plot file (type pdf/png/jpg etc.)." )
+
parser . add_argument ( '-t' , '--tree_name' , type = str , required = False , default = "otree" ,
+
help = "Name of root tree" )
+
parser . add_argument ( '-f' , '--tree_folder' , type = str , required = False , default = "" ,
+
help = "Folder where tree is stored" )
+
parser . add_argument ( '-v' , '--tree_var' , nargs = '+' , type = str , required = False , default = "LHE_mWW" ,
+
help = "Variable name in root tree" )
+
parser . add_argument ( '--cut' , type = str , required = False , default = "" ,
+
help = "cut to be applied" )
+
parser . add_argument ( '--xlabel' , type = str , required = False , default = "Invariant mass of WW" ,
+
help = "x axis label" )
+
parser . add_argument ( '--ylabel' , type = str , required = False , default = "" ,
+
help = "y axis label" )
+
parser . add_argument ( '--leg' , nargs = '+' , type = str , required = False , default = "" ,
+
help = "Histo/Rootfile legend name" )
+
parser . add_argument ( '--legPos' , type = str , required = False , default = "bc" ,
+
help = "Legend Position: tr, tl, tc, br, bc, bl" )
+
parser . add_argument ( '--legFontSize' , type = float , required = False , default = 0.04 ,
+
help = "Legend font size" )
+
parser . add_argument ( '--weight' , nargs = '+' , type = str , required = False , default = "" ,
+
help = "Weight corresponding to variable" )
+
parser . add_argument ( '--xmin' , type = float , required = False , default = 0 ,
+
help = "minimum x value" )
+
parser . add_argument ( '--xmax' , type = float , required = False , default = 600 ,
+
help = "maximum x value" )
+
parser . add_argument ( '--ymin' , type = float , required = False , default = 0 ,
+
help = "minimum y value" )
+
parser . add_argument ( '--ymax' , type = float , required = False , default = 0 ,
+
help = "maximum y value" )
+
parser . add_argument ( '--nbin' , type = int , required = False , default = 15 ,
+
help = "Number of bins to group together (1D only)" )
+
parser . add_argument ( '--rebin' , type = int , required = False , default = 0 ,
+
help = "Number of bins to group together (1D only)" )
+
parser . add_argument ( '--logy' , action = 'store_true' ,
+
help = "Set y axis to logarithmic scale" )
+
parser . add_argument ( '--logx' , action = 'store_true' ,
+
help = "Set x axis to logarithmic scale" )
+
parser . add_argument ( '--grid' , action = 'store_true' ,
+
help = "Set grid for x-y axis" )
+
parser . add_argument ( '--printCMS' , type = str , default = "left" , required = False ,
+
choices = [ "left" , "right" ], help = """print 'CMS preliminary'
+
in left (or right) upper corner""" )
+
return parser
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/build/html/_modules/tdrstyle.html b/docs/build/html/_modules/tdrstyle.html
new file mode 100644
index 0000000..d32cfb8
--- /dev/null
+++ b/docs/build/html/_modules/tdrstyle.html
@@ -0,0 +1,350 @@
+
+
+
+
+
+
+
+
+
+
+ tdrstyle — plotting macro 0.0.1 documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ plotting macro
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Source code for tdrstyle
+import ROOT as rt
+
+[docs] def tdrGrid ( gridOn ):
+
tdrStyle . SetPadGridX ( gridOn )
+
tdrStyle . SetPadGridY ( gridOn )
+
+#fixOverlay: Redraws the axis
+[docs] def fixOverlay (): gPad . RedrawAxis ()
+
+[docs] def setTDRStyle ():
+
tdrStyle = rt . TStyle ( "tdrStyle" , "Style for P-TDR" )
+
+
#for the canvas:
+
tdrStyle . SetCanvasBorderMode ( 0 )
+
tdrStyle . SetCanvasColor ( rt . kWhite )
+
tdrStyle . SetCanvasDefH ( 600 ) #Height of canvas
+
tdrStyle . SetCanvasDefW ( 600 ) #Width of canvas
+
tdrStyle . SetCanvasDefX ( 0 ) #POsition on screen
+
tdrStyle . SetCanvasDefY ( 0 )
+
+
+
tdrStyle . SetPadBorderMode ( 0 )
+
#tdrStyle.SetPadBorderSize(Width_t size = 1)
+
tdrStyle . SetPadColor ( rt . kWhite )
+
tdrStyle . SetPadGridX ( False )
+
tdrStyle . SetPadGridY ( False )
+
tdrStyle . SetGridColor ( 0 )
+
tdrStyle . SetGridStyle ( 3 )
+
tdrStyle . SetGridWidth ( 1 )
+
+
#For the frame:
+
tdrStyle . SetFrameBorderMode ( 0 )
+
tdrStyle . SetFrameBorderSize ( 1 )
+
tdrStyle . SetFrameFillColor ( 0 )
+
tdrStyle . SetFrameFillStyle ( 0 )
+
tdrStyle . SetFrameLineColor ( 1 )
+
tdrStyle . SetFrameLineStyle ( 1 )
+
tdrStyle . SetFrameLineWidth ( 1 )
+
+
#For the histo:
+
#tdrStyle.SetHistFillColor(1)
+
#tdrStyle.SetHistFillStyle(0)
+
tdrStyle . SetHistLineColor ( 1 )
+
tdrStyle . SetHistLineStyle ( 0 )
+
tdrStyle . SetHistLineWidth ( 1 )
+
#tdrStyle.SetLegoInnerR(Float_t rad = 0.5)
+
#tdrStyle.SetNumberContours(Int_t number = 20)
+
+
tdrStyle . SetEndErrorSize ( 2 )
+
#tdrStyle.SetErrorMarker(20)
+
#tdrStyle.SetErrorX(0.)
+
+
tdrStyle . SetMarkerStyle ( 20 )
+
+
#For the fit/function:
+
tdrStyle . SetOptFit ( 1 )
+
tdrStyle . SetFitFormat ( "5.4g" )
+
tdrStyle . SetFuncColor ( 2 )
+
tdrStyle . SetFuncStyle ( 1 )
+
tdrStyle . SetFuncWidth ( 1 )
+
+
#For the date:
+
tdrStyle . SetOptDate ( 0 )
+
# tdrStyle.SetDateX(Float_t x = 0.01)
+
# tdrStyle.SetDateY(Float_t y = 0.01)
+
+
# For the statistics box:
+
tdrStyle . SetOptFile ( 0 )
+
tdrStyle . SetOptStat ( 0 ) # To display the mean and RMS: SetOptStat("mr")
+
tdrStyle . SetStatColor ( rt . kWhite )
+
tdrStyle . SetStatFont ( 42 )
+
tdrStyle . SetStatFontSize ( 0.025 )
+
tdrStyle . SetStatTextColor ( 1 )
+
tdrStyle . SetStatFormat ( "6.4g" )
+
tdrStyle . SetStatBorderSize ( 1 )
+
tdrStyle . SetStatH ( 0.1 )
+
tdrStyle . SetStatW ( 0.15 )
+
# tdrStyle.SetStatStyle(Style_t style = 1001)
+
# tdrStyle.SetStatX(Float_t x = 0)
+
# tdrStyle.SetStatY(Float_t y = 0)
+
+
# Margins:
+
tdrStyle . SetPadTopMargin ( 0.05 )
+
tdrStyle . SetPadBottomMargin ( 0.13 )
+
tdrStyle . SetPadLeftMargin ( 0.22 )
+
tdrStyle . SetPadRightMargin ( 0.12 )
+
+
# For the Global title:
+
+
tdrStyle . SetOptTitle ( 0 )
+
tdrStyle . SetTitleFont ( 42 )
+
tdrStyle . SetTitleColor ( 1 )
+
tdrStyle . SetTitleTextColor ( 1 )
+
tdrStyle . SetTitleFillColor ( 10 )
+
tdrStyle . SetTitleFontSize ( 0.03 )
+
# tdrStyle.SetTitleH(0) # Set the height of the title box
+
# tdrStyle.SetTitleW(0) # Set the width of the title box
+
# tdrStyle.SetTitleX(0) # Set the position of the title box
+
# tdrStyle.SetTitleY(0.985) # Set the position of the title box
+
# tdrStyle.SetTitleStyle(Style_t style = 1001)
+
# tdrStyle.SetTitleBorderSize(2)
+
+
# For the axis titles:
+
+
tdrStyle . SetTitleColor ( 1 , "XYZ" )
+
tdrStyle . SetTitleFont ( 42 , "XYZ" )
+
tdrStyle . SetTitleSize ( 0.04 , "XYZ" )
+
# tdrStyle.SetTitleXSize(Float_t size = 0.02) # Another way to set the size?
+
# tdrStyle.SetTitleYSize(Float_t size = 0.02)
+
tdrStyle . SetTitleXOffset ( 0.75 )
+
tdrStyle . SetTitleYOffset ( 1.10 )
+
# tdrStyle.SetTitleOffset(1.1, "Y") # Another way to set the Offset
+
+
# For the axis labels:
+
+
tdrStyle . SetLabelColor ( 1 , "XYZ" )
+
tdrStyle . SetLabelFont ( 42 , "XYZ" )
+
tdrStyle . SetLabelOffset ( 0.007 , "XYZ" )
+
tdrStyle . SetLabelSize ( 0.03 , "XYZ" )
+
+
# For the axis:
+
+
tdrStyle . SetAxisColor ( 1 , "XYZ" )
+
tdrStyle . SetStripDecimals ( True )
+
tdrStyle . SetTickLength ( 0.03 , "XYZ" )
+
tdrStyle . SetNdivisions ( 510 , "XYZ" )
+
tdrStyle . SetPadTickX ( 1 ) # To get tick marks on the opposite side of the frame
+
tdrStyle . SetPadTickY ( 1 )
+
+
# Change for log plots:
+
tdrStyle . SetOptLogx ( 0 )
+
tdrStyle . SetOptLogy ( 0 )
+
tdrStyle . SetOptLogz ( 0 )
+
+
# Postscript options:
+
tdrStyle . SetPaperSize ( 20. , 20. )
+
# tdrStyle.SetLineScalePS(Float_t scale = 3)
+
# tdrStyle.SetLineStyleString(Int_t i, const char* text)
+
# tdrStyle.SetHeaderPS(const char* header)
+
# tdrStyle.SetTitlePS(const char* pstitle)
+
+
# tdrStyle.SetBarOffset(Float_t baroff = 0.5)
+
# tdrStyle.SetBarWidth(Float_t barwidth = 0.5)
+
# tdrStyle.SetPaintTextFormat(const char* format = "g")
+
# tdrStyle.SetPalette(Int_t ncolors = 0, Int_t* colors = 0)
+
# tdrStyle.SetTimeOffset(Double_t toffset)
+
# tdrStyle.SetHistMinimumZero(kTRUE)
+
+
tdrStyle . SetHatchesLineWidth ( 5 )
+
tdrStyle . SetHatchesSpacing ( 0.05 )
+
+
tdrStyle . cd ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/build/html/_sources/CMS_lumi.rst.txt b/docs/build/html/_sources/CMS_lumi.rst.txt
new file mode 100644
index 0000000..bfd76d1
--- /dev/null
+++ b/docs/build/html/_sources/CMS_lumi.rst.txt
@@ -0,0 +1,7 @@
+CMS\_lumi module
+================
+
+.. automodule:: CMS_lumi
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/build/html/_sources/GetEntries.rst.txt b/docs/build/html/_sources/GetEntries.rst.txt
new file mode 100644
index 0000000..76282f5
--- /dev/null
+++ b/docs/build/html/_sources/GetEntries.rst.txt
@@ -0,0 +1,7 @@
+GetEntries module
+=================
+
+.. automodule:: GetEntries
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/build/html/_sources/Print_AQGC_par.rst.txt b/docs/build/html/_sources/Print_AQGC_par.rst.txt
new file mode 100644
index 0000000..c5e8037
--- /dev/null
+++ b/docs/build/html/_sources/Print_AQGC_par.rst.txt
@@ -0,0 +1,7 @@
+Print\_AQGC\_par module
+=======================
+
+.. automodule:: Print_AQGC_par
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/build/html/_sources/example.rst.txt b/docs/build/html/_sources/example.rst.txt
new file mode 100644
index 0000000..8b07006
--- /dev/null
+++ b/docs/build/html/_sources/example.rst.txt
@@ -0,0 +1,117 @@
+Examples
+=============
+
+Installation/Usage:
+*******************
+As the package has not been published on PyPi yet, it CANNOT be install using pip.
+
+For now, the suggested method is to put the file `simpleble.py` in the same directory as your source files and call ``from simpleble import SimpleBleClient, SimpleBleDevice``.
+
+``bluepy`` must also be installed and imported as shown in the example below.
+For instructions about how to install, as well as the full documentation of, ``bluepy`` please refer `here `_
+
+Search for device, connect and read characteristic
+**************************************************
+.. code-block:: python
+
+ """This example demonstrates a simple BLE client that scans for devices,
+ connects to a device (GATT server) of choice and continuously reads a characteristic on that device.
+
+ The GATT Server in this example runs on an ESP32 with Arduino. For the
+ exact script used for this example see `here `_
+ """
+
+ from bluepy.btle import *
+ from simpleble import SimpleBleClient, SimpleBleDevice
+
+ # The UUID of the characteristic we want to read and the name of the device # we want to read it from
+ Characteristic_UUID = "beb5483e-36e1-4688-b7f5-ea07361b26a8"
+ Device_Name = "MyESP32"
+
+ # Define our scan and notification callback methods
+ def myScanCallback(client, device, isNewDevice, isNewData):
+ client._yes = True
+ print("#MAC: " + device.addr + " #isNewDevice: " +
+ str(isNewDevice) + " #isNewData: " + str(isNewData))
+ # TODO: NOTIFICATIONS ARE NOT SUPPORTED YET
+ # def myNotificationCallback(client, characteristic, data):
+ # print("Notification received!")
+ # print(" Characteristic UUID: " + characteristic.uuid)
+ # print(" Data: " + str(data))
+
+ # Instantiate a SimpleBleClient and set it's scan callback
+ bleClient = SimpleBleClient()
+ bleClient.setScanCallback(myScanCallback)
+ # TODO: NOTIFICATIONS ARE NOT SUPPORTED YET
+ # bleClient.setNotificationCallback(myNotificationCollback)
+
+ # Error handling to detect Keyboard interrupt (Ctrl+C)
+ # Loop to ensure we can survive connection drops
+ while(not bleClient.isConnected()):
+ try:
+ # Search for 2 seconds and return a device of interest if found.
+ # Internally this makes a call to bleClient.scan(timeout), thus
+ # triggering the scan callback method when nearby devices are detected
+ device = bleClient.searchDevice(name="MyESP32", timeout=2)
+ if(device is not None):
+ # If the device was found print out it's info
+ print("Found device!!")
+ device.printInfo()
+
+ # Proceed to connect to the device
+ print("Proceeding to connect....")
+ if(bleClient.connect(device)):
+
+ # Have a peek at the services provided by the device
+ services = device.getServices()
+ for service in services:
+ print("Service ["+str(service.uuid)+"]")
+
+ # Check to see if the device provides a characteristic with the
+ # desired UUID
+ counter = bleClient.getCharacteristics(
+ uuids=[Characteristic_UUID])[0]
+ if(counter):
+ # If it does, then we proceed to read its value every second
+ while(True):
+ # Error handling ensures that we can survive from
+ # potential connection drops
+ try:
+ # Read the data as bytes and convert to string
+ data_bytes = bleClient.readCharacteristic(
+ counter)
+ data_str = "".join(map(chr, data_bytes))
+
+ # Now print the data and wait for a second
+ print("Data: " + data_str)
+ time.sleep(1.0)
+ except BTLEException as e:
+ # If we get disconnected from the device, keep
+ # looping until we have reconnected
+ if(e.code == BTLEException.DISCONNECTED):
+ bleClient.disconnect()
+ print(
+ "Connection to BLE device has been lost!")
+ break
+ # while(not bleClient.isConnected()):
+ # bleClient.connect(device)
+
+ else:
+ print("Could not connect to device! Retrying in 3 sec...")
+ time.sleep(3.0)
+ else:
+ print("Device not found! Retrying in 3 sec...")
+ time.sleep(3.0)
+ except BTLEException as e:
+ # If we get disconnected from the device, keep
+ # looping until we have reconnected
+ if(e.code == BTLEException.DISCONNECTED):
+ bleClient.disconnect()
+ print(
+ "Connection to BLE device has been lost!")
+ break
+ except KeyboardInterrupt as e:
+ # Detect keyboard interrupt and close down
+ # bleClient gracefully
+ bleClient.disconnect()
+ raise e
diff --git a/docs/build/html/_sources/index.rst.txt b/docs/build/html/_sources/index.rst.txt
new file mode 100644
index 0000000..9feb396
--- /dev/null
+++ b/docs/build/html/_sources/index.rst.txt
@@ -0,0 +1,21 @@
+.. plotting macro documentation master file, created by
+ sphinx-quickstart on Sat Nov 30 19:46:27 2019.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Welcome to plotting macro's documentation!
+==========================================
+
+.. toctree::
+ :maxdepth: 2
+ :caption: Contents:
+
+ intro
+ example
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
diff --git a/docs/build/html/_sources/intro.rst.txt b/docs/build/html/_sources/intro.rst.txt
new file mode 100644
index 0000000..6166e41
--- /dev/null
+++ b/docs/build/html/_sources/intro.rst.txt
@@ -0,0 +1,24 @@
+Introduction
+============
+
+``simpleble`` is a high-level OO Python package which aims to provide an easy and intuitive way of interacting with nearby Bluetooth Low Energy (BLE) devices (GATT servers). In essence, this package is an extension of the ``bluepy`` package created by Ian Harvey (see `here `_)
+
+The aim here was to define a single object which would allow users to perform the various operations performed by the ``bluepy.btle.Peripheral``, ``bluepy.btle.Scanner``, ``bluepy.btle.Service`` and ``bluepy.btle.Characteristic`` classes of ``bluepy``, from one central place. This functionality is facilitated by the ``simpleble.SimpleBleClient`` and ``simpleble.SimpleBleDevice`` classes, where the latter is an extention/subclass of ``bluepy.btle.Peripheral``, combined with properties of ``bluepy.btle.ScanEntry``.
+
+The current implementation has been developed in Python 3 and tested on a Raspberry Pi Zero W, running Raspbian 9 (stretch), but should work with Python 2.7+ (maybe with minor modifications in terms of printing and error handling) and most Debian based OSs.
+
+Motivation
+**********
+
+As a newbie experimenter/hobbyist in the field of IoT using BLE communications, I found it pretty hard to identify a Python package which would enable one to use a Raspberry Pi (Zero W inthis case) to swiftly scan, connect to and read/write from/to a nearby BLE device (GATT server).
+
+This package is intended to provide a quick, as well as (hopefully) easy to undestand, way of getting a simple BLE GATT client up and running, for all those out there, who, like myself, are hands-on learners and are eager to get their hands dirty from early on.
+
+Limitations
+***********
+
+- As my main use-case scenario was to simply connect two devices, the current version of :class:`simpleble.SimpleBleClient` has been designed and implemented with this use-case in mind. As such, if you are looking for a package to allow you to connect to multiple devices, then know that off-the-self this package DOES NOT allow you to do so. However, implementing such a feature is an easily achievable task, which has been planned for sometime in the near future and if there proves to be interest on the project, I would be happy to speed up the process.
+
+- Only Read and Write operations are currently supported, but I am planning on adding Notifications soon.
+
+- Although the interfacing operations of the :class:`bluepy.btle.Service` and :class:`bluepy.btle.Peripheral` classes have been brought forward to the :class:`simpleble.SimpleBleClient` class, the same has not been done for the :class:`bluepy.btle.Descriptor`, meaning that the :class:`simpleble.SimpleBleClient` cannot be used to directly access the Descriptors. This can however be done easily by obtaining a handle of a :class:`simpleble.SimpleBleDevice` object and calling the superclass :meth:`bluepy.btle.Peripheral.getDescriptors` method.
diff --git a/docs/build/html/_sources/make_aQGC_plots.rst.txt b/docs/build/html/_sources/make_aQGC_plots.rst.txt
new file mode 100644
index 0000000..263418b
--- /dev/null
+++ b/docs/build/html/_sources/make_aQGC_plots.rst.txt
@@ -0,0 +1,7 @@
+make\_aQGC\_plots module
+========================
+
+.. automodule:: make_aQGC_plots
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/build/html/_sources/modules.rst.txt b/docs/build/html/_sources/modules.rst.txt
new file mode 100644
index 0000000..2d300ee
--- /dev/null
+++ b/docs/build/html/_sources/modules.rst.txt
@@ -0,0 +1,12 @@
+CompareDistributions
+====================
+
+.. toctree::
+ :maxdepth: 4
+
+ CMS_lumi
+ GetEntries
+ Print_AQGC_par
+ make_aQGC_plots
+ plot_functions
+ tdrstyle
diff --git a/docs/build/html/_sources/plot_functions.rst.txt b/docs/build/html/_sources/plot_functions.rst.txt
new file mode 100644
index 0000000..66d2dca
--- /dev/null
+++ b/docs/build/html/_sources/plot_functions.rst.txt
@@ -0,0 +1,7 @@
+plot\_functions module
+======================
+
+.. automodule:: plot_functions
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/build/html/_sources/tdrstyle.rst.txt b/docs/build/html/_sources/tdrstyle.rst.txt
new file mode 100644
index 0000000..865bbf0
--- /dev/null
+++ b/docs/build/html/_sources/tdrstyle.rst.txt
@@ -0,0 +1,7 @@
+tdrstyle module
+===============
+
+.. automodule:: tdrstyle
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/build/html/_static/ajax-loader.gif b/docs/build/html/_static/ajax-loader.gif
new file mode 100644
index 0000000..61faf8c
Binary files /dev/null and b/docs/build/html/_static/ajax-loader.gif differ
diff --git a/docs/build/html/_static/basic.css b/docs/build/html/_static/basic.css
new file mode 100644
index 0000000..19ced10
--- /dev/null
+++ b/docs/build/html/_static/basic.css
@@ -0,0 +1,665 @@
+/*
+ * basic.css
+ * ~~~~~~~~~
+ *
+ * Sphinx stylesheet -- basic theme.
+ *
+ * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+/* -- main layout ----------------------------------------------------------- */
+
+div.clearer {
+ clear: both;
+}
+
+/* -- relbar ---------------------------------------------------------------- */
+
+div.related {
+ width: 100%;
+ font-size: 90%;
+}
+
+div.related h3 {
+ display: none;
+}
+
+div.related ul {
+ margin: 0;
+ padding: 0 0 0 10px;
+ list-style: none;
+}
+
+div.related li {
+ display: inline;
+}
+
+div.related li.right {
+ float: right;
+ margin-right: 5px;
+}
+
+/* -- sidebar --------------------------------------------------------------- */
+
+div.sphinxsidebarwrapper {
+ padding: 10px 5px 0 10px;
+}
+
+div.sphinxsidebar {
+ float: left;
+ width: 230px;
+ margin-left: -100%;
+ font-size: 90%;
+ word-wrap: break-word;
+ overflow-wrap : break-word;
+}
+
+div.sphinxsidebar ul {
+ list-style: none;
+}
+
+div.sphinxsidebar ul ul,
+div.sphinxsidebar ul.want-points {
+ margin-left: 20px;
+ list-style: square;
+}
+
+div.sphinxsidebar ul ul {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+div.sphinxsidebar form {
+ margin-top: 10px;
+}
+
+div.sphinxsidebar input {
+ border: 1px solid #98dbcc;
+ font-family: sans-serif;
+ font-size: 1em;
+}
+
+div.sphinxsidebar #searchbox input[type="text"] {
+ float: left;
+ width: 80%;
+ padding: 0.25em;
+ box-sizing: border-box;
+}
+
+div.sphinxsidebar #searchbox input[type="submit"] {
+ float: left;
+ width: 20%;
+ border-left: none;
+ padding: 0.25em;
+ box-sizing: border-box;
+}
+
+
+img {
+ border: 0;
+ max-width: 100%;
+}
+
+/* -- search page ----------------------------------------------------------- */
+
+ul.search {
+ margin: 10px 0 0 20px;
+ padding: 0;
+}
+
+ul.search li {
+ padding: 5px 0 5px 20px;
+ background-image: url(file.png);
+ background-repeat: no-repeat;
+ background-position: 0 7px;
+}
+
+ul.search li a {
+ font-weight: bold;
+}
+
+ul.search li div.context {
+ color: #888;
+ margin: 2px 0 0 30px;
+ text-align: left;
+}
+
+ul.keywordmatches li.goodmatch a {
+ font-weight: bold;
+}
+
+/* -- index page ------------------------------------------------------------ */
+
+table.contentstable {
+ width: 90%;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+table.contentstable p.biglink {
+ line-height: 150%;
+}
+
+a.biglink {
+ font-size: 1.3em;
+}
+
+span.linkdescr {
+ font-style: italic;
+ padding-top: 5px;
+ font-size: 90%;
+}
+
+/* -- general index --------------------------------------------------------- */
+
+table.indextable {
+ width: 100%;
+}
+
+table.indextable td {
+ text-align: left;
+ vertical-align: top;
+}
+
+table.indextable ul {
+ margin-top: 0;
+ margin-bottom: 0;
+ list-style-type: none;
+}
+
+table.indextable > tbody > tr > td > ul {
+ padding-left: 0em;
+}
+
+table.indextable tr.pcap {
+ height: 10px;
+}
+
+table.indextable tr.cap {
+ margin-top: 10px;
+ background-color: #f2f2f2;
+}
+
+img.toggler {
+ margin-right: 3px;
+ margin-top: 3px;
+ cursor: pointer;
+}
+
+div.modindex-jumpbox {
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ margin: 1em 0 1em 0;
+ padding: 0.4em;
+}
+
+div.genindex-jumpbox {
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ margin: 1em 0 1em 0;
+ padding: 0.4em;
+}
+
+/* -- domain module index --------------------------------------------------- */
+
+table.modindextable td {
+ padding: 2px;
+ border-collapse: collapse;
+}
+
+/* -- general body styles --------------------------------------------------- */
+
+div.body {
+ min-width: 450px;
+ max-width: 800px;
+}
+
+div.body p, div.body dd, div.body li, div.body blockquote {
+ -moz-hyphens: auto;
+ -ms-hyphens: auto;
+ -webkit-hyphens: auto;
+ hyphens: auto;
+}
+
+a.headerlink {
+ visibility: hidden;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink,
+caption:hover > a.headerlink,
+p.caption:hover > a.headerlink,
+div.code-block-caption:hover > a.headerlink {
+ visibility: visible;
+}
+
+div.body p.caption {
+ text-align: inherit;
+}
+
+div.body td {
+ text-align: left;
+}
+
+.first {
+ margin-top: 0 !important;
+}
+
+p.rubric {
+ margin-top: 30px;
+ font-weight: bold;
+}
+
+img.align-left, .figure.align-left, object.align-left {
+ clear: left;
+ float: left;
+ margin-right: 1em;
+}
+
+img.align-right, .figure.align-right, object.align-right {
+ clear: right;
+ float: right;
+ margin-left: 1em;
+}
+
+img.align-center, .figure.align-center, object.align-center {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.align-left {
+ text-align: left;
+}
+
+.align-center {
+ text-align: center;
+}
+
+.align-right {
+ text-align: right;
+}
+
+/* -- sidebars -------------------------------------------------------------- */
+
+div.sidebar {
+ margin: 0 0 0.5em 1em;
+ border: 1px solid #ddb;
+ padding: 7px 7px 0 7px;
+ background-color: #ffe;
+ width: 40%;
+ float: right;
+}
+
+p.sidebar-title {
+ font-weight: bold;
+}
+
+/* -- topics ---------------------------------------------------------------- */
+
+div.topic {
+ border: 1px solid #ccc;
+ padding: 7px 7px 0 7px;
+ margin: 10px 0 10px 0;
+}
+
+p.topic-title {
+ font-size: 1.1em;
+ font-weight: bold;
+ margin-top: 10px;
+}
+
+/* -- admonitions ----------------------------------------------------------- */
+
+div.admonition {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ padding: 7px;
+}
+
+div.admonition dt {
+ font-weight: bold;
+}
+
+div.admonition dl {
+ margin-bottom: 0;
+}
+
+p.admonition-title {
+ margin: 0px 10px 5px 0px;
+ font-weight: bold;
+}
+
+div.body p.centered {
+ text-align: center;
+ margin-top: 25px;
+}
+
+/* -- tables ---------------------------------------------------------------- */
+
+table.docutils {
+ border: 0;
+ border-collapse: collapse;
+}
+
+table.align-center {
+ margin-left: auto;
+ margin-right: auto;
+}
+
+table caption span.caption-number {
+ font-style: italic;
+}
+
+table caption span.caption-text {
+}
+
+table.docutils td, table.docutils th {
+ padding: 1px 8px 1px 5px;
+ border-top: 0;
+ border-left: 0;
+ border-right: 0;
+ border-bottom: 1px solid #aaa;
+}
+
+table.footnote td, table.footnote th {
+ border: 0 !important;
+}
+
+th {
+ text-align: left;
+ padding-right: 5px;
+}
+
+table.citation {
+ border-left: solid 1px gray;
+ margin-left: 1px;
+}
+
+table.citation td {
+ border-bottom: none;
+}
+
+/* -- figures --------------------------------------------------------------- */
+
+div.figure {
+ margin: 0.5em;
+ padding: 0.5em;
+}
+
+div.figure p.caption {
+ padding: 0.3em;
+}
+
+div.figure p.caption span.caption-number {
+ font-style: italic;
+}
+
+div.figure p.caption span.caption-text {
+}
+
+/* -- field list styles ----------------------------------------------------- */
+
+table.field-list td, table.field-list th {
+ border: 0 !important;
+}
+
+.field-list ul {
+ margin: 0;
+ padding-left: 1em;
+}
+
+.field-list p {
+ margin: 0;
+}
+
+.field-name {
+ -moz-hyphens: manual;
+ -ms-hyphens: manual;
+ -webkit-hyphens: manual;
+ hyphens: manual;
+}
+
+/* -- other body styles ----------------------------------------------------- */
+
+ol.arabic {
+ list-style: decimal;
+}
+
+ol.loweralpha {
+ list-style: lower-alpha;
+}
+
+ol.upperalpha {
+ list-style: upper-alpha;
+}
+
+ol.lowerroman {
+ list-style: lower-roman;
+}
+
+ol.upperroman {
+ list-style: upper-roman;
+}
+
+dl {
+ margin-bottom: 15px;
+}
+
+dd p {
+ margin-top: 0px;
+}
+
+dd ul, dd table {
+ margin-bottom: 10px;
+}
+
+dd {
+ margin-top: 3px;
+ margin-bottom: 10px;
+ margin-left: 30px;
+}
+
+dt:target, span.highlighted {
+ background-color: #fbe54e;
+}
+
+rect.highlighted {
+ fill: #fbe54e;
+}
+
+dl.glossary dt {
+ font-weight: bold;
+ font-size: 1.1em;
+}
+
+.optional {
+ font-size: 1.3em;
+}
+
+.sig-paren {
+ font-size: larger;
+}
+
+.versionmodified {
+ font-style: italic;
+}
+
+.system-message {
+ background-color: #fda;
+ padding: 5px;
+ border: 3px solid red;
+}
+
+.footnote:target {
+ background-color: #ffa;
+}
+
+.line-block {
+ display: block;
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+
+.line-block .line-block {
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-left: 1.5em;
+}
+
+.guilabel, .menuselection {
+ font-family: sans-serif;
+}
+
+.accelerator {
+ text-decoration: underline;
+}
+
+.classifier {
+ font-style: oblique;
+}
+
+abbr, acronym {
+ border-bottom: dotted 1px;
+ cursor: help;
+}
+
+/* -- code displays --------------------------------------------------------- */
+
+pre {
+ overflow: auto;
+ overflow-y: hidden; /* fixes display issues on Chrome browsers */
+}
+
+span.pre {
+ -moz-hyphens: none;
+ -ms-hyphens: none;
+ -webkit-hyphens: none;
+ hyphens: none;
+}
+
+td.linenos pre {
+ padding: 5px 0px;
+ border: 0;
+ background-color: transparent;
+ color: #aaa;
+}
+
+table.highlighttable {
+ margin-left: 0.5em;
+}
+
+table.highlighttable td {
+ padding: 0 0.5em 0 0.5em;
+}
+
+div.code-block-caption {
+ padding: 2px 5px;
+ font-size: small;
+}
+
+div.code-block-caption code {
+ background-color: transparent;
+}
+
+div.code-block-caption + div > div.highlight > pre {
+ margin-top: 0;
+}
+
+div.code-block-caption span.caption-number {
+ padding: 0.1em 0.3em;
+ font-style: italic;
+}
+
+div.code-block-caption span.caption-text {
+}
+
+div.literal-block-wrapper {
+ padding: 1em 1em 0;
+}
+
+div.literal-block-wrapper div.highlight {
+ margin: 0;
+}
+
+code.descname {
+ background-color: transparent;
+ font-weight: bold;
+ font-size: 1.2em;
+}
+
+code.descclassname {
+ background-color: transparent;
+}
+
+code.xref, a code {
+ background-color: transparent;
+ font-weight: bold;
+}
+
+h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
+ background-color: transparent;
+}
+
+.viewcode-link {
+ float: right;
+}
+
+.viewcode-back {
+ float: right;
+ font-family: sans-serif;
+}
+
+div.viewcode-block:target {
+ margin: -1px -10px;
+ padding: 0 10px;
+}
+
+/* -- math display ---------------------------------------------------------- */
+
+img.math {
+ vertical-align: middle;
+}
+
+div.body div.math p {
+ text-align: center;
+}
+
+span.eqno {
+ float: right;
+}
+
+span.eqno a.headerlink {
+ position: relative;
+ left: 0px;
+ z-index: 1;
+}
+
+div.math:hover a.headerlink {
+ visibility: visible;
+}
+
+/* -- printout stylesheet --------------------------------------------------- */
+
+@media print {
+ div.document,
+ div.documentwrapper,
+ div.bodywrapper {
+ margin: 0 !important;
+ width: 100%;
+ }
+
+ div.sphinxsidebar,
+ div.related,
+ div.footer,
+ #top-link {
+ display: none;
+ }
+}
\ No newline at end of file
diff --git a/docs/build/html/_static/css/badge_only.css b/docs/build/html/_static/css/badge_only.css
new file mode 100644
index 0000000..3c33cef
--- /dev/null
+++ b/docs/build/html/_static/css/badge_only.css
@@ -0,0 +1 @@
+.fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../fonts/fontawesome-webfont.eot");src:url("../fonts/fontawesome-webfont.eot?#iefix") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff") format("woff"),url("../fonts/fontawesome-webfont.ttf") format("truetype"),url("../fonts/fontawesome-webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:""}.icon-book:before{content:""}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}
diff --git a/docs/build/html/_static/css/theme.css b/docs/build/html/_static/css/theme.css
new file mode 100644
index 0000000..aed8cef
--- /dev/null
+++ b/docs/build/html/_static/css/theme.css
@@ -0,0 +1,6 @@
+/* sphinx_rtd_theme version 0.4.3 | MIT license */
+/* Built 20190212 16:02 */
+*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}[hidden]{display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:hover,a:active{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;color:#000;text-decoration:none}mark{background:#ff0;color:#000;font-style:italic;font-weight:bold}pre,code,.rst-content tt,.rst-content code,kbd,samp{font-family:monospace,serif;_font-family:"courier new",monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:before,q:after{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}ul,ol,dl{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:0;margin:0;padding:0}label{cursor:pointer}legend{border:0;*margin-left:-7px;padding:0;white-space:normal}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*width:13px;*height:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top;resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none !important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{html,body,section{background:none !important}*{box-shadow:none !important;text-shadow:none !important;filter:none !important;-ms-filter:none !important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:.5cm}p,h2,.rst-content .toctree-wrapper p.caption,h3{orphans:3;widows:3}h2,.rst-content .toctree-wrapper p.caption,h3{page-break-after:avoid}}.fa:before,.wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content .code-block-caption .headerlink:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo,.rst-content .admonition,.btn,input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"],select,textarea,.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a,.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a,.wy-nav-top a{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}/*!
+ * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
+ * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
+ */@font-face{font-family:'FontAwesome';src:url("../fonts/fontawesome-webfont.eot?v=4.7.0");src:url("../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff2?v=4.7.0") format("woff2"),url("../fonts/fontawesome-webfont.woff?v=4.7.0") format("woff"),url("../fonts/fontawesome-webfont.ttf?v=4.7.0") format("truetype"),url("../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular") format("svg");font-weight:normal;font-style:normal}.fa,.wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink,.rst-content table>caption .headerlink,.rst-content .code-block-caption .headerlink,.rst-content tt.download span:first-child,.rst-content code.download span:first-child,.icon{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.2857142857em;text-align:center}.fa-ul{padding-left:0;margin-left:2.1428571429em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.1428571429em;width:2.1428571429em;top:.1428571429em;text-align:center}.fa-li.fa-lg{left:-1.8571428571em}.fa-border{padding:.2em .25em .15em;border:solid 0.08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.wy-menu-vertical li span.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a span.fa-pull-left.toctree-expand,.wy-menu-vertical li.current>a span.fa-pull-left.toctree-expand,.rst-content .fa-pull-left.admonition-title,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content dl dt .fa-pull-left.headerlink,.rst-content p.caption .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.rst-content code.download span.fa-pull-left:first-child,.fa-pull-left.icon{margin-right:.3em}.fa.fa-pull-right,.wy-menu-vertical li span.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a span.fa-pull-right.toctree-expand,.wy-menu-vertical li.current>a span.fa-pull-right.toctree-expand,.rst-content .fa-pull-right.admonition-title,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content dl dt .fa-pull-right.headerlink,.rst-content p.caption .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.rst-content code.download span.fa-pull-right:first-child,.fa-pull-right.icon{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.wy-menu-vertical li span.pull-left.toctree-expand,.wy-menu-vertical li.on a span.pull-left.toctree-expand,.wy-menu-vertical li.current>a span.pull-left.toctree-expand,.rst-content .pull-left.admonition-title,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content dl dt .pull-left.headerlink,.rst-content p.caption .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content .code-block-caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.rst-content code.download span.pull-left:first-child,.pull-left.icon{margin-right:.3em}.fa.pull-right,.wy-menu-vertical li span.pull-right.toctree-expand,.wy-menu-vertical li.on a span.pull-right.toctree-expand,.wy-menu-vertical li.current>a span.pull-right.toctree-expand,.rst-content .pull-right.admonition-title,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content dl dt .pull-right.headerlink,.rst-content p.caption .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content .code-block-caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.rst-content code.download span.pull-right:first-child,.pull-right.icon{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-remove:before,.fa-close:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-gear:before,.fa-cog:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-rotate-right:before,.fa-repeat:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.rst-content .admonition-title:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-warning:before,.fa-exclamation-triangle:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-gears:before,.fa-cogs:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-save:before,.fa-floppy-o:before{content:""}.fa-square:before{content:""}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.wy-dropdown .caret:before,.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-unsorted:before,.fa-sort:before{content:""}.fa-sort-down:before,.fa-sort-desc:before{content:""}.fa-sort-up:before,.fa-sort-asc:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-legal:before,.fa-gavel:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-flash:before,.fa-bolt:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-paste:before,.fa-clipboard:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-unlink:before,.fa-chain-broken:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:""}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:""}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:""}.fa-euro:before,.fa-eur:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-rupee:before,.fa-inr:before{content:""}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:""}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:""}.fa-won:before,.fa-krw:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-turkish-lira:before,.fa-try:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li span.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-institution:before,.fa-bank:before,.fa-university:before{content:""}.fa-mortar-board:before,.fa-graduation-cap:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper-pp:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:""}.fa-file-zip-o:before,.fa-file-archive-o:before{content:""}.fa-file-sound-o:before,.fa-file-audio-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:""}.fa-ge:before,.fa-empire:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-send:before,.fa-paper-plane:before{content:""}.fa-send-o:before,.fa-paper-plane-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-hotel:before,.fa-bed:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-yc:before,.fa-y-combinator:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-tv:before,.fa-television:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before,.icon-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:""}.fa-audio-description:before{content:""}.fa-volume-control-phone:before{content:""}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:""}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-signing:before,.fa-sign-language:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:""}.fa-pied-piper:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-vcard:before,.fa-address-card:before{content:""}.fa-vcard-o:before,.fa-address-card-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:""}.fa-id-badge:before{content:""}.fa-drivers-license:before,.fa-id-card:before{content:""}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:""}.fa-free-code-camp:before{content:""}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:""}.fa-shower:before{content:""}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:""}.fa-podcast:before{content:""}.fa-window-maximize:before{content:""}.fa-window-minimize:before{content:""}.fa-window-restore:before{content:""}.fa-times-rectangle:before,.fa-window-close:before{content:""}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:""}.fa-bandcamp:before{content:""}.fa-grav:before{content:""}.fa-etsy:before{content:""}.fa-imdb:before{content:""}.fa-ravelry:before{content:""}.fa-eercast:before{content:""}.fa-microchip:before{content:""}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:""}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:""}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink,.rst-content table>caption .headerlink,.rst-content .code-block-caption .headerlink,.rst-content tt.download span:first-child,.rst-content code.download span:first-child,.icon,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context{font-family:inherit}.fa:before,.wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content .code-block-caption .headerlink:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before{font-family:"FontAwesome";display:inline-block;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa,a .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li a span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,a .rst-content .admonition-title,.rst-content a .admonition-title,a .rst-content h1 .headerlink,.rst-content h1 a .headerlink,a .rst-content h2 .headerlink,.rst-content h2 a .headerlink,a .rst-content h3 .headerlink,.rst-content h3 a .headerlink,a .rst-content h4 .headerlink,.rst-content h4 a .headerlink,a .rst-content h5 .headerlink,.rst-content h5 a .headerlink,a .rst-content h6 .headerlink,.rst-content h6 a .headerlink,a .rst-content dl dt .headerlink,.rst-content dl dt a .headerlink,a .rst-content p.caption .headerlink,.rst-content p.caption a .headerlink,a .rst-content table>caption .headerlink,.rst-content table>caption a .headerlink,a .rst-content .code-block-caption .headerlink,.rst-content .code-block-caption a .headerlink,a .rst-content tt.download span:first-child,.rst-content tt.download a span:first-child,a .rst-content code.download span:first-child,.rst-content code.download a span:first-child,a .icon{display:inline-block;text-decoration:inherit}.btn .fa,.btn .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .btn span.toctree-expand,.btn .wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.on a .btn span.toctree-expand,.btn .wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.current>a .btn span.toctree-expand,.btn .rst-content .admonition-title,.rst-content .btn .admonition-title,.btn .rst-content h1 .headerlink,.rst-content h1 .btn .headerlink,.btn .rst-content h2 .headerlink,.rst-content h2 .btn .headerlink,.btn .rst-content h3 .headerlink,.rst-content h3 .btn .headerlink,.btn .rst-content h4 .headerlink,.rst-content h4 .btn .headerlink,.btn .rst-content h5 .headerlink,.rst-content h5 .btn .headerlink,.btn .rst-content h6 .headerlink,.rst-content h6 .btn .headerlink,.btn .rst-content dl dt .headerlink,.rst-content dl dt .btn .headerlink,.btn .rst-content p.caption .headerlink,.rst-content p.caption .btn .headerlink,.btn .rst-content table>caption .headerlink,.rst-content table>caption .btn .headerlink,.btn .rst-content .code-block-caption .headerlink,.rst-content .code-block-caption .btn .headerlink,.btn .rst-content tt.download span:first-child,.rst-content tt.download .btn span:first-child,.btn .rst-content code.download span:first-child,.rst-content code.download .btn span:first-child,.btn .icon,.nav .fa,.nav .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .nav span.toctree-expand,.nav .wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.on a .nav span.toctree-expand,.nav .wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.current>a .nav span.toctree-expand,.nav .rst-content .admonition-title,.rst-content .nav .admonition-title,.nav .rst-content h1 .headerlink,.rst-content h1 .nav .headerlink,.nav .rst-content h2 .headerlink,.rst-content h2 .nav .headerlink,.nav .rst-content h3 .headerlink,.rst-content h3 .nav .headerlink,.nav .rst-content h4 .headerlink,.rst-content h4 .nav .headerlink,.nav .rst-content h5 .headerlink,.rst-content h5 .nav .headerlink,.nav .rst-content h6 .headerlink,.rst-content h6 .nav .headerlink,.nav .rst-content dl dt .headerlink,.rst-content dl dt .nav .headerlink,.nav .rst-content p.caption .headerlink,.rst-content p.caption .nav .headerlink,.nav .rst-content table>caption .headerlink,.rst-content table>caption .nav .headerlink,.nav .rst-content .code-block-caption .headerlink,.rst-content .code-block-caption .nav .headerlink,.nav .rst-content tt.download span:first-child,.rst-content tt.download .nav span:first-child,.nav .rst-content code.download span:first-child,.rst-content code.download .nav span:first-child,.nav .icon{display:inline}.btn .fa.fa-large,.btn .wy-menu-vertical li span.fa-large.toctree-expand,.wy-menu-vertical li .btn span.fa-large.toctree-expand,.btn .rst-content .fa-large.admonition-title,.rst-content .btn .fa-large.admonition-title,.btn .rst-content h1 .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.btn .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .btn .fa-large.headerlink,.btn .rst-content p.caption .fa-large.headerlink,.rst-content p.caption .btn .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.btn .rst-content .code-block-caption .fa-large.headerlink,.rst-content .code-block-caption .btn .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.rst-content tt.download .btn span.fa-large:first-child,.btn .rst-content code.download span.fa-large:first-child,.rst-content code.download .btn span.fa-large:first-child,.btn .fa-large.icon,.nav .fa.fa-large,.nav .wy-menu-vertical li span.fa-large.toctree-expand,.wy-menu-vertical li .nav span.fa-large.toctree-expand,.nav .rst-content .fa-large.admonition-title,.rst-content .nav .fa-large.admonition-title,.nav .rst-content h1 .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.nav .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.nav .rst-content p.caption .fa-large.headerlink,.rst-content p.caption .nav .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.nav .rst-content .code-block-caption .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.nav .rst-content code.download span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.nav .fa-large.icon{line-height:.9em}.btn .fa.fa-spin,.btn .wy-menu-vertical li span.fa-spin.toctree-expand,.wy-menu-vertical li .btn span.fa-spin.toctree-expand,.btn .rst-content .fa-spin.admonition-title,.rst-content .btn .fa-spin.admonition-title,.btn .rst-content h1 .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.btn .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .btn .fa-spin.headerlink,.btn .rst-content p.caption .fa-spin.headerlink,.rst-content p.caption .btn .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.btn .rst-content .code-block-caption .fa-spin.headerlink,.rst-content .code-block-caption .btn .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.rst-content tt.download .btn span.fa-spin:first-child,.btn .rst-content code.download span.fa-spin:first-child,.rst-content code.download .btn span.fa-spin:first-child,.btn .fa-spin.icon,.nav .fa.fa-spin,.nav .wy-menu-vertical li span.fa-spin.toctree-expand,.wy-menu-vertical li .nav span.fa-spin.toctree-expand,.nav .rst-content .fa-spin.admonition-title,.rst-content .nav .fa-spin.admonition-title,.nav .rst-content h1 .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.nav .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.nav .rst-content p.caption .fa-spin.headerlink,.rst-content p.caption .nav .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.nav .rst-content .code-block-caption .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.nav .rst-content code.download span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.nav .fa-spin.icon{display:inline-block}.btn.fa:before,.wy-menu-vertical li span.btn.toctree-expand:before,.rst-content .btn.admonition-title:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content dl dt .btn.headerlink:before,.rst-content p.caption .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.rst-content code.download span.btn:first-child:before,.btn.icon:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.wy-menu-vertical li span.btn.toctree-expand:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content p.caption .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.rst-content code.download span.btn:first-child:hover:before,.btn.icon:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li .btn-mini span.toctree-expand:before,.btn-mini .rst-content .admonition-title:before,.rst-content .btn-mini .admonition-title:before,.btn-mini .rst-content h1 .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.btn-mini .rst-content dl dt .headerlink:before,.rst-content dl dt .btn-mini .headerlink:before,.btn-mini .rst-content p.caption .headerlink:before,.rst-content p.caption .btn-mini .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.rst-content tt.download .btn-mini span:first-child:before,.btn-mini .rst-content code.download span:first-child:before,.rst-content code.download .btn-mini span:first-child:before,.btn-mini .icon:before{font-size:14px;vertical-align:-15%}.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo,.rst-content .admonition{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.wy-alert-title,.rst-content .admonition-title{color:#fff;font-weight:bold;display:block;color:#fff;background:#6ab0de;margin:-12px;padding:6px 12px;margin-bottom:12px}.wy-alert.wy-alert-danger,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.admonition{background:#fdf3f2}.wy-alert.wy-alert-danger .wy-alert-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .danger .wy-alert-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .danger .admonition-title,.rst-content .error .admonition-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition .admonition-title{background:#f29f97}.wy-alert.wy-alert-warning,.rst-content .wy-alert-warning.note,.rst-content .attention,.rst-content .caution,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.tip,.rst-content .warning,.rst-content .wy-alert-warning.seealso,.rst-content .admonition-todo,.rst-content .wy-alert-warning.admonition{background:#ffedcc}.wy-alert.wy-alert-warning .wy-alert-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .attention .wy-alert-title,.rst-content .caution .wy-alert-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .attention .admonition-title,.rst-content .caution .admonition-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .warning .admonition-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .admonition-todo .admonition-title,.rst-content .wy-alert-warning.admonition .admonition-title{background:#f0b37e}.wy-alert.wy-alert-info,.rst-content .note,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.rst-content .seealso,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.admonition{background:#e7f2fa}.wy-alert.wy-alert-info .wy-alert-title,.rst-content .note .wy-alert-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.rst-content .note .admonition-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .seealso .admonition-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition .admonition-title{background:#6ab0de}.wy-alert.wy-alert-success,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.warning,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.admonition{background:#dbfaf4}.wy-alert.wy-alert-success .wy-alert-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .hint .wy-alert-title,.rst-content .important .wy-alert-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .hint .admonition-title,.rst-content .important .admonition-title,.rst-content .tip .admonition-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition .admonition-title{background:#1abc9c}.wy-alert.wy-alert-neutral,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.admonition{background:#f3f6f6}.wy-alert.wy-alert-neutral .wy-alert-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition .admonition-title{color:#404040;background:#e1e4e5}.wy-alert.wy-alert-neutral a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a{color:#2980B9}.wy-alert p:last-child,.rst-content .note p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.rst-content .seealso p:last-child,.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0px;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,0.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27AE60}.wy-tray-container li.wy-tray-item-info{background:#2980B9}.wy-tray-container li.wy-tray-item-warning{background:#E67E22}.wy-tray-container li.wy-tray-item-danger{background:#E74C3C}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width: 768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px 12px;color:#fff;border:1px solid rgba(0,0,0,0.1);background-color:#27AE60;text-decoration:none;font-weight:normal;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:0px 1px 2px -1px rgba(255,255,255,0.5) inset,0px -2px 0px 0px rgba(0,0,0,0.1) inset;outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:0px -1px 0px 0px rgba(0,0,0,0.05) inset,0px 2px 0px 0px rgba(0,0,0,0.1) inset;padding:8px 12px 6px 12px}.btn:visited{color:#fff}.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn-disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn-disabled:hover,.btn-disabled:focus,.btn-disabled:active{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980B9 !important}.btn-info:hover{background-color:#2e8ece !important}.btn-neutral{background-color:#f3f6f6 !important;color:#404040 !important}.btn-neutral:hover{background-color:#e5ebeb !important;color:#404040}.btn-neutral:visited{color:#404040 !important}.btn-success{background-color:#27AE60 !important}.btn-success:hover{background-color:#295 !important}.btn-danger{background-color:#E74C3C !important}.btn-danger:hover{background-color:#ea6153 !important}.btn-warning{background-color:#E67E22 !important}.btn-warning:hover{background-color:#e98b39 !important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f !important}.btn-link{background-color:transparent !important;color:#2980B9;box-shadow:none;border-color:transparent !important}.btn-link:hover{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:active{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:visited{color:#9B59B6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:before,.wy-btn-group:after{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:solid 1px #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,0.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980B9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:solid 1px #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type="search"]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980B9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned input,.wy-form-aligned textarea,.wy-form-aligned select,.wy-form-aligned .wy-help-inline,.wy-form-aligned label{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{border:0;margin:0;padding:0}legend{display:block;width:100%;border:0;padding:0;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label{display:block;margin:0 0 .3125em 0;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;*zoom:1;max-width:68em;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#E74C3C}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full input[type="text"],.wy-control-group .wy-form-full input[type="password"],.wy-control-group .wy-form-full input[type="email"],.wy-control-group .wy-form-full input[type="url"],.wy-control-group .wy-form-full input[type="date"],.wy-control-group .wy-form-full input[type="month"],.wy-control-group .wy-form-full input[type="time"],.wy-control-group .wy-form-full input[type="datetime"],.wy-control-group .wy-form-full input[type="datetime-local"],.wy-control-group .wy-form-full input[type="week"],.wy-control-group .wy-form-full input[type="number"],.wy-control-group .wy-form-full input[type="search"],.wy-control-group .wy-form-full input[type="tel"],.wy-control-group .wy-form-full input[type="color"],.wy-control-group .wy-form-halves input[type="text"],.wy-control-group .wy-form-halves input[type="password"],.wy-control-group .wy-form-halves input[type="email"],.wy-control-group .wy-form-halves input[type="url"],.wy-control-group .wy-form-halves input[type="date"],.wy-control-group .wy-form-halves input[type="month"],.wy-control-group .wy-form-halves input[type="time"],.wy-control-group .wy-form-halves input[type="datetime"],.wy-control-group .wy-form-halves input[type="datetime-local"],.wy-control-group .wy-form-halves input[type="week"],.wy-control-group .wy-form-halves input[type="number"],.wy-control-group .wy-form-halves input[type="search"],.wy-control-group .wy-form-halves input[type="tel"],.wy-control-group .wy-form-halves input[type="color"],.wy-control-group .wy-form-thirds input[type="text"],.wy-control-group .wy-form-thirds input[type="password"],.wy-control-group .wy-form-thirds input[type="email"],.wy-control-group .wy-form-thirds input[type="url"],.wy-control-group .wy-form-thirds input[type="date"],.wy-control-group .wy-form-thirds input[type="month"],.wy-control-group .wy-form-thirds input[type="time"],.wy-control-group .wy-form-thirds input[type="datetime"],.wy-control-group .wy-form-thirds input[type="datetime-local"],.wy-control-group .wy-form-thirds input[type="week"],.wy-control-group .wy-form-thirds input[type="number"],.wy-control-group .wy-form-thirds input[type="search"],.wy-control-group .wy-form-thirds input[type="tel"],.wy-control-group .wy-form-thirds input[type="color"]{width:100%}.wy-control-group .wy-form-full{float:left;display:block;margin-right:2.3576515979%;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.3576515979%;width:48.821174201%}.wy-control-group .wy-form-halves:last-child{margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n+1){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.3576515979%;width:31.7615656014%}.wy-control-group .wy-form-thirds:last-child{margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control{margin:6px 0 0 0;font-size:90%}.wy-control-no-input{display:inline-block;margin:6px 0 0 0;font-size:90%}.wy-control-group.fluid-input input[type="text"],.wy-control-group.fluid-input input[type="password"],.wy-control-group.fluid-input input[type="email"],.wy-control-group.fluid-input input[type="url"],.wy-control-group.fluid-input input[type="date"],.wy-control-group.fluid-input input[type="month"],.wy-control-group.fluid-input input[type="time"],.wy-control-group.fluid-input input[type="datetime"],.wy-control-group.fluid-input input[type="datetime-local"],.wy-control-group.fluid-input input[type="week"],.wy-control-group.fluid-input input[type="number"],.wy-control-group.fluid-input input[type="search"],.wy-control-group.fluid-input input[type="tel"],.wy-control-group.fluid-input input[type="color"]{width:100%}.wy-form-message-inline{display:inline-block;padding-left:.3em;color:#666;vertical-align:middle;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;*overflow:visible}input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type="datetime-local"]{padding:.34375em .625em}input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}input[type="text"]:focus,input[type="password"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus{outline:0;outline:thin dotted \9;border-color:#333}input.no-focus:focus{border-color:#ccc !important}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:1px auto #129FEA}input[type="text"][disabled],input[type="password"][disabled],input[type="email"][disabled],input[type="url"][disabled],input[type="date"][disabled],input[type="month"][disabled],input[type="time"][disabled],input[type="datetime"][disabled],input[type="datetime-local"][disabled],input[type="week"][disabled],input[type="number"][disabled],input[type="search"][disabled],input[type="tel"][disabled],input[type="color"][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#E74C3C;border:1px solid #E74C3C}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#E74C3C}input[type="file"]:focus:invalid:focus,input[type="radio"]:focus:invalid:focus,input[type="checkbox"]:focus:invalid:focus{outline-color:#E74C3C}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type="radio"][disabled],input[type="checkbox"][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:solid 1px #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{position:absolute;content:"";display:block;left:0;top:0;width:36px;height:12px;border-radius:4px;background:#ccc;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{position:absolute;content:"";display:block;width:18px;height:18px;border-radius:4px;background:#999;left:-3px;top:-3px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27AE60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#E74C3C}.wy-control-group.wy-control-group-error input[type="text"],.wy-control-group.wy-control-group-error input[type="password"],.wy-control-group.wy-control-group-error input[type="email"],.wy-control-group.wy-control-group-error input[type="url"],.wy-control-group.wy-control-group-error input[type="date"],.wy-control-group.wy-control-group-error input[type="month"],.wy-control-group.wy-control-group-error input[type="time"],.wy-control-group.wy-control-group-error input[type="datetime"],.wy-control-group.wy-control-group-error input[type="datetime-local"],.wy-control-group.wy-control-group-error input[type="week"],.wy-control-group.wy-control-group-error input[type="number"],.wy-control-group.wy-control-group-error input[type="search"],.wy-control-group.wy-control-group-error input[type="tel"],.wy-control-group.wy-control-group-error input[type="color"]{border:solid 1px #E74C3C}.wy-control-group.wy-control-group-error textarea{border:solid 1px #E74C3C}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27AE60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#E74C3C}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#E67E22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980B9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width: 480px){.wy-form button[type="submit"]{margin:.7em 0 0}.wy-form input[type="text"],.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:.3em;display:block}.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0 0}.wy-form .wy-help-inline,.wy-form-message-inline,.wy-form-message{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width: 768px){.tablet-hide{display:none}}@media screen and (max-width: 480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.wy-table,.rst-content table.docutils,.rst-content table.field-list{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.wy-table caption,.rst-content table.docutils caption,.rst-content table.field-list caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td,.wy-table th,.rst-content table.docutils th,.rst-content table.field-list th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.wy-table td:first-child,.rst-content table.docutils td:first-child,.rst-content table.field-list td:first-child,.wy-table th:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list th:first-child{border-left-width:0}.wy-table thead,.rst-content table.docutils thead,.rst-content table.field-list thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.wy-table thead th,.rst-content table.docutils thead th,.rst-content table.field-list thead th{font-weight:bold;border-bottom:solid 2px #e1e4e5}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td{background-color:transparent;vertical-align:middle}.wy-table td p,.rst-content table.docutils td p,.rst-content table.field-list td p{line-height:18px}.wy-table td p:last-child,.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child{margin-bottom:0}.wy-table .wy-table-cell-min,.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min{width:1%;padding-right:0}.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:gray;font-size:90%}.wy-table-tertiary{color:gray;font-size:80%}.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td,.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td{background-color:#f3f6f6}.wy-table-backed{background-color:#f3f6f6}.wy-table-bordered-all,.rst-content table.docutils{border:1px solid #e1e4e5}.wy-table-bordered-all td,.rst-content table.docutils td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.wy-table-bordered-all tbody>tr:last-child td,.rst-content table.docutils tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px 0;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0 !important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980B9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9B59B6}html{height:100%;overflow-x:hidden}body{font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;font-weight:normal;color:#404040;min-height:100%;overflow-x:hidden;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#E67E22 !important}a.wy-text-warning:hover{color:#eb9950 !important}.wy-text-info{color:#2980B9 !important}a.wy-text-info:hover{color:#409ad5 !important}.wy-text-success{color:#27AE60 !important}a.wy-text-success:hover{color:#36d278 !important}.wy-text-danger{color:#E74C3C !important}a.wy-text-danger:hover{color:#ed7669 !important}.wy-text-neutral{color:#404040 !important}a.wy-text-neutral:hover{color:#595959 !important}h1,h2,.rst-content .toctree-wrapper p.caption,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif}p{line-height:24px;margin:0;font-size:16px;margin-bottom:24px}h1{font-size:175%}h2,.rst-content .toctree-wrapper p.caption{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}code,.rst-content tt,.rst-content code{white-space:nowrap;max-width:100%;background:#fff;border:solid 1px #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;color:#E74C3C;overflow-x:auto}code.code-large,.rst-content tt.code-large{font-size:90%}.wy-plain-list-disc,.rst-content .section ul,.rst-content .toctree-wrapper ul,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.wy-plain-list-disc li,.rst-content .section ul li,.rst-content .toctree-wrapper ul li,article ul li{list-style:disc;margin-left:24px}.wy-plain-list-disc li p:last-child,.rst-content .section ul li p:last-child,.rst-content .toctree-wrapper ul li p:last-child,article ul li p:last-child{margin-bottom:0}.wy-plain-list-disc li ul,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li ul,article ul li ul{margin-bottom:0}.wy-plain-list-disc li li,.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,article ul li li{list-style:circle}.wy-plain-list-disc li li li,.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,article ul li li li{list-style:square}.wy-plain-list-disc li ol li,.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,article ul li ol li{list-style:decimal}.wy-plain-list-decimal,.rst-content .section ol,.rst-content ol.arabic,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.wy-plain-list-decimal li,.rst-content .section ol li,.rst-content ol.arabic li,article ol li{list-style:decimal;margin-left:24px}.wy-plain-list-decimal li p:last-child,.rst-content .section ol li p:last-child,.rst-content ol.arabic li p:last-child,article ol li p:last-child{margin-bottom:0}.wy-plain-list-decimal li ul,.rst-content .section ol li ul,.rst-content ol.arabic li ul,article ol li ul{margin-bottom:0}.wy-plain-list-decimal li ul li,.rst-content .section ol li ul li,.rst-content ol.arabic li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:before,.wy-breadcrumbs:after{display:table;content:""}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs li{display:inline-block}.wy-breadcrumbs li.wy-breadcrumbs-aside{float:right}.wy-breadcrumbs li a{display:inline-block;padding:5px}.wy-breadcrumbs li a:first-child{padding-left:0}.wy-breadcrumbs li code,.wy-breadcrumbs li .rst-content tt,.rst-content .wy-breadcrumbs li tt{padding:5px;border:none;background:none}.wy-breadcrumbs li code.literal,.wy-breadcrumbs li .rst-content tt.literal,.rst-content .wy-breadcrumbs li tt.literal{color:#404040}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width: 480px){.wy-breadcrumbs-extra{display:none}.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:before,.wy-menu-horiz:after{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz ul,.wy-menu-horiz li{display:inline-block}.wy-menu-horiz li:hover{background:rgba(255,255,255,0.1)}.wy-menu-horiz li.divide-left{border-left:solid 1px #404040}.wy-menu-horiz li.divide-right{border-right:solid 1px #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#3a7ca8;height:32px;display:inline-block;line-height:32px;padding:0 1.618em;margin:12px 0 0 0;display:block;font-weight:bold;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:solid 1px #404040}.wy-menu-vertical li.divide-bottom{border-bottom:solid 1px #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:gray;border-right:solid 1px #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.wy-menu-vertical li code,.wy-menu-vertical li .rst-content tt,.rst-content .wy-menu-vertical li tt{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li span.toctree-expand{display:block;float:left;margin-left:-1.2em;font-size:.8em;line-height:1.6em;color:#4d4d4d}.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a{color:#404040;padding:.4045em 1.618em;font-weight:bold;position:relative;background:#fcfcfc;border:none;padding-left:1.618em -4px}.wy-menu-vertical li.on a:hover,.wy-menu-vertical li.current>a:hover{background:#fcfcfc}.wy-menu-vertical li.on a:hover span.toctree-expand,.wy-menu-vertical li.current>a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand{display:block;font-size:.8em;line-height:1.6em;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:solid 1px #c9c9c9;border-top:solid 1px #c9c9c9}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a{color:#404040}.wy-menu-vertical li.toctree-l1.current li.toctree-l2>ul,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>ul{display:none}.wy-menu-vertical li.toctree-l1.current li.toctree-l2.current>ul,.wy-menu-vertical li.toctree-l2.current li.toctree-l3.current>ul{display:block}.wy-menu-vertical li.toctree-l2.current>a{background:#c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{display:block;background:#c9c9c9;padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l2 a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.toctree-l2 span.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3{font-size:.9em}.wy-menu-vertical li.toctree-l3.current>a{background:#bdbdbd;padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{display:block;background:#bdbdbd;padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l3 a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.toctree-l3 span.toctree-expand{color:#969696}.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:normal}.wy-menu-vertical a{display:inline-block;line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover span.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980B9;cursor:pointer;color:#fff}.wy-menu-vertical a:active span.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980B9;text-align:center;padding:.809em;display:block;color:#fcfcfc;margin-bottom:.809em}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em auto;height:45px;width:45px;background-color:#2980B9;padding:5px;border-radius:100%}.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a{color:#fcfcfc;font-size:100%;font-weight:bold;display:inline-block;padding:4px 6px;margin-bottom:.809em}.wy-side-nav-search>a:hover,.wy-side-nav-search .wy-dropdown>a:hover{background:rgba(255,255,255,0.1)}.wy-side-nav-search>a img.logo,.wy-side-nav-search .wy-dropdown>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search>a.icon img.logo,.wy-side-nav-search .wy-dropdown>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.version{margin-top:-.4045em;margin-bottom:.809em;font-weight:normal;color:rgba(255,255,255,0.3)}.wy-nav .wy-menu-vertical header{color:#2980B9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980B9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980B9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:before,.wy-nav-top:after{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:bold}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980B9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,0.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:gray}footer p{margin-bottom:12px}footer span.commit code,footer span.commit .rst-content tt,.rst-content footer span.commit tt{padding:0px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:1em;background:none;border:none;color:gray}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:before,.rst-footer-buttons:after{width:100%}.rst-footer-buttons:before,.rst-footer-buttons:after{display:table;content:""}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:before,.rst-breadcrumbs-buttons:after{display:table;content:""}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:solid 1px #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:solid 1px #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:gray;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width: 768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-side-scroll{width:auto}.wy-side-nav-search{width:auto}.wy-menu.wy-menu-vertical{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width: 1100px){.wy-nav-content-wrap{background:rgba(0,0,0,0.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,footer,.wy-nav-side{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version span.toctree-expand,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content p.caption .headerlink,.rst-content p.caption .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .icon{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}.rst-content img{max-width:100%;height:auto}.rst-content div.figure{margin-bottom:24px}.rst-content div.figure p.caption{font-style:italic}.rst-content div.figure p:last-child.caption{margin-bottom:0px}.rst-content div.figure.align-center{text-align:center}.rst-content .section>img,.rst-content .section>a>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:"";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px 12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;display:block;overflow:auto}.rst-content pre.literal-block,.rst-content div[class^='highlight']{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px 0}.rst-content pre.literal-block div[class^='highlight'],.rst-content div[class^='highlight'] div[class^='highlight']{padding:0px;border:none;margin:0}.rst-content div[class^='highlight'] td.code{width:100%}.rst-content .linenodiv pre{border-right:solid 1px #e6e9ea;margin:0;padding:12px 12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^='highlight'] pre{white-space:pre;margin:0;padding:12px 12px;display:block;overflow:auto}.rst-content div[class^='highlight'] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content pre.literal-block,.rst-content div[class^='highlight'] pre,.rst-content .linenodiv pre{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:12px;line-height:1.4}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^='highlight'],.rst-content div[class^='highlight'] pre{white-space:pre-wrap}}.rst-content .note .last,.rst-content .attention .last,.rst-content .caution .last,.rst-content .danger .last,.rst-content .error .last,.rst-content .hint .last,.rst-content .important .last,.rst-content .tip .last,.rst-content .warning .last,.rst-content .seealso .last,.rst-content .admonition-todo .last,.rst-content .admonition .last{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,0.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent !important;border-color:rgba(0,0,0,0.1) !important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha li{list-style:upper-alpha}.rst-content .section ol p,.rst-content .section ul p{margin-bottom:12px}.rst-content .section ol p:last-child,.rst-content .section ul p:last-child{margin-bottom:24px}.rst-content .line-block{margin-left:0px;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0px}.rst-content .topic-title{font-weight:bold;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0px 0px 24px 24px}.rst-content .align-left{float:left;margin:0px 24px 24px 0px}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content .toctree-wrapper p.caption .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink,.rst-content table>caption .headerlink,.rst-content .code-block-caption .headerlink{visibility:hidden;font-size:14px}.rst-content h1 .headerlink:after,.rst-content h2 .headerlink:after,.rst-content .toctree-wrapper p.caption .headerlink:after,.rst-content h3 .headerlink:after,.rst-content h4 .headerlink:after,.rst-content h5 .headerlink:after,.rst-content h6 .headerlink:after,.rst-content dl dt .headerlink:after,.rst-content p.caption .headerlink:after,.rst-content table>caption .headerlink:after,.rst-content .code-block-caption .headerlink:after{content:"";font-family:FontAwesome}.rst-content h1:hover .headerlink:after,.rst-content h2:hover .headerlink:after,.rst-content .toctree-wrapper p.caption:hover .headerlink:after,.rst-content h3:hover .headerlink:after,.rst-content h4:hover .headerlink:after,.rst-content h5:hover .headerlink:after,.rst-content h6:hover .headerlink:after,.rst-content dl dt:hover .headerlink:after,.rst-content p.caption:hover .headerlink:after,.rst-content table>caption:hover .headerlink:after,.rst-content .code-block-caption:hover .headerlink:after{visibility:visible}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:solid 1px #e1e4e5}.rst-content .sidebar p,.rst-content .sidebar ul,.rst-content .sidebar dl{font-size:90%}.rst-content .sidebar .last{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif;font-weight:bold;background:#e1e4e5;padding:6px 12px;margin:-24px;margin-bottom:24px;font-size:100%}.rst-content .highlighted{background:#F1C40F;display:inline-block;font-weight:bold;padding:0 6px}.rst-content .footnote-reference,.rst-content .citation-reference{vertical-align:baseline;position:relative;top:-0.4em;line-height:0;font-size:90%}.rst-content table.docutils.citation,.rst-content table.docutils.footnote{background:none;border:none;color:gray}.rst-content table.docutils.citation td,.rst-content table.docutils.citation tr,.rst-content table.docutils.footnote td,.rst-content table.docutils.footnote tr{border:none;background-color:transparent !important;white-space:normal}.rst-content table.docutils.citation td.label,.rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}.rst-content table.docutils.citation tt,.rst-content table.docutils.citation code,.rst-content table.docutils.footnote tt,.rst-content table.docutils.footnote code{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}.rst-content table.docutils td .last,.rst-content table.docutils td .last :last-child{margin-bottom:0}.rst-content table.field-list{border:none}.rst-content table.field-list td{border:none}.rst-content table.field-list td p{font-size:inherit;line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content tt,.rst-content tt,.rst-content code{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;padding:2px 5px}.rst-content tt big,.rst-content tt em,.rst-content tt big,.rst-content code big,.rst-content tt em,.rst-content code em{font-size:100% !important;line-height:normal}.rst-content tt.literal,.rst-content tt.literal,.rst-content code.literal{color:#E74C3C}.rst-content tt.xref,a .rst-content tt,.rst-content tt.xref,.rst-content code.xref,a .rst-content tt,a .rst-content code{font-weight:bold;color:#404040}.rst-content pre,.rst-content kbd,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace}.rst-content a tt,.rst-content a tt,.rst-content a code{color:#2980B9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:bold;margin-bottom:12px}.rst-content dl p,.rst-content dl table,.rst-content dl ul,.rst-content dl ol{margin-bottom:12px !important}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}.rst-content dl:not(.docutils){margin-bottom:24px}.rst-content dl:not(.docutils) dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980B9;border-top:solid 3px #6ab0de;padding:6px;position:relative}.rst-content dl:not(.docutils) dt:before{color:#6ab0de}.rst-content dl:not(.docutils) dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dl dt{margin-bottom:6px;border:none;border-left:solid 3px #ccc;background:#f0f0f0;color:#555}.rst-content dl:not(.docutils) dl dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dt:first-child{margin-top:0}.rst-content dl:not(.docutils) tt,.rst-content dl:not(.docutils) tt,.rst-content dl:not(.docutils) code{font-weight:bold}.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) tt.descclassname,.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) code.descname,.rst-content dl:not(.docutils) tt.descclassname,.rst-content dl:not(.docutils) code.descclassname{background-color:transparent;border:none;padding:0;font-size:100% !important}.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) code.descname{font-weight:bold}.rst-content dl:not(.docutils) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:bold}.rst-content dl:not(.docutils) .property{display:inline-block;padding-right:8px}.rst-content .viewcode-link,.rst-content .viewcode-back{display:inline-block;color:#27AE60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:bold}.rst-content tt.download,.rst-content code.download{background:inherit;padding:inherit;font-weight:normal;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content tt.download span:first-child,.rst-content code.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before{margin-right:4px}.rst-content .guilabel{border:1px solid #7fbbe3;background:#e7f2fa;font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content .versionmodified{font-style:italic}@media screen and (max-width: 480px){.rst-content .sidebar{width:100%}}span[id*='MathJax-Span']{color:#404040}.math{text-align:center}@font-face{font-family:"Lato";src:url("../fonts/Lato/lato-regular.eot");src:url("../fonts/Lato/lato-regular.eot?#iefix") format("embedded-opentype"),url("../fonts/Lato/lato-regular.woff2") format("woff2"),url("../fonts/Lato/lato-regular.woff") format("woff"),url("../fonts/Lato/lato-regular.ttf") format("truetype");font-weight:400;font-style:normal}@font-face{font-family:"Lato";src:url("../fonts/Lato/lato-bold.eot");src:url("../fonts/Lato/lato-bold.eot?#iefix") format("embedded-opentype"),url("../fonts/Lato/lato-bold.woff2") format("woff2"),url("../fonts/Lato/lato-bold.woff") format("woff"),url("../fonts/Lato/lato-bold.ttf") format("truetype");font-weight:700;font-style:normal}@font-face{font-family:"Lato";src:url("../fonts/Lato/lato-bolditalic.eot");src:url("../fonts/Lato/lato-bolditalic.eot?#iefix") format("embedded-opentype"),url("../fonts/Lato/lato-bolditalic.woff2") format("woff2"),url("../fonts/Lato/lato-bolditalic.woff") format("woff"),url("../fonts/Lato/lato-bolditalic.ttf") format("truetype");font-weight:700;font-style:italic}@font-face{font-family:"Lato";src:url("../fonts/Lato/lato-italic.eot");src:url("../fonts/Lato/lato-italic.eot?#iefix") format("embedded-opentype"),url("../fonts/Lato/lato-italic.woff2") format("woff2"),url("../fonts/Lato/lato-italic.woff") format("woff"),url("../fonts/Lato/lato-italic.ttf") format("truetype");font-weight:400;font-style:italic}@font-face{font-family:"Roboto Slab";font-style:normal;font-weight:400;src:url("../fonts/RobotoSlab/roboto-slab.eot");src:url("../fonts/RobotoSlab/roboto-slab-v7-regular.eot?#iefix") format("embedded-opentype"),url("../fonts/RobotoSlab/roboto-slab-v7-regular.woff2") format("woff2"),url("../fonts/RobotoSlab/roboto-slab-v7-regular.woff") format("woff"),url("../fonts/RobotoSlab/roboto-slab-v7-regular.ttf") format("truetype")}@font-face{font-family:"Roboto Slab";font-style:normal;font-weight:700;src:url("../fonts/RobotoSlab/roboto-slab-v7-bold.eot");src:url("../fonts/RobotoSlab/roboto-slab-v7-bold.eot?#iefix") format("embedded-opentype"),url("../fonts/RobotoSlab/roboto-slab-v7-bold.woff2") format("woff2"),url("../fonts/RobotoSlab/roboto-slab-v7-bold.woff") format("woff"),url("../fonts/RobotoSlab/roboto-slab-v7-bold.ttf") format("truetype")}
diff --git a/docs/build/html/_static/doctools.js b/docs/build/html/_static/doctools.js
new file mode 100644
index 0000000..d892892
--- /dev/null
+++ b/docs/build/html/_static/doctools.js
@@ -0,0 +1,313 @@
+/*
+ * doctools.js
+ * ~~~~~~~~~~~
+ *
+ * Sphinx JavaScript utilities for all documentation.
+ *
+ * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+/**
+ * select a different prefix for underscore
+ */
+$u = _.noConflict();
+
+/**
+ * make the code below compatible with browsers without
+ * an installed firebug like debugger
+if (!window.console || !console.firebug) {
+ var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
+ "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
+ "profile", "profileEnd"];
+ window.console = {};
+ for (var i = 0; i < names.length; ++i)
+ window.console[names[i]] = function() {};
+}
+ */
+
+/**
+ * small helper function to urldecode strings
+ */
+jQuery.urldecode = function(x) {
+ return decodeURIComponent(x).replace(/\+/g, ' ');
+};
+
+/**
+ * small helper function to urlencode strings
+ */
+jQuery.urlencode = encodeURIComponent;
+
+/**
+ * This function returns the parsed url parameters of the
+ * current request. Multiple values per key are supported,
+ * it will always return arrays of strings for the value parts.
+ */
+jQuery.getQueryParameters = function(s) {
+ if (typeof s === 'undefined')
+ s = document.location.search;
+ var parts = s.substr(s.indexOf('?') + 1).split('&');
+ var result = {};
+ for (var i = 0; i < parts.length; i++) {
+ var tmp = parts[i].split('=', 2);
+ var key = jQuery.urldecode(tmp[0]);
+ var value = jQuery.urldecode(tmp[1]);
+ if (key in result)
+ result[key].push(value);
+ else
+ result[key] = [value];
+ }
+ return result;
+};
+
+/**
+ * highlight a given string on a jquery object by wrapping it in
+ * span elements with the given class name.
+ */
+jQuery.fn.highlightText = function(text, className) {
+ function highlight(node, addItems) {
+ if (node.nodeType === 3) {
+ var val = node.nodeValue;
+ var pos = val.toLowerCase().indexOf(text);
+ if (pos >= 0 &&
+ !jQuery(node.parentNode).hasClass(className) &&
+ !jQuery(node.parentNode).hasClass("nohighlight")) {
+ var span;
+ var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
+ if (isInSVG) {
+ span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
+ } else {
+ span = document.createElement("span");
+ span.className = className;
+ }
+ span.appendChild(document.createTextNode(val.substr(pos, text.length)));
+ node.parentNode.insertBefore(span, node.parentNode.insertBefore(
+ document.createTextNode(val.substr(pos + text.length)),
+ node.nextSibling));
+ node.nodeValue = val.substr(0, pos);
+ if (isInSVG) {
+ var bbox = span.getBBox();
+ var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
+ rect.x.baseVal.value = bbox.x;
+ rect.y.baseVal.value = bbox.y;
+ rect.width.baseVal.value = bbox.width;
+ rect.height.baseVal.value = bbox.height;
+ rect.setAttribute('class', className);
+ var parentOfText = node.parentNode.parentNode;
+ addItems.push({
+ "parent": node.parentNode,
+ "target": rect});
+ }
+ }
+ }
+ else if (!jQuery(node).is("button, select, textarea")) {
+ jQuery.each(node.childNodes, function() {
+ highlight(this, addItems);
+ });
+ }
+ }
+ var addItems = [];
+ var result = this.each(function() {
+ highlight(this, addItems);
+ });
+ for (var i = 0; i < addItems.length; ++i) {
+ jQuery(addItems[i].parent).before(addItems[i].target);
+ }
+ return result;
+};
+
+/*
+ * backward compatibility for jQuery.browser
+ * This will be supported until firefox bug is fixed.
+ */
+if (!jQuery.browser) {
+ jQuery.uaMatch = function(ua) {
+ ua = ua.toLowerCase();
+
+ var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
+ /(webkit)[ \/]([\w.]+)/.exec(ua) ||
+ /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
+ /(msie) ([\w.]+)/.exec(ua) ||
+ ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
+ [];
+
+ return {
+ browser: match[ 1 ] || "",
+ version: match[ 2 ] || "0"
+ };
+ };
+ jQuery.browser = {};
+ jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
+}
+
+/**
+ * Small JavaScript module for the documentation.
+ */
+var Documentation = {
+
+ init : function() {
+ this.fixFirefoxAnchorBug();
+ this.highlightSearchWords();
+ this.initIndexTable();
+
+ },
+
+ /**
+ * i18n support
+ */
+ TRANSLATIONS : {},
+ PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; },
+ LOCALE : 'unknown',
+
+ // gettext and ngettext don't access this so that the functions
+ // can safely bound to a different name (_ = Documentation.gettext)
+ gettext : function(string) {
+ var translated = Documentation.TRANSLATIONS[string];
+ if (typeof translated === 'undefined')
+ return string;
+ return (typeof translated === 'string') ? translated : translated[0];
+ },
+
+ ngettext : function(singular, plural, n) {
+ var translated = Documentation.TRANSLATIONS[singular];
+ if (typeof translated === 'undefined')
+ return (n == 1) ? singular : plural;
+ return translated[Documentation.PLURALEXPR(n)];
+ },
+
+ addTranslations : function(catalog) {
+ for (var key in catalog.messages)
+ this.TRANSLATIONS[key] = catalog.messages[key];
+ this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
+ this.LOCALE = catalog.locale;
+ },
+
+ /**
+ * add context elements like header anchor links
+ */
+ addContextElements : function() {
+ $('div[id] > :header:first').each(function() {
+ $('').
+ attr('href', '#' + this.id).
+ attr('title', _('Permalink to this headline')).
+ appendTo(this);
+ });
+ $('dt[id]').each(function() {
+ $('').
+ attr('href', '#' + this.id).
+ attr('title', _('Permalink to this definition')).
+ appendTo(this);
+ });
+ },
+
+ /**
+ * workaround a firefox stupidity
+ * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
+ */
+ fixFirefoxAnchorBug : function() {
+ if (document.location.hash && $.browser.mozilla)
+ window.setTimeout(function() {
+ document.location.href += '';
+ }, 10);
+ },
+
+ /**
+ * highlight the search words provided in the url in the text
+ */
+ highlightSearchWords : function() {
+ var params = $.getQueryParameters();
+ var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
+ if (terms.length) {
+ var body = $('div.body');
+ if (!body.length) {
+ body = $('body');
+ }
+ window.setTimeout(function() {
+ $.each(terms, function() {
+ body.highlightText(this.toLowerCase(), 'highlighted');
+ });
+ }, 10);
+ $('' + _('Hide Search Matches') + '
')
+ .appendTo($('#searchbox'));
+ }
+ },
+
+ /**
+ * init the domain index toggle buttons
+ */
+ initIndexTable : function() {
+ var togglers = $('img.toggler').click(function() {
+ var src = $(this).attr('src');
+ var idnum = $(this).attr('id').substr(7);
+ $('tr.cg-' + idnum).toggle();
+ if (src.substr(-9) === 'minus.png')
+ $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
+ else
+ $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
+ }).css('display', '');
+ if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
+ togglers.click();
+ }
+ },
+
+ /**
+ * helper function to hide the search marks again
+ */
+ hideSearchWords : function() {
+ $('#searchbox .highlight-link').fadeOut(300);
+ $('span.highlighted').removeClass('highlighted');
+ },
+
+ /**
+ * make the url absolute
+ */
+ makeURL : function(relativeURL) {
+ return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
+ },
+
+ /**
+ * get the current relative url
+ */
+ getCurrentURL : function() {
+ var path = document.location.pathname;
+ var parts = path.split(/\//);
+ $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
+ if (this === '..')
+ parts.pop();
+ });
+ var url = parts.join('/');
+ return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
+ },
+
+ initOnKeyListeners: function() {
+ $(document).keyup(function(event) {
+ var activeElementType = document.activeElement.tagName;
+ // don't navigate when in search box or textarea
+ if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
+ switch (event.keyCode) {
+ case 37: // left
+ var prevHref = $('link[rel="prev"]').prop('href');
+ if (prevHref) {
+ window.location.href = prevHref;
+ return false;
+ }
+ case 39: // right
+ var nextHref = $('link[rel="next"]').prop('href');
+ if (nextHref) {
+ window.location.href = nextHref;
+ return false;
+ }
+ }
+ }
+ });
+ }
+};
+
+// quick alias for translations
+_ = Documentation.gettext;
+
+$(document).ready(function() {
+ Documentation.init();
+});
\ No newline at end of file
diff --git a/docs/build/html/_static/documentation_options.js b/docs/build/html/_static/documentation_options.js
new file mode 100644
index 0000000..c1609a8
--- /dev/null
+++ b/docs/build/html/_static/documentation_options.js
@@ -0,0 +1,9 @@
+var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
+ VERSION: '0.0.1',
+ LANGUAGE: 'None',
+ COLLAPSE_INDEX: false,
+ FILE_SUFFIX: '.html',
+ HAS_SOURCE: true,
+ SOURCELINK_SUFFIX: '.txt'
+};
\ No newline at end of file
diff --git a/docs/build/html/_static/fonts/Inconsolata-Bold.ttf b/docs/build/html/_static/fonts/Inconsolata-Bold.ttf
new file mode 100644
index 0000000..809c1f5
Binary files /dev/null and b/docs/build/html/_static/fonts/Inconsolata-Bold.ttf differ
diff --git a/docs/build/html/_static/fonts/Inconsolata-Regular.ttf b/docs/build/html/_static/fonts/Inconsolata-Regular.ttf
new file mode 100644
index 0000000..fc981ce
Binary files /dev/null and b/docs/build/html/_static/fonts/Inconsolata-Regular.ttf differ
diff --git a/docs/build/html/_static/fonts/Inconsolata.ttf b/docs/build/html/_static/fonts/Inconsolata.ttf
new file mode 100644
index 0000000..4b8a36d
Binary files /dev/null and b/docs/build/html/_static/fonts/Inconsolata.ttf differ
diff --git a/docs/build/html/_static/fonts/Lato-Bold.ttf b/docs/build/html/_static/fonts/Lato-Bold.ttf
new file mode 100644
index 0000000..1d23c70
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato-Bold.ttf differ
diff --git a/docs/build/html/_static/fonts/Lato-Regular.ttf b/docs/build/html/_static/fonts/Lato-Regular.ttf
new file mode 100644
index 0000000..0f3d0f8
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato-Regular.ttf differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-bold.eot b/docs/build/html/_static/fonts/Lato/lato-bold.eot
new file mode 100644
index 0000000..3361183
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-bold.eot differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-bold.ttf b/docs/build/html/_static/fonts/Lato/lato-bold.ttf
new file mode 100644
index 0000000..29f691d
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-bold.ttf differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-bold.woff b/docs/build/html/_static/fonts/Lato/lato-bold.woff
new file mode 100644
index 0000000..c6dff51
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-bold.woff differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-bold.woff2 b/docs/build/html/_static/fonts/Lato/lato-bold.woff2
new file mode 100644
index 0000000..bb19504
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-bold.woff2 differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-bolditalic.eot b/docs/build/html/_static/fonts/Lato/lato-bolditalic.eot
new file mode 100644
index 0000000..3d41549
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-bolditalic.eot differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-bolditalic.ttf b/docs/build/html/_static/fonts/Lato/lato-bolditalic.ttf
new file mode 100644
index 0000000..f402040
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-bolditalic.ttf differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff b/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff
new file mode 100644
index 0000000..88ad05b
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff2 b/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff2
new file mode 100644
index 0000000..c4e3d80
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff2 differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-italic.eot b/docs/build/html/_static/fonts/Lato/lato-italic.eot
new file mode 100644
index 0000000..3f82642
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-italic.eot differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-italic.ttf b/docs/build/html/_static/fonts/Lato/lato-italic.ttf
new file mode 100644
index 0000000..b4bfc9b
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-italic.ttf differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-italic.woff b/docs/build/html/_static/fonts/Lato/lato-italic.woff
new file mode 100644
index 0000000..76114bc
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-italic.woff differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-italic.woff2 b/docs/build/html/_static/fonts/Lato/lato-italic.woff2
new file mode 100644
index 0000000..3404f37
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-italic.woff2 differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-regular.eot b/docs/build/html/_static/fonts/Lato/lato-regular.eot
new file mode 100644
index 0000000..11e3f2a
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-regular.eot differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-regular.ttf b/docs/build/html/_static/fonts/Lato/lato-regular.ttf
new file mode 100644
index 0000000..74decd9
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-regular.ttf differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-regular.woff b/docs/build/html/_static/fonts/Lato/lato-regular.woff
new file mode 100644
index 0000000..ae1307f
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-regular.woff differ
diff --git a/docs/build/html/_static/fonts/Lato/lato-regular.woff2 b/docs/build/html/_static/fonts/Lato/lato-regular.woff2
new file mode 100644
index 0000000..3bf9843
Binary files /dev/null and b/docs/build/html/_static/fonts/Lato/lato-regular.woff2 differ
diff --git a/docs/build/html/_static/fonts/RobotoSlab-Bold.ttf b/docs/build/html/_static/fonts/RobotoSlab-Bold.ttf
new file mode 100644
index 0000000..df5d1df
Binary files /dev/null and b/docs/build/html/_static/fonts/RobotoSlab-Bold.ttf differ
diff --git a/docs/build/html/_static/fonts/RobotoSlab-Regular.ttf b/docs/build/html/_static/fonts/RobotoSlab-Regular.ttf
new file mode 100644
index 0000000..eb52a79
Binary files /dev/null and b/docs/build/html/_static/fonts/RobotoSlab-Regular.ttf differ
diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot
new file mode 100644
index 0000000..79dc8ef
Binary files /dev/null and b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot differ
diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf
new file mode 100644
index 0000000..df5d1df
Binary files /dev/null and b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf differ
diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff
new file mode 100644
index 0000000..6cb6000
Binary files /dev/null and b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff differ
diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2
new file mode 100644
index 0000000..7059e23
Binary files /dev/null and b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 differ
diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot
new file mode 100644
index 0000000..2f7ca78
Binary files /dev/null and b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot differ
diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf
new file mode 100644
index 0000000..eb52a79
Binary files /dev/null and b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf differ
diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff
new file mode 100644
index 0000000..f815f63
Binary files /dev/null and b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff differ
diff --git a/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2
new file mode 100644
index 0000000..f2c76e5
Binary files /dev/null and b/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 differ
diff --git a/docs/build/html/_static/fonts/fontawesome-webfont.eot b/docs/build/html/_static/fonts/fontawesome-webfont.eot
new file mode 100644
index 0000000..e9f60ca
Binary files /dev/null and b/docs/build/html/_static/fonts/fontawesome-webfont.eot differ
diff --git a/docs/build/html/_static/fonts/fontawesome-webfont.svg b/docs/build/html/_static/fonts/fontawesome-webfont.svg
new file mode 100644
index 0000000..855c845
--- /dev/null
+++ b/docs/build/html/_static/fonts/fontawesome-webfont.svg
@@ -0,0 +1,2671 @@
+
+
+
+
+Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016
+ By ,,,
+Copyright Dave Gandy 2016. All rights reserved.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/build/html/_static/fonts/fontawesome-webfont.ttf b/docs/build/html/_static/fonts/fontawesome-webfont.ttf
new file mode 100644
index 0000000..35acda2
Binary files /dev/null and b/docs/build/html/_static/fonts/fontawesome-webfont.ttf differ
diff --git a/docs/build/html/_static/fonts/fontawesome-webfont.woff b/docs/build/html/_static/fonts/fontawesome-webfont.woff
new file mode 100644
index 0000000..400014a
Binary files /dev/null and b/docs/build/html/_static/fonts/fontawesome-webfont.woff differ
diff --git a/docs/build/html/_static/fonts/fontawesome-webfont.woff2 b/docs/build/html/_static/fonts/fontawesome-webfont.woff2
new file mode 100644
index 0000000..4d13fc6
Binary files /dev/null and b/docs/build/html/_static/fonts/fontawesome-webfont.woff2 differ
diff --git a/docs/build/html/_static/jquery-3.2.1.js b/docs/build/html/_static/jquery-3.2.1.js
new file mode 100644
index 0000000..d2d8ca4
--- /dev/null
+++ b/docs/build/html/_static/jquery-3.2.1.js
@@ -0,0 +1,10253 @@
+/*!
+ * jQuery JavaScript Library v3.2.1
+ * https://jquery.com/
+ *
+ * Includes Sizzle.js
+ * https://sizzlejs.com/
+ *
+ * Copyright JS Foundation and other contributors
+ * Released under the MIT license
+ * https://jquery.org/license
+ *
+ * Date: 2017-03-20T18:59Z
+ */
+( function( global, factory ) {
+
+ "use strict";
+
+ if ( typeof module === "object" && typeof module.exports === "object" ) {
+
+ // For CommonJS and CommonJS-like environments where a proper `window`
+ // is present, execute the factory and get jQuery.
+ // For environments that do not have a `window` with a `document`
+ // (such as Node.js), expose a factory as module.exports.
+ // This accentuates the need for the creation of a real `window`.
+ // e.g. var jQuery = require("jquery")(window);
+ // See ticket #14549 for more info.
+ module.exports = global.document ?
+ factory( global, true ) :
+ function( w ) {
+ if ( !w.document ) {
+ throw new Error( "jQuery requires a window with a document" );
+ }
+ return factory( w );
+ };
+ } else {
+ factory( global );
+ }
+
+// Pass this if window is not defined yet
+} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+
+// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
+// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
+// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
+// enough that all such attempts are guarded in a try block.
+"use strict";
+
+var arr = [];
+
+var document = window.document;
+
+var getProto = Object.getPrototypeOf;
+
+var slice = arr.slice;
+
+var concat = arr.concat;
+
+var push = arr.push;
+
+var indexOf = arr.indexOf;
+
+var class2type = {};
+
+var toString = class2type.toString;
+
+var hasOwn = class2type.hasOwnProperty;
+
+var fnToString = hasOwn.toString;
+
+var ObjectFunctionString = fnToString.call( Object );
+
+var support = {};
+
+
+
+ function DOMEval( code, doc ) {
+ doc = doc || document;
+
+ var script = doc.createElement( "script" );
+
+ script.text = code;
+ doc.head.appendChild( script ).parentNode.removeChild( script );
+ }
+/* global Symbol */
+// Defining this global in .eslintrc.json would create a danger of using the global
+// unguarded in another place, it seems safer to define global only for this module
+
+
+
+var
+ version = "3.2.1",
+
+ // Define a local copy of jQuery
+ jQuery = function( selector, context ) {
+
+ // The jQuery object is actually just the init constructor 'enhanced'
+ // Need init if jQuery is called (just allow error to be thrown if not included)
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // Support: Android <=4.0 only
+ // Make sure we trim BOM and NBSP
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+ // Matches dashed string for camelizing
+ rmsPrefix = /^-ms-/,
+ rdashAlpha = /-([a-z])/g,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
+
+jQuery.fn = jQuery.prototype = {
+
+ // The current version of jQuery being used
+ jquery: version,
+
+ constructor: jQuery,
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ toArray: function() {
+ return slice.call( this );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+
+ // Return all the elements in a clean array
+ if ( num == null ) {
+ return slice.call( this );
+ }
+
+ // Return just the one element from the set
+ return num < 0 ? this[ num + this.length ] : this[ num ];
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems ) {
+
+ // Build a new jQuery matched element set
+ var ret = jQuery.merge( this.constructor(), elems );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ each: function( callback ) {
+ return jQuery.each( this, callback );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map( this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ } ) );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ) );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ eq: function( i ) {
+ var len = this.length,
+ j = +i + ( i < 0 ? len : 0 );
+ return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor();
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: arr.sort,
+ splice: arr.splice
+};
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[ 0 ] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+
+ // Skip the boolean and the target
+ target = arguments[ i ] || {};
+ i++;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
+ target = {};
+ }
+
+ // Extend jQuery itself if only one argument is passed
+ if ( i === length ) {
+ target = this;
+ i--;
+ }
+
+ for ( ; i < length; i++ ) {
+
+ // Only deal with non-null/undefined values
+ if ( ( options = arguments[ i ] ) != null ) {
+
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
+ ( copyIsArray = Array.isArray( copy ) ) ) ) {
+
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && Array.isArray( src ) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject( src ) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend( {
+
+ // Unique for each copy of jQuery on the page
+ expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
+
+ // Assume jQuery is ready without the ready module
+ isReady: true,
+
+ error: function( msg ) {
+ throw new Error( msg );
+ },
+
+ noop: function() {},
+
+ isFunction: function( obj ) {
+ return jQuery.type( obj ) === "function";
+ },
+
+ isWindow: function( obj ) {
+ return obj != null && obj === obj.window;
+ },
+
+ isNumeric: function( obj ) {
+
+ // As of jQuery 3.0, isNumeric is limited to
+ // strings and numbers (primitives or objects)
+ // that can be coerced to finite numbers (gh-2662)
+ var type = jQuery.type( obj );
+ return ( type === "number" || type === "string" ) &&
+
+ // parseFloat NaNs numeric-cast false positives ("")
+ // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
+ // subtraction forces infinities to NaN
+ !isNaN( obj - parseFloat( obj ) );
+ },
+
+ isPlainObject: function( obj ) {
+ var proto, Ctor;
+
+ // Detect obvious negatives
+ // Use toString instead of jQuery.type to catch host objects
+ if ( !obj || toString.call( obj ) !== "[object Object]" ) {
+ return false;
+ }
+
+ proto = getProto( obj );
+
+ // Objects with no prototype (e.g., `Object.create( null )`) are plain
+ if ( !proto ) {
+ return true;
+ }
+
+ // Objects with prototype are plain iff they were constructed by a global Object function
+ Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
+ return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
+ },
+
+ isEmptyObject: function( obj ) {
+
+ /* eslint-disable no-unused-vars */
+ // See https://github.com/eslint/eslint/issues/6125
+ var name;
+
+ for ( name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ type: function( obj ) {
+ if ( obj == null ) {
+ return obj + "";
+ }
+
+ // Support: Android <=2.3 only (functionish RegExp)
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[ toString.call( obj ) ] || "object" :
+ typeof obj;
+ },
+
+ // Evaluates a script in a global context
+ globalEval: function( code ) {
+ DOMEval( code );
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Support: IE <=9 - 11, Edge 12 - 13
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ each: function( obj, callback ) {
+ var length, i = 0;
+
+ if ( isArrayLike( obj ) ) {
+ length = obj.length;
+ for ( ; i < length; i++ ) {
+ if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
+ break;
+ }
+ }
+ }
+
+ return obj;
+ },
+
+ // Support: Android <=4.0 only
+ trim: function( text ) {
+ return text == null ?
+ "" :
+ ( text + "" ).replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( arr, results ) {
+ var ret = results || [];
+
+ if ( arr != null ) {
+ if ( isArrayLike( Object( arr ) ) ) {
+ jQuery.merge( ret,
+ typeof arr === "string" ?
+ [ arr ] : arr
+ );
+ } else {
+ push.call( ret, arr );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, arr, i ) {
+ return arr == null ? -1 : indexOf.call( arr, elem, i );
+ },
+
+ // Support: Android <=4.0 only, PhantomJS 1 only
+ // push.apply(_, arraylike) throws on ancient WebKit
+ merge: function( first, second ) {
+ var len = +second.length,
+ j = 0,
+ i = first.length;
+
+ for ( ; j < len; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, invert ) {
+ var callbackInverse,
+ matches = [],
+ i = 0,
+ length = elems.length,
+ callbackExpect = !invert;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( ; i < length; i++ ) {
+ callbackInverse = !callback( elems[ i ], i );
+ if ( callbackInverse !== callbackExpect ) {
+ matches.push( elems[ i ] );
+ }
+ }
+
+ return matches;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var length, value,
+ i = 0,
+ ret = [];
+
+ // Go through the array, translating each of the items to their new values
+ if ( isArrayLike( elems ) ) {
+ length = elems.length;
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( i in elems ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ var tmp, args, proxy;
+
+ if ( typeof context === "string" ) {
+ tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ args = slice.call( arguments, 2 );
+ proxy = function() {
+ return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ now: Date.now,
+
+ // jQuery.support is not used in Core but other projects attach their
+ // properties to it so it needs to exist.
+ support: support
+} );
+
+if ( typeof Symbol === "function" ) {
+ jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
+}
+
+// Populate the class2type map
+jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
+function( i, name ) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+} );
+
+function isArrayLike( obj ) {
+
+ // Support: real iOS 8.2 only (not reproducible in simulator)
+ // `in` check used to prevent JIT error (gh-2145)
+ // hasOwn isn't used here due to false negatives
+ // regarding Nodelist length in IE
+ var length = !!obj && "length" in obj && obj.length,
+ type = jQuery.type( obj );
+
+ if ( type === "function" || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ return type === "array" || length === 0 ||
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj;
+}
+var Sizzle =
+/*!
+ * Sizzle CSS Selector Engine v2.3.3
+ * https://sizzlejs.com/
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2016-08-08
+ */
+(function( window ) {
+
+var i,
+ support,
+ Expr,
+ getText,
+ isXML,
+ tokenize,
+ compile,
+ select,
+ outermostContext,
+ sortInput,
+ hasDuplicate,
+
+ // Local document vars
+ setDocument,
+ document,
+ docElem,
+ documentIsHTML,
+ rbuggyQSA,
+ rbuggyMatches,
+ matches,
+ contains,
+
+ // Instance-specific data
+ expando = "sizzle" + 1 * new Date(),
+ preferredDoc = window.document,
+ dirruns = 0,
+ done = 0,
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ }
+ return 0;
+ },
+
+ // Instance methods
+ hasOwn = ({}).hasOwnProperty,
+ arr = [],
+ pop = arr.pop,
+ push_native = arr.push,
+ push = arr.push,
+ slice = arr.slice,
+ // Use a stripped-down indexOf as it's faster than native
+ // https://jsperf.com/thor-indexof-vs-for/5
+ indexOf = function( list, elem ) {
+ var i = 0,
+ len = list.length;
+ for ( ; i < len; i++ ) {
+ if ( list[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+
+ // Regular expressions
+
+ // http://www.w3.org/TR/css3-selectors/#whitespace
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+
+ // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
+
+ // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
+ attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
+ // Operator (capture 2)
+ "*([*^$|!~]?=)" + whitespace +
+ // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
+ "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
+ "*\\]",
+
+ pseudos = ":(" + identifier + ")(?:\\((" +
+ // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
+ // 1. quoted (capture 3; capture 4 or capture 5)
+ "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
+ // 2. simple (capture 6)
+ "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
+ // 3. anything else (capture 2)
+ ".*" +
+ ")\\)|)",
+
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rwhitespace = new RegExp( whitespace + "+", "g" ),
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
+
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
+
+ rpseudo = new RegExp( pseudos ),
+ ridentifier = new RegExp( "^" + identifier + "$" ),
+
+ matchExpr = {
+ "ID": new RegExp( "^#(" + identifier + ")" ),
+ "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
+ "TAG": new RegExp( "^(" + identifier + "|[*])" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+ // For use in libraries implementing .is()
+ // We use this for POS matching in `select`
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+ },
+
+ rinputs = /^(?:input|select|textarea|button)$/i,
+ rheader = /^h\d$/i,
+
+ rnative = /^[^{]+\{\s*\[native \w/,
+
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+ rsibling = /[+~]/,
+
+ // CSS escapes
+ // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+ funescape = function( _, escaped, escapedWhitespace ) {
+ var high = "0x" + escaped - 0x10000;
+ // NaN means non-codepoint
+ // Support: Firefox<24
+ // Workaround erroneous numeric interpretation of +"0x"
+ return high !== high || escapedWhitespace ?
+ escaped :
+ high < 0 ?
+ // BMP codepoint
+ String.fromCharCode( high + 0x10000 ) :
+ // Supplemental Plane codepoint (surrogate pair)
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+ },
+
+ // CSS string/identifier serialization
+ // https://drafts.csswg.org/cssom/#common-serializing-idioms
+ rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
+ fcssescape = function( ch, asCodePoint ) {
+ if ( asCodePoint ) {
+
+ // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
+ if ( ch === "\0" ) {
+ return "\uFFFD";
+ }
+
+ // Control characters and (dependent upon position) numbers get escaped as code points
+ return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
+ }
+
+ // Other potentially-special ASCII characters get backslash-escaped
+ return "\\" + ch;
+ },
+
+ // Used for iframes
+ // See setDocument()
+ // Removing the function wrapper causes a "Permission Denied"
+ // error in IE
+ unloadHandler = function() {
+ setDocument();
+ },
+
+ disabledAncestor = addCombinator(
+ function( elem ) {
+ return elem.disabled === true && ("form" in elem || "label" in elem);
+ },
+ { dir: "parentNode", next: "legend" }
+ );
+
+// Optimize for push.apply( _, NodeList )
+try {
+ push.apply(
+ (arr = slice.call( preferredDoc.childNodes )),
+ preferredDoc.childNodes
+ );
+ // Support: Android<4.0
+ // Detect silently failing push.apply
+ arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+ push = { apply: arr.length ?
+
+ // Leverage slice if possible
+ function( target, els ) {
+ push_native.apply( target, slice.call(els) );
+ } :
+
+ // Support: IE<9
+ // Otherwise append directly
+ function( target, els ) {
+ var j = target.length,
+ i = 0;
+ // Can't trust NodeList.length
+ while ( (target[j++] = els[i++]) ) {}
+ target.length = j - 1;
+ }
+ };
+}
+
+function Sizzle( selector, context, results, seed ) {
+ var m, i, elem, nid, match, groups, newSelector,
+ newContext = context && context.ownerDocument,
+
+ // nodeType defaults to 9, since context defaults to document
+ nodeType = context ? context.nodeType : 9;
+
+ results = results || [];
+
+ // Return early from calls with invalid selector or context
+ if ( typeof selector !== "string" || !selector ||
+ nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
+
+ return results;
+ }
+
+ // Try to shortcut find operations (as opposed to filters) in HTML documents
+ if ( !seed ) {
+
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+ setDocument( context );
+ }
+ context = context || document;
+
+ if ( documentIsHTML ) {
+
+ // If the selector is sufficiently simple, try using a "get*By*" DOM method
+ // (excepting DocumentFragment context, where the methods don't exist)
+ if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
+
+ // ID selector
+ if ( (m = match[1]) ) {
+
+ // Document context
+ if ( nodeType === 9 ) {
+ if ( (elem = context.getElementById( m )) ) {
+
+ // Support: IE, Opera, Webkit
+ // TODO: identify versions
+ // getElementById can match elements by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+
+ // Element context
+ } else {
+
+ // Support: IE, Opera, Webkit
+ // TODO: identify versions
+ // getElementById can match elements by name instead of ID
+ if ( newContext && (elem = newContext.getElementById( m )) &&
+ contains( context, elem ) &&
+ elem.id === m ) {
+
+ results.push( elem );
+ return results;
+ }
+ }
+
+ // Type selector
+ } else if ( match[2] ) {
+ push.apply( results, context.getElementsByTagName( selector ) );
+ return results;
+
+ // Class selector
+ } else if ( (m = match[3]) && support.getElementsByClassName &&
+ context.getElementsByClassName ) {
+
+ push.apply( results, context.getElementsByClassName( m ) );
+ return results;
+ }
+ }
+
+ // Take advantage of querySelectorAll
+ if ( support.qsa &&
+ !compilerCache[ selector + " " ] &&
+ (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+
+ if ( nodeType !== 1 ) {
+ newContext = context;
+ newSelector = selector;
+
+ // qSA looks outside Element context, which is not what we want
+ // Thanks to Andrew Dupont for this workaround technique
+ // Support: IE <=8
+ // Exclude object elements
+ } else if ( context.nodeName.toLowerCase() !== "object" ) {
+
+ // Capture the context ID, setting it first if necessary
+ if ( (nid = context.getAttribute( "id" )) ) {
+ nid = nid.replace( rcssescape, fcssescape );
+ } else {
+ context.setAttribute( "id", (nid = expando) );
+ }
+
+ // Prefix every selector in the list
+ groups = tokenize( selector );
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = "#" + nid + " " + toSelector( groups[i] );
+ }
+ newSelector = groups.join( "," );
+
+ // Expand context for sibling selectors
+ newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
+ context;
+ }
+
+ if ( newSelector ) {
+ try {
+ push.apply( results,
+ newContext.querySelectorAll( newSelector )
+ );
+ return results;
+ } catch ( qsaError ) {
+ } finally {
+ if ( nid === expando ) {
+ context.removeAttribute( "id" );
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // All others
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {function(string, object)} Returns the Object data after storing it on itself with
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ * deleting the oldest entry
+ */
+function createCache() {
+ var keys = [];
+
+ function cache( key, value ) {
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+ if ( keys.push( key + " " ) > Expr.cacheLength ) {
+ // Only keep the most recent entries
+ delete cache[ keys.shift() ];
+ }
+ return (cache[ key + " " ] = value);
+ }
+ return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+ fn[ expando ] = true;
+ return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created element and returns a boolean result
+ */
+function assert( fn ) {
+ var el = document.createElement("fieldset");
+
+ try {
+ return !!fn( el );
+ } catch (e) {
+ return false;
+ } finally {
+ // Remove from its parent by default
+ if ( el.parentNode ) {
+ el.parentNode.removeChild( el );
+ }
+ // release memory in IE
+ el = null;
+ }
+}
+
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+ var arr = attrs.split("|"),
+ i = arr.length;
+
+ while ( i-- ) {
+ Expr.attrHandle[ arr[i] ] = handler;
+ }
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+ var cur = b && a,
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+ a.sourceIndex - b.sourceIndex;
+
+ // Use IE sourceIndex if available on both nodes
+ if ( diff ) {
+ return diff;
+ }
+
+ // Check if b follows a
+ if ( cur ) {
+ while ( (cur = cur.nextSibling) ) {
+ if ( cur === b ) {
+ return -1;
+ }
+ }
+ }
+
+ return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for :enabled/:disabled
+ * @param {Boolean} disabled true for :disabled; false for :enabled
+ */
+function createDisabledPseudo( disabled ) {
+
+ // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
+ return function( elem ) {
+
+ // Only certain elements can match :enabled or :disabled
+ // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
+ // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
+ if ( "form" in elem ) {
+
+ // Check for inherited disabledness on relevant non-disabled elements:
+ // * listed form-associated elements in a disabled fieldset
+ // https://html.spec.whatwg.org/multipage/forms.html#category-listed
+ // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
+ // * option elements in a disabled optgroup
+ // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
+ // All such elements have a "form" property.
+ if ( elem.parentNode && elem.disabled === false ) {
+
+ // Option elements defer to a parent optgroup if present
+ if ( "label" in elem ) {
+ if ( "label" in elem.parentNode ) {
+ return elem.parentNode.disabled === disabled;
+ } else {
+ return elem.disabled === disabled;
+ }
+ }
+
+ // Support: IE 6 - 11
+ // Use the isDisabled shortcut property to check for disabled fieldset ancestors
+ return elem.isDisabled === disabled ||
+
+ // Where there is no isDisabled, check manually
+ /* jshint -W018 */
+ elem.isDisabled !== !disabled &&
+ disabledAncestor( elem ) === disabled;
+ }
+
+ return elem.disabled === disabled;
+
+ // Try to winnow out elements that can't be disabled before trusting the disabled property.
+ // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
+ // even exist on them, let alone have a boolean value.
+ } else if ( "label" in elem ) {
+ return elem.disabled === disabled;
+ }
+
+ // Remaining elements are neither :enabled nor :disabled
+ return false;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
+/**
+ * Checks a node for validity as a Sizzle context
+ * @param {Element|Object=} context
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
+ */
+function testContext( context ) {
+ return context && typeof context.getElementsByTagName !== "undefined" && context;
+}
+
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
+/**
+ * Detects XML nodes
+ * @param {Element|Object} elem An element or a document
+ * @returns {Boolean} True iff elem is a non-HTML XML node
+ */
+isXML = Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+ var hasCompare, subWindow,
+ doc = node ? node.ownerDocument || node : preferredDoc;
+
+ // Return early if doc is invalid or already selected
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+ return document;
+ }
+
+ // Update global variables
+ document = doc;
+ docElem = document.documentElement;
+ documentIsHTML = !isXML( document );
+
+ // Support: IE 9-11, Edge
+ // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
+ if ( preferredDoc !== document &&
+ (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
+
+ // Support: IE 11, Edge
+ if ( subWindow.addEventListener ) {
+ subWindow.addEventListener( "unload", unloadHandler, false );
+
+ // Support: IE 9 - 10 only
+ } else if ( subWindow.attachEvent ) {
+ subWindow.attachEvent( "onunload", unloadHandler );
+ }
+ }
+
+ /* Attributes
+ ---------------------------------------------------------------------- */
+
+ // Support: IE<8
+ // Verify that getAttribute really returns attributes and not properties
+ // (excepting IE8 booleans)
+ support.attributes = assert(function( el ) {
+ el.className = "i";
+ return !el.getAttribute("className");
+ });
+
+ /* getElement(s)By*
+ ---------------------------------------------------------------------- */
+
+ // Check if getElementsByTagName("*") returns only elements
+ support.getElementsByTagName = assert(function( el ) {
+ el.appendChild( document.createComment("") );
+ return !el.getElementsByTagName("*").length;
+ });
+
+ // Support: IE<9
+ support.getElementsByClassName = rnative.test( document.getElementsByClassName );
+
+ // Support: IE<10
+ // Check if getElementById returns elements by name
+ // The broken getElementById methods don't pick up programmatically-set names,
+ // so use a roundabout getElementsByName test
+ support.getById = assert(function( el ) {
+ docElem.appendChild( el ).id = expando;
+ return !document.getElementsByName || !document.getElementsByName( expando ).length;
+ });
+
+ // ID filter and find
+ if ( support.getById ) {
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ return elem.getAttribute("id") === attrId;
+ };
+ };
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
+ var elem = context.getElementById( id );
+ return elem ? [ elem ] : [];
+ }
+ };
+ } else {
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== "undefined" &&
+ elem.getAttributeNode("id");
+ return node && node.value === attrId;
+ };
+ };
+
+ // Support: IE 6 - 7 only
+ // getElementById is not reliable as a find shortcut
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
+ var node, i, elems,
+ elem = context.getElementById( id );
+
+ if ( elem ) {
+
+ // Verify the id attribute
+ node = elem.getAttributeNode("id");
+ if ( node && node.value === id ) {
+ return [ elem ];
+ }
+
+ // Fall back on getElementsByName
+ elems = context.getElementsByName( id );
+ i = 0;
+ while ( (elem = elems[i++]) ) {
+ node = elem.getAttributeNode("id");
+ if ( node && node.value === id ) {
+ return [ elem ];
+ }
+ }
+ }
+
+ return [];
+ }
+ };
+ }
+
+ // Tag
+ Expr.find["TAG"] = support.getElementsByTagName ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ return context.getElementsByTagName( tag );
+
+ // DocumentFragment nodes don't have gEBTN
+ } else if ( support.qsa ) {
+ return context.querySelectorAll( tag );
+ }
+ } :
+
+ function( tag, context ) {
+ var elem,
+ tmp = [],
+ i = 0,
+ // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
+ results = context.getElementsByTagName( tag );
+
+ // Filter out possible comments
+ if ( tag === "*" ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
+ }
+
+ return tmp;
+ }
+ return results;
+ };
+
+ // Class
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+ if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
+ return context.getElementsByClassName( className );
+ }
+ };
+
+ /* QSA/matchesSelector
+ ---------------------------------------------------------------------- */
+
+ // QSA and matchesSelector support
+
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+ rbuggyMatches = [];
+
+ // qSa(:focus) reports false when true (Chrome 21)
+ // We allow this because of a bug in IE8/9 that throws an error
+ // whenever `document.activeElement` is accessed on an iframe
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
+ // See https://bugs.jquery.com/ticket/13378
+ rbuggyQSA = [];
+
+ if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert(function( el ) {
+ // Select is set to empty string on purpose
+ // This is to test IE's treatment of not explicitly
+ // setting a boolean content attribute,
+ // since its presence should be enough
+ // https://bugs.jquery.com/ticket/12359
+ docElem.appendChild( el ).innerHTML = " " +
+ "" +
+ " ";
+
+ // Support: IE8, Opera 11-12.16
+ // Nothing should be selected when empty strings follow ^= or $= or *=
+ // The test attribute must be unknown in Opera but "safe" for WinRT
+ // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
+ if ( el.querySelectorAll("[msallowcapture^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+ }
+
+ // Support: IE8
+ // Boolean attributes and "value" are not treated correctly
+ if ( !el.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+ }
+
+ // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
+ if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
+ rbuggyQSA.push("~=");
+ }
+
+ // Webkit/Opera - :checked should return selected option elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ // IE8 throws error here and will not see later tests
+ if ( !el.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+
+ // Support: Safari 8+, iOS 8+
+ // https://bugs.webkit.org/show_bug.cgi?id=136851
+ // In-page `selector#id sibling-combinator selector` fails
+ if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
+ rbuggyQSA.push(".#.+[+~]");
+ }
+ });
+
+ assert(function( el ) {
+ el.innerHTML = " " +
+ " ";
+
+ // Support: Windows 8 Native Apps
+ // The type and name attributes are restricted during .innerHTML assignment
+ var input = document.createElement("input");
+ input.setAttribute( "type", "hidden" );
+ el.appendChild( input ).setAttribute( "name", "D" );
+
+ // Support: IE8
+ // Enforce case-sensitivity of name attribute
+ if ( el.querySelectorAll("[name=d]").length ) {
+ rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
+ }
+
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+ // IE8 throws error here and will not see later tests
+ if ( el.querySelectorAll(":enabled").length !== 2 ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Support: IE9-11+
+ // IE's :disabled selector does not pick up the children of disabled fieldsets
+ docElem.appendChild( el ).disabled = true;
+ if ( el.querySelectorAll(":disabled").length !== 2 ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Opera 10-11 does not throw on post-comma invalid pseudos
+ el.querySelectorAll("*,:x");
+ rbuggyQSA.push(",.*:");
+ });
+ }
+
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
+ docElem.webkitMatchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector) )) ) {
+
+ assert(function( el ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9)
+ support.disconnectedMatch = matches.call( el, "*" );
+
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( el, "[s!='']:x" );
+ rbuggyMatches.push( "!=", pseudos );
+ });
+ }
+
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+ /* Contains
+ ---------------------------------------------------------------------- */
+ hasCompare = rnative.test( docElem.compareDocumentPosition );
+
+ // Element contains another
+ // Purposefully self-exclusive
+ // As in, an element does not contain itself
+ contains = hasCompare || rnative.test( docElem.contains ) ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && (
+ adown.contains ?
+ adown.contains( bup ) :
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+ ));
+ } :
+ function( a, b ) {
+ if ( b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ /* Sorting
+ ---------------------------------------------------------------------- */
+
+ // Document order sorting
+ sortOrder = hasCompare ?
+ function( a, b ) {
+
+ // Flag for duplicate removal
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ // Sort on method existence if only one input has compareDocumentPosition
+ var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
+ if ( compare ) {
+ return compare;
+ }
+
+ // Calculate position if both inputs belong to the same document
+ compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
+ a.compareDocumentPosition( b ) :
+
+ // Otherwise we know they are disconnected
+ 1;
+
+ // Disconnected nodes
+ if ( compare & 1 ||
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+ // Choose the first element that is related to our preferred document
+ if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
+ return -1;
+ }
+ if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
+ return 1;
+ }
+
+ // Maintain original order
+ return sortInput ?
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
+ 0;
+ }
+
+ return compare & 4 ? -1 : 1;
+ } :
+ function( a, b ) {
+ // Exit early if the nodes are identical
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ var cur,
+ i = 0,
+ aup = a.parentNode,
+ bup = b.parentNode,
+ ap = [ a ],
+ bp = [ b ];
+
+ // Parentless nodes are either documents or disconnected
+ if ( !aup || !bup ) {
+ return a === document ? -1 :
+ b === document ? 1 :
+ aup ? -1 :
+ bup ? 1 :
+ sortInput ?
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
+ 0;
+
+ // If the nodes are siblings, we can do a quick check
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+ }
+
+ // Otherwise we need full lists of their ancestors for comparison
+ cur = a;
+ while ( (cur = cur.parentNode) ) {
+ ap.unshift( cur );
+ }
+ cur = b;
+ while ( (cur = cur.parentNode) ) {
+ bp.unshift( cur );
+ }
+
+ // Walk down the tree looking for a discrepancy
+ while ( ap[i] === bp[i] ) {
+ i++;
+ }
+
+ return i ?
+ // Do a sibling check if the nodes have a common ancestor
+ siblingCheck( ap[i], bp[i] ) :
+
+ // Otherwise nodes in our document sort first
+ ap[i] === preferredDoc ? -1 :
+ bp[i] === preferredDoc ? 1 :
+ 0;
+ };
+
+ return document;
+};
+
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
+ if ( support.matchesSelector && documentIsHTML &&
+ !compilerCache[ expr + " " ] &&
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
+
+ try {
+ var ret = matches.call( elem, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || support.disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch (e) {}
+ }
+
+ return Sizzle( expr, document, null, [ elem ] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+ // Set document vars if needed
+ if ( ( context.ownerDocument || context ) !== document ) {
+ setDocument( context );
+ }
+ return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+ fn( elem, name, !documentIsHTML ) :
+ undefined;
+
+ return val !== undefined ?
+ val :
+ support.attributes || !documentIsHTML ?
+ elem.getAttribute( name ) :
+ (val = elem.getAttributeNode(name)) && val.specified ?
+ val.value :
+ null;
+};
+
+Sizzle.escape = function( sel ) {
+ return (sel + "").replace( rcssescape, fcssescape );
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ duplicates = [],
+ j = 0,
+ i = 0;
+
+ // Unless we *know* we can detect duplicates, assume their presence
+ hasDuplicate = !support.detectDuplicates;
+ sortInput = !support.sortStable && results.slice( 0 );
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem === results[ i ] ) {
+ j = duplicates.push( i );
+ }
+ }
+ while ( j-- ) {
+ results.splice( duplicates[ j ], 1 );
+ }
+ }
+
+ // Clear input after sorting to release objects
+ // See https://github.com/jquery/sizzle/pull/225
+ sortInput = null;
+
+ return results;
+};
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( !nodeType ) {
+ // If no nodeType, this is expected to be an array
+ while ( (node = elem[i++]) ) {
+ // Do not traverse comment nodes
+ ret += getText( node );
+ }
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent for elements
+ // innerText usage removed for consistency of new lines (jQuery #11153)
+ if ( typeof elem.textContent === "string" ) {
+ return elem.textContent;
+ } else {
+ // Traverse its children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ // Do not include comment or processing instruction nodes
+
+ return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+ // Can be adjusted by the user
+ cacheLength: 50,
+
+ createPseudo: markFunction,
+
+ match: matchExpr,
+
+ attrHandle: {},
+
+ find: {},
+
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
+ },
+
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( runescape, funescape );
+
+ // Move the given value to match[3] whether quoted or unquoted
+ match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
+
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
+ }
+
+ return match.slice( 0, 4 );
+ },
+
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 what (child|of-type)
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
+ 5 sign of xn-component
+ 6 x of xn-component
+ 7 sign of y-component
+ 8 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
+
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
+ // nth-* requires argument
+ if ( !match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // numeric x and y parameters for Expr.filter.CHILD
+ // remember that false/true cast respectively to 0/1
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+ // other types prohibit arguments
+ } else if ( match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ return match;
+ },
+
+ "PSEUDO": function( match ) {
+ var excess,
+ unquoted = !match[6] && match[2];
+
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
+ }
+
+ // Accept quoted arguments as-is
+ if ( match[3] ) {
+ match[2] = match[4] || match[5] || "";
+
+ // Strip excess characters from unquoted arguments
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
+ // Get excess from tokenize (recursively)
+ (excess = tokenize( unquoted, true )) &&
+ // advance to the next closing parenthesis
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+ // excess is a negative index
+ match[0] = match[0].slice( 0, excess );
+ match[2] = unquoted.slice( 0, excess );
+ }
+
+ // Return only captures needed by the pseudo filter method (type and argument)
+ return match.slice( 0, 3 );
+ }
+ },
+
+ filter: {
+
+ "TAG": function( nodeNameSelector ) {
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+ return nodeNameSelector === "*" ?
+ function() { return true; } :
+ function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+
+ "CLASS": function( className ) {
+ var pattern = classCache[ className + " " ];
+
+ return pattern ||
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+ classCache( className, function( elem ) {
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
+ });
+ },
+
+ "ATTR": function( name, operator, check ) {
+ return function( elem ) {
+ var result = Sizzle.attr( elem, name );
+
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
+
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.slice( -check.length ) === check :
+ operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
+ },
+
+ "CHILD": function( type, what, argument, first, last ) {
+ var simple = type.slice( 0, 3 ) !== "nth",
+ forward = type.slice( -4 ) !== "last",
+ ofType = what === "of-type";
+
+ return first === 1 && last === 0 ?
+
+ // Shortcut for :nth-*(n)
+ function( elem ) {
+ return !!elem.parentNode;
+ } :
+
+ function( elem, context, xml ) {
+ var cache, uniqueCache, outerCache, node, nodeIndex, start,
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
+ parent = elem.parentNode,
+ name = ofType && elem.nodeName.toLowerCase(),
+ useCache = !xml && !ofType,
+ diff = false;
+
+ if ( parent ) {
+
+ // :(first|last|only)-(child|of-type)
+ if ( simple ) {
+ while ( dir ) {
+ node = elem;
+ while ( (node = node[ dir ]) ) {
+ if ( ofType ?
+ node.nodeName.toLowerCase() === name :
+ node.nodeType === 1 ) {
+
+ return false;
+ }
+ }
+ // Reverse direction for :only-* (if we haven't yet done so)
+ start = dir = type === "only" && !start && "nextSibling";
+ }
+ return true;
+ }
+
+ start = [ forward ? parent.firstChild : parent.lastChild ];
+
+ // non-xml :nth-child(...) stores cache data on `parent`
+ if ( forward && useCache ) {
+
+ // Seek `elem` from a previously-cached index
+
+ // ...in a gzip-friendly way
+ node = parent;
+ outerCache = node[ expando ] || (node[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ node.uniqueID ] ||
+ (outerCache[ node.uniqueID ] = {});
+
+ cache = uniqueCache[ type ] || [];
+ nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
+ diff = nodeIndex && cache[ 2 ];
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+ // Fallback to seeking `elem` from the start
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ // When found, cache indexes on `parent` and break
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
+ uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
+ break;
+ }
+ }
+
+ } else {
+ // Use previously-cached element index if available
+ if ( useCache ) {
+ // ...in a gzip-friendly way
+ node = elem;
+ outerCache = node[ expando ] || (node[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ node.uniqueID ] ||
+ (outerCache[ node.uniqueID ] = {});
+
+ cache = uniqueCache[ type ] || [];
+ nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
+ diff = nodeIndex;
+ }
+
+ // xml :nth-child(...)
+ // or :nth-last-child(...) or :nth(-last)?-of-type(...)
+ if ( diff === false ) {
+ // Use the same loop as above to seek `elem` from the start
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ if ( ( ofType ?
+ node.nodeName.toLowerCase() === name :
+ node.nodeType === 1 ) &&
+ ++diff ) {
+
+ // Cache the index of each encountered element
+ if ( useCache ) {
+ outerCache = node[ expando ] || (node[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ node.uniqueID ] ||
+ (outerCache[ node.uniqueID ] = {});
+
+ uniqueCache[ type ] = [ dirruns, diff ];
+ }
+
+ if ( node === elem ) {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Incorporate the offset, then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ }
+ };
+ },
+
+ "PSEUDO": function( pseudo, argument ) {
+ // pseudo-class names are case-insensitive
+ // http://www.w3.org/TR/selectors/#pseudo-classes
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ // The user may use createPseudo to indicate that
+ // arguments are needed to create the filter function
+ // just as Sizzle does
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
+
+ return fn;
+ }
+ },
+
+ pseudos: {
+ // Potentially complex pseudos
+ "not": markFunction(function( selector ) {
+ // Trim the selector passed to compile
+ // to avoid treating leading and trailing
+ // spaces as combinators
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ // Don't keep the element (issue #299)
+ input[0] = null;
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
+
+ "contains": markFunction(function( text ) {
+ text = text.replace( runescape, funescape );
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ // "Whether an element is represented by a :lang() selector
+ // is based solely on the element's language value
+ // being equal to the identifier C,
+ // or beginning with the identifier C immediately followed by "-".
+ // The matching of C against the element's language value is performed case-insensitively.
+ // The identifier C does not have to be a valid language name."
+ // http://www.w3.org/TR/selectors/#lang-pseudo
+ "lang": markFunction( function( lang ) {
+ // lang value must be a valid identifier
+ if ( !ridentifier.test(lang || "") ) {
+ Sizzle.error( "unsupported lang: " + lang );
+ }
+ lang = lang.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ var elemLang;
+ do {
+ if ( (elemLang = documentIsHTML ?
+ elem.lang :
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+ }
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+ return false;
+ };
+ }),
+
+ // Miscellaneous
+ "target": function( elem ) {
+ var hash = window.location && window.location.hash;
+ return hash && hash.slice( 1 ) === elem.id;
+ },
+
+ "root": function( elem ) {
+ return elem === docElem;
+ },
+
+ "focus": function( elem ) {
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+ },
+
+ // Boolean properties
+ "enabled": createDisabledPseudo( false ),
+ "disabled": createDisabledPseudo( true ),
+
+ "checked": function( elem ) {
+ // In CSS3, :checked should return both checked and selected elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ // Contents
+ "empty": function( elem ) {
+ // http://www.w3.org/TR/selectors/#empty-pseudo
+ // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
+ // but not by others (comment: 8; processing instruction: 7; etc.)
+ // nodeType < 6 works because attributes (2) do not appear as children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ if ( elem.nodeType < 6 ) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
+
+ // Element/input types
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
+
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
+ },
+
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
+ },
+
+ "text": function( elem ) {
+ var attr;
+ return elem.nodeName.toLowerCase() === "input" &&
+ elem.type === "text" &&
+
+ // Support: IE<8
+ // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
+ },
+
+ // Position-in-collection
+ "first": createPositionalPseudo(function() {
+ return [ 0 ];
+ }),
+
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 0;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 1;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
+ }
+};
+
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+ Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+ Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+// Easy API for creating new setFilters
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
+ var matched, match, tokens, type,
+ soFar, groups, preFilters,
+ cached = tokenCache[ selector + " " ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ // Comma and first run
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ // Don't consume trailing commas as valid
+ soFar = soFar.slice( match[0].length ) || soFar;
+ }
+ groups.push( (tokens = []) );
+ }
+
+ matched = false;
+
+ // Combinators
+ if ( (match = rcombinators.exec( soFar )) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ // Cast descendant combinators to space
+ type: match[0].replace( rtrim, " " )
+ });
+ soFar = soFar.slice( matched.length );
+ }
+
+ // Filters
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ (match = preFilters[ type ]( match ))) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ type: type,
+ matches: match
+ });
+ soFar = soFar.slice( matched.length );
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ // Return the length of the invalid excess
+ // if we're just parsing
+ // Otherwise, throw an error or return tokens
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+};
+
+function toSelector( tokens ) {
+ var i = 0,
+ len = tokens.length,
+ selector = "";
+ for ( ; i < len; i++ ) {
+ selector += tokens[i].value;
+ }
+ return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ skip = combinator.next,
+ key = skip || dir,
+ checkNonElements = base && key === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ return false;
+ } :
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ var oldCache, uniqueCache, outerCache,
+ newCache = [ dirruns, doneName ];
+
+ // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
+ if ( xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ if ( matcher( elem, context, xml ) ) {
+ return true;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
+
+ if ( skip && skip === elem.nodeName.toLowerCase() ) {
+ elem = elem[ dir ] || elem;
+ } else if ( (oldCache = uniqueCache[ key ]) &&
+ oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
+
+ // Assign to newCache so results back-propagate to previous elements
+ return (newCache[ 2 ] = oldCache[ 2 ]);
+ } else {
+ // Reuse newcache so results back-propagate to previous elements
+ uniqueCache[ key ] = newCache;
+
+ // A match means we're done; a fail means we have to keep checking
+ if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function multipleContexts( selector, contexts, results ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results );
+ }
+ return results;
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
+
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
+ }
+ }
+
+ return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ var temp, i, elem,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
+
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
+
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+ // ...intermediate processing is necessary
+ [] :
+
+ // ...otherwise use results directly
+ results :
+ matcherIn;
+
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ // Apply postFilter
+ if ( postFilter ) {
+ temp = condense( matcherOut, postMap );
+ postFilter( temp, [], context, xml );
+
+ // Un-match failing elements by moving them back to matcherIn
+ i = temp.length;
+ while ( i-- ) {
+ if ( (elem = temp[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ if ( seed ) {
+ if ( postFinder || preFilter ) {
+ if ( postFinder ) {
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
+ temp = [];
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ // Restore matcherIn since elem is not yet a final match
+ temp.push( (matcherIn[i] = elem) );
+ }
+ }
+ postFinder( null, (matcherOut = []), temp, xml );
+ }
+
+ // Move matched elements from seed to results to keep them synchronized
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) &&
+ (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
+
+ seed[temp] = !(results[temp] = elem);
+ }
+ }
+ }
+
+ // Add elements to results, through postFinder if defined
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
+
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ // Avoid hanging onto element (issue #299)
+ checkContext = null;
+ return ret;
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+ } else {
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && toSelector(
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+ ).replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && toSelector( tokens )
+ );
+ }
+ matchers.push( matcher );
+ }
+ }
+
+ return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ var bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, outermost ) {
+ var elem, j, matcher,
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ setMatched = [],
+ contextBackup = outermostContext,
+ // We must always have either seed elements or outermost context
+ elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
+ // Use integer dirruns iff this is the outermost matcher
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
+ len = elems.length;
+
+ if ( outermost ) {
+ outermostContext = context === document || context || outermost;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ // Support: IE<9, Safari
+ // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id
+ for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ j = 0;
+ if ( !context && elem.ownerDocument !== document ) {
+ setDocument( elem );
+ xml = !documentIsHTML;
+ }
+ while ( (matcher = elementMatchers[j++]) ) {
+ if ( matcher( elem, context || document, xml) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ }
+ }
+
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
+ }
+
+ // `i` is now the count of elements visited above, and adding it to `matchedCount`
+ // makes the latter nonnegative.
+ matchedCount += i;
+
+ // Apply set filters to unmatched elements
+ // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
+ // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
+ // no element matchers and no seed.
+ // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
+ // case, which will result in a "00" `matchedCount` that differs from `i` but is also
+ // numerically zero.
+ if ( bySet && i !== matchedCount ) {
+ j = 0;
+ while ( (matcher = setMatchers[j++]) ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
+
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
+
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
+
+ // Add matches to results
+ push.apply( results, setMatched );
+
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
+ }
+ }
+
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
+ }
+
+ return unmatched;
+ };
+
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ selector + " " ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !match ) {
+ match = tokenize( selector );
+ }
+ i = match.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( match[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
+
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+
+ // Save selector and tokenization
+ cached.selector = selector;
+ }
+ return cached;
+};
+
+/**
+ * A low-level selection function that works with Sizzle's compiled
+ * selector functions
+ * @param {String|Function} selector A selector or a pre-compiled
+ * selector function built with Sizzle.compile
+ * @param {Element} context
+ * @param {Array} [results]
+ * @param {Array} [seed] A set of elements to match against
+ */
+select = Sizzle.select = function( selector, context, results, seed ) {
+ var i, tokens, token, type, find,
+ compiled = typeof selector === "function" && selector,
+ match = !seed && tokenize( (selector = compiled.selector || selector) );
+
+ results = results || [];
+
+ // Try to minimize operations if there is only one selector in the list and no seed
+ // (the latter of which guarantees us context)
+ if ( match.length === 1 ) {
+
+ // Reduce context if the leading compound selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
+
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+ if ( !context ) {
+ return results;
+
+ // Precompiled matchers will still verify ancestry, so step up a level
+ } else if ( compiled ) {
+ context = context.parentNode;
+ }
+
+ selector = selector.slice( tokens.shift().value.length );
+ }
+
+ // Fetch a seed set for right-to-left matching
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+ while ( i-- ) {
+ token = tokens[i];
+
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( runescape, funescape ),
+ rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
+ )) ) {
+
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && toSelector( tokens );
+ if ( !selector ) {
+ push.apply( results, seed );
+ return results;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+
+ // Compile and execute a filtering function if one is not provided
+ // Provide `match` to avoid retokenization if we modified the selector above
+ ( compiled || compile( selector, match ) )(
+ seed,
+ context,
+ !documentIsHTML,
+ results,
+ !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
+ );
+ return results;
+};
+
+// One-time assignments
+
+// Sort stability
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+// Support: Chrome 14-35+
+// Always assume duplicates if they aren't passed to the comparison function
+support.detectDuplicates = !!hasDuplicate;
+
+// Initialize against the default document
+setDocument();
+
+// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Detached nodes confoundingly follow *each other*
+support.sortDetached = assert(function( el ) {
+ // Should return 1, but returns 4 (following)
+ return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
+});
+
+// Support: IE<8
+// Prevent attribute/property "interpolation"
+// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !assert(function( el ) {
+ el.innerHTML = " ";
+ return el.firstChild.getAttribute("href") === "#" ;
+}) ) {
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
+ }
+ });
+}
+
+// Support: IE<9
+// Use defaultValue in place of getAttribute("value")
+if ( !support.attributes || !assert(function( el ) {
+ el.innerHTML = " ";
+ el.firstChild.setAttribute( "value", "" );
+ return el.firstChild.getAttribute( "value" ) === "";
+}) ) {
+ addHandle( "value", function( elem, name, isXML ) {
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
+ return elem.defaultValue;
+ }
+ });
+}
+
+// Support: IE<9
+// Use getAttributeNode to fetch booleans when getAttribute lies
+if ( !assert(function( el ) {
+ return el.getAttribute("disabled") == null;
+}) ) {
+ addHandle( booleans, function( elem, name, isXML ) {
+ var val;
+ if ( !isXML ) {
+ return elem[ name ] === true ? name.toLowerCase() :
+ (val = elem.getAttributeNode( name )) && val.specified ?
+ val.value :
+ null;
+ }
+ });
+}
+
+return Sizzle;
+
+})( window );
+
+
+
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+
+// Deprecated
+jQuery.expr[ ":" ] = jQuery.expr.pseudos;
+jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+jQuery.escapeSelector = Sizzle.escape;
+
+
+
+
+var dir = function( elem, dir, until ) {
+ var matched = [],
+ truncate = until !== undefined;
+
+ while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
+ if ( elem.nodeType === 1 ) {
+ if ( truncate && jQuery( elem ).is( until ) ) {
+ break;
+ }
+ matched.push( elem );
+ }
+ }
+ return matched;
+};
+
+
+var siblings = function( n, elem ) {
+ var matched = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ matched.push( n );
+ }
+ }
+
+ return matched;
+};
+
+
+var rneedsContext = jQuery.expr.match.needsContext;
+
+
+
+function nodeName( elem, name ) {
+
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+
+};
+var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
+
+
+
+var risSimple = /^.[^:#\[\.,]*$/;
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, not ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep( elements, function( elem, i ) {
+ return !!qualifier.call( elem, i, elem ) !== not;
+ } );
+ }
+
+ // Single element
+ if ( qualifier.nodeType ) {
+ return jQuery.grep( elements, function( elem ) {
+ return ( elem === qualifier ) !== not;
+ } );
+ }
+
+ // Arraylike of elements (jQuery, arguments, Array)
+ if ( typeof qualifier !== "string" ) {
+ return jQuery.grep( elements, function( elem ) {
+ return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
+ } );
+ }
+
+ // Simple selector that can be filtered directly, removing non-Elements
+ if ( risSimple.test( qualifier ) ) {
+ return jQuery.filter( qualifier, elements, not );
+ }
+
+ // Complex selector, compare the two sets, removing non-Elements
+ qualifier = jQuery.filter( qualifier, elements );
+ return jQuery.grep( elements, function( elem ) {
+ return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
+ } );
+}
+
+jQuery.filter = function( expr, elems, not ) {
+ var elem = elems[ 0 ];
+
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ if ( elems.length === 1 && elem.nodeType === 1 ) {
+ return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
+ }
+
+ return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
+ return elem.nodeType === 1;
+ } ) );
+};
+
+jQuery.fn.extend( {
+ find: function( selector ) {
+ var i, ret,
+ len = this.length,
+ self = this;
+
+ if ( typeof selector !== "string" ) {
+ return this.pushStack( jQuery( selector ).filter( function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ } ) );
+ }
+
+ ret = this.pushStack( [] );
+
+ for ( i = 0; i < len; i++ ) {
+ jQuery.find( selector, self[ i ], ret );
+ }
+
+ return len > 1 ? jQuery.uniqueSort( ret ) : ret;
+ },
+ filter: function( selector ) {
+ return this.pushStack( winnow( this, selector || [], false ) );
+ },
+ not: function( selector ) {
+ return this.pushStack( winnow( this, selector || [], true ) );
+ },
+ is: function( selector ) {
+ return !!winnow(
+ this,
+
+ // If this is a positional/relative selector, check membership in the returned set
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
+ typeof selector === "string" && rneedsContext.test( selector ) ?
+ jQuery( selector ) :
+ selector || [],
+ false
+ ).length;
+ }
+} );
+
+
+// Initialize a jQuery object
+
+
+// A central reference to the root jQuery(document)
+var rootjQuery,
+
+ // A simple way to check for HTML strings
+ // Prioritize #id over to avoid XSS via location.hash (#9521)
+ // Strict HTML recognition (#11290: must start with <)
+ // Shortcut simple #id case for speed
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
+
+ init = jQuery.fn.init = function( selector, context, root ) {
+ var match, elem;
+
+ // HANDLE: $(""), $(null), $(undefined), $(false)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Method init() accepts an alternate rootjQuery
+ // so migrate can support jQuery.sub (gh-2101)
+ root = root || rootjQuery;
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ if ( selector[ 0 ] === "<" &&
+ selector[ selector.length - 1 ] === ">" &&
+ selector.length >= 3 ) {
+
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = rquickExpr.exec( selector );
+ }
+
+ // Match html or make sure no context is specified for #id
+ if ( match && ( match[ 1 ] || !context ) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[ 1 ] ) {
+ context = context instanceof jQuery ? context[ 0 ] : context;
+
+ // Option to run scripts is true for back-compat
+ // Intentionally let the error be thrown if parseHTML is not present
+ jQuery.merge( this, jQuery.parseHTML(
+ match[ 1 ],
+ context && context.nodeType ? context.ownerDocument || context : document,
+ true
+ ) );
+
+ // HANDLE: $(html, props)
+ if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
+ for ( match in context ) {
+
+ // Properties of context are called as methods if possible
+ if ( jQuery.isFunction( this[ match ] ) ) {
+ this[ match ]( context[ match ] );
+
+ // ...and otherwise set as attributes
+ } else {
+ this.attr( match, context[ match ] );
+ }
+ }
+ }
+
+ return this;
+
+ // HANDLE: $(#id)
+ } else {
+ elem = document.getElementById( match[ 2 ] );
+
+ if ( elem ) {
+
+ // Inject the element directly into the jQuery object
+ this[ 0 ] = elem;
+ this.length = 1;
+ }
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || root ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(DOMElement)
+ } else if ( selector.nodeType ) {
+ this[ 0 ] = selector;
+ this.length = 1;
+ return this;
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return root.ready !== undefined ?
+ root.ready( selector ) :
+
+ // Execute immediately if ready is not present
+ selector( jQuery );
+ }
+
+ return jQuery.makeArray( selector, this );
+ };
+
+// Give the init function the jQuery prototype for later instantiation
+init.prototype = jQuery.fn;
+
+// Initialize central reference
+rootjQuery = jQuery( document );
+
+
+var rparentsprev = /^(?:parents|prev(?:Until|All))/,
+
+ // Methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.fn.extend( {
+ has: function( target ) {
+ var targets = jQuery( target, this ),
+ l = targets.length;
+
+ return this.filter( function() {
+ var i = 0;
+ for ( ; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[ i ] ) ) {
+ return true;
+ }
+ }
+ } );
+ },
+
+ closest: function( selectors, context ) {
+ var cur,
+ i = 0,
+ l = this.length,
+ matched = [],
+ targets = typeof selectors !== "string" && jQuery( selectors );
+
+ // Positional selectors never match, since there's no _selection_ context
+ if ( !rneedsContext.test( selectors ) ) {
+ for ( ; i < l; i++ ) {
+ for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
+
+ // Always skip document fragments
+ if ( cur.nodeType < 11 && ( targets ?
+ targets.index( cur ) > -1 :
+
+ // Don't pass non-elements to Sizzle
+ cur.nodeType === 1 &&
+ jQuery.find.matchesSelector( cur, selectors ) ) ) {
+
+ matched.push( cur );
+ break;
+ }
+ }
+ }
+ }
+
+ return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
+ },
+
+ // Determine the position of an element within the set
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
+ }
+
+ // Index in selector
+ if ( typeof elem === "string" ) {
+ return indexOf.call( jQuery( elem ), this[ 0 ] );
+ }
+
+ // Locate the position of the desired element
+ return indexOf.call( this,
+
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[ 0 ] : elem
+ );
+ },
+
+ add: function( selector, context ) {
+ return this.pushStack(
+ jQuery.uniqueSort(
+ jQuery.merge( this.get(), jQuery( selector, context ) )
+ )
+ );
+ },
+
+ addBack: function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter( selector )
+ );
+ }
+} );
+
+function sibling( cur, dir ) {
+ while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
+ return cur;
+}
+
+jQuery.each( {
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return sibling( elem, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return sibling( elem, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return siblings( ( elem.parentNode || {} ).firstChild, elem );
+ },
+ children: function( elem ) {
+ return siblings( elem.firstChild );
+ },
+ contents: function( elem ) {
+ if ( nodeName( elem, "iframe" ) ) {
+ return elem.contentDocument;
+ }
+
+ // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
+ // Treat the template element as a regular one in browsers that
+ // don't support it.
+ if ( nodeName( elem, "template" ) ) {
+ elem = elem.content || elem;
+ }
+
+ return jQuery.merge( [], elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var matched = jQuery.map( this, fn, until );
+
+ if ( name.slice( -5 ) !== "Until" ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ matched = jQuery.filter( selector, matched );
+ }
+
+ if ( this.length > 1 ) {
+
+ // Remove duplicates
+ if ( !guaranteedUnique[ name ] ) {
+ jQuery.uniqueSort( matched );
+ }
+
+ // Reverse order for parents* and prev-derivatives
+ if ( rparentsprev.test( name ) ) {
+ matched.reverse();
+ }
+ }
+
+ return this.pushStack( matched );
+ };
+} );
+var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
+
+
+
+// Convert String-formatted options into Object-formatted ones
+function createOptions( options ) {
+ var object = {};
+ jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
+ object[ flag ] = true;
+ } );
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * options: an optional list of space-separated options that will change how
+ * the callback list behaves or a more traditional option object
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible options:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( options ) {
+
+ // Convert options from String-formatted to Object-formatted if needed
+ // (we check in cache first)
+ options = typeof options === "string" ?
+ createOptions( options ) :
+ jQuery.extend( {}, options );
+
+ var // Flag to know if list is currently firing
+ firing,
+
+ // Last fire value for non-forgettable lists
+ memory,
+
+ // Flag to know if list was already fired
+ fired,
+
+ // Flag to prevent firing
+ locked,
+
+ // Actual callback list
+ list = [],
+
+ // Queue of execution data for repeatable lists
+ queue = [],
+
+ // Index of currently firing callback (modified by add/remove as needed)
+ firingIndex = -1,
+
+ // Fire callbacks
+ fire = function() {
+
+ // Enforce single-firing
+ locked = locked || options.once;
+
+ // Execute callbacks for all pending executions,
+ // respecting firingIndex overrides and runtime changes
+ fired = firing = true;
+ for ( ; queue.length; firingIndex = -1 ) {
+ memory = queue.shift();
+ while ( ++firingIndex < list.length ) {
+
+ // Run callback and check for early termination
+ if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
+ options.stopOnFalse ) {
+
+ // Jump to end and forget the data so .add doesn't re-fire
+ firingIndex = list.length;
+ memory = false;
+ }
+ }
+ }
+
+ // Forget the data if we're done with it
+ if ( !options.memory ) {
+ memory = false;
+ }
+
+ firing = false;
+
+ // Clean up if we're done firing for good
+ if ( locked ) {
+
+ // Keep an empty list if we have data for future add calls
+ if ( memory ) {
+ list = [];
+
+ // Otherwise, this object is spent
+ } else {
+ list = "";
+ }
+ }
+ },
+
+ // Actual Callbacks object
+ self = {
+
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+
+ // If we have memory from a past run, we should fire after adding
+ if ( memory && !firing ) {
+ firingIndex = list.length - 1;
+ queue.push( memory );
+ }
+
+ ( function add( args ) {
+ jQuery.each( args, function( _, arg ) {
+ if ( jQuery.isFunction( arg ) ) {
+ if ( !options.unique || !self.has( arg ) ) {
+ list.push( arg );
+ }
+ } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
+
+ // Inspect recursively
+ add( arg );
+ }
+ } );
+ } )( arguments );
+
+ if ( memory && !firing ) {
+ fire();
+ }
+ }
+ return this;
+ },
+
+ // Remove a callback from the list
+ remove: function() {
+ jQuery.each( arguments, function( _, arg ) {
+ var index;
+ while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+ list.splice( index, 1 );
+
+ // Handle firing indexes
+ if ( index <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ } );
+ return this;
+ },
+
+ // Check if a given callback is in the list.
+ // If no argument is given, return whether or not list has callbacks attached.
+ has: function( fn ) {
+ return fn ?
+ jQuery.inArray( fn, list ) > -1 :
+ list.length > 0;
+ },
+
+ // Remove all callbacks from the list
+ empty: function() {
+ if ( list ) {
+ list = [];
+ }
+ return this;
+ },
+
+ // Disable .fire and .add
+ // Abort any current/pending executions
+ // Clear all callbacks and values
+ disable: function() {
+ locked = queue = [];
+ list = memory = "";
+ return this;
+ },
+ disabled: function() {
+ return !list;
+ },
+
+ // Disable .fire
+ // Also disable .add unless we have memory (since it would have no effect)
+ // Abort any pending executions
+ lock: function() {
+ locked = queue = [];
+ if ( !memory && !firing ) {
+ list = memory = "";
+ }
+ return this;
+ },
+ locked: function() {
+ return !!locked;
+ },
+
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ if ( !locked ) {
+ args = args || [];
+ args = [ context, args.slice ? args.slice() : args ];
+ queue.push( args );
+ if ( !firing ) {
+ fire();
+ }
+ }
+ return this;
+ },
+
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!fired;
+ }
+ };
+
+ return self;
+};
+
+
+function Identity( v ) {
+ return v;
+}
+function Thrower( ex ) {
+ throw ex;
+}
+
+function adoptValue( value, resolve, reject, noValue ) {
+ var method;
+
+ try {
+
+ // Check for promise aspect first to privilege synchronous behavior
+ if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {
+ method.call( value ).done( resolve ).fail( reject );
+
+ // Other thenables
+ } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {
+ method.call( value, resolve, reject );
+
+ // Other non-thenables
+ } else {
+
+ // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
+ // * false: [ value ].slice( 0 ) => resolve( value )
+ // * true: [ value ].slice( 1 ) => resolve()
+ resolve.apply( undefined, [ value ].slice( noValue ) );
+ }
+
+ // For Promises/A+, convert exceptions into rejections
+ // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
+ // Deferred#then to conditionally suppress rejection.
+ } catch ( value ) {
+
+ // Support: Android 4.0 only
+ // Strict mode functions invoked without .call/.apply get global-object context
+ reject.apply( undefined, [ value ] );
+ }
+}
+
+jQuery.extend( {
+
+ Deferred: function( func ) {
+ var tuples = [
+
+ // action, add listener, callbacks,
+ // ... .then handlers, argument index, [final state]
+ [ "notify", "progress", jQuery.Callbacks( "memory" ),
+ jQuery.Callbacks( "memory" ), 2 ],
+ [ "resolve", "done", jQuery.Callbacks( "once memory" ),
+ jQuery.Callbacks( "once memory" ), 0, "resolved" ],
+ [ "reject", "fail", jQuery.Callbacks( "once memory" ),
+ jQuery.Callbacks( "once memory" ), 1, "rejected" ]
+ ],
+ state = "pending",
+ promise = {
+ state: function() {
+ return state;
+ },
+ always: function() {
+ deferred.done( arguments ).fail( arguments );
+ return this;
+ },
+ "catch": function( fn ) {
+ return promise.then( null, fn );
+ },
+
+ // Keep pipe for back-compat
+ pipe: function( /* fnDone, fnFail, fnProgress */ ) {
+ var fns = arguments;
+
+ return jQuery.Deferred( function( newDefer ) {
+ jQuery.each( tuples, function( i, tuple ) {
+
+ // Map tuples (progress, done, fail) to arguments (done, fail, progress)
+ var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
+
+ // deferred.progress(function() { bind to newDefer or newDefer.notify })
+ // deferred.done(function() { bind to newDefer or newDefer.resolve })
+ // deferred.fail(function() { bind to newDefer or newDefer.reject })
+ deferred[ tuple[ 1 ] ]( function() {
+ var returned = fn && fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise()
+ .progress( newDefer.notify )
+ .done( newDefer.resolve )
+ .fail( newDefer.reject );
+ } else {
+ newDefer[ tuple[ 0 ] + "With" ](
+ this,
+ fn ? [ returned ] : arguments
+ );
+ }
+ } );
+ } );
+ fns = null;
+ } ).promise();
+ },
+ then: function( onFulfilled, onRejected, onProgress ) {
+ var maxDepth = 0;
+ function resolve( depth, deferred, handler, special ) {
+ return function() {
+ var that = this,
+ args = arguments,
+ mightThrow = function() {
+ var returned, then;
+
+ // Support: Promises/A+ section 2.3.3.3.3
+ // https://promisesaplus.com/#point-59
+ // Ignore double-resolution attempts
+ if ( depth < maxDepth ) {
+ return;
+ }
+
+ returned = handler.apply( that, args );
+
+ // Support: Promises/A+ section 2.3.1
+ // https://promisesaplus.com/#point-48
+ if ( returned === deferred.promise() ) {
+ throw new TypeError( "Thenable self-resolution" );
+ }
+
+ // Support: Promises/A+ sections 2.3.3.1, 3.5
+ // https://promisesaplus.com/#point-54
+ // https://promisesaplus.com/#point-75
+ // Retrieve `then` only once
+ then = returned &&
+
+ // Support: Promises/A+ section 2.3.4
+ // https://promisesaplus.com/#point-64
+ // Only check objects and functions for thenability
+ ( typeof returned === "object" ||
+ typeof returned === "function" ) &&
+ returned.then;
+
+ // Handle a returned thenable
+ if ( jQuery.isFunction( then ) ) {
+
+ // Special processors (notify) just wait for resolution
+ if ( special ) {
+ then.call(
+ returned,
+ resolve( maxDepth, deferred, Identity, special ),
+ resolve( maxDepth, deferred, Thrower, special )
+ );
+
+ // Normal processors (resolve) also hook into progress
+ } else {
+
+ // ...and disregard older resolution values
+ maxDepth++;
+
+ then.call(
+ returned,
+ resolve( maxDepth, deferred, Identity, special ),
+ resolve( maxDepth, deferred, Thrower, special ),
+ resolve( maxDepth, deferred, Identity,
+ deferred.notifyWith )
+ );
+ }
+
+ // Handle all other returned values
+ } else {
+
+ // Only substitute handlers pass on context
+ // and multiple values (non-spec behavior)
+ if ( handler !== Identity ) {
+ that = undefined;
+ args = [ returned ];
+ }
+
+ // Process the value(s)
+ // Default process is resolve
+ ( special || deferred.resolveWith )( that, args );
+ }
+ },
+
+ // Only normal processors (resolve) catch and reject exceptions
+ process = special ?
+ mightThrow :
+ function() {
+ try {
+ mightThrow();
+ } catch ( e ) {
+
+ if ( jQuery.Deferred.exceptionHook ) {
+ jQuery.Deferred.exceptionHook( e,
+ process.stackTrace );
+ }
+
+ // Support: Promises/A+ section 2.3.3.3.4.1
+ // https://promisesaplus.com/#point-61
+ // Ignore post-resolution exceptions
+ if ( depth + 1 >= maxDepth ) {
+
+ // Only substitute handlers pass on context
+ // and multiple values (non-spec behavior)
+ if ( handler !== Thrower ) {
+ that = undefined;
+ args = [ e ];
+ }
+
+ deferred.rejectWith( that, args );
+ }
+ }
+ };
+
+ // Support: Promises/A+ section 2.3.3.3.1
+ // https://promisesaplus.com/#point-57
+ // Re-resolve promises immediately to dodge false rejection from
+ // subsequent errors
+ if ( depth ) {
+ process();
+ } else {
+
+ // Call an optional hook to record the stack, in case of exception
+ // since it's otherwise lost when execution goes async
+ if ( jQuery.Deferred.getStackHook ) {
+ process.stackTrace = jQuery.Deferred.getStackHook();
+ }
+ window.setTimeout( process );
+ }
+ };
+ }
+
+ return jQuery.Deferred( function( newDefer ) {
+
+ // progress_handlers.add( ... )
+ tuples[ 0 ][ 3 ].add(
+ resolve(
+ 0,
+ newDefer,
+ jQuery.isFunction( onProgress ) ?
+ onProgress :
+ Identity,
+ newDefer.notifyWith
+ )
+ );
+
+ // fulfilled_handlers.add( ... )
+ tuples[ 1 ][ 3 ].add(
+ resolve(
+ 0,
+ newDefer,
+ jQuery.isFunction( onFulfilled ) ?
+ onFulfilled :
+ Identity
+ )
+ );
+
+ // rejected_handlers.add( ... )
+ tuples[ 2 ][ 3 ].add(
+ resolve(
+ 0,
+ newDefer,
+ jQuery.isFunction( onRejected ) ?
+ onRejected :
+ Thrower
+ )
+ );
+ } ).promise();
+ },
+
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
+ }
+ },
+ deferred = {};
+
+ // Add list-specific methods
+ jQuery.each( tuples, function( i, tuple ) {
+ var list = tuple[ 2 ],
+ stateString = tuple[ 5 ];
+
+ // promise.progress = list.add
+ // promise.done = list.add
+ // promise.fail = list.add
+ promise[ tuple[ 1 ] ] = list.add;
+
+ // Handle state
+ if ( stateString ) {
+ list.add(
+ function() {
+
+ // state = "resolved" (i.e., fulfilled)
+ // state = "rejected"
+ state = stateString;
+ },
+
+ // rejected_callbacks.disable
+ // fulfilled_callbacks.disable
+ tuples[ 3 - i ][ 2 ].disable,
+
+ // progress_callbacks.lock
+ tuples[ 0 ][ 2 ].lock
+ );
+ }
+
+ // progress_handlers.fire
+ // fulfilled_handlers.fire
+ // rejected_handlers.fire
+ list.add( tuple[ 3 ].fire );
+
+ // deferred.notify = function() { deferred.notifyWith(...) }
+ // deferred.resolve = function() { deferred.resolveWith(...) }
+ // deferred.reject = function() { deferred.rejectWith(...) }
+ deferred[ tuple[ 0 ] ] = function() {
+ deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
+ return this;
+ };
+
+ // deferred.notifyWith = list.fireWith
+ // deferred.resolveWith = list.fireWith
+ // deferred.rejectWith = list.fireWith
+ deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
+ } );
+
+ // Make the deferred a promise
+ promise.promise( deferred );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( singleValue ) {
+ var
+
+ // count of uncompleted subordinates
+ remaining = arguments.length,
+
+ // count of unprocessed arguments
+ i = remaining,
+
+ // subordinate fulfillment data
+ resolveContexts = Array( i ),
+ resolveValues = slice.call( arguments ),
+
+ // the master Deferred
+ master = jQuery.Deferred(),
+
+ // subordinate callback factory
+ updateFunc = function( i ) {
+ return function( value ) {
+ resolveContexts[ i ] = this;
+ resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
+ if ( !( --remaining ) ) {
+ master.resolveWith( resolveContexts, resolveValues );
+ }
+ };
+ };
+
+ // Single- and empty arguments are adopted like Promise.resolve
+ if ( remaining <= 1 ) {
+ adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
+ !remaining );
+
+ // Use .then() to unwrap secondary thenables (cf. gh-3000)
+ if ( master.state() === "pending" ||
+ jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
+
+ return master.then();
+ }
+ }
+
+ // Multiple arguments are aggregated like Promise.all array elements
+ while ( i-- ) {
+ adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
+ }
+
+ return master.promise();
+ }
+} );
+
+
+// These usually indicate a programmer mistake during development,
+// warn about them ASAP rather than swallowing them by default.
+var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
+
+jQuery.Deferred.exceptionHook = function( error, stack ) {
+
+ // Support: IE 8 - 9 only
+ // Console exists when dev tools are open, which can happen at any time
+ if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
+ window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
+ }
+};
+
+
+
+
+jQuery.readyException = function( error ) {
+ window.setTimeout( function() {
+ throw error;
+ } );
+};
+
+
+
+
+// The deferred used on DOM ready
+var readyList = jQuery.Deferred();
+
+jQuery.fn.ready = function( fn ) {
+
+ readyList
+ .then( fn )
+
+ // Wrap jQuery.readyException in a function so that the lookup
+ // happens at the time of error handling instead of callback
+ // registration.
+ .catch( function( error ) {
+ jQuery.readyException( error );
+ } );
+
+ return this;
+};
+
+jQuery.extend( {
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+
+ // Abort if there are pending holds or we're already ready
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+ return;
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+ }
+} );
+
+jQuery.ready.then = readyList.then;
+
+// The ready event handler and self cleanup method
+function completed() {
+ document.removeEventListener( "DOMContentLoaded", completed );
+ window.removeEventListener( "load", completed );
+ jQuery.ready();
+}
+
+// Catch cases where $(document).ready() is called
+// after the browser event has already occurred.
+// Support: IE <=9 - 10 only
+// Older IE sometimes signals "interactive" too soon
+if ( document.readyState === "complete" ||
+ ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
+
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ window.setTimeout( jQuery.ready );
+
+} else {
+
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", completed );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", completed );
+}
+
+
+
+
+// Multifunctional method to get and set values of a collection
+// The value/s can optionally be executed if it's a function
+var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
+ var i = 0,
+ len = elems.length,
+ bulk = key == null;
+
+ // Sets many values
+ if ( jQuery.type( key ) === "object" ) {
+ chainable = true;
+ for ( i in key ) {
+ access( elems, fn, i, key[ i ], true, emptyGet, raw );
+ }
+
+ // Sets one value
+ } else if ( value !== undefined ) {
+ chainable = true;
+
+ if ( !jQuery.isFunction( value ) ) {
+ raw = true;
+ }
+
+ if ( bulk ) {
+
+ // Bulk operations run against the entire set
+ if ( raw ) {
+ fn.call( elems, value );
+ fn = null;
+
+ // ...except when executing function values
+ } else {
+ bulk = fn;
+ fn = function( elem, key, value ) {
+ return bulk.call( jQuery( elem ), value );
+ };
+ }
+ }
+
+ if ( fn ) {
+ for ( ; i < len; i++ ) {
+ fn(
+ elems[ i ], key, raw ?
+ value :
+ value.call( elems[ i ], i, fn( elems[ i ], key ) )
+ );
+ }
+ }
+ }
+
+ if ( chainable ) {
+ return elems;
+ }
+
+ // Gets
+ if ( bulk ) {
+ return fn.call( elems );
+ }
+
+ return len ? fn( elems[ 0 ], key ) : emptyGet;
+};
+var acceptData = function( owner ) {
+
+ // Accepts only:
+ // - Node
+ // - Node.ELEMENT_NODE
+ // - Node.DOCUMENT_NODE
+ // - Object
+ // - Any
+ return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
+};
+
+
+
+
+function Data() {
+ this.expando = jQuery.expando + Data.uid++;
+}
+
+Data.uid = 1;
+
+Data.prototype = {
+
+ cache: function( owner ) {
+
+ // Check if the owner object already has a cache
+ var value = owner[ this.expando ];
+
+ // If not, create one
+ if ( !value ) {
+ value = {};
+
+ // We can accept data for non-element nodes in modern browsers,
+ // but we should not, see #8335.
+ // Always return an empty object.
+ if ( acceptData( owner ) ) {
+
+ // If it is a node unlikely to be stringify-ed or looped over
+ // use plain assignment
+ if ( owner.nodeType ) {
+ owner[ this.expando ] = value;
+
+ // Otherwise secure it in a non-enumerable property
+ // configurable must be true to allow the property to be
+ // deleted when data is removed
+ } else {
+ Object.defineProperty( owner, this.expando, {
+ value: value,
+ configurable: true
+ } );
+ }
+ }
+ }
+
+ return value;
+ },
+ set: function( owner, data, value ) {
+ var prop,
+ cache = this.cache( owner );
+
+ // Handle: [ owner, key, value ] args
+ // Always use camelCase key (gh-2257)
+ if ( typeof data === "string" ) {
+ cache[ jQuery.camelCase( data ) ] = value;
+
+ // Handle: [ owner, { properties } ] args
+ } else {
+
+ // Copy the properties one-by-one to the cache object
+ for ( prop in data ) {
+ cache[ jQuery.camelCase( prop ) ] = data[ prop ];
+ }
+ }
+ return cache;
+ },
+ get: function( owner, key ) {
+ return key === undefined ?
+ this.cache( owner ) :
+
+ // Always use camelCase key (gh-2257)
+ owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
+ },
+ access: function( owner, key, value ) {
+
+ // In cases where either:
+ //
+ // 1. No key was specified
+ // 2. A string key was specified, but no value provided
+ //
+ // Take the "read" path and allow the get method to determine
+ // which value to return, respectively either:
+ //
+ // 1. The entire cache object
+ // 2. The data stored at the key
+ //
+ if ( key === undefined ||
+ ( ( key && typeof key === "string" ) && value === undefined ) ) {
+
+ return this.get( owner, key );
+ }
+
+ // When the key is not a string, or both a key and value
+ // are specified, set or extend (existing objects) with either:
+ //
+ // 1. An object of properties
+ // 2. A key and value
+ //
+ this.set( owner, key, value );
+
+ // Since the "set" path can have two possible entry points
+ // return the expected data based on which path was taken[*]
+ return value !== undefined ? value : key;
+ },
+ remove: function( owner, key ) {
+ var i,
+ cache = owner[ this.expando ];
+
+ if ( cache === undefined ) {
+ return;
+ }
+
+ if ( key !== undefined ) {
+
+ // Support array or space separated string of keys
+ if ( Array.isArray( key ) ) {
+
+ // If key is an array of keys...
+ // We always set camelCase keys, so remove that.
+ key = key.map( jQuery.camelCase );
+ } else {
+ key = jQuery.camelCase( key );
+
+ // If a key with the spaces exists, use it.
+ // Otherwise, create an array by matching non-whitespace
+ key = key in cache ?
+ [ key ] :
+ ( key.match( rnothtmlwhite ) || [] );
+ }
+
+ i = key.length;
+
+ while ( i-- ) {
+ delete cache[ key[ i ] ];
+ }
+ }
+
+ // Remove the expando if there's no more data
+ if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
+
+ // Support: Chrome <=35 - 45
+ // Webkit & Blink performance suffers when deleting properties
+ // from DOM nodes, so set to undefined instead
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
+ if ( owner.nodeType ) {
+ owner[ this.expando ] = undefined;
+ } else {
+ delete owner[ this.expando ];
+ }
+ }
+ },
+ hasData: function( owner ) {
+ var cache = owner[ this.expando ];
+ return cache !== undefined && !jQuery.isEmptyObject( cache );
+ }
+};
+var dataPriv = new Data();
+
+var dataUser = new Data();
+
+
+
+// Implementation Summary
+//
+// 1. Enforce API surface and semantic compatibility with 1.9.x branch
+// 2. Improve the module's maintainability by reducing the storage
+// paths to a single mechanism.
+// 3. Use the same single mechanism to support "private" and "user" data.
+// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
+// 5. Avoid exposing implementation details on user objects (eg. expando properties)
+// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
+
+var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
+ rmultiDash = /[A-Z]/g;
+
+function getData( data ) {
+ if ( data === "true" ) {
+ return true;
+ }
+
+ if ( data === "false" ) {
+ return false;
+ }
+
+ if ( data === "null" ) {
+ return null;
+ }
+
+ // Only convert to a number if it doesn't change the string
+ if ( data === +data + "" ) {
+ return +data;
+ }
+
+ if ( rbrace.test( data ) ) {
+ return JSON.parse( data );
+ }
+
+ return data;
+}
+
+function dataAttr( elem, key, data ) {
+ var name;
+
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+ name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = getData( data );
+ } catch ( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ dataUser.set( elem, key, data );
+ } else {
+ data = undefined;
+ }
+ }
+ return data;
+}
+
+jQuery.extend( {
+ hasData: function( elem ) {
+ return dataUser.hasData( elem ) || dataPriv.hasData( elem );
+ },
+
+ data: function( elem, name, data ) {
+ return dataUser.access( elem, name, data );
+ },
+
+ removeData: function( elem, name ) {
+ dataUser.remove( elem, name );
+ },
+
+ // TODO: Now that all calls to _data and _removeData have been replaced
+ // with direct calls to dataPriv methods, these can be deprecated.
+ _data: function( elem, name, data ) {
+ return dataPriv.access( elem, name, data );
+ },
+
+ _removeData: function( elem, name ) {
+ dataPriv.remove( elem, name );
+ }
+} );
+
+jQuery.fn.extend( {
+ data: function( key, value ) {
+ var i, name, data,
+ elem = this[ 0 ],
+ attrs = elem && elem.attributes;
+
+ // Gets all values
+ if ( key === undefined ) {
+ if ( this.length ) {
+ data = dataUser.get( elem );
+
+ if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
+ i = attrs.length;
+ while ( i-- ) {
+
+ // Support: IE 11 only
+ // The attrs elements can be null (#14894)
+ if ( attrs[ i ] ) {
+ name = attrs[ i ].name;
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.slice( 5 ) );
+ dataAttr( elem, name, data[ name ] );
+ }
+ }
+ }
+ dataPriv.set( elem, "hasDataAttrs", true );
+ }
+ }
+
+ return data;
+ }
+
+ // Sets multiple values
+ if ( typeof key === "object" ) {
+ return this.each( function() {
+ dataUser.set( this, key );
+ } );
+ }
+
+ return access( this, function( value ) {
+ var data;
+
+ // The calling jQuery object (element matches) is not empty
+ // (and therefore has an element appears at this[ 0 ]) and the
+ // `value` parameter was not undefined. An empty jQuery object
+ // will result in `undefined` for elem = this[ 0 ] which will
+ // throw an exception if an attempt to read a data cache is made.
+ if ( elem && value === undefined ) {
+
+ // Attempt to get data from the cache
+ // The key will always be camelCased in Data
+ data = dataUser.get( elem, key );
+ if ( data !== undefined ) {
+ return data;
+ }
+
+ // Attempt to "discover" the data in
+ // HTML5 custom data-* attrs
+ data = dataAttr( elem, key );
+ if ( data !== undefined ) {
+ return data;
+ }
+
+ // We tried really hard, but the data doesn't exist.
+ return;
+ }
+
+ // Set the data...
+ this.each( function() {
+
+ // We always store the camelCased key
+ dataUser.set( this, key, value );
+ } );
+ }, null, value, arguments.length > 1, null, true );
+ },
+
+ removeData: function( key ) {
+ return this.each( function() {
+ dataUser.remove( this, key );
+ } );
+ }
+} );
+
+
+jQuery.extend( {
+ queue: function( elem, type, data ) {
+ var queue;
+
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ queue = dataPriv.get( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !queue || Array.isArray( data ) ) {
+ queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
+ } else {
+ queue.push( data );
+ }
+ }
+ return queue || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ startLength = queue.length,
+ fn = queue.shift(),
+ hooks = jQuery._queueHooks( elem, type ),
+ next = function() {
+ jQuery.dequeue( elem, type );
+ };
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ startLength--;
+ }
+
+ if ( fn ) {
+
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ // Clear up the last queue stop function
+ delete hooks.stop;
+ fn.call( elem, next, hooks );
+ }
+
+ if ( !startLength && hooks ) {
+ hooks.empty.fire();
+ }
+ },
+
+ // Not public - generate a queueHooks object, or return the current one
+ _queueHooks: function( elem, type ) {
+ var key = type + "queueHooks";
+ return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
+ empty: jQuery.Callbacks( "once memory" ).add( function() {
+ dataPriv.remove( elem, [ type + "queue", key ] );
+ } )
+ } );
+ }
+} );
+
+jQuery.fn.extend( {
+ queue: function( type, data ) {
+ var setter = 2;
+
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ setter--;
+ }
+
+ if ( arguments.length < setter ) {
+ return jQuery.queue( this[ 0 ], type );
+ }
+
+ return data === undefined ?
+ this :
+ this.each( function() {
+ var queue = jQuery.queue( this, type, data );
+
+ // Ensure a hooks for this queue
+ jQuery._queueHooks( this, type );
+
+ if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ } );
+ },
+ dequeue: function( type ) {
+ return this.each( function() {
+ jQuery.dequeue( this, type );
+ } );
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, obj ) {
+ var tmp,
+ count = 1,
+ defer = jQuery.Deferred(),
+ elements = this,
+ i = this.length,
+ resolve = function() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ };
+
+ if ( typeof type !== "string" ) {
+ obj = type;
+ type = undefined;
+ }
+ type = type || "fx";
+
+ while ( i-- ) {
+ tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
+ if ( tmp && tmp.empty ) {
+ count++;
+ tmp.empty.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise( obj );
+ }
+} );
+var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
+
+var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
+
+
+var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
+
+var isHiddenWithinTree = function( elem, el ) {
+
+ // isHiddenWithinTree might be called from jQuery#filter function;
+ // in that case, element will be second argument
+ elem = el || elem;
+
+ // Inline style trumps all
+ return elem.style.display === "none" ||
+ elem.style.display === "" &&
+
+ // Otherwise, check computed style
+ // Support: Firefox <=43 - 45
+ // Disconnected elements can have computed display: none, so first confirm that elem is
+ // in the document.
+ jQuery.contains( elem.ownerDocument, elem ) &&
+
+ jQuery.css( elem, "display" ) === "none";
+ };
+
+var swap = function( elem, options, callback, args ) {
+ var ret, name,
+ old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ ret = callback.apply( elem, args || [] );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+
+ return ret;
+};
+
+
+
+
+function adjustCSS( elem, prop, valueParts, tween ) {
+ var adjusted,
+ scale = 1,
+ maxIterations = 20,
+ currentValue = tween ?
+ function() {
+ return tween.cur();
+ } :
+ function() {
+ return jQuery.css( elem, prop, "" );
+ },
+ initial = currentValue(),
+ unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
+
+ // Starting value computation is required for potential unit mismatches
+ initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
+ rcssNum.exec( jQuery.css( elem, prop ) );
+
+ if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
+
+ // Trust units reported by jQuery.css
+ unit = unit || initialInUnit[ 3 ];
+
+ // Make sure we update the tween properties later on
+ valueParts = valueParts || [];
+
+ // Iteratively approximate from a nonzero starting point
+ initialInUnit = +initial || 1;
+
+ do {
+
+ // If previous iteration zeroed out, double until we get *something*.
+ // Use string for doubling so we don't accidentally see scale as unchanged below
+ scale = scale || ".5";
+
+ // Adjust and apply
+ initialInUnit = initialInUnit / scale;
+ jQuery.style( elem, prop, initialInUnit + unit );
+
+ // Update scale, tolerating zero or NaN from tween.cur()
+ // Break the loop if scale is unchanged or perfect, or if we've just had enough.
+ } while (
+ scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
+ );
+ }
+
+ if ( valueParts ) {
+ initialInUnit = +initialInUnit || +initial || 0;
+
+ // Apply relative offset (+=/-=) if specified
+ adjusted = valueParts[ 1 ] ?
+ initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
+ +valueParts[ 2 ];
+ if ( tween ) {
+ tween.unit = unit;
+ tween.start = initialInUnit;
+ tween.end = adjusted;
+ }
+ }
+ return adjusted;
+}
+
+
+var defaultDisplayMap = {};
+
+function getDefaultDisplay( elem ) {
+ var temp,
+ doc = elem.ownerDocument,
+ nodeName = elem.nodeName,
+ display = defaultDisplayMap[ nodeName ];
+
+ if ( display ) {
+ return display;
+ }
+
+ temp = doc.body.appendChild( doc.createElement( nodeName ) );
+ display = jQuery.css( temp, "display" );
+
+ temp.parentNode.removeChild( temp );
+
+ if ( display === "none" ) {
+ display = "block";
+ }
+ defaultDisplayMap[ nodeName ] = display;
+
+ return display;
+}
+
+function showHide( elements, show ) {
+ var display, elem,
+ values = [],
+ index = 0,
+ length = elements.length;
+
+ // Determine new display value for elements that need to change
+ for ( ; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+
+ display = elem.style.display;
+ if ( show ) {
+
+ // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
+ // check is required in this first loop unless we have a nonempty display value (either
+ // inline or about-to-be-restored)
+ if ( display === "none" ) {
+ values[ index ] = dataPriv.get( elem, "display" ) || null;
+ if ( !values[ index ] ) {
+ elem.style.display = "";
+ }
+ }
+ if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
+ values[ index ] = getDefaultDisplay( elem );
+ }
+ } else {
+ if ( display !== "none" ) {
+ values[ index ] = "none";
+
+ // Remember what we're overwriting
+ dataPriv.set( elem, "display", display );
+ }
+ }
+ }
+
+ // Set the display of the elements in a second loop to avoid constant reflow
+ for ( index = 0; index < length; index++ ) {
+ if ( values[ index ] != null ) {
+ elements[ index ].style.display = values[ index ];
+ }
+ }
+
+ return elements;
+}
+
+jQuery.fn.extend( {
+ show: function() {
+ return showHide( this, true );
+ },
+ hide: function() {
+ return showHide( this );
+ },
+ toggle: function( state ) {
+ if ( typeof state === "boolean" ) {
+ return state ? this.show() : this.hide();
+ }
+
+ return this.each( function() {
+ if ( isHiddenWithinTree( this ) ) {
+ jQuery( this ).show();
+ } else {
+ jQuery( this ).hide();
+ }
+ } );
+ }
+} );
+var rcheckableType = ( /^(?:checkbox|radio)$/i );
+
+var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
+
+var rscriptType = ( /^$|\/(?:java|ecma)script/i );
+
+
+
+// We have to close these tags to support XHTML (#13200)
+var wrapMap = {
+
+ // Support: IE <=9 only
+ option: [ 1, "", " " ],
+
+ // XHTML parsers do not magically insert elements in the
+ // same way that tag soup parsers do. So we cannot shorten
+ // this by omitting or other required elements.
+ thead: [ 1, "" ],
+ col: [ 2, "" ],
+ tr: [ 2, "" ],
+ td: [ 3, "" ],
+
+ _default: [ 0, "", "" ]
+};
+
+// Support: IE <=9 only
+wrapMap.optgroup = wrapMap.option;
+
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+
+function getAll( context, tag ) {
+
+ // Support: IE <=9 - 11 only
+ // Use typeof to avoid zero-argument method invocation on host objects (#15151)
+ var ret;
+
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ ret = context.getElementsByTagName( tag || "*" );
+
+ } else if ( typeof context.querySelectorAll !== "undefined" ) {
+ ret = context.querySelectorAll( tag || "*" );
+
+ } else {
+ ret = [];
+ }
+
+ if ( tag === undefined || tag && nodeName( context, tag ) ) {
+ return jQuery.merge( [ context ], ret );
+ }
+
+ return ret;
+}
+
+
+// Mark scripts as having already been evaluated
+function setGlobalEval( elems, refElements ) {
+ var i = 0,
+ l = elems.length;
+
+ for ( ; i < l; i++ ) {
+ dataPriv.set(
+ elems[ i ],
+ "globalEval",
+ !refElements || dataPriv.get( refElements[ i ], "globalEval" )
+ );
+ }
+}
+
+
+var rhtml = /<|?\w+;/;
+
+function buildFragment( elems, context, scripts, selection, ignored ) {
+ var elem, tmp, tag, wrap, contains, j,
+ fragment = context.createDocumentFragment(),
+ nodes = [],
+ i = 0,
+ l = elems.length;
+
+ for ( ; i < l; i++ ) {
+ elem = elems[ i ];
+
+ if ( elem || elem === 0 ) {
+
+ // Add nodes directly
+ if ( jQuery.type( elem ) === "object" ) {
+
+ // Support: Android <=4.0 only, PhantomJS 1 only
+ // push.apply(_, arraylike) throws on ancient WebKit
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
+
+ // Convert non-html into a text node
+ } else if ( !rhtml.test( elem ) ) {
+ nodes.push( context.createTextNode( elem ) );
+
+ // Convert html into DOM nodes
+ } else {
+ tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
+
+ // Deserialize a standard representation
+ tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
+ wrap = wrapMap[ tag ] || wrapMap._default;
+ tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
+
+ // Descend through wrappers to the right content
+ j = wrap[ 0 ];
+ while ( j-- ) {
+ tmp = tmp.lastChild;
+ }
+
+ // Support: Android <=4.0 only, PhantomJS 1 only
+ // push.apply(_, arraylike) throws on ancient WebKit
+ jQuery.merge( nodes, tmp.childNodes );
+
+ // Remember the top-level container
+ tmp = fragment.firstChild;
+
+ // Ensure the created nodes are orphaned (#12392)
+ tmp.textContent = "";
+ }
+ }
+ }
+
+ // Remove wrapper from fragment
+ fragment.textContent = "";
+
+ i = 0;
+ while ( ( elem = nodes[ i++ ] ) ) {
+
+ // Skip elements already in the context collection (trac-4087)
+ if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
+ if ( ignored ) {
+ ignored.push( elem );
+ }
+ continue;
+ }
+
+ contains = jQuery.contains( elem.ownerDocument, elem );
+
+ // Append to fragment
+ tmp = getAll( fragment.appendChild( elem ), "script" );
+
+ // Preserve script evaluation history
+ if ( contains ) {
+ setGlobalEval( tmp );
+ }
+
+ // Capture executables
+ if ( scripts ) {
+ j = 0;
+ while ( ( elem = tmp[ j++ ] ) ) {
+ if ( rscriptType.test( elem.type || "" ) ) {
+ scripts.push( elem );
+ }
+ }
+ }
+ }
+
+ return fragment;
+}
+
+
+( function() {
+ var fragment = document.createDocumentFragment(),
+ div = fragment.appendChild( document.createElement( "div" ) ),
+ input = document.createElement( "input" );
+
+ // Support: Android 4.0 - 4.3 only
+ // Check state lost if the name is set (#11217)
+ // Support: Windows Web Apps (WWA)
+ // `name` and `type` must use .setAttribute for WWA (#14901)
+ input.setAttribute( "type", "radio" );
+ input.setAttribute( "checked", "checked" );
+ input.setAttribute( "name", "t" );
+
+ div.appendChild( input );
+
+ // Support: Android <=4.1 only
+ // Older WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Support: IE <=11 only
+ // Make sure textarea (and checkbox) defaultValue is properly cloned
+ div.innerHTML = "";
+ support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
+} )();
+var documentElement = document.documentElement;
+
+
+
+var
+ rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
+
+function returnTrue() {
+ return true;
+}
+
+function returnFalse() {
+ return false;
+}
+
+// Support: IE <=9 only
+// See #13393 for more info
+function safeActiveElement() {
+ try {
+ return document.activeElement;
+ } catch ( err ) { }
+}
+
+function on( elem, types, selector, data, fn, one ) {
+ var origFn, type;
+
+ // Types can be a map of types/handlers
+ if ( typeof types === "object" ) {
+
+ // ( types-Object, selector, data )
+ if ( typeof selector !== "string" ) {
+
+ // ( types-Object, data )
+ data = data || selector;
+ selector = undefined;
+ }
+ for ( type in types ) {
+ on( elem, type, selector, data, types[ type ], one );
+ }
+ return elem;
+ }
+
+ if ( data == null && fn == null ) {
+
+ // ( types, fn )
+ fn = selector;
+ data = selector = undefined;
+ } else if ( fn == null ) {
+ if ( typeof selector === "string" ) {
+
+ // ( types, selector, fn )
+ fn = data;
+ data = undefined;
+ } else {
+
+ // ( types, data, fn )
+ fn = data;
+ data = selector;
+ selector = undefined;
+ }
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ } else if ( !fn ) {
+ return elem;
+ }
+
+ if ( one === 1 ) {
+ origFn = fn;
+ fn = function( event ) {
+
+ // Can use an empty set, since event contains the info
+ jQuery().off( event );
+ return origFn.apply( this, arguments );
+ };
+
+ // Use same guid so caller can remove using origFn
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
+ }
+ return elem.each( function() {
+ jQuery.event.add( this, types, fn, data, selector );
+ } );
+}
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ global: {},
+
+ add: function( elem, types, handler, data, selector ) {
+
+ var handleObjIn, eventHandle, tmp,
+ events, t, handleObj,
+ special, handlers, type, namespaces, origType,
+ elemData = dataPriv.get( elem );
+
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
+ if ( !elemData ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ selector = handleObjIn.selector;
+ }
+
+ // Ensure that invalid selectors throw exceptions at attach time
+ // Evaluate against documentElement in case elem is a non-element node (e.g., document)
+ if ( selector ) {
+ jQuery.find.matchesSelector( documentElement, selector );
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ if ( !( events = elemData.events ) ) {
+ events = elemData.events = {};
+ }
+ if ( !( eventHandle = elemData.handle ) ) {
+ eventHandle = elemData.handle = function( e ) {
+
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
+ jQuery.event.dispatch.apply( elem, arguments ) : undefined;
+ };
+ }
+
+ // Handle multiple events separated by a space
+ types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[ t ] ) || [];
+ type = origType = tmp[ 1 ];
+ namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
+
+ // There *must* be a type, no attaching namespace-only handlers
+ if ( !type ) {
+ continue;
+ }
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend( {
+ type: type,
+ origType: origType,
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
+ namespace: namespaces.join( "." )
+ }, handleObjIn );
+
+ // Init the event handler queue if we're the first
+ if ( !( handlers = events[ type ] ) ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener if the special events handler returns false
+ if ( !special.setup ||
+ special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ },
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector, mappedTypes ) {
+
+ var j, origCount, tmp,
+ events, t, handleObj,
+ special, handlers, type, namespaces, origType,
+ elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
+
+ if ( !elemData || !( events = elemData.events ) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[ t ] ) || [];
+ type = origType = tmp[ 1 ];
+ namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+ }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+ handlers = events[ type ] || [];
+ tmp = tmp[ 2 ] &&
+ new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
+
+ // Remove matching events
+ origCount = j = handlers.length;
+ while ( j-- ) {
+ handleObj = handlers[ j ];
+
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
+ ( !handler || handler.guid === handleObj.guid ) &&
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
+ ( !selector || selector === handleObj.selector ||
+ selector === "**" && handleObj.selector ) ) {
+ handlers.splice( j, 1 );
+
+ if ( handleObj.selector ) {
+ handlers.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( origCount && !handlers.length ) {
+ if ( !special.teardown ||
+ special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
+
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove data and the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ dataPriv.remove( elem, "handle events" );
+ }
+ },
+
+ dispatch: function( nativeEvent ) {
+
+ // Make a writable jQuery.Event from the native event object
+ var event = jQuery.event.fix( nativeEvent );
+
+ var i, j, ret, matched, handleObj, handlerQueue,
+ args = new Array( arguments.length ),
+ handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
+ special = jQuery.event.special[ event.type ] || {};
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[ 0 ] = event;
+
+ for ( i = 1; i < arguments.length; i++ ) {
+ args[ i ] = arguments[ i ];
+ }
+
+ event.delegateTarget = this;
+
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+ return;
+ }
+
+ // Determine handlers
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
+
+ // Run delegates first; they may want to stop propagation beneath us
+ i = 0;
+ while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
+ event.currentTarget = matched.elem;
+
+ j = 0;
+ while ( ( handleObj = matched.handlers[ j++ ] ) &&
+ !event.isImmediatePropagationStopped() ) {
+
+ // Triggered event must either 1) have no namespace, or 2) have namespace(s)
+ // a subset or equal to those in the bound event (both can have no namespace).
+ if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
+
+ event.handleObj = handleObj;
+ event.data = handleObj.data;
+
+ ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
+ handleObj.handler ).apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ if ( ( event.result = ret ) === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ // Call the postDispatch hook for the mapped type
+ if ( special.postDispatch ) {
+ special.postDispatch.call( this, event );
+ }
+
+ return event.result;
+ },
+
+ handlers: function( event, handlers ) {
+ var i, handleObj, sel, matchedHandlers, matchedSelectors,
+ handlerQueue = [],
+ delegateCount = handlers.delegateCount,
+ cur = event.target;
+
+ // Find delegate handlers
+ if ( delegateCount &&
+
+ // Support: IE <=9
+ // Black-hole SVG instance trees (trac-13180)
+ cur.nodeType &&
+
+ // Support: Firefox <=42
+ // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
+ // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
+ // Support: IE 11 only
+ // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
+ !( event.type === "click" && event.button >= 1 ) ) {
+
+ for ( ; cur !== this; cur = cur.parentNode || this ) {
+
+ // Don't check non-elements (#13208)
+ // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
+ if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
+ matchedHandlers = [];
+ matchedSelectors = {};
+ for ( i = 0; i < delegateCount; i++ ) {
+ handleObj = handlers[ i ];
+
+ // Don't conflict with Object.prototype properties (#13203)
+ sel = handleObj.selector + " ";
+
+ if ( matchedSelectors[ sel ] === undefined ) {
+ matchedSelectors[ sel ] = handleObj.needsContext ?
+ jQuery( sel, this ).index( cur ) > -1 :
+ jQuery.find( sel, this, null, [ cur ] ).length;
+ }
+ if ( matchedSelectors[ sel ] ) {
+ matchedHandlers.push( handleObj );
+ }
+ }
+ if ( matchedHandlers.length ) {
+ handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
+ }
+ }
+ }
+ }
+
+ // Add the remaining (directly-bound) handlers
+ cur = this;
+ if ( delegateCount < handlers.length ) {
+ handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
+ }
+
+ return handlerQueue;
+ },
+
+ addProp: function( name, hook ) {
+ Object.defineProperty( jQuery.Event.prototype, name, {
+ enumerable: true,
+ configurable: true,
+
+ get: jQuery.isFunction( hook ) ?
+ function() {
+ if ( this.originalEvent ) {
+ return hook( this.originalEvent );
+ }
+ } :
+ function() {
+ if ( this.originalEvent ) {
+ return this.originalEvent[ name ];
+ }
+ },
+
+ set: function( value ) {
+ Object.defineProperty( this, name, {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: value
+ } );
+ }
+ } );
+ },
+
+ fix: function( originalEvent ) {
+ return originalEvent[ jQuery.expando ] ?
+ originalEvent :
+ new jQuery.Event( originalEvent );
+ },
+
+ special: {
+ load: {
+
+ // Prevent triggered image.load events from bubbling to window.load
+ noBubble: true
+ },
+ focus: {
+
+ // Fire native event if possible so blur/focus sequence is correct
+ trigger: function() {
+ if ( this !== safeActiveElement() && this.focus ) {
+ this.focus();
+ return false;
+ }
+ },
+ delegateType: "focusin"
+ },
+ blur: {
+ trigger: function() {
+ if ( this === safeActiveElement() && this.blur ) {
+ this.blur();
+ return false;
+ }
+ },
+ delegateType: "focusout"
+ },
+ click: {
+
+ // For checkbox, fire native event so checked state will be right
+ trigger: function() {
+ if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) {
+ this.click();
+ return false;
+ }
+ },
+
+ // For cross-browser consistency, don't fire native .click() on links
+ _default: function( event ) {
+ return nodeName( event.target, "a" );
+ }
+ },
+
+ beforeunload: {
+ postDispatch: function( event ) {
+
+ // Support: Firefox 20+
+ // Firefox doesn't alert if the returnValue field is not set.
+ if ( event.result !== undefined && event.originalEvent ) {
+ event.originalEvent.returnValue = event.result;
+ }
+ }
+ }
+ }
+};
+
+jQuery.removeEvent = function( elem, type, handle ) {
+
+ // This "if" is needed for plain objects
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle );
+ }
+};
+
+jQuery.Event = function( src, props ) {
+
+ // Allow instantiation without the 'new' keyword
+ if ( !( this instanceof jQuery.Event ) ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = src.defaultPrevented ||
+ src.defaultPrevented === undefined &&
+
+ // Support: Android <=2.3 only
+ src.returnValue === false ?
+ returnTrue :
+ returnFalse;
+
+ // Create target properties
+ // Support: Safari <=6 - 7 only
+ // Target should not be a text node (#504, #13143)
+ this.target = ( src.target && src.target.nodeType === 3 ) ?
+ src.target.parentNode :
+ src.target;
+
+ this.currentTarget = src.currentTarget;
+ this.relatedTarget = src.relatedTarget;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // Create a timestamp if incoming event doesn't have one
+ this.timeStamp = src && src.timeStamp || jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ constructor: jQuery.Event,
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse,
+ isSimulated: false,
+
+ preventDefault: function() {
+ var e = this.originalEvent;
+
+ this.isDefaultPrevented = returnTrue;
+
+ if ( e && !this.isSimulated ) {
+ e.preventDefault();
+ }
+ },
+ stopPropagation: function() {
+ var e = this.originalEvent;
+
+ this.isPropagationStopped = returnTrue;
+
+ if ( e && !this.isSimulated ) {
+ e.stopPropagation();
+ }
+ },
+ stopImmediatePropagation: function() {
+ var e = this.originalEvent;
+
+ this.isImmediatePropagationStopped = returnTrue;
+
+ if ( e && !this.isSimulated ) {
+ e.stopImmediatePropagation();
+ }
+
+ this.stopPropagation();
+ }
+};
+
+// Includes all common event props including KeyEvent and MouseEvent specific props
+jQuery.each( {
+ altKey: true,
+ bubbles: true,
+ cancelable: true,
+ changedTouches: true,
+ ctrlKey: true,
+ detail: true,
+ eventPhase: true,
+ metaKey: true,
+ pageX: true,
+ pageY: true,
+ shiftKey: true,
+ view: true,
+ "char": true,
+ charCode: true,
+ key: true,
+ keyCode: true,
+ button: true,
+ buttons: true,
+ clientX: true,
+ clientY: true,
+ offsetX: true,
+ offsetY: true,
+ pointerId: true,
+ pointerType: true,
+ screenX: true,
+ screenY: true,
+ targetTouches: true,
+ toElement: true,
+ touches: true,
+
+ which: function( event ) {
+ var button = event.button;
+
+ // Add which for key events
+ if ( event.which == null && rkeyEvent.test( event.type ) ) {
+ return event.charCode != null ? event.charCode : event.keyCode;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
+ if ( button & 1 ) {
+ return 1;
+ }
+
+ if ( button & 2 ) {
+ return 3;
+ }
+
+ if ( button & 4 ) {
+ return 2;
+ }
+
+ return 0;
+ }
+
+ return event.which;
+ }
+}, jQuery.event.addProp );
+
+// Create mouseenter/leave events using mouseover/out and event-time checks
+// so that event delegation works in jQuery.
+// Do the same for pointerenter/pointerleave and pointerover/pointerout
+//
+// Support: Safari 7 only
+// Safari sends mouseenter too often; see:
+// https://bugs.chromium.org/p/chromium/issues/detail?id=470258
+// for the description of the bug (it existed in older Chrome versions as well).
+jQuery.each( {
+ mouseenter: "mouseover",
+ mouseleave: "mouseout",
+ pointerenter: "pointerover",
+ pointerleave: "pointerout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ delegateType: fix,
+ bindType: fix,
+
+ handle: function( event ) {
+ var ret,
+ target = this,
+ related = event.relatedTarget,
+ handleObj = event.handleObj;
+
+ // For mouseenter/leave call the handler if related is outside the target.
+ // NB: No relatedTarget if the mouse left/entered the browser window
+ if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
+ event.type = handleObj.origType;
+ ret = handleObj.handler.apply( this, arguments );
+ event.type = fix;
+ }
+ return ret;
+ }
+ };
+} );
+
+jQuery.fn.extend( {
+
+ on: function( types, selector, data, fn ) {
+ return on( this, types, selector, data, fn );
+ },
+ one: function( types, selector, data, fn ) {
+ return on( this, types, selector, data, fn, 1 );
+ },
+ off: function( types, selector, fn ) {
+ var handleObj, type;
+ if ( types && types.preventDefault && types.handleObj ) {
+
+ // ( event ) dispatched jQuery.Event
+ handleObj = types.handleObj;
+ jQuery( types.delegateTarget ).off(
+ handleObj.namespace ?
+ handleObj.origType + "." + handleObj.namespace :
+ handleObj.origType,
+ handleObj.selector,
+ handleObj.handler
+ );
+ return this;
+ }
+ if ( typeof types === "object" ) {
+
+ // ( types-object [, selector] )
+ for ( type in types ) {
+ this.off( type, selector, types[ type ] );
+ }
+ return this;
+ }
+ if ( selector === false || typeof selector === "function" ) {
+
+ // ( types [, fn] )
+ fn = selector;
+ selector = undefined;
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ }
+ return this.each( function() {
+ jQuery.event.remove( this, types, fn, selector );
+ } );
+ }
+} );
+
+
+var
+
+ /* eslint-disable max-len */
+
+ // See https://github.com/eslint/eslint/issues/3229
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
+
+ /* eslint-enable */
+
+ // Support: IE <=10 - 11, Edge 12 - 13
+ // In IE/Edge using regex groups here causes severe slowdowns.
+ // See https://connect.microsoft.com/IE/feedback/details/1736512/
+ rnoInnerhtml = /
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ plotting macro
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Examples
+
+
Installation/Usage:
+
As the package has not been published on PyPi yet, it CANNOT be install using pip.
+
For now, the suggested method is to put the file simpleble.py in the same directory as your source files and call from simpleble import SimpleBleClient, SimpleBleDevice .
+
bluepy must also be installed and imported as shown in the example below.
+For instructions about how to install, as well as the full documentation of, bluepy please refer here
+
+
+
Search for device, connect and read characteristic
+
"""This example demonstrates a simple BLE client that scans for devices,
+connects to a device (GATT server) of choice and continuously reads a characteristic on that device.
+
+The GATT Server in this example runs on an ESP32 with Arduino. For the
+exact script used for this example see `here <https://github.com/nkolban/ESP32_BLE_Arduino/blob/6bad7b42a96f0aa493323ef4821a8efb0e8815f2/examples/BLE_notify/BLE_notify.ino/>`_
+"""
+
+from bluepy.btle import *
+from simpleble import SimpleBleClient , SimpleBleDevice
+
+# The UUID of the characteristic we want to read and the name of the device # we want to read it from
+Characteristic_UUID = "beb5483e-36e1-4688-b7f5-ea07361b26a8"
+Device_Name = "MyESP32"
+
+# Define our scan and notification callback methods
+def myScanCallback ( client , device , isNewDevice , isNewData ):
+ client . _yes = True
+ print ( "#MAC: " + device . addr + " #isNewDevice: " +
+ str ( isNewDevice ) + " #isNewData: " + str ( isNewData ))
+# TODO: NOTIFICATIONS ARE NOT SUPPORTED YET
+# def myNotificationCallback(client, characteristic, data):
+# print("Notification received!")
+# print(" Characteristic UUID: " + characteristic.uuid)
+# print(" Data: " + str(data))
+
+# Instantiate a SimpleBleClient and set it's scan callback
+bleClient = SimpleBleClient ()
+bleClient . setScanCallback ( myScanCallback )
+# TODO: NOTIFICATIONS ARE NOT SUPPORTED YET
+# bleClient.setNotificationCallback(myNotificationCollback)
+
+# Error handling to detect Keyboard interrupt (Ctrl+C)
+# Loop to ensure we can survive connection drops
+while ( not bleClient . isConnected ()):
+ try :
+ # Search for 2 seconds and return a device of interest if found.
+ # Internally this makes a call to bleClient.scan(timeout), thus
+ # triggering the scan callback method when nearby devices are detected
+ device = bleClient . searchDevice ( name = "MyESP32" , timeout = 2 )
+ if ( device is not None ):
+ # If the device was found print out it's info
+ print ( "Found device!!" )
+ device . printInfo ()
+
+ # Proceed to connect to the device
+ print ( "Proceeding to connect...." )
+ if ( bleClient . connect ( device )):
+
+ # Have a peek at the services provided by the device
+ services = device . getServices ()
+ for service in services :
+ print ( "Service [" + str ( service . uuid ) + "]" )
+
+ # Check to see if the device provides a characteristic with the
+ # desired UUID
+ counter = bleClient . getCharacteristics (
+ uuids = [ Characteristic_UUID ])[ 0 ]
+ if ( counter ):
+ # If it does, then we proceed to read its value every second
+ while ( True ):
+ # Error handling ensures that we can survive from
+ # potential connection drops
+ try :
+ # Read the data as bytes and convert to string
+ data_bytes = bleClient . readCharacteristic (
+ counter )
+ data_str = "" . join ( map ( chr , data_bytes ))
+
+ # Now print the data and wait for a second
+ print ( "Data: " + data_str )
+ time . sleep ( 1.0 )
+ except BTLEException as e :
+ # If we get disconnected from the device, keep
+ # looping until we have reconnected
+ if ( e . code == BTLEException . DISCONNECTED ):
+ bleClient . disconnect ()
+ print (
+ "Connection to BLE device has been lost!" )
+ break
+ # while(not bleClient.isConnected()):
+ # bleClient.connect(device)
+
+ else :
+ print ( "Could not connect to device! Retrying in 3 sec..." )
+ time . sleep ( 3.0 )
+ else :
+ print ( "Device not found! Retrying in 3 sec..." )
+ time . sleep ( 3.0 )
+ except BTLEException as e :
+ # If we get disconnected from the device, keep
+ # looping until we have reconnected
+ if ( e . code == BTLEException . DISCONNECTED ):
+ bleClient . disconnect ()
+ print (
+ "Connection to BLE device has been lost!" )
+ break
+ except KeyboardInterrupt as e :
+ # Detect keyboard interrupt and close down
+ # bleClient gracefully
+ bleClient . disconnect ()
+ raise e
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+