diff --git a/bin/x_02_all_vars b/bin/x_02_all_vars index 8d7e3004..9e971409 100755 --- a/bin/x_02_all_vars +++ b/bin/x_02_all_vars @@ -20,5 +20,5 @@ for var in MET HT ST MT WPT; do wait; fi done - +wait; echo "All done! Time to run x_03_all_vars." diff --git a/bin/x_03_all_vars b/bin/x_03_all_vars index cccc97c0..05af676e 100755 --- a/bin/x_03_all_vars +++ b/bin/x_03_all_vars @@ -21,4 +21,5 @@ for var in MET HT ST MT WPT; do fi done +wait; echo "All done! Time to run x_04_all_vars and x_05_all_vars." diff --git a/bin/x_04_all_vars b/bin/x_04_all_vars index 156fd636..af4515d2 100755 --- a/bin/x_04_all_vars +++ b/bin/x_04_all_vars @@ -22,4 +22,5 @@ for var in MET HT ST MT WPT; do fi done +wait; echo "All done!" diff --git a/bin/x_05_all_vars b/bin/x_05_all_vars index 5051de44..a04f165e 100755 --- a/bin/x_05_all_vars +++ b/bin/x_05_all_vars @@ -22,4 +22,5 @@ for var in MET HT ST MT WPT; do fi done +wait; echo "All done!" diff --git a/config/__init__.py b/config/__init__.py index 7eceaa2d..d563887e 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -171,6 +171,8 @@ def __fill_defaults__( self ): self.central_general_template = path_to_files + 'central/%s' + middle + '.root' self.generator_systematic_vjets_templates = { systematic: path_to_files + 'central/VJets-%s_%dpb_PFElectron_PFMuon_PF2PATJets_PFMET.root' % ( systematic, self.luminosity ) for systematic in self.generator_systematics} + self.kValueSystematic = [ 'kValue_up', 'kValue_down'] + categories_and_prefixes = self.categories_and_prefixes self.general_category_templates = {category: path_to_files + category + '/%s' + middle + prefix + '.root' for category, prefix in categories_and_prefixes.iteritems()} diff --git a/config/latex_labels.py b/config/latex_labels.py index a9851124..705fd955 100644 --- a/config/latex_labels.py +++ b/config/latex_labels.py @@ -63,6 +63,8 @@ 'Electron_up' : 'Electron efficiency $+1\sigma$', 'Muon_down' : 'Muon efficiency $-1\sigma$', 'Muon_up' : 'Muon efficiency $+1\sigma$', + 'kValue_up' : 'k Value $+1$', + 'kValue_down' : 'k Value $-1$', } met_systematics_latex = { diff --git a/src/cross_section_measurement/02_unfold_and_measure.py b/src/cross_section_measurement/02_unfold_and_measure.py index ec17f157..ee1f2ec6 100644 --- a/src/cross_section_measurement/02_unfold_and_measure.py +++ b/src/cross_section_measurement/02_unfold_and_measure.py @@ -399,9 +399,9 @@ def calculate_normalised_xsections( normalisation, category, channel, k_value = file_for_massup = File( measurement_config.unfolding_mass_up, 'read' ) variable = options.variable - k_value_electron = measurement_config.k_values_electron[variable] - k_value_muon = measurement_config.k_values_muon[variable] - k_value_combined = measurement_config.k_values_combined[variable] + k_value_electron_central = measurement_config.k_values_electron[variable] + k_value_muon_central = measurement_config.k_values_muon[variable] + k_value_combined_central = measurement_config.k_values_combined[variable] load_fakes = options.load_fakes unfoldCfg.Hreco = options.Hreco method = options.unfolding_method @@ -425,6 +425,10 @@ def calculate_normalised_xsections( normalisation, category, channel, k_value = ttbar_mass_systematics = measurement_config.topMass_systematics categories.extend( measurement_config.topMass_systematics ) + # Add k Value systematic + kValue_systematics = measurement_config.kValueSystematic + categories.extend( measurement_config.kValueSystematic ) + 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()] ) @@ -455,14 +459,30 @@ def calculate_normalised_xsections( normalisation, category, channel, k_value = met_type += 'JetEnDown' if met_type == 'PFMETJetEnDown': met_type = 'patPFMetJetEnDown' - + + # Choose k Value + k_value_electron = k_value_electron_central + k_value_muon = k_value_muon_central + k_value_combined = k_value_combined_central + if category == 'kValue_up': + k_value_electron = k_value_electron_central+1 + k_value_muon = k_value_muon_central+1 + k_value_combined = k_value_combined_central+1 + elif category == 'kValue_down': + k_value_electron = k_value_electron_central-1 + if k_value_electron < 2 : k_value_electron = 2 + k_value_muon = k_value_muon_central-1 + if k_value_muon < 2 : k_value_muon = 2 + k_value_combined = k_value_combined_central-1 + if k_value_combined < 2 : k_value_combined = 2 + # read fit results from JSON electron_file = path_to_JSON + '/fit_results/' + category + '/fit_results_electron_' + met_type + '.txt' muon_file = path_to_JSON + '/fit_results/' + category + '/fit_results_muon_' + met_type + '.txt' combined_file = path_to_JSON + '/fit_results/' + category + '/fit_results_combined_' + met_type + '.txt' # don't change fit input for ttbar generator/theory systematics and PDF weights - if category in ttbar_generator_systematics or category in ttbar_theory_systematics or category in pdf_uncertainties or category in ttbar_mass_systematics: + if category in ttbar_generator_systematics or category in ttbar_theory_systematics or category in pdf_uncertainties or category in ttbar_mass_systematics or category in kValue_systematics: electron_file = path_to_JSON + '/fit_results/central/fit_results_electron_' + met_type + '.txt' muon_file = path_to_JSON + '/fit_results/central/fit_results_muon_' + met_type + '.txt' combined_file = path_to_JSON + '/fit_results/central/fit_results_combined_' + met_type + '.txt' @@ -490,9 +510,9 @@ def calculate_normalised_xsections( normalisation, category, channel, k_value = else: unfolded_normalisation_combined = combine_complex_results( unfolded_normalisation_electron, unfolded_normalisation_muon ) - filename = path_to_JSON + '/xsection_measurement_results/electron/kv%d/%s/normalisation_%s.txt' % ( k_value_electron, category, met_type ) + filename = path_to_JSON + '/xsection_measurement_results/electron/kv%d/%s/normalisation_%s.txt' % ( k_value_electron_central, category, met_type ) write_data_to_JSON( unfolded_normalisation_electron, filename ) - filename = path_to_JSON + '/xsection_measurement_results/muon/kv%d/%s/normalisation_%s.txt' % ( k_value_muon, category, met_type ) + filename = path_to_JSON + '/xsection_measurement_results/muon/kv%d/%s/normalisation_%s.txt' % ( k_value_muon_central, category, met_type ) write_data_to_JSON( unfolded_normalisation_muon, filename ) filename = path_to_JSON + '/xsection_measurement_results/combined/%s/normalisation_%s.txt' % ( category, met_type ) write_data_to_JSON( unfolded_normalisation_combined, filename ) @@ -509,23 +529,23 @@ def calculate_normalised_xsections( normalisation, category, channel, k_value = else: unfolded_normalisation_combined_higgs = combine_complex_results( unfolded_normalisation_electron_higgs, unfolded_normalisation_muon_higgs ) - filename = path_to_JSON + '/xsection_measurement_results/electron/kv%d/%s/normalisation_%s_Higgs.txt' % ( k_value_electron, category, met_type ) + filename = path_to_JSON + '/xsection_measurement_results/electron/kv%d/%s/normalisation_%s_Higgs.txt' % ( k_value_electron_central, category, met_type ) write_data_to_JSON( unfolded_normalisation_electron_higgs, filename ) - filename = path_to_JSON + '/xsection_measurement_results/muon/kv%d/%s/normalisation_%s_Higgs.txt' % ( k_value_muon, category, met_type ) + filename = path_to_JSON + '/xsection_measurement_results/muon/kv%d/%s/normalisation_%s_Higgs.txt' % ( k_value_muon_central, category, met_type ) write_data_to_JSON( unfolded_normalisation_muon_higgs, filename ) filename = path_to_JSON + '/xsection_measurement_results/combined/%s/normalisation_%s_Higgs.txt' % ( category, met_type ) write_data_to_JSON( unfolded_normalisation_combined_higgs, filename ) # measure xsection - calculate_xsections( unfolded_normalisation_electron, category, 'electron', k_value_electron ) - calculate_xsections( unfolded_normalisation_muon, category, 'muon', k_value_muon ) + calculate_xsections( unfolded_normalisation_electron, category, 'electron', k_value_electron_central ) + calculate_xsections( unfolded_normalisation_muon, category, 'muon', k_value_muon_central ) calculate_xsections( unfolded_normalisation_combined, category, 'combined' ) - calculate_normalised_xsections( unfolded_normalisation_electron, category, 'electron', k_value_electron ) - calculate_normalised_xsections( unfolded_normalisation_muon, category, 'muon', k_value_muon ) + calculate_normalised_xsections( unfolded_normalisation_electron, category, 'electron', k_value_electron_central ) + calculate_normalised_xsections( unfolded_normalisation_muon, category, 'muon', k_value_muon_central ) calculate_normalised_xsections( unfolded_normalisation_combined, category, 'combined' ) normalise_to_one = True - calculate_normalised_xsections( unfolded_normalisation_electron, category, 'electron', k_value_electron, normalise_to_one ) - calculate_normalised_xsections( unfolded_normalisation_muon, category, 'muon', k_value_muon, normalise_to_one ) + calculate_normalised_xsections( unfolded_normalisation_electron, category, 'electron', k_value_electron_central, normalise_to_one ) + calculate_normalised_xsections( unfolded_normalisation_muon, category, 'muon', k_value_muon_central, normalise_to_one ) calculate_normalised_xsections( unfolded_normalisation_combined, category, 'combined', normalise_to_one ) diff --git a/src/cross_section_measurement/03_calculate_systematics.py b/src/cross_section_measurement/03_calculate_systematics.py index 62c19b1c..e8e55008 100644 --- a/src/cross_section_measurement/03_calculate_systematics.py +++ b/src/cross_section_measurement/03_calculate_systematics.py @@ -66,7 +66,7 @@ def read_normalised_xsection_systematics( list_of_systematics, channel ): return systematics, systematics_unfolded -def summarise_systematics( list_of_central_measurements, dictionary_of_systematics, pdf_calculation = False, hadronisation_systematic = False, mass_systematic = False ): +def summarise_systematics( list_of_central_measurements, dictionary_of_systematics, pdf_calculation = False, hadronisation_systematic = False, mass_systematic = False, kValueSystematic = False ): global symmetrise_errors # number of bins number_of_bins = len( list_of_central_measurements ) @@ -92,10 +92,13 @@ def summarise_systematics( list_of_central_measurements, dictionary_of_systemati list_of_systematics = [systematic[bin_i][0] for systematic in dictionary_of_systematics.values()] error_down, error_up = calculate_lower_and_upper_systematics( central_value, list_of_systematics, False ) # Scale errors calculated using very different top masses - error_down, error_up = scaleTopMassSystematicErrors( error_down, error_up ) - if symmetrise_errors: - error_down = max(error_down, error_up) - error_up = max(error_down, error_up) + error_down, error_up = scaleTopMassSystematicErrors( [error_down], [error_up] ) + error_down = error_down[0] + error_up = error_up[0] + elif kValueSystematic: + list_of_systematics = [systematic[bin_i][0] for systematic in dictionary_of_systematics.values()] + error_down, error_up = calculate_lower_and_upper_systematics( central_value, list_of_systematics, False ) + error_down = error_up else: list_of_systematics = [systematic[bin_i][0] for systematic in dictionary_of_systematics.values()] error_down, error_up = calculate_lower_and_upper_systematics( central_value, list_of_systematics, symmetrise_errors ) @@ -106,12 +109,14 @@ def summarise_systematics( list_of_central_measurements, dictionary_of_systemati return down_errors, up_errors def scaleTopMassSystematicErrors( error_down, error_up ): - upMassDifference = measurement_config.topMasses[2] - measurement_config.topMasses[1] - downMassDifference = measurement_config.topMasses[1] - measurement_config.topMasses[0] + error_down_new, error_up_new = [], [] + for down,up in zip( error_down,error_up ): + upMassDifference = measurement_config.topMasses[2] - measurement_config.topMasses[1] + downMassDifference = measurement_config.topMasses[1] - measurement_config.topMasses[0] - error_down = error_down * measurement_config.topMassUncertainty / downMassDifference - error_up = error_up * measurement_config.topMassUncertainty / upMassDifference - return error_down, error_up + error_down_new.append( down * measurement_config.topMassUncertainty / downMassDifference ) + error_up_new.append( up * measurement_config.topMassUncertainty / upMassDifference ) + return error_down_new, error_up_new def get_measurement_with_lower_and_upper_errors( list_of_central_measurements, lists_of_lower_systematic_errors, lists_of_upper_systematic_errors ): ''' @@ -197,6 +202,9 @@ def replace_measurement_with_deviation_from_central( central_measurement, dictio # Top mass systematics ttbar_mass_systematics_list = measurement_config.topMass_systematics + # k Value systematic + kValue_systematic_list = measurement_config.kValueSystematic + # ttbar theory systematics: ptreweighting, hadronisation systematic (powheg_pythia - powheg_herwig) # ttbar_ptreweight_systematic_list = [ttbar_theory_systematic_prefix + 'ptreweight'] ttbar_hadronisation_systematic_list = [ttbar_theory_systematic_prefix + 'powheg_pythia', ttbar_theory_systematic_prefix + 'powheg_herwig'] @@ -216,7 +224,7 @@ def replace_measurement_with_deviation_from_central( central_measurement, dictio other_uncertainties_list.extend( vjets_generator_systematics_list ) other_uncertainties_list.append( 'QCD_shape' ) other_uncertainties_list.extend( rate_changing_systematics_list ) - + for channel in ['electron', 'muon', 'combined']: # read central measurement central_measurement, central_measurement_unfolded = read_normalised_xsection_measurement( 'central', channel ) @@ -226,7 +234,8 @@ def replace_measurement_with_deviation_from_central( central_measurement, dictio ttbar_hadronisation_systematic, ttbar_hadronisation_systematic_unfolded = read_normalised_xsection_systematics( list_of_systematics = ttbar_hadronisation_systematic_list, channel = channel ) # top mass systematic ttbar_mass_systematic, ttbar_mass_systematic_unfolded = read_normalised_xsection_systematics( list_of_systematics = ttbar_mass_systematics_list, channel = channel ) - + # k Value systematics + kValue_systematic, kValue_systematic_unfolded = read_normalised_xsection_systematics( list_of_systematics = kValue_systematic_list, channel = channel ) pdf_systematics, pdf_systematics_unfolded = read_normalised_xsection_systematics( list_of_systematics = pdf_uncertainties, channel = channel ) @@ -248,6 +257,13 @@ def replace_measurement_with_deviation_from_central( central_measurement, dictio ttbar_mass_min, ttbar_mass_max = summarise_systematics( central_measurement, ttbar_mass_systematic, mass_systematic = True ) ttbar_mass_min_unfolded, ttbar_mass_max_unfolded = summarise_systematics( central_measurement_unfolded, ttbar_mass_systematic_unfolded, mass_systematic = True ) + # k Value systematic + kValue_min, kValue_max = summarise_systematics( central_measurement, kValue_systematic, kValueSystematic = True) + kValue_min_unfolded, kValue_max_unfolded = summarise_systematics( central_measurement_unfolded, kValue_systematic_unfolded, kValueSystematic = True) + # Take up variation as the down variation also. + kValue_systematic['kValue_down'] = kValue_systematic['kValue_up'] + kValue_systematic_unfolded['kValue_down'] = kValue_systematic_unfolded['kValue_up'] + # 45 PDFs pdf_min, pdf_max = summarise_systematics( central_measurement, pdf_systematics, pdf_calculation = True ) pdf_min_unfolded, pdf_max_unfolded = summarise_systematics( central_measurement_unfolded, pdf_systematics_unfolded, pdf_calculation = True ) @@ -265,48 +281,60 @@ def replace_measurement_with_deviation_from_central( central_measurement, dictio [ttbar_generator_min, #ttbar_ptreweight_min, ttbar_hadronisation_min, ttbar_mass_min, + kValue_min, pdf_min, met_min, other_min], [ttbar_generator_max, #ttbar_ptreweight_max, ttbar_hadronisation_max, ttbar_mass_max, + kValue_max, pdf_max, met_max, other_max] ) central_measurement_with_systematics_but_without_ttbar_theory = get_measurement_with_lower_and_upper_errors( central_measurement, [pdf_min, met_min, other_min, ttbar_mass_min, + kValue_min, ttbar_generator_min], [pdf_max, met_max, other_max, ttbar_mass_max, + kValue_max, ttbar_generator_max] ) central_measurement_with_systematics_but_without_generator = get_measurement_with_lower_and_upper_errors( central_measurement, [ttbar_hadronisation_min, #ttbar_ptreweight_min, ttbar_mass_min, + kValue_min, pdf_min, met_min, other_min], [ttbar_hadronisation_max, #ttbar_ptreweight_max, ttbar_mass_max, + kValue_max, pdf_max, met_max, other_max] ) central_measurement_unfolded_with_systematics = get_measurement_with_lower_and_upper_errors( central_measurement_unfolded, [ttbar_generator_min_unfolded, #ttbar_ptreweight_min_unfolded, ttbar_hadronisation_min_unfolded, ttbar_mass_min_unfolded, + kValue_min_unfolded, pdf_min_unfolded, met_min_unfolded, other_min_unfolded], [ttbar_generator_max_unfolded, #ttbar_ptreweight_max_unfolded, ttbar_hadronisation_max_unfolded, ttbar_mass_max_unfolded, + kValue_max_unfolded, pdf_max_unfolded, met_max_unfolded, other_max_unfolded] ) central_measurement_unfolded_with_systematics_but_without_ttbar_theory = get_measurement_with_lower_and_upper_errors( central_measurement_unfolded, [pdf_min_unfolded, met_min_unfolded, other_min_unfolded, ttbar_mass_min_unfolded, + kValue_min_unfolded, ttbar_generator_min_unfolded], [pdf_max_unfolded, met_max_unfolded, other_max_unfolded, ttbar_mass_max_unfolded, + kValue_max_unfolded, ttbar_generator_max_unfolded] ) central_measurement_unfolded_with_systematics_but_without_generator = get_measurement_with_lower_and_upper_errors( central_measurement_unfolded, [ttbar_hadronisation_min_unfolded, #ttbar_ptreweight_min_unfolded, ttbar_mass_min_unfolded, + kValue_min_unfolded, pdf_min_unfolded, met_min_unfolded, other_min_unfolded], [ttbar_hadronisation_max_unfolded, #ttbar_ptreweight_max_unfolded, - ttbar_mass_max_unfolded, + ttbar_mass_max_unfolded, + kValue_max_unfolded, pdf_max_unfolded, met_max_unfolded, other_max_unfolded] ) write_normalised_xsection_measurement( central_measurement_with_systematics, @@ -327,13 +355,19 @@ def replace_measurement_with_deviation_from_central( central_measurement, dictio pdf_systematics = replace_measurement_with_deviation_from_central( central_measurement, pdf_systematics ) met_systematics = replace_measurement_with_deviation_from_central( central_measurement, met_systematics ) ttbar_mass_systematic = replace_measurement_with_deviation_from_central( central_measurement, ttbar_mass_systematic ) + kValue_systematic = replace_measurement_with_deviation_from_central( central_measurement, kValue_systematic ) other_systematics = replace_measurement_with_deviation_from_central( central_measurement, other_systematics ) ttbar_generator_systematics_unfolded = replace_measurement_with_deviation_from_central( central_measurement_unfolded, ttbar_generator_systematics_unfolded ) pdf_systematics_unfolded = replace_measurement_with_deviation_from_central( central_measurement_unfolded, pdf_systematics_unfolded ) met_systematics_unfolded = replace_measurement_with_deviation_from_central( central_measurement_unfolded, met_systematics_unfolded ) ttbar_mass_systematic_unfolded = replace_measurement_with_deviation_from_central( central_measurement_unfolded, ttbar_mass_systematic_unfolded ) + kValue_systematic_unfolded = replace_measurement_with_deviation_from_central( central_measurement_unfolded, kValue_systematic_unfolded ) other_systematics_unfolded = replace_measurement_with_deviation_from_central( central_measurement_unfolded, other_systematics_unfolded ) + + # Scale mass systematic + ttbar_mass_systematic['TTJets_massdown'], ttbar_mass_systematic['TTJets_massup'] = scaleTopMassSystematicErrors( ttbar_mass_systematic['TTJets_massdown'], ttbar_mass_systematic['TTJets_massup'] ) + ttbar_mass_systematic_unfolded['TTJets_massdown'], ttbar_mass_systematic_unfolded['TTJets_massup'] = scaleTopMassSystematicErrors( ttbar_mass_systematic_unfolded['TTJets_massdown'], ttbar_mass_systematic_unfolded['TTJets_massup'] ) # add total errors # TODO: these are currently still storing the measurement, but should store the difference to the measurement like total_* @@ -349,9 +383,14 @@ def replace_measurement_with_deviation_from_central( central_measurement, dictio ttbar_mass_systematic['total_lower'], ttbar_mass_systematic['total_upper'] = ttbar_mass_min, ttbar_mass_max ttbar_mass_systematic_unfolded['total_lower'], ttbar_mass_systematic_unfolded['total_upper'] = ttbar_mass_min_unfolded, ttbar_mass_max_unfolded + kValue_systematic['total_lower'], kValue_systematic['total_upper'] = kValue_min, kValue_max + kValue_systematic_unfolded['total_lower'], kValue_systematic_unfolded['total_upper'] = kValue_min_unfolded, kValue_max_unfolded + other_systematics['total_lower'], other_systematics['total_upper'] = other_min, other_max other_systematics_unfolded['total_lower'], other_systematics_unfolded['total_upper'] = other_min_unfolded, other_max_unfolded + # print 'Generator',ttbar_generator_systematics_unfolded + # print 'k Value',kValue_systematic_unfolded new_systematics = {} new_systematics_unfolded = {} @@ -365,6 +404,7 @@ def replace_measurement_with_deviation_from_central( central_measurement, dictio write_normalised_xsection_measurement( pdf_systematics, pdf_systematics_unfolded, channel, summary = 'PDF' ) write_normalised_xsection_measurement( met_systematics, met_systematics_unfolded, channel, summary = 'MET' ) write_normalised_xsection_measurement( ttbar_mass_systematic, ttbar_mass_systematic_unfolded, channel, summary = 'topMass' ) + write_normalised_xsection_measurement( kValue_systematic, kValue_systematic_unfolded, channel, summary = 'kValue' ) write_normalised_xsection_measurement( other_systematics, other_systematics_unfolded, channel, summary = 'other' ) write_normalised_xsection_measurement( new_systematics, new_systematics_unfolded, channel, summary = 'new' ) diff --git a/src/cross_section_measurement/04_make_plots_matplotlib.py b/src/cross_section_measurement/04_make_plots_matplotlib.py index f2ae2395..2d06629a 100644 --- a/src/cross_section_measurement/04_make_plots_matplotlib.py +++ b/src/cross_section_measurement/04_make_plots_matplotlib.py @@ -547,6 +547,10 @@ def get_unit_string(fit_variable): # Add mass systematics ttbar_mass_systematics = measurement_config.topMass_systematics categories.extend( measurement_config.topMass_systematics ) + + # Add k value systematic + kValue_systematics = measurement_config.kValueSystematic + categories.extend( measurement_config.kValueSystematic ) 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 )] diff --git a/src/cross_section_measurement/05_make_tables.py b/src/cross_section_measurement/05_make_tables.py index 8d52469f..02419942 100644 --- a/src/cross_section_measurement/05_make_tables.py +++ b/src/cross_section_measurement/05_make_tables.py @@ -35,6 +35,9 @@ def read_xsection_measurement_results_with_errors(channel): file_name = file_template.replace('.txt', '_topMass_errors.txt') normalised_xsection_topMass_errors = read_data_from_JSON( file_name ) + file_name = file_template.replace('.txt', '_kValue_errors.txt') + normalised_xsection_kValue_errors = read_data_from_JSON( file_name ) + file_name = file_template.replace('.txt', '_PDF_errors.txt') normalised_xsection_PDF_errors = read_data_from_JSON( file_name ) @@ -51,6 +54,7 @@ def read_xsection_measurement_results_with_errors(channel): normalised_xsection_measured_errors.update(normalised_xsection_PDF_errors['TTJet_measured']) normalised_xsection_measured_errors.update(normalised_xsection_MET_errors['TTJet_measured']) normalised_xsection_measured_errors.update(normalised_xsection_topMass_errors['TTJet_measured']) + normalised_xsection_measured_errors.update(normalised_xsection_kValue_errors['TTJet_measured']) normalised_xsection_measured_errors.update(normalised_xsection_other_errors['TTJet_measured']) normalised_xsection_measured_errors.update(normalised_xsection_new_errors['TTJet_measured']) @@ -58,6 +62,7 @@ def read_xsection_measurement_results_with_errors(channel): normalised_xsection_unfolded_errors.update(normalised_xsection_PDF_errors['TTJet_unfolded']) normalised_xsection_unfolded_errors.update(normalised_xsection_MET_errors['TTJet_unfolded']) normalised_xsection_unfolded_errors.update(normalised_xsection_topMass_errors['TTJet_unfolded']) + normalised_xsection_unfolded_errors.update(normalised_xsection_kValue_errors['TTJet_unfolded']) normalised_xsection_unfolded_errors.update(normalised_xsection_other_errors['TTJet_unfolded']) normalised_xsection_unfolded_errors.update(normalised_xsection_new_errors['TTJet_unfolded']) @@ -440,6 +445,10 @@ def print_error_table(central_values, errors, channel, toFile = True, print_befo ttbar_mass_systematics = measurement_config.topMass_systematics categories.extend( measurement_config.topMass_systematics ) + # Add k value systematic + kValue_systematics = measurement_config.kValueSystematic + categories.extend( measurement_config.kValueSystematic ) + # 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 = ['hadronisation', 'QCD_shape', 'PDF_total_lower', 'PDF_total_upper']