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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/x_01b_all_vars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ N_JOBS=4


i=0
for var in MET HT ST WPT; do
for var in MET HT ST WPT lepton_pt abs_lepton_eta NJets; do
echo "Fitting distribution: $var"
nohup time python src/cross_section_measurement/01_get_ttjet_normalisation.py -v $var -i config/measurements/background_subtraction &> logs/01_${var}_bgs_13TeV_fullPS.log &
let i+=1
Expand All @@ -17,7 +17,7 @@ for var in MET HT ST WPT; do
done

wait;
for var in MET HT ST WPT; do
for var in MET HT ST WPT lepton_pt abs_lepton_eta NJets; do
echo "Fitting distribution: $var"
nohup time python src/cross_section_measurement/01_get_ttjet_normalisation.py -v $var -i config/measurements/background_subtraction --visiblePS &> logs/01_${var}_bgs_13TeV_visiblePS.log &
let i+=1
Expand Down
2 changes: 1 addition & 1 deletion bin/x_02b_all_vars
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
echo "This will take a while ... grab a coffee/tea/water"
mkdir -p logs
N_JOBS=3
N_JOBS=4

i=0

Expand Down
36 changes: 18 additions & 18 deletions bin/x_05_all_vars
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,32 @@ mkdir -p logs
mkdir -p plots
fit_var="M3,angle_bl"
nice_fit_var=`echo $fit_var | sed 's/,/_/g'`
N_JOBS=4
N_JOBS=1

echo "Using the fit variable(s): $fit_var"
# input_folder=/hdfs/TopQuarkGroup/run2/dpsData/data/normalisation/background_subtraction/
input_folder=data/normalisation/background_subtraction/
output_folder=tables/background_subtraction/
com=13
typical_systematics="${output_folder}/${com}TeV/FullPS/typical_systematics_${com}TeV_combined.tex"
typical_systematics_vis="${output_folder}/${com}TeV/VisiblePS/typical_systematics_${com}TeV_combined_vis.tex"
if [ -f $typical_systematics ];
typical_systematics_vis="${output_folder}/${com}TeV/VisiblePS/typical_systematics_${com}TeV_combined.tex"
if [ -e $typical_systematics ];
then
echo "Cleaning up old typical systematics file for full phase space"
rm $typical_systematics
fi

if [ -f $typical_systematics_vis ];
if [ -e $typical_systematics_vis ];
then
echo "Cleaning up old typical systematics file for visible phase space"
rm $typical_systematics_vis
fi

echo "Visible phase space ..."
i=0
for var in MET HT ST WPT lepton_pt abs_lepton_eta NJets; do
echo "Tabulating diff. x-section for distribution: $var"
nohup time python src/cross_section_measurement/05_make_tables.py -v $var -c $com -p $input_folder -o $output_folder -a &> logs/05_${var}_table_${com}TeV.log &
nohup time python src/cross_section_measurement/05_make_tables.py -v $var -c 13 -p $input_folder -o $output_folder -a --visiblePS &> logs/05_${var}_table_13TeV_vis.log &
let i+=1
if (( $i % N_JOBS == 0 ))
then
Expand All @@ -37,18 +38,17 @@ for var in MET HT ST WPT lepton_pt abs_lepton_eta NJets; do
fi
done

wait;

echo "Now visible phase space ..."
i=0
for var in MET HT ST WPT lepton_pt abs_lepton_eta NJets; do
echo "Tabulating diff. x-section for distribution: $var"
nohup time python src/cross_section_measurement/05_make_tables.py -v $var -c 13 -p $input_folder -o $output_folder -a --visiblePS &> logs/05_${var}_table_13TeV_vis.log &
let i+=1
if (( $i % N_JOBS == 0 ))
then
echo "Waiting on the above to finish."
wait;
fi
done
# for var in MET HT ST WPT lepton_pt abs_lepton_eta NJets; do
# echo "Tabulating diff. x-section for distribution: $var"
# nohup time python src/cross_section_measurement/05_make_tables.py -v $var -c $com -p $input_folder -o $output_folder -a &> logs/05_${var}_table_${com}TeV.log &
# let i+=1
# if (( $i % N_JOBS == 0 ))
# then
# echo "Waiting on the above to finish."
# wait;
# fi
# done

wait;
echo "All done!"
2 changes: 1 addition & 1 deletion config/CMS.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}

y_axis_title_small = {
'fontsize':40,
'fontsize':50,
'position' : (0, 1.),
'verticalalignment': 'bottom',
'horizontalalignment': 'right'
Expand Down
36 changes: 32 additions & 4 deletions config/cross_section_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class XSectionConfig():
current_analysis_path = '/hdfs/TopQuarkGroup/run2/atOutput/'
known_centre_of_mass_energies = [7,8,13]
# has to be separate as many variables depend on it
luminosities = {7:5050, 8:19584, 13:40.028}
luminosities = {7:5050, 8:19584, 13:41.62912}
parameters = ['SingleTop_category_templates', 'SingleTop_category_templates_trees', 'SingleTop_file',
'VJets_category_templates', 'VJets_category_templates_trees', 'analysis_types',
'categories_and_prefixes', 'central_general_template',
Expand Down Expand Up @@ -185,6 +185,8 @@ def __fill_defaults__( self ):
# 'LightJet_down':'_minusLightJet',
# 'LightJet_up':'_plusLightJet',

'PileUpSystematic' : '',


# Other MET uncertainties not already included
'ElectronEnUp' : '',
Expand Down Expand Up @@ -292,6 +294,10 @@ def __fill_defaults__( self ):
self.ttbar_scaledown_category_templates_trees = path_to_files + '/TTJets_PowhegPythia8_scaledown_tree.root'
self.ttbar_mtop1695_category_templates_trees = path_to_files + '/TTJets_PowhegPythia8_mtop1695_tree.root'
self.ttbar_mtop1755_category_templates_trees = path_to_files + '/TTJets_PowhegPythia8_mtop1755_tree.root'
self.ttbar_jesup_category_templates_trees = path_to_files + '/TTJets_PowhegPythia8_plusJES_tree.root'
self.ttbar_jesdown_category_templates_trees = path_to_files + '/TTJets_PowhegPythia8_minusJES_tree.root'
self.ttbar_jerup_category_templates_trees = path_to_files + '/TTJets_PowhegPythia8_plusJER_tree.root'
self.ttbar_jerdown_category_templates_trees = path_to_files + '/TTJets_PowhegPythia8_minusJER_tree.root'

self.data_muon_category_templates = {
'central': self.data_file_muon,
Expand Down Expand Up @@ -347,6 +353,26 @@ def __fill_defaults__( self ):
self.unfolding_matching_up = self.unfolding_matching_up_raw.replace( '.root', '_asymmetric.root' )
self.unfolding_mass_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_massdown_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_mass_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_massup_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_Lepton_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_leptondown_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_Lepton_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_leptonup_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_jes_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_jesdown_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_jes_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_jesup_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_jer_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_jerdown_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_jer_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_jerup_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_bjet_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_bjetdown_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_bjet_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_bjetup_asymmetric.root' % self.centre_of_mass_energy

self.unfolding_ElectronEn_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_ElectronEnDown_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_ElectronEn_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_ElectronEnUp_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_MuonEn_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_MuonEnDown_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_MuonEn_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_MuonEnUp_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_TauEn_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_TauEnDown_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_TauEn_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_TauEnUp_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_UnclusteredEn_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_UnclusteredEnDown_asymmetric.root' % self.centre_of_mass_energy
self.unfolding_UnclusteredEn_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_UnclusteredEnUp_asymmetric.root' % self.centre_of_mass_energy

self.unfolding_PUSystematic = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_pileupSystematic_asymmetric.root' % self.centre_of_mass_energy


self.unfolding_pdfweights = {index : path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_asymmetric_generatorWeight_%d.root' % (self.centre_of_mass_energy, index) for index in range( 9, 109 )}

Expand Down Expand Up @@ -393,8 +419,8 @@ def __fill_defaults__( self ):
'Lepton selection efficiency': [('Electron_down', 'Electron_up'), ('Muon_down', 'Muon_up')],
'Jet energy \& resolution': [('JES_down', 'JES_up', 'JER_down', 'JER_up')],
'B-tagging' : [('BJet_down', 'BJet_up')],
'MET' : [('ElectronEnDown', 'ElectronEnUp'), ('MuonEnDown','MuonEnUp'),('TauEnDown','TauEnUp'),('UnclusteredEnDown','UnclusteredEnUp')],
'Normalisation': [
'\met' : [('ElectronEnDown', 'ElectronEnUp'), ('MuonEnDown','MuonEnUp'),('TauEnDown','TauEnUp'),('UnclusteredEnDown','UnclusteredEnUp')],
'Background Normalisation': [
# ('TTJet_cross_section-', 'TTJet_cross_section+'),
('SingleTop_cross_section-', 'SingleTop_cross_section+'),
('luminosity-', 'luminosity+'),
Expand All @@ -404,6 +430,7 @@ def __fill_defaults__( self ):
'Hadronisation': [('TTJets_hadronisation', 'TTJets_hadronisation')],
'NLO generator': [('TTJets_NLOgenerator', 'TTJets_NLOgenerator')],
'PDF': [('PDF_total_lower', 'PDF_total_upper')],
'Pileup' : [('PileUpSystematic','PileUpSystematic')],
'QCD shape': [('QCD_shape', 'QCD_shape')]
}
self.typical_systematics = []
Expand Down Expand Up @@ -524,7 +551,8 @@ def __fill_defaults_13TeV__( self ):
middle = self.middle
path_to_files = self.path_to_files

self.new_luminosity = 40.028 # pb^-1
# self.new_luminosity = 40.028 # pb^-1
self.new_luminosity = 41.62912 # pb^-1
self.ttbar_xsection = 831.76 # pb

self.rate_changing_systematics = {#TODO check where this is used
Expand Down
41 changes: 29 additions & 12 deletions config/latex_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,22 @@
'ttbarM': '\ensuremath{M_\mathrm{t\\bar{t}}}',
'ttbarRap': '\ensuremath{y_{\mathrm{t\\bar{t}}}}',
'NJets': '\ensuremath{N_{\mathrm{Jets}}}',
'lepton_pt': '\ensuremath{ \mathrm{lepton} p_{\mathrm{T}} }',
'lepton_eta': '\ensuremath{ \mathrm{lepton} \eta }',
'abs_lepton_eta': '\ensuremath{ \mathrm{lepton} |\eta| }',
'lepton_pt': '\ensuremath{ p_{\mathrm{T}}^\mathrm{l} }',
'lepton_eta': '\ensuremath{ \eta^\mathrm{l} }',
'abs_lepton_eta': '\ensuremath{ |\eta^\mathrm{l}| }',
'bjets_pt': '\ensuremath{ \mathrm{b-jet} p_{\mathrm{T}} }',
'bjets_eta': '\ensuremath{ \mathrm{b-jet} \eta }',
'sigmaietaieta' : '\ensuremath{\sigma_{i\eta i \eta}}',
}

variables_NonLatex = {
'MET': 'MET',
'HT': 'HT',
'ST': 'ST',
'WPT': 'WPT',
'NJets': 'N Jets',
'lepton_pt': 'lepton pt',
'abs_lepton_eta': 'lepton eta',
}

control_plots_latex = {
Expand All @@ -53,19 +63,23 @@
'MADGRAPH': '$t\\bar{t}$ (MADGRAPH+Pythia)',
'MADGRAPH_ptreweight': '$t\\bar{t}$ (MADGRAPH+$p_\mathrm{T}^\mathrm{reweight}$)',
'amcatnlo': 'aMC@NLO',
'madgraphMLM': 'MADGRAPHMLM',
'madgraphMLM': 'Madgraph',
'POWHEG_PYTHIA': '$t\\bar{t}$ (POWHEG+Pythia)',
'POWHEG_HERWIG': '$t\\bar{t}$ (POWHEG+Herwig)',
'powhegPythia8': 'POWHEG+Pythia8',
'POWHEG_HERWIG': 'Powheg Herwig++',
'powhegPythia8': 'Powheg Pythia8',
'pythia8': '$t\\bar{t}$ (Pythia8)',
'matchingdown': '$t\\bar{t}$ (matching down)',
'matchingup': '$t\\bar{t}$ (matching up)',
'scaledown': '$t\\bar{t}$ ($Q^{2}$ down)',
'scaleup': '$t\\bar{t}$ ($Q^{2}$ up)',
# 'scaledown': '$t\\bar{t}$ ($Q^{2}$ down)',
# 'scaleup': '$t\\bar{t}$ ($Q^{2}$ up)',
'scaledown': '$Q^{2}$ down',
'scaleup': '$Q^{2}$ up',
'TTJets_matchingdown': '$t\\bar{t}$ (matching down)',
'TTJets_matchingup': '$t\\bar{t}$ (matching up)',
'TTJets_scaledown': '$t\\bar{t}$ ($Q^{2}$ down)',
'TTJets_scaleup': '$t\\bar{t}$ ($Q^{2}$ up)',
# 'TTJets_scaledown': '$t\\bar{t}$ ($Q^{2}$ down)',
# 'TTJets_scaleup': '$t\\bar{t}$ ($Q^{2}$ up)',
'TTJets_scaledown': '$Q^{2}$ down',
'TTJets_scaleup': '$Q^{2}$ up',
'TTJets_massdown': '$t\\bar{t}$ (top mass down)',
'TTJets_massup': '$t\\bar{t}$ (top mass up)',
'VJets_matchingdown': 'V+jets (matching down)',
Expand All @@ -84,6 +98,7 @@
'LightJet_up': 'b-tagging mis-tag rate $+1\sigma$',
'PU_down': 'Pile-up $-1\sigma$',
'PU_up': 'Pile-up $+1\sigma$',
'PileUpSystematic' : 'Pile-up',
'central': 'central',
#'ptreweight_max': '$p_\mathrm{T}(t,\\bar{t})$ reweighting',
'TTJets_hadronisation': 'Hadronisation uncertainty',
Expand Down Expand Up @@ -113,8 +128,10 @@
'SingleTop_cross_section+': 'Single top cross section \ensuremath{+1\sigma}',
'luminosity-': 'Luminosity \ensuremath{-1\sigma}',
'luminosity+': 'Luminosity \ensuremath{+1\sigma}',
'massdown': '\ensuremath{t\\bar{t}} (top mass down)',
'massup': '\ensuremath{t\\bar{t}} (top mass up)',
# 'massdown': '\ensuremath{t\\bar{t}} (top mass down)',
# 'massup': '\ensuremath{t\\bar{t}} (top mass up)',
'massdown': 'Top mass down',
'massup': 'Top mass up',
}

met_systematics_latex = {
Expand Down
2 changes: 2 additions & 0 deletions config/variable_binning.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
'WPT' : [i * 25 for i in range ( 0, 17 )],
'HT' : [i * 50 for i in range ( 0, 21 )],
'ST' : [i * 50 for i in range ( 2, 25 )],
# 'sigmaietaieta' : [i * 0.001 for i in range ( 12, 40 )],
'sigmaietaieta' : [i * 0.002 for i in range ( 0, 20 )],
}


Expand Down
Loading