Skip to content

Commit

Permalink
Merge pull request #124 from kreczko/fix-pdf-index
Browse files Browse the repository at this point in the history
changed the range for PDF weights from 1-45 to 1-44
  • Loading branch information
senkin committed Aug 8, 2014
2 parents 495f8bf + 4f98311 commit 8e426a8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/cross_section_measurement/02_unfold_and_measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down Expand Up @@ -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' )
Expand Down Expand Up @@ -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()] )

Expand Down
2 changes: 1 addition & 1 deletion src/cross_section_measurement/03_calculate_systematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions src/cross_section_measurement/04_make_plots_matplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
2 changes: 1 addition & 1 deletion tools/Calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8e426a8

Please sign in to comment.