def combine(self, other): if not self.have_normalisation or not other.have_normalisation: mylog.warn( 'One of the TTJetNormalisations does not have a normalisation, aborting.') return self.normalisation = combine_complex_results( self.normalisation, other.normalisation) self.initial_normalisation = combine_complex_results( self.initial_normalisation, other.initial_normalisation) self.templates = combine_complex_results( self.templates, other.templates) self.channel = 'combined'
def combine(self, other): if not self.have_normalisation or not other.have_normalisation: mylog.warn( 'One of the TTJetNormalisations does not have a normalisation, aborting.' ) return self.normalisation = combine_complex_results(self.normalisation, other.normalisation) self.initial_normalisation = combine_complex_results( self.initial_normalisation, other.initial_normalisation) # self.unity_normalisation = combine_complex_results( # self.unity_normalisation, other.unity_normalisation) self.channel = 'combined'
calculate_normalised_xsections( unfolded_normalisation_muon, category, channel, covariance_matrix=covariance_muon ) calculate_normalised_xsections( unfolded_normalisation_muon, category, channel , True ) # Results where the channels are combined before unfolding (the 'combined in the response matrix') channel = 'combinedBeforeUnfolding' unfolded_normalisation_combinedBeforeUnfolding, covariance_combinedBeforeUnfolding = get_unfolded_normalisation( TTJet_normalisation_results_combined, category, 'combined', tau_value=tau_value_combined, visiblePS=visiblePS, ) # measure xsection calculate_xsections( unfolded_normalisation_combinedBeforeUnfolding, category, channel ) calculate_normalised_xsections( unfolded_normalisation_combinedBeforeUnfolding, category, channel, covariance_matrix=covariance_combinedBeforeUnfolding ) calculate_normalised_xsections( unfolded_normalisation_combinedBeforeUnfolding, category, channel , True ) # Results where the channels are combined after unfolding channel = 'combined' unfolded_normalisation_combined = combine_complex_results( unfolded_normalisation_electron, unfolded_normalisation_muon ) covariance_combined = None if not covariance_electron is None and not covariance_muon is None: covariance_combined = covariance_electron + covariance_muon # measure xsection calculate_xsections( unfolded_normalisation_combined, category, channel ) calculate_normalised_xsections( unfolded_normalisation_combined, category, channel, covariance_matrix=covariance_combined ) calculate_normalised_xsections( unfolded_normalisation_combined, category, channel , True )
'SingleTop': SingleTop_file, 'V+Jets': VJets_file, 'QCD' : QCD_muon_file, 'data': data_file_muon, }, variable = variable, met_systematic = met_systematic, met_type = met_type, b_tag_bin = b_tag_bin, treePrefix = treePrefix, weightBranch = weightBranch, scale_factors = scaleFactor, ) write_fit_results_and_initial_values( 'electron', category, fit_results_electron, initial_values_electron, templates_electron ) write_fit_results_and_initial_values( 'muon', category, fit_results_muon, initial_values_muon, templates_muon ) fit_results_combined = combine_complex_results( fit_results_electron, fit_results_muon ) initial_values_combined = combine_complex_results( initial_values_electron, initial_values_muon) write_fit_results_and_initial_values( 'combined', category, fit_results_combined, initial_values_combined) last_systematic = category # TTJet_file.Close() # SingleTop_file.Close() # VJets_file.Close() # data_file_electron.Close() # data_file_muon.Close() # if Higgs_file: # Higgs_file.Close() # data_file_electron = File( measurement_config.data_electron_category_templates_trees )