From b921dc65dbccf521860f6a42c41ab11b5b18e751 Mon Sep 17 00:00:00 2001 From: Emyr Clement Date: Thu, 27 Aug 2015 11:39:39 +0100 Subject: [PATCH 1/3] Add NLO generator systematic. --- config/cross_section_config.py | 8 +++++--- config/latex_labels.py | 1 + .../02_unfold_and_measure.py | 19 ++++++------------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/config/cross_section_config.py b/config/cross_section_config.py index d77c20a2..795c04df 100644 --- a/config/cross_section_config.py +++ b/config/cross_section_config.py @@ -209,7 +209,8 @@ def __fill_defaults__( self ): # 'matchingup', 'matchingdown', 'scaleup', 'scaledown', 'massup', 'massdown', - 'hadronisation' + 'hadronisation', + 'NLOgenerator' ] self.k_values = { 'electron' : self.k_values_electron, @@ -251,7 +252,7 @@ def __fill_defaults__( self ): self.central_general_template = path_to_files + 'central/%s' + middle + '.root' self.generator_systematic_vjets_templates = {} for systematic in self.generator_systematics: - if 'mass' in systematic or 'hadronisation' in systematic: + if 'mass' in systematic or 'hadronisation' in systematic or 'NLOgenerator' in systematic: continue tmp = path_to_files + 'central/VJets-{0}_{1}pb_PFElectron_PFMuon_PF2PATJets_PFMET.root' tmp = tmp.format(systematic, self.luminosity) @@ -401,8 +402,9 @@ def __fill_defaults__( self ): 'Theory': [('TTJets_scaledown', 'TTJets_scaleup'), ('TTJets_massdown', 'TTJets_massup')], 'Hadronisation': [('TTJets_hadronisation', 'TTJets_hadronisation')], + 'NLO generator': [('TTJets_NLOgenerator', 'TTJets_NLOgenerator')], 'PDF': [('PDF_total_lower', 'PDF_total_upper')], - 'others': [('QCD_shape', 'QCD_shape')] + 'QCD shape': [('QCD_shape', 'QCD_shape')] } self.typical_systematics = [] for _, values in self.typical_systematics_summary.items(): diff --git a/config/latex_labels.py b/config/latex_labels.py index 9bbcc81e..09f2a785 100644 --- a/config/latex_labels.py +++ b/config/latex_labels.py @@ -87,6 +87,7 @@ 'central': 'central', #'ptreweight_max': '$p_\mathrm{T}(t,\\bar{t})$ reweighting', 'TTJets_hadronisation': 'Hadronisation uncertainty', + 'TTJets_NLOgenerator': 'NLO generator', 'PDF_total_lower': 'PDF uncertainty $-1\sigma$', 'PDF_total_upper': 'PDF uncertainty $+1\sigma$', 'QCD_shape': 'QCD shape uncertainty', diff --git a/src/cross_section_measurement/02_unfold_and_measure.py b/src/cross_section_measurement/02_unfold_and_measure.py index 893e7b45..7de0988d 100644 --- a/src/cross_section_measurement/02_unfold_and_measure.py +++ b/src/cross_section_measurement/02_unfold_and_measure.py @@ -64,6 +64,7 @@ def get_unfolded_normalisation( TTJet_fit_results, category, channel, tau_value, ttbar_theory_systematic_prefix + 'massdown' : file_for_massdown, ttbar_theory_systematic_prefix + 'massup' : file_for_massup, ttbar_theory_systematic_prefix + 'hadronisation' : file_for_powheg_herwig, + ttbar_theory_systematic_prefix + 'NLOgenerator' : file_for_amcatnlo, } h_truth, h_measured, h_response, h_fakes = None, None, None, None @@ -438,25 +439,17 @@ def calculate_normalised_xsections( normalisation, category, channel, normalise_ categories.extend( ttbar_generator_systematics ) ### categories.extend( vjets_generator_systematics ) - ### ttbar theory systematics, including pt reweighting and hadronisation systematic - ttbar_theory_systematics = [] #[ ttbar_theory_systematic_prefix + 'ptreweight' ] - ttbar_theory_systematics.extend( [ttbar_theory_systematic_prefix + 'powheg_pythia', ttbar_theory_systematic_prefix + 'powheg_herwig'] ) - categories.extend( ttbar_theory_systematics ) - - ### 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 ) + # ### ttbar theory systematics, including pt reweighting and hadronisation systematic + # ttbar_theory_systematics = [] #[ ttbar_theory_systematic_prefix + 'ptreweight' ] + # 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( 0, 100 )] rate_changing_systematics = [systematic for systematic in measurement_config.rate_changing_systematics_names] # all MET uncertainties except JES as this is already included met_uncertainties = [suffix for suffix in measurement_config.met_systematics_suffixes if not 'JetEn' in suffix and not 'JetRes' in suffix] all_measurements = deepcopy( categories ) - all_measurements.extend( pdf_uncertainties ) + # all_measurements.extend( pdf_uncertainties ) all_measurements.extend( ['QCD_shape'] ) all_measurements.extend( rate_changing_systematics ) From 99185f5e8a6b09c387b1ddc298d4afc7c3862da1 Mon Sep 17 00:00:00 2001 From: Emyr Clement Date: Thu, 27 Aug 2015 11:39:54 +0100 Subject: [PATCH 2/3] Fix bug in typical systematics table. --- src/cross_section_measurement/05_make_tables.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cross_section_measurement/05_make_tables.py b/src/cross_section_measurement/05_make_tables.py index bc19213c..8f91c1e5 100644 --- a/src/cross_section_measurement/05_make_tables.py +++ b/src/cross_section_measurement/05_make_tables.py @@ -476,7 +476,11 @@ def print_typical_systematics_table(central_values, errors, channel, toFile = Tr assert(errors.has_key(s)) group_errors = {} + for group in measurement_config.typical_systematics_summary: + group_errors[group] = [] + for bin_i, _ in enumerate(bins): + central_value = central_values[measurement][bin_i][0] uncertainties = {} # calculate all relative errors @@ -486,12 +490,13 @@ def print_typical_systematics_table(central_values, errors, channel, toFile = Tr uncertainties[systematic] = relative_error # add errors in a group in quadrature for group, u_list in measurement_config.typical_systematics_summary.items(): + group_error_squared = 0 for subgroup in u_list: # use the biggest of up and down subgroup_error = max(uncertainties[subgroup[0]], uncertainties[subgroup[1]]) group_error_squared += pow(subgroup_error, 2) - group_errors[group] = math.sqrt(group_error_squared) + group_errors[group].append(math.sqrt(group_error_squared)) summarised_typical_systematics = {} # calculate the median From bac5cfb8db8060dcd68c93cfb9d32d09eb44ee95 Mon Sep 17 00:00:00 2001 From: Emyr Clement Date: Thu, 27 Aug 2015 11:41:26 +0100 Subject: [PATCH 3/3] Put number of 01 jobs to 14. --- experimental/condor/01b/01_fit.description | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/condor/01b/01_fit.description b/experimental/condor/01b/01_fit.description index f56b9ab3..c16d08e1 100644 --- a/experimental/condor/01b/01_fit.description +++ b/experimental/condor/01b/01_fit.description @@ -15,4 +15,4 @@ request_memory=500 # use the ENV that is provided getenv = true -queue 7 +queue 14