From 4f98311d36df3f2a8acf2518566fe1ad4eb2f043 Mon Sep 17 00:00:00 2001 From: Lukasz Kreczko Date: Fri, 8 Aug 2014 15:48:08 +0100 Subject: [PATCH] changed the range for PDF weights from 1-45 to 1-44 --- src/cross_section_measurement/02_unfold_and_measure.py | 10 +++++----- .../03_calculate_systematics.py | 2 +- .../04_make_plots_matplotlib.py | 4 ++-- tools/Calculation.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/cross_section_measurement/02_unfold_and_measure.py b/src/cross_section_measurement/02_unfold_and_measure.py index 5dfaf105..4e981b88 100644 --- a/src/cross_section_measurement/02_unfold_and_measure.py +++ b/src/cross_section_measurement/02_unfold_and_measure.py @@ -326,12 +326,12 @@ def calculate_normalised_xsections( normalisation, category, channel, k_value = } if not channel == 'combined': - filename = path_to_JSON + '/xsection_measurement_results/%s/kv%d/%s/normalised_xsection_%s.txt' % ( channel, k_value, category, met_type ) + filename = path_to_JSON + '/xsection_measurement_results/%s/kv%d/%s/normalised_xsection_%s.txt' % ( channel, k_value, category, met_type ) else: - filename = path_to_JSON + '/xsection_measurement_results/%s/%s/normalised_xsection_%s.txt' % ( channel, category, met_type ) + filename = path_to_JSON + '/xsection_measurement_results/%s/%s/normalised_xsection_%s.txt' % ( channel, category, met_type ) if normalise_to_one: - filename = filename.replace( 'normalised_xsection', 'normalised_to_one_xsection' ) + filename = filename.replace( 'normalised_xsection', 'normalised_to_one_xsection' ) write_data_to_JSON( normalised_xsection, filename ) if __name__ == '__main__': @@ -385,7 +385,7 @@ def calculate_normalised_xsections( normalisation, category, channel, k_value = file_for_powheg_herwig = File( measurement_config.unfolding_powheg_herwig, 'read' ) file_for_mcatnlo = File( measurement_config.unfolding_mcatnlo, 'read' ) file_for_ptreweight = File ( measurement_config.unfolding_ptreweight, 'read' ) - files_for_pdfs = { 'PDFWeights_%d' % index : File ( measurement_config.unfolding_pdfweights[index] ) for index in range( 1, 46 ) } + files_for_pdfs = { 'PDFWeights_%d' % index : File ( measurement_config.unfolding_pdfweights[index] ) for index in range( 1, 45 ) } file_for_scaledown = File( measurement_config.unfolding_scale_down, 'read' ) file_for_scaleup = File( measurement_config.unfolding_scale_up, 'read' ) @@ -415,7 +415,7 @@ def calculate_normalised_xsections( normalisation, category, channel, k_value = ttbar_theory_systematics.extend( [ttbar_theory_systematic_prefix + 'powheg_pythia', ttbar_theory_systematic_prefix + 'powheg_herwig'] ) categories.extend( ttbar_theory_systematics ) - pdf_uncertainties = ['PDFWeights_%d' % index for index in range( 1, 46 )] + pdf_uncertainties = ['PDFWeights_%d' % index for index in range( 1, 45 )] rate_changing_systematics = [systematic + '+' for systematic in measurement_config.rate_changing_systematics.keys()] rate_changing_systematics.extend( [systematic + '-' for systematic in measurement_config.rate_changing_systematics.keys()] ) diff --git a/src/cross_section_measurement/03_calculate_systematics.py b/src/cross_section_measurement/03_calculate_systematics.py index 7b7bb7f1..6db31e61 100644 --- a/src/cross_section_measurement/03_calculate_systematics.py +++ b/src/cross_section_measurement/03_calculate_systematics.py @@ -183,7 +183,7 @@ def replace_measurement_with_deviation_from_central( central_measurement, dictio ttbar_hadronisation_systematic_list = [ttbar_theory_systematic_prefix + 'powheg_pythia', ttbar_theory_systematic_prefix + 'powheg_herwig'] # 45 PDF uncertainties - pdf_uncertainties = ['PDFWeights_%d' % index for index in range( 1, 46 )] + pdf_uncertainties = ['PDFWeights_%d' % index for index in range( 1, 45 )] # all MET uncertainties except JES and JER as this is already included met_uncertainties_list = [met_type + suffix for suffix in met_systematics_suffixes if not 'JetEn' in suffix and not 'JetRes' in suffix] diff --git a/src/cross_section_measurement/04_make_plots_matplotlib.py b/src/cross_section_measurement/04_make_plots_matplotlib.py index 8267eee4..b0390786 100644 --- a/src/cross_section_measurement/04_make_plots_matplotlib.py +++ b/src/cross_section_measurement/04_make_plots_matplotlib.py @@ -544,11 +544,11 @@ def get_unit_string(fit_variable): categories.extend( ttbar_generator_systematics ) categories.extend( vjets_generator_systematics ) - pdf_uncertainties = ['PDFWeights_%d' % index for index in range( 1, 46 )] + pdf_uncertainties = ['PDFWeights_%d' % index for index in range( 1, 45 )] pdf_uncertainties_1_to_11 = ['PDFWeights_%d' % index for index in range( 1, 12 )] pdf_uncertainties_12_to_22 = ['PDFWeights_%d' % index for index in range( 12, 23 )] pdf_uncertainties_23_to_33 = ['PDFWeights_%d' % index for index in range( 23, 34 )] - pdf_uncertainties_34_to_45 = ['PDFWeights_%d' % index for index in range( 34, 46 )] + pdf_uncertainties_34_to_45 = ['PDFWeights_%d' % index for index in range( 34, 45 )] # all MET uncertainties except JES as this is already included met_uncertainties = [met_type + suffix for suffix in met_systematics_suffixes if not 'JetEn' in suffix and not 'JetRes' in suffix] new_uncertainties = ['QCD_shape'] diff --git a/tools/Calculation.py b/tools/Calculation.py index 81393b45..d7b58f6f 100644 --- a/tools/Calculation.py +++ b/tools/Calculation.py @@ -120,7 +120,7 @@ def calculate_lower_and_upper_PDFuncertainty(central_measurement, pdf_uncertaint positive = [] # split PDF uncertainties into downwards (negative) and upwards (positive) components - for index in range(1, 46): + for index in range(1, 45): pdf_weight = 'PDFWeights_%d' % index pdf_uncertainty = pdf_uncertainty_values[pdf_weight] if index % 2 == 0: # even == negative