Skip to content

Commit 9f993fb

Browse files
committed
Merge pull request BristolTopGroup#289 from kreczko/approval
Approval sprint (superseding BristolTopGroup#288)
2 parents c79c657 + c9a1d0a commit 9f993fb

20 files changed

+1450
-387
lines changed

bin/x_01b_all_vars

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ N_JOBS=4
55

66

77
i=0
8-
for var in MET HT ST WPT; do
8+
for var in MET HT ST WPT lepton_pt abs_lepton_eta NJets; do
99
echo "Fitting distribution: $var"
1010
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 &
1111
let i+=1
@@ -17,7 +17,7 @@ for var in MET HT ST WPT; do
1717
done
1818

1919
wait;
20-
for var in MET HT ST WPT; do
20+
for var in MET HT ST WPT lepton_pt abs_lepton_eta NJets; do
2121
echo "Fitting distribution: $var"
2222
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 &
2323
let i+=1

bin/x_02b_all_vars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
echo "This will take a while ... grab a coffee/tea/water"
33
mkdir -p logs
4-
N_JOBS=3
4+
N_JOBS=4
55

66
i=0
77

bin/x_05_all_vars

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,32 @@ mkdir -p logs
44
mkdir -p plots
55
fit_var="M3,angle_bl"
66
nice_fit_var=`echo $fit_var | sed 's/,/_/g'`
7-
N_JOBS=4
7+
N_JOBS=1
88

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

22-
if [ -f $typical_systematics_vis ];
22+
if [ -e $typical_systematics_vis ];
2323
then
2424
echo "Cleaning up old typical systematics file for visible phase space"
2525
rm $typical_systematics_vis
2626
fi
2727

28+
echo "Visible phase space ..."
2829
i=0
2930
for var in MET HT ST WPT lepton_pt abs_lepton_eta NJets; do
3031
echo "Tabulating diff. x-section for distribution: $var"
31-
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 &
32+
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 &
3233
let i+=1
3334
if (( $i % N_JOBS == 0 ))
3435
then
@@ -37,18 +38,17 @@ for var in MET HT ST WPT lepton_pt abs_lepton_eta NJets; do
3738
fi
3839
done
3940

40-
wait;
41-
42-
echo "Now visible phase space ..."
4341
i=0
44-
for var in MET HT ST WPT lepton_pt abs_lepton_eta NJets; do
45-
echo "Tabulating diff. x-section for distribution: $var"
46-
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 &
47-
let i+=1
48-
if (( $i % N_JOBS == 0 ))
49-
then
50-
echo "Waiting on the above to finish."
51-
wait;
52-
fi
53-
done
42+
# for var in MET HT ST WPT lepton_pt abs_lepton_eta NJets; do
43+
# echo "Tabulating diff. x-section for distribution: $var"
44+
# 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 &
45+
# let i+=1
46+
# if (( $i % N_JOBS == 0 ))
47+
# then
48+
# echo "Waiting on the above to finish."
49+
# wait;
50+
# fi
51+
# done
52+
53+
wait;
5454
echo "All done!"

config/CMS.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}
2323

2424
y_axis_title_small = {
25-
'fontsize':40,
25+
'fontsize':50,
2626
'position' : (0, 1.),
2727
'verticalalignment': 'bottom',
2828
'horizontalalignment': 'right'

config/cross_section_config.py

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class XSectionConfig():
55
current_analysis_path = '/hdfs/TopQuarkGroup/run2/atOutput/'
66
known_centre_of_mass_energies = [7,8,13]
77
# has to be separate as many variables depend on it
8-
luminosities = {7:5050, 8:19584, 13:40.028}
8+
luminosities = {7:5050, 8:19584, 13:41.62912}
99
parameters = ['SingleTop_category_templates', 'SingleTop_category_templates_trees', 'SingleTop_file',
1010
'VJets_category_templates', 'VJets_category_templates_trees', 'analysis_types',
1111
'categories_and_prefixes', 'central_general_template',
@@ -185,6 +185,8 @@ def __fill_defaults__( self ):
185185
# 'LightJet_down':'_minusLightJet',
186186
# 'LightJet_up':'_plusLightJet',
187187

188+
'PileUpSystematic' : '',
189+
188190

189191
# Other MET uncertainties not already included
190192
'ElectronEnUp' : '',
@@ -292,6 +294,10 @@ def __fill_defaults__( self ):
292294
self.ttbar_scaledown_category_templates_trees = path_to_files + '/TTJets_PowhegPythia8_scaledown_tree.root'
293295
self.ttbar_mtop1695_category_templates_trees = path_to_files + '/TTJets_PowhegPythia8_mtop1695_tree.root'
294296
self.ttbar_mtop1755_category_templates_trees = path_to_files + '/TTJets_PowhegPythia8_mtop1755_tree.root'
297+
self.ttbar_jesup_category_templates_trees = path_to_files + '/TTJets_PowhegPythia8_plusJES_tree.root'
298+
self.ttbar_jesdown_category_templates_trees = path_to_files + '/TTJets_PowhegPythia8_minusJES_tree.root'
299+
self.ttbar_jerup_category_templates_trees = path_to_files + '/TTJets_PowhegPythia8_plusJER_tree.root'
300+
self.ttbar_jerdown_category_templates_trees = path_to_files + '/TTJets_PowhegPythia8_minusJER_tree.root'
295301

296302
self.data_muon_category_templates = {
297303
'central': self.data_file_muon,
@@ -347,6 +353,26 @@ def __fill_defaults__( self ):
347353
self.unfolding_matching_up = self.unfolding_matching_up_raw.replace( '.root', '_asymmetric.root' )
348354
self.unfolding_mass_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_massdown_asymmetric.root' % self.centre_of_mass_energy
349355
self.unfolding_mass_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_massup_asymmetric.root' % self.centre_of_mass_energy
356+
self.unfolding_Lepton_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_leptondown_asymmetric.root' % self.centre_of_mass_energy
357+
self.unfolding_Lepton_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_leptonup_asymmetric.root' % self.centre_of_mass_energy
358+
self.unfolding_jes_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_jesdown_asymmetric.root' % self.centre_of_mass_energy
359+
self.unfolding_jes_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_jesup_asymmetric.root' % self.centre_of_mass_energy
360+
self.unfolding_jer_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_jerdown_asymmetric.root' % self.centre_of_mass_energy
361+
self.unfolding_jer_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_jerup_asymmetric.root' % self.centre_of_mass_energy
362+
self.unfolding_bjet_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_bjetdown_asymmetric.root' % self.centre_of_mass_energy
363+
self.unfolding_bjet_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_bjetup_asymmetric.root' % self.centre_of_mass_energy
364+
365+
self.unfolding_ElectronEn_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_ElectronEnDown_asymmetric.root' % self.centre_of_mass_energy
366+
self.unfolding_ElectronEn_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_ElectronEnUp_asymmetric.root' % self.centre_of_mass_energy
367+
self.unfolding_MuonEn_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_MuonEnDown_asymmetric.root' % self.centre_of_mass_energy
368+
self.unfolding_MuonEn_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_MuonEnUp_asymmetric.root' % self.centre_of_mass_energy
369+
self.unfolding_TauEn_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_TauEnDown_asymmetric.root' % self.centre_of_mass_energy
370+
self.unfolding_TauEn_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_TauEnUp_asymmetric.root' % self.centre_of_mass_energy
371+
self.unfolding_UnclusteredEn_down = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_UnclusteredEnDown_asymmetric.root' % self.centre_of_mass_energy
372+
self.unfolding_UnclusteredEn_up = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_UnclusteredEnUp_asymmetric.root' % self.centre_of_mass_energy
373+
374+
self.unfolding_PUSystematic = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_pileupSystematic_asymmetric.root' % self.centre_of_mass_energy
375+
350376

351377
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 )}
352378

@@ -393,8 +419,8 @@ def __fill_defaults__( self ):
393419
'Lepton selection efficiency': [('Electron_down', 'Electron_up'), ('Muon_down', 'Muon_up')],
394420
'Jet energy \& resolution': [('JES_down', 'JES_up', 'JER_down', 'JER_up')],
395421
'B-tagging' : [('BJet_down', 'BJet_up')],
396-
'MET' : [('ElectronEnDown', 'ElectronEnUp'), ('MuonEnDown','MuonEnUp'),('TauEnDown','TauEnUp'),('UnclusteredEnDown','UnclusteredEnUp')],
397-
'Normalisation': [
422+
'\met' : [('ElectronEnDown', 'ElectronEnUp'), ('MuonEnDown','MuonEnUp'),('TauEnDown','TauEnUp'),('UnclusteredEnDown','UnclusteredEnUp')],
423+
'Background Normalisation': [
398424
# ('TTJet_cross_section-', 'TTJet_cross_section+'),
399425
('SingleTop_cross_section-', 'SingleTop_cross_section+'),
400426
('luminosity-', 'luminosity+'),
@@ -404,6 +430,7 @@ def __fill_defaults__( self ):
404430
'Hadronisation': [('TTJets_hadronisation', 'TTJets_hadronisation')],
405431
'NLO generator': [('TTJets_NLOgenerator', 'TTJets_NLOgenerator')],
406432
'PDF': [('PDF_total_lower', 'PDF_total_upper')],
433+
'Pileup' : [('PileUpSystematic','PileUpSystematic')],
407434
'QCD shape': [('QCD_shape', 'QCD_shape')]
408435
}
409436
self.typical_systematics = []
@@ -524,7 +551,8 @@ def __fill_defaults_13TeV__( self ):
524551
middle = self.middle
525552
path_to_files = self.path_to_files
526553

527-
self.new_luminosity = 40.028 # pb^-1
554+
# self.new_luminosity = 40.028 # pb^-1
555+
self.new_luminosity = 41.62912 # pb^-1
528556
self.ttbar_xsection = 831.76 # pb
529557

530558
self.rate_changing_systematics = {#TODO check where this is used

config/latex_labels.py

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,22 @@
2828
'ttbarM': '\ensuremath{M_\mathrm{t\\bar{t}}}',
2929
'ttbarRap': '\ensuremath{y_{\mathrm{t\\bar{t}}}}',
3030
'NJets': '\ensuremath{N_{\mathrm{Jets}}}',
31-
'lepton_pt': '\ensuremath{ \mathrm{lepton} p_{\mathrm{T}} }',
32-
'lepton_eta': '\ensuremath{ \mathrm{lepton} \eta }',
33-
'abs_lepton_eta': '\ensuremath{ \mathrm{lepton} |\eta| }',
31+
'lepton_pt': '\ensuremath{ p_{\mathrm{T}}^\mathrm{l} }',
32+
'lepton_eta': '\ensuremath{ \eta^\mathrm{l} }',
33+
'abs_lepton_eta': '\ensuremath{ |\eta^\mathrm{l}| }',
3434
'bjets_pt': '\ensuremath{ \mathrm{b-jet} p_{\mathrm{T}} }',
3535
'bjets_eta': '\ensuremath{ \mathrm{b-jet} \eta }',
36+
'sigmaietaieta' : '\ensuremath{\sigma_{i\eta i \eta}}',
37+
}
3638

39+
variables_NonLatex = {
40+
'MET': 'MET',
41+
'HT': 'HT',
42+
'ST': 'ST',
43+
'WPT': 'WPT',
44+
'NJets': 'N Jets',
45+
'lepton_pt': 'lepton pt',
46+
'abs_lepton_eta': 'lepton eta',
3747
}
3848

3949
control_plots_latex = {
@@ -53,19 +63,23 @@
5363
'MADGRAPH': '$t\\bar{t}$ (MADGRAPH+Pythia)',
5464
'MADGRAPH_ptreweight': '$t\\bar{t}$ (MADGRAPH+$p_\mathrm{T}^\mathrm{reweight}$)',
5565
'amcatnlo': 'aMC@NLO',
56-
'madgraphMLM': 'MADGRAPHMLM',
66+
'madgraphMLM': 'Madgraph',
5767
'POWHEG_PYTHIA': '$t\\bar{t}$ (POWHEG+Pythia)',
58-
'POWHEG_HERWIG': '$t\\bar{t}$ (POWHEG+Herwig)',
59-
'powhegPythia8': 'POWHEG+Pythia8',
68+
'POWHEG_HERWIG': 'Powheg Herwig++',
69+
'powhegPythia8': 'Powheg Pythia8',
6070
'pythia8': '$t\\bar{t}$ (Pythia8)',
6171
'matchingdown': '$t\\bar{t}$ (matching down)',
6272
'matchingup': '$t\\bar{t}$ (matching up)',
63-
'scaledown': '$t\\bar{t}$ ($Q^{2}$ down)',
64-
'scaleup': '$t\\bar{t}$ ($Q^{2}$ up)',
73+
# 'scaledown': '$t\\bar{t}$ ($Q^{2}$ down)',
74+
# 'scaleup': '$t\\bar{t}$ ($Q^{2}$ up)',
75+
'scaledown': '$Q^{2}$ down',
76+
'scaleup': '$Q^{2}$ up',
6577
'TTJets_matchingdown': '$t\\bar{t}$ (matching down)',
6678
'TTJets_matchingup': '$t\\bar{t}$ (matching up)',
67-
'TTJets_scaledown': '$t\\bar{t}$ ($Q^{2}$ down)',
68-
'TTJets_scaleup': '$t\\bar{t}$ ($Q^{2}$ up)',
79+
# 'TTJets_scaledown': '$t\\bar{t}$ ($Q^{2}$ down)',
80+
# 'TTJets_scaleup': '$t\\bar{t}$ ($Q^{2}$ up)',
81+
'TTJets_scaledown': '$Q^{2}$ down',
82+
'TTJets_scaleup': '$Q^{2}$ up',
6983
'TTJets_massdown': '$t\\bar{t}$ (top mass down)',
7084
'TTJets_massup': '$t\\bar{t}$ (top mass up)',
7185
'VJets_matchingdown': 'V+jets (matching down)',
@@ -84,6 +98,7 @@
8498
'LightJet_up': 'b-tagging mis-tag rate $+1\sigma$',
8599
'PU_down': 'Pile-up $-1\sigma$',
86100
'PU_up': 'Pile-up $+1\sigma$',
101+
'PileUpSystematic' : 'Pile-up',
87102
'central': 'central',
88103
#'ptreweight_max': '$p_\mathrm{T}(t,\\bar{t})$ reweighting',
89104
'TTJets_hadronisation': 'Hadronisation uncertainty',
@@ -113,8 +128,10 @@
113128
'SingleTop_cross_section+': 'Single top cross section \ensuremath{+1\sigma}',
114129
'luminosity-': 'Luminosity \ensuremath{-1\sigma}',
115130
'luminosity+': 'Luminosity \ensuremath{+1\sigma}',
116-
'massdown': '\ensuremath{t\\bar{t}} (top mass down)',
117-
'massup': '\ensuremath{t\\bar{t}} (top mass up)',
131+
# 'massdown': '\ensuremath{t\\bar{t}} (top mass down)',
132+
# 'massup': '\ensuremath{t\\bar{t}} (top mass up)',
133+
'massdown': 'Top mass down',
134+
'massup': 'Top mass up',
118135
}
119136

120137
met_systematics_latex = {

config/variable_binning.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@
8888
'WPT' : [i * 25 for i in range ( 0, 17 )],
8989
'HT' : [i * 50 for i in range ( 0, 21 )],
9090
'ST' : [i * 50 for i in range ( 2, 25 )],
91+
# 'sigmaietaieta' : [i * 0.001 for i in range ( 12, 40 )],
92+
'sigmaietaieta' : [i * 0.002 for i in range ( 0, 20 )],
9193
}
9294

9395

0 commit comments

Comments
 (0)