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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions dps/analysis/xsection/02_unfold_and_measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,6 @@ def parse_arguments():
for category in all_measurements:
if run_just_central and not category == 'central':
continue

if ( variable in measurement_config.variables_no_met ) and (category in measurement_config.met_specific_systematics):
continue
print 'Unfolding category {}'.format(category)
Expand Down Expand Up @@ -1280,13 +1279,26 @@ def parse_arguments():
elif category == 'Electron_up' or category == 'Electron_down':
normalisation_results_electron = read_tuple_from_file( electron_file )
normalisation_results_muon = read_tuple_from_file( path_to_DF + '/central/normalisation_muon.txt' )
elif category == 'QCD_shape_electron' or category == 'QCD_cross_section_electron':
if category == 'QCD_shape_electron':
normalisation_results_electron = read_tuple_from_file( electron_file.replace('QCD_shape_electron','QCD_shape') )
else:
normalisation_results_electron = read_tuple_from_file( electron_file.replace('QCD_cross_section_electron','QCD_cross_section') )

normalisation_results_muon = read_tuple_from_file( path_to_DF + '/central/normalisation_muon.txt' )
elif category == 'QCD_shape_muon' or category == 'QCD_cross_section_muon':
normalisation_results_electron = read_tuple_from_file( path_to_DF + '/central/normalisation_electron.txt' )
if category == 'QCD_shape_muon':
normalisation_results_muon = read_tuple_from_file( muon_file.replace('QCD_shape_muon','QCD_shape') )
else:
normalisation_results_muon = read_tuple_from_file( muon_file.replace('QCD_cross_section_muon','QCD_cross_section') )
else:
normalisation_results_electron = read_tuple_from_file( electron_file )
normalisation_results_muon = read_tuple_from_file( muon_file )

# Add additional 50% uncertainty here instead of 03. Can do it before combining channels.
# I think this is the correct way of doing it.
if category == 'QCD_cross_section':
if category == 'QCD_cross_section' or category == 'QCD_cross_section_electron':
for i in range(0, len(normalisation_results_electron['QCD']) ):
normalisation_results_electron['QCD'][i] = tuple([1.5*x for x in normalisation_results_electron['QCD'][i]])

Expand Down
2 changes: 2 additions & 0 deletions dps/analysis/xsection/05_make_systematic_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def plot_systematic_uncertainties(systematic_uncertainties, bin_edges, variable,
x_limits = [bin_edges[0], bin_edges[-1]]
# y_limits = [-0.6,0.6]
y_limits = [0,0.4]
if 'abs_lepton_eta' in variable and 'normalised' in output_folder:
y_limits = [0,0.05]

fig_syst = plt.figure( figsize = ( 20, 16 ), dpi = 400, facecolor = 'white' )
ax_syst = fig_syst.add_subplot(1, 1, 1)
Expand Down
40 changes: 30 additions & 10 deletions dps/config/xsection.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __fill_defaults__( self ):

# self.path_to_unfolding_histograms = '/hdfs/TopQuarkGroup/run2/unfolding/13TeV/Moriond2017/'
# self.path_to_unfolding_histograms = '/hdfs/TopQuarkGroup/run2/unfolding/13TeV/EPS2017/'
self.path_to_unfolding_histograms = 'unfolding/13TeV/'
self.path_to_unfolding_histograms = 'unfolding/13TeV_debug/'

path_to_unfolding_histograms = self.path_to_unfolding_histograms

Expand Down Expand Up @@ -203,6 +203,12 @@ def __fill_defaults__( self ):
'QCD_cross_section',
'QCD_shape',

'QCD_cross_section_electron',
'QCD_shape_electron',

'QCD_cross_section_muon',
'QCD_shape_muon',

'QCD_other_control_region',
'QCD_signal_MC'
]
Expand Down Expand Up @@ -243,14 +249,24 @@ def __fill_defaults__( self ):
self.measurements = self.normalisation_systematics + self.generator_systematics

self.list_of_systematics = {
# Theoretical Uncertainties (Rate Changing)
# # Theoretical Uncertainties (Rate Changing)
'V+Jets_cross_section' : ['V+Jets_cross_section+', 'V+Jets_cross_section-'],
'QCD_cross_section' : ['QCD_cross_section', 'QCD_cross_section'],
# 'QCD_cross_section' : ['QCD_cross_section', 'QCD_cross_section'],
'SingleTop_cross_section' : ['SingleTop_cross_section+', 'SingleTop_cross_section-'],
'luminosity' : ['luminosity+', 'luminosity-'],
# QCD Shape
'QCD_shape' : ['QCD_shape', 'QCD_shape'],
# Generator Uncertainties
# 'QCD_shape' : ['QCD_shape', 'QCD_shape'],

'QCD_shape_electron' : ['QCD_shape_electron', 'QCD_shape_electron'],
'QCD_cross_section_electron' : ['QCD_cross_section_electron', 'QCD_cross_section_electron'],

'QCD_shape_muon' : ['QCD_shape_muon', 'QCD_shape_muon'],
'QCD_cross_section_muon' : ['QCD_cross_section_muon', 'QCD_cross_section_muon'],

# 'QCD_other_control_region' : ['QCD_other_control_region', 'QCD_other_control_region'],


# # Generator Uncertainties
'TTJets_mass' : ['TTJets_massup', 'TTJets_massdown'],
'TTJets_ue' : ['TTJets_ueup', 'TTJets_uedown'],
'TTJets_topPt' : ['TTJets_topPt', 'TTJets_topPt'],
Expand All @@ -260,10 +276,10 @@ def __fill_defaults__( self ):
'TTJets_fsrup', 'TTJets_fsrdown',
'TTJets_isrup', 'TTJets_isrdown'
],
# 'TTJets_fsr' : ['TTJets_fsrup', 'TTJets_fsrdown'],
# 'TTJets_isr' : ['TTJets_isrup', 'TTJets_isrdown'],
# # 'TTJets_fsr' : ['TTJets_fsrup', 'TTJets_fsrdown'],
# # 'TTJets_isr' : ['TTJets_isrup', 'TTJets_isrdown'],

'TTJets_alphaS' : ['TTJets_alphaSup', 'TTJets_alphaSdown'],
# 'TTJets_alphaS' : ['TTJets_alphaSup', 'TTJets_alphaSdown'],
'TTJets_hdamp' : ['TTJets_hdampup', 'TTJets_hdampdown'],
'TTJets_semiLepBr' : ['TTJets_semiLepBrup', 'TTJets_semiLepBrdown'],
'TTJets_frag' : ['TTJets_fragup', 'TTJets_fragdown'],
Expand All @@ -274,7 +290,7 @@ def __fill_defaults__( self ):
'TTJets_CR_GluonMove' : ['TTJets_GluonMove', 'TTJets_GluonMove'],
# 'TTJets_CR_GluonMove_erdOn' : ['TTJets_GluonMove_erdOn', 'TTJets_GluonMove_erdOn'],

# Event Reweighting
# # Event Reweighting
'PileUp' : ['PileUp_up', 'PileUp_down'],
'JES' : ['JES_up', 'JES_down'],
'JER' : ['JER_up', 'JER_down'],
Expand All @@ -284,7 +300,7 @@ def __fill_defaults__( self ):
'Electron' : ['Electron_up', 'Electron_down'],
'Muon' : ['Muon_up', 'Muon_down'],
# PDF Uncertainties
'PDF' : ['PDF', 'PDF'],
# 'PDF' : ['PDF', 'PDF'],
# MET Uncertainties
'ElectronEn' : ['ElectronEnUp', 'ElectronEnDown'],
'MuonEn' : ['MuonEnUp', 'MuonEnDown'],
Expand Down Expand Up @@ -322,6 +338,10 @@ def __fill_defaults__( self ):
'SingleTop_cross_section',
'QCD_cross_section',
'QCD_shape',
'QCD_cross_section_electron',
'QCD_shape_electron',
'QCD_cross_section_muon',
'QCD_shape_muon',
]
self.systematic_group_met = [
'ElectronEn',
Expand Down
Loading