32 def makeAlgs(self, config):
33
34 if config.dataType() == DataType.Data:
35 return
36
37 alg = config.createAlgorithm('CP::SSVWeightsAlg', 'SSVWeightsAlg')
38
39 jetContainer, sep, jetSelectionName = self.jets.partition('.')
40 alg.jetSelection = config.getFullSelection(jetContainer, jetSelectionName)
41 alg.jets = config.readName(jetContainer)
42
43 electronContainer, sep, electronSelectionName = self.electrons.partition('.')
44 alg.electronSelection = config.getFullSelection(electronContainer, electronSelectionName)
45 alg.electrons = config.readName(electronContainer)
46
47 muonContainer, sep, muonSelectionName = self.muons.partition('.')
48 alg.muonSelection = config.getFullSelection(muonContainer, muonSelectionName)
49 alg.muons = config.readName(muonContainer)
50
51 log = logging.getLogger('SSVWeightsAlgConfig')
52 log.info(f'You run with the following jet selections: {alg.jetSelection}')
53 log.info(f'You run with the following electron selections: {alg.electronSelection}')
54 log.info(f'You run with the following muon selections: {alg.muonSelection}')
55
56 alg.NVSI_WP = self.NVSI_WP
57 alg.JsonConfigFile_SSVWeightsAlg = self.JsonConfigFile_SSVWeightsAlg
58 alg.BTaggingWP = self.BTaggingWP
59 alg.EfficiencyMethod = self.EfficiencyMethod
60 alg.nFMethod = self.nFMethod
61 alg.OutputVariableSize = self.OutputVariableSize
62
63 config.addOutputVar('EventInfo', 'SSV_weight_%SYS%', 'SSV_weight', auxType="float")
64
65 if alg.OutputVariableSize in ["extended", "additional", "all"] :
66 config.addOutputVar('EventInfo', 'P_eff_%SYS%', 'P_eff', auxType="float")
67 config.addOutputVar('EventInfo', 'P_ineff_%SYS%', 'P_ineff', auxType="float")
68 config.addOutputVar('EventInfo', 'P_fake_%SYS%', 'P_fake', auxType="float")
69
70 if alg.OutputVariableSize in ["additional", "all"] :
71 config.addOutputVar('EventInfo', 'N_matched_%SYS%', 'N_matched', auxType="int")
72 config.addOutputVar('EventInfo', 'N_missed_%SYS%', 'N_missed', auxType="int")
73 config.addOutputVar('EventInfo', 'N_fake_%SYS%', 'N_fake', auxType="int")
74 config.addOutputVar('EventInfo', 'number_of_bjets_%SYS%', 'number_of_bjets', auxType="int")
75 config.addOutputVar('EventInfo', 'number_of_accepted_Bhadrons_%SYS%', 'number_of_accepted_Bhadrons', auxType="int")
76 config.addOutputVar('EventInfo', 'number_of_good_SSVs_%SYS%', 'number_of_good_SSVs', auxType="int")
77
78 if alg.OutputVariableSize == "all":
79 config.addOutputVar('EventInfo', 'P_ineff_bjet_based_%SYS%', 'P_ineff_bjet_based', auxType="float")
80 config.addOutputVar('EventInfo', 'P_ineff_pt_eta_based_%SYS%', 'P_ineff_pt_eta_based', auxType="float")
81 config.addOutputVar('EventInfo', 'P_fake_pileup_bjet_based_%SYS%', 'P_fake_pileup_bjet_based', auxType="float")
82 config.addOutputVar('EventInfo', 'P_fake_pileup_based_linearfit_%SYS%', 'P_fake_pileup_based_linearfit', auxType="float")
83 config.addOutputVar('EventInfo', 'P_fake_pileup_based_binned_%SYS%', 'P_fake_pileup_based_binned', auxType="float")