24 if config.dataType() == DataType.Data:
27 alg = config.createAlgorithm(
'CP::SSVWeightsAlg',
'SSVWeightsAlg')
29 jetContainer, sep, jetSelectionName = self.jets.partition(
'.')
30 alg.jetSelection = config.getFullSelection(jetContainer, jetSelectionName)
31 alg.jets = config.readName(jetContainer)
33 electronContainer, sep, electronSelectionName = self.electrons.partition(
'.')
34 alg.electronSelection = config.getFullSelection(electronContainer, electronSelectionName)
35 alg.electrons = config.readName(electronContainer)
37 muonContainer, sep, muonSelectionName = self.muons.partition(
'.')
38 alg.muonSelection = config.getFullSelection(muonContainer, muonSelectionName)
39 alg.muons = config.readName(muonContainer)
41 print(
"Py:SSVWeightsAlg ",
"You run with the following jet selections: ", alg.jetSelection)
42 print(
"Py:SSVWeightsAlg ",
"You run with the following electron selections: ", alg.electronSelection)
43 print(
"Py:SSVWeightsAlg ",
"You run with the following muon selections: ", alg.muonSelection)
45 alg.NVSI_WP = self.NVSI_WP
46 alg.JsonConfigFile_SSVWeightsAlg = self.JsonConfigFile_SSVWeightsAlg
47 alg.BTaggingWP = self.BTaggingWP
48 alg.EfficiencyMethod = self.EfficiencyMethod
49 alg.nFMethod = self.nFMethod
50 alg.OutputVariableSize = self.OutputVariableSize
52 config.addOutputVar(
'EventInfo',
'SSV_weight_%SYS%',
'SSV_weight')
54 if alg.OutputVariableSize
in [
"extended",
"additional",
"all"] :
55 config.addOutputVar(
'EventInfo',
'P_eff_%SYS%',
'P_eff')
56 config.addOutputVar(
'EventInfo',
'P_ineff_%SYS%',
'P_ineff')
57 config.addOutputVar(
'EventInfo',
'P_fake_%SYS%',
'P_fake')
59 if alg.OutputVariableSize
in [
"additional",
"all"] :
60 config.addOutputVar(
'EventInfo',
'N_matched_%SYS%',
'N_matched')
61 config.addOutputVar(
'EventInfo',
'N_missed_%SYS%',
'N_missed')
62 config.addOutputVar(
'EventInfo',
'N_fake_%SYS%',
'N_fake')
63 config.addOutputVar(
'EventInfo',
'number_of_bjets_%SYS%',
'number_of_bjets')
64 config.addOutputVar(
'EventInfo',
'number_of_accepted_Bhadrons_%SYS%',
'number_of_accepted_Bhadrons')
65 config.addOutputVar(
'EventInfo',
'number_of_good_SSVs_%SYS%',
'number_of_good_SSVs')
67 if alg.OutputVariableSize ==
"all":
68 config.addOutputVar(
'EventInfo',
'P_ineff_bjet_based_%SYS%',
'P_ineff_bjet_based')
69 config.addOutputVar(
'EventInfo',
'P_ineff_pt_eta_based_%SYS%',
'P_ineff_pt_eta_based')
70 config.addOutputVar(
'EventInfo',
'P_fake_pileup_bjet_based_%SYS%',
'P_fake_pileup_bjet_based')
71 config.addOutputVar(
'EventInfo',
'P_fake_pileup_based_linearfit_%SYS%',
'P_fake_pileup_based_linearfit')
72 config.addOutputVar(
'EventInfo',
'P_fake_pileup_based_binned_%SYS%',
'P_fake_pileup_based_binned')