|
17 | 17 | mc_emb = [skey for skey in samples if skey not in ('Fake', 'DATA', 'DATA_Mu', 'DATA_EMu', 'Fake_EG', 'Fake_Mu', 'Fake_EMu')] |
18 | 18 |
|
19 | 19 |
|
20 | | -# LepCut2l__ele_wp90iso__mu_cut_TightHWW |
21 | | -eleWP = 'wp90iso' |
22 | | -muWP = 'cut_Tight_HWW' |
| 20 | +# LepCut2l__ele_cutBased_LooseID_tthMVA_Run3__mu_cut_TightID_pfIsoTight_HWW_tthmva_67 |
| 21 | +eleWP = 'cutBased_LooseID_tthMVA_Run3' |
| 22 | +muWP = 'cut_TightID_pfIsoTight_HWW_tthmva_67' |
23 | 23 |
|
24 | 24 | aliases['LepWPCut'] = { |
25 | 25 | 'expr': 'LepCut2l__ele_'+eleWP+'__mu_'+muWP, |
|
59 | 59 |
|
60 | 60 | Tag = 'ele_'+eleWP+'_mu_'+muWP |
61 | 61 |
|
62 | | -#aliases["fakeW"] = { |
63 | | -# "expr": f"fakeW_{Tag}_2l0j*(Alt(CleanJet_pt[abs(CleanJet_eta)<=2.5], 0, 0)<30.0) + fakeW_{Tag}_2l1j*(Alt(CleanJet_pt[abs(CleanJet_eta)<=2.5], 0, 0)>30.0 && Alt(CleanJet_pt[abs(CleanJet_eta)<=2.5], 1, 0)<30.0) + fakeW_{Tag}_2l2j*(Alt(CleanJet_pt[abs(CleanJet_eta)<=2.5], 1, 0)>30.0)", |
64 | | -# 'samples': ['Fake', 'Fake_EG', 'Fake_Mu', 'Fake_EMu'] |
65 | | -#} |
| 62 | +aliases['fakeW'] = { |
| 63 | + 'linesToAdd' : [f'#include "{configurations}macros/fake_rate_reader_class.cc"'], |
| 64 | + 'linesToProcess':[f"ROOT.gInterpreter.Declare('fake_rate_reader fr_reader = fake_rate_reader(\"2022\", \"{eleWP}\", \"{muWP}\", 0.90, 0.80, \"nominal\", 2, \"std\", \"{configurations}\");')"], |
| 65 | + 'expr': f'fr_reader(Lepton_pdgId, Lepton_pt, Lepton_eta, Lepton_isTightMuon_{muWP}, Lepton_isTightElectron_{eleWP}, Lepton_muonIdx, CleanJet_pt, nCleanJet)', |
| 66 | + 'samples' : ['Fake'] |
| 67 | +} |
| 68 | + |
66 | 69 | #aliases["fakeWEleUp"] = { |
67 | 70 | # "expr": f"fakeW_{Tag}_2l0jElUp*(Alt(CleanJet_pt[abs(CleanJet_eta)<=2.5], 0, 0)<30.0) + fakeW_{Tag}_2l1jElUp*(Alt(CleanJet_pt[abs(CleanJet_eta)<=2.5], 0, 0)>30.0 && Alt(CleanJet_pt[abs(CleanJet_eta)<=2.5], 1, 0)<30.0) + fakeW_{Tag}_2l2jElUp*(Alt(CleanJet_pt[abs(CleanJet_eta)<=2.5], 1, 0)>30.0)", |
68 | 71 | # 'samples':['Fake', 'Fake_EG', 'Fake_Mu', 'Fake_EMu'] |
|
167 | 170 | # If this is not the case, swap configurations with the proper path |
168 | 171 |
|
169 | 172 | # path = "your/path" |
170 | | -''' |
| 173 | + |
171 | 174 | eff_map_year = '2022' # ['2022', '20222', '2023', '20232'] |
172 | 175 | year = '2022_Summer22' |
173 | 176 |
|
|
177 | 180 | if shift != 'central': |
178 | 181 | btagsf += '_' + shift |
179 | 182 | aliases[btagsf] = { |
180 | | - 'linesToAdd': [f'#include "{configurations}evaluate_btagSF{flavour}.cc"'], |
181 | | - 'linesToProcess': [f"ROOT.gInterpreter.Declare('btagSF{flavour} btagSF{flavour}_{shift} = btagSF{flavour}(\"{configurations}bTagEff_2022_ttbar_{bAlgo}_loose.root\", \"{year}\");')"], |
| 183 | + 'linesToAdd': [f'#include "{configurations}macros/evaluate_btagSF{flavour}.cc"'], |
| 184 | + 'linesToProcess': [f"ROOT.gInterpreter.Declare('btagSF{flavour} btagSF{flavour}_{shift} = btagSF{flavour}(\"{configurations}fixedWP/bTagEff_{eff_map_year}_ttbar_{bAlgo}_loose.root\", \"{year}\");')"], |
182 | 185 | 'expr': f'btagSF{flavour}_{shift}(CleanJet_pt, CleanJet_eta, CleanJet_jetIdx, nCleanJet, Jet_hadronFlavour, Jet_btag{bAlgo}, "{WP_eval}", "{shift}", "{tagger}")', |
183 | 186 | 'samples' : mc, |
184 | 187 | } |
185 | | -''' |
| 188 | + |
186 | 189 |
|
187 | 190 | # B tagging selections and scale factors |
188 | 191 | aliases['bVeto'] = { |
|
206 | 209 |
|
207 | 210 | # CR definition |
208 | 211 | aliases['topcr'] = { |
209 | | - 'expr': 'mtw2 > 30 && mll > 50 && ((zeroJet && !bVeto) || bReq)' |
| 212 | + 'expr': 'mll > 50 && ((zeroJet && !bVeto) || bReq) && mtw2 > 30' |
210 | 213 | } |
211 | 214 | aliases['dycr'] = { |
212 | | - 'expr': 'mth < 60 && mll > 30 && mll < 80 && bVeto' |
| 215 | + 'expr': 'mth < 60 && mll > 30 && mll < 80 && bVeto && mtw2 > 30' |
213 | 216 | } |
214 | 217 | aliases['wwcr'] = { |
215 | 218 | 'expr': 'mth > 60 && mtw2 > 30 && mll > 100 && bVeto' |
|
232 | 235 | # Systematic uncertainty variations standard B-tagger |
233 | 236 |
|
234 | 237 |
|
235 | | -for shift in ['jes','lf','hf','lfstats1','lfstats2','hfstats1','hfstats2','cferr1','cferr2']: |
236 | | - |
237 | | - for targ in ['bVeto', 'bReq']: |
238 | | - alias = aliases['%sSF%sup' % (targ, shift)] = copy.deepcopy(aliases['%sSF' % targ]) |
239 | | - #alias['expr'] = alias['expr'].replace('btagSF_deepjet_shape', 'btagSF_deepjet_shape_up_%s' % shift) |
240 | | - alias['expr'] = alias['expr'].replace(f"btagSF_{bSF}_shape", f"btagSF_{bSF}_shape_up_{shift}") |
241 | | - |
242 | | - alias = aliases['%sSF%sdown' % (targ, shift)] = copy.deepcopy(aliases['%sSF' % targ]) |
243 | | - #alias['expr'] = alias['expr'].replace('btagSF_deepjet_shape', 'btagSF_deepjet_shape_down_%s' % shift) |
244 | | - alias['expr'] = alias['expr'].replace(f"btagSF_{bSF}_shape", f"btagSF_{bSF}_shape_down_{shift}") |
245 | | - |
246 | | - aliases['btagSF%sup' % shift] = { |
247 | | - 'expr': aliases['btagSF']['expr'].replace('SF', 'SF' + shift + 'up'), |
248 | | - 'samples': mc |
249 | | - } |
250 | | - |
251 | | - aliases['btagSF%sdown' % shift] = { |
252 | | - 'expr': aliases['btagSF']['expr'].replace('SF', 'SF' + shift + 'down'), |
253 | | - 'samples': mc |
254 | | - } |
| 238 | +#for shift in ['jes','lf','hf','lfstats1','lfstats2','hfstats1','hfstats2','cferr1','cferr2']: |
| 239 | +# |
| 240 | +# for targ in ['bVeto', 'bReq']: |
| 241 | +# alias = aliases['%sSF%sup' % (targ, shift)] = copy.deepcopy(aliases['%sSF' % targ]) |
| 242 | +# #alias['expr'] = alias['expr'].replace('btagSF_deepjet_shape', 'btagSF_deepjet_shape_up_%s' % shift) |
| 243 | +# alias['expr'] = alias['expr'].replace(f"btagSF_{bSF}_shape", f"btagSF_{bSF}_shape_up_{shift}") |
| 244 | +# |
| 245 | +# alias = aliases['%sSF%sdown' % (targ, shift)] = copy.deepcopy(aliases['%sSF' % targ]) |
| 246 | +# #alias['expr'] = alias['expr'].replace('btagSF_deepjet_shape', 'btagSF_deepjet_shape_down_%s' % shift) |
| 247 | +# alias['expr'] = alias['expr'].replace(f"btagSF_{bSF}_shape", f"btagSF_{bSF}_shape_down_{shift}") |
| 248 | +# |
| 249 | +# aliases['btagSF%sup' % shift] = { |
| 250 | +# 'expr': aliases['btagSF']['expr'].replace('SF', 'SF' + shift + 'up'), |
| 251 | +# 'samples': mc |
| 252 | +# } |
| 253 | +# |
| 254 | +# aliases['btagSF%sdown' % shift] = { |
| 255 | +# 'expr': aliases['btagSF']['expr'].replace('SF', 'SF' + shift + 'down'), |
| 256 | +# 'samples': mc |
| 257 | +# } |
255 | 258 |
|
256 | 259 |
|
257 | 260 | ######################## |
|
262 | 265 |
|
263 | 266 | # Use this for the usual SF |
264 | 267 | aliases['SFweight'] = { |
265 | | - 'expr': ' * '.join(['SFweight2l', 'LepWPCut', 'LepWPSF','btagSF']), |
| 268 | + 'expr': ' * '.join(['SFweight2l', 'LepWPCut', 'LepWPSF', 'btagSFbc', 'btagSFlight']), |
266 | 269 | 'samples': mc |
267 | 270 | } |
268 | 271 |
|
|
283 | 286 | 'expr': 'LepSF2l__mu_'+muWP+'__Down', |
284 | 287 | 'samples': mc |
285 | 288 | } |
286 | | - |
287 | | -aliases['snn_SigVSBkg'] = { |
288 | | - 'linesToAdd': ['#include "/afs/cern.ch/user/s/squinto/private/work/PlotsConfigurationsRun3/HWW/ggH_DF/2022/macros/snn_sigVSbkg.cc"'], |
289 | | - 'class': 'snn_SigVSBkg', |
290 | | - 'args': 'PV_npvsGood, mll, mth, ptll, drll, dphill, \ |
291 | | - Lepton_pt[0], Lepton_pt[1], Lepton_eta[0], Lepton_eta[1], Lepton_phi[0], Lepton_phi[1], \ |
292 | | - PuppiMET_pt, Sum(CleanJet_pt>30), \ |
293 | | - Alt(CleanJet_pt, 0, -99) - 9999.9*(CleanJet_pt[0]<30), Alt(CleanJet_pt, 1, -99) - 9999.9*(CleanJet_pt[1]<30), \ |
294 | | - Alt(CleanJet_eta, 0, -99) - 9999.9*(CleanJet_pt[0]<30), Alt(CleanJet_eta, 1, -99) - 9999.9*(CleanJet_pt[1]<30)', |
295 | | - 'afterNuis' : True |
296 | | -} |
297 | | - |
298 | | -#aliases['sns_SigVSBkg'] = { |
299 | | -# 'linesToAdd': ['#include "/afs/cern.ch/user/s/squinto/private/work/PlotsConfigurationsRun3/HWW/ggH_DF/2022/macros/sns_sigVSbkg.cc"'], |
300 | | -# 'class': 'sns_SigVSBkg', |
301 | | -# 'args': 'PV_npvsGood, mll, mth, ptll, drll, dphill, \ |
302 | | -# Lepton_pt[0], Lepton_pt[1], Lepton_eta[0], Lepton_eta[1], Lepton_phi[0], Lepton_phi[1], \ |
303 | | -# PuppiMET_pt, Sum(CleanJet_pt>30), \ |
304 | | -# Alt(CleanJet_pt, 0, -99) - 9999.9*(CleanJet_pt[0]<30), Alt(CleanJet_pt, 1, -99) - 9999.9*(CleanJet_pt[1]<30), \ |
305 | | -# Alt(CleanJet_eta, 0, -99) - 9999.9*(CleanJet_pt[0]<30), Alt(CleanJet_eta, 1, -99) - 9999.9*(CleanJet_pt[1]<30)', |
306 | | -# 'afterNuis' : True |
307 | | -#} |
0 commit comments