12 """Configure the skimming tool"""
15 from DerivationFrameworkJetEtMiss
import TriggerLists
16 metTriggers = TriggerLists.MET_Trig(flags)
17 elTriggers = TriggerLists.single_el_Trig(flags)
18 muTriggers = TriggerLists.single_mu_Trig(flags)
20 addRun3METTriggers = [
"HLT_xe55_cell_xe70_tcpufit_xe90_pfsum_vssk_L1XE50",
"HLT_xe55_cell_xe70_tcpufit_xe95_pfsum_cssk_L1XE50",
"HLT_xe60_cell_xe95_pfsum_cssk_L1XE50",
"HLT_xe65_cell_xe100_mhtpufit_pf_L1XE50",
"HLT_xe65_cell_xe105_mhtpufit_em_L1XE50",
"HLT_xe75_cell_xe65_tcpufit_xe90_trkmht_L1XE50",
"HLT_xe65_cell_xe90_pfopufit_L1XE50",
"HLT_xe80_cell_xe115_tcpufit_L1XE50"]
22 addRun3ElectronTriggers = [
"HLT_e17_lhvloose_L1EM15VHI",
"HLT_e20_lhvloose_L1EM15VH",
"HLT_e250_etcut_L1EM22VHI",
23 "HLT_e26_lhtight_ivarloose_L1EM22VHI",
"HLT_e26_lhtight_ivarloose_L1eEM26M",
24 "HLT_e60_lhmedium_L1EM22VHI",
"HLT_e60_lhmedium_L1eEM26M",
25 "HLT_e140_lhloose_L1EM22VHI",
"HLT_e140_lhloose_L1eEM26M",
26 "HLT_e300_etcut_L1EM22VHI",
"HLT_e300_etcut_L1eEM26M",
27 "HLT_e140_lhloose_noringer_L1EM22VHI",
"HLT_e140_lhloose_noringer_L1eEM26M"]
29 addRund3MuonTriggers = [
"HLT_mu24_ivarmedium_L1MU14FCH",
"HLT_mu50_L1MU14FCH",
"HLT_mu60_0eta105_msonly_L1MU14FCH",
"HLT_mu60_L1MU14FCH",
"HLT_mu80_msonly_3layersEC_L1MU14FCH"]
31 metTriggers = metTriggers+addRun3METTriggers
32 elTriggers = elTriggers+addRun3ElectronTriggers
33 muTriggers = muTriggers+addRund3MuonTriggers
36 if not flags.Input.isMC:
38 from CoolConvUtilities.MagFieldUtils
import getFieldForRun
39 magfield=
getFieldForRun(flags.Input.RunNumbers[0],lumiblock=flags.Input.LumiBlockNumbers[0])
40 addTtbarEvents = magfield.solenoidCurrent() > 0
44 tracks =
'InDetTrackParticles.TrkIsoPt1000_ptcone20 < 0.12*InDetTrackParticles.pt && InDetTrackParticles.DFCommonTightPrimary && abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 5.0*mm'
46 trackRequirements =
'(InDetTrackParticles.pt > 6.*GeV && '+tracks+
' )'
47 trackRequirementsMu =
'(InDetTrackParticles.pt > 40.*GeV && '+tracks+
' )'
48 jetRequirementsTtbar =
'(AntiKt4EMPFlowJets.pt > 18*GeV && log(BTagging_AntiKt4EMPFlow.DL1dv01_pb/(0.018*BTagging_AntiKt4EMPFlow.DL1dv01_pc+(1.0-0.018)*BTagging_AntiKt4EMPFlow.DL1dv01_pu)) > 0.948)'
49 trackRequirementsNoIso =
'(InDetTrackParticles.pt > 10.*GeV && abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 5.0*mm )'
51 muonsRequirements =
'(Muons.pt >= 20.*GeV) && (abs(Muons.eta) < 2.6) && (Muons.DFCommonMuonPassPreselection)'
52 electronsRequirements =
'(Electrons.pt > 20.*GeV) && (abs(Electrons.eta) < 2.6) && ((Electrons.Loose) || (Electrons.DFCommonElectronsLHLoose))'
55 expression_W =
'( count('+trackRequirements+
') >=1 )'
56 expression_Mu =
'( count('+trackRequirementsMu+
') >=1 )'
57 expression_ttbarEl =
'( count('+electronsRequirements+
') >=1 ) && ( count('+jetRequirementsTtbar+
') >=1 ) && ( count('+trackRequirementsNoIso+
') >=2 ) && ( count('+trackRequirements+
') >=1 )'
58 expression_ttbarElNoTag =
'( count('+electronsRequirements+
') >=1 ) && ( count('+trackRequirements+
') >=1 )'
59 expression_ttbarMu =
'( count('+muonsRequirements+
') >=1 ) && ( count('+jetRequirementsTtbar+
') >=1 ) && ( count('+trackRequirementsNoIso+
') >=2 ) && ( count('+trackRequirements+
') >=1 )'
60 expression_ttbarMuNoTag =
'( count('+muonsRequirements+
') >=1 ) && ( count('+trackRequirements+
') >=1 )'
62 skimmingTool_W = CompFactory.DerivationFramework.xAODStringSkimmingTool(name =
"skimmingTool_W", expression = expression_W)
63 acc.addPublicTool(skimmingTool_W)
64 skimmingTool_Mu = CompFactory.DerivationFramework.xAODStringSkimmingTool(name =
"skimmingTool_mu", expression = expression_Mu)
65 acc.addPublicTool(skimmingTool_Mu)
68 JETM12TriggerSkimmingTool_W = CompFactory.DerivationFramework.TriggerSkimmingTool(name =
"JETM12TriggerSkimmingTool_W", TriggerListOR = metTriggers)
69 acc.addPublicTool(JETM12TriggerSkimmingTool_W)
70 JETM12TriggerSkimmingTool_ele = CompFactory.DerivationFramework.TriggerSkimmingTool(name =
"JETM12TriggerSkimmingTool_ele", TriggerListOR = elTriggers)
71 acc.addPublicTool(JETM12TriggerSkimmingTool_ele)
72 JETM12TriggerSkimmingTool_mu = CompFactory.DerivationFramework.TriggerSkimmingTool(name =
"JETM12TriggerSkimmingTool_mu", TriggerListOR = muTriggers)
73 acc.addPublicTool(JETM12TriggerSkimmingTool_mu)
75 JETM12SkimmingTool_W = CompFactory.DerivationFramework.FilterCombinationAND(name=
"JETM12SkimmingTool_W", FilterList=[skimmingTool_W, JETM12TriggerSkimmingTool_W])
76 acc.addPublicTool(JETM12SkimmingTool_W)
77 JETM12SkimmingTool_Mu = CompFactory.DerivationFramework.FilterCombinationAND(name=
"JETM12SkimmingTool_Mu", FilterList=[skimmingTool_Mu, JETM12TriggerSkimmingTool_mu])
78 acc.addPublicTool(JETM12SkimmingTool_Mu)
80 finalSkimmingTools = [JETM12SkimmingTool_W,JETM12SkimmingTool_Mu]
83 skimmingTool_ttbarEl = CompFactory.DerivationFramework.xAODStringSkimmingTool(name =
"skimmingTool_ttbarEl", expression = expression_ttbarEl)
84 acc.addPublicTool(skimmingTool_ttbarEl)
85 skimmingTool_ttbarElNoTag = CompFactory.DerivationFramework.xAODStringSkimmingTool(name =
"skimmingTool_ttbarElNoTag", expression = expression_ttbarElNoTag)
86 acc.addPublicTool(skimmingTool_ttbarElNoTag)
87 skimmingTool_ttbarMu = CompFactory.DerivationFramework.xAODStringSkimmingTool(name =
"skimmingTool_ttbarMu", expression = expression_ttbarMu)
88 acc.addPublicTool(skimmingTool_ttbarMu)
89 skimmingTool_ttbarMuNoTag = CompFactory.DerivationFramework.xAODStringSkimmingTool(name =
"skimmingTool_ttbarMuNoTag", expression = expression_ttbarMuNoTag)
90 acc.addPublicTool(skimmingTool_ttbarMuNoTag)
92 JETM12SkimmingTool_ttbarEl = CompFactory.DerivationFramework.FilterCombinationAND(name=
"JETM12SkimmingTool_ttbarEl",FilterList=[skimmingTool_ttbarEl,JETM12TriggerSkimmingTool_ele])
93 acc.addPublicTool(JETM12SkimmingTool_ttbarEl)
94 JETM12SkimmingTool_ttbarElNoTag = CompFactory.DerivationFramework.FilterCombinationAND(name=
"JETM12SkimmingTool_ttbarElNoTag",FilterList=[skimmingTool_ttbarElNoTag,JETM12TriggerSkimmingTool_ele])
95 acc.addPublicTool(JETM12SkimmingTool_ttbarElNoTag)
96 JETM12SkimmingTool_ttbarMu = CompFactory.DerivationFramework.FilterCombinationAND(name=
"JETM12SkimmingTool_ttbarMu",FilterList=[skimmingTool_ttbarMu,JETM12TriggerSkimmingTool_mu])
97 acc.addPublicTool(JETM12SkimmingTool_ttbarMu)
98 JETM12SkimmingTool_ttbarMuNoTag = CompFactory.DerivationFramework.FilterCombinationAND(name=
"JETM12SkimmingTool_ttbarMuNoTag",FilterList=[skimmingTool_ttbarMuNoTag,JETM12TriggerSkimmingTool_mu])
99 acc.addPublicTool(JETM12SkimmingTool_ttbarMuNoTag)
101 finalSkimmingTools = [JETM12SkimmingTool_W, JETM12SkimmingTool_Mu, JETM12SkimmingTool_ttbarEl, JETM12SkimmingTool_ttbarMu, JETM12SkimmingTool_ttbarElNoTag, JETM12SkimmingTool_ttbarMuNoTag]
103 JETM12SkimmingTool = CompFactory.DerivationFramework.FilterCombinationOR(name=
"JETM12SkimmingTool", FilterList=finalSkimmingTools)
104 acc.addPublicTool(JETM12SkimmingTool, primary =
True)