Skip to content
Merged
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
8 changes: 5 additions & 3 deletions config/cross_section_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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():
Expand Down
1 change: 1 addition & 0 deletions config/latex_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion experimental/condor/01b/01_fit.description
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ request_memory=500
# use the ENV that is provided
getenv = true

queue 7
queue 14
19 changes: 6 additions & 13 deletions src/cross_section_measurement/02_unfold_and_measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 )

Expand Down
7 changes: 6 additions & 1 deletion src/cross_section_measurement/05_make_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down