3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from AthenaCommon.CFElements
import seqAND
6 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import InvariantMassToolCfg
7 from PrimaryDPDMaker.DRAWCommonByteStream
import DRAWCommonByteStreamCfg
13 result.addSequence(
seqAND(
"DRAWZMUMU_Sequence"))
15 massEntryName =
"DRZmumuMass"
17 sel_muon1 =
'Muons.pt > 25*GeV && Muons.ptcone40/Muons.pt < 0.3'
18 sel_muon2 =
'Muons.pt > 20*GeV && Muons.ptcone40/Muons.pt < 0.3'
21 "ExtraInputs", [(
'xAOD::MuonContainer',
'StoreGateSvc+Muons.ptcone40')])
24 name=
"DRZmumuMassTool",
25 ContainerName=
"Muons",
26 ObjectRequirements=sel_muon1,
27 SecondObjectRequirements=sel_muon2,
28 MassHypothesis=105.66,
29 SecondMassHypothesis=105.66,
30 StoreGateEntryName=massEntryName))
32 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import AsgSelectionToolWrapperCfg
33 from MuonSelectorTools.MuonSelectorToolsConfig
import MuonSelectionToolCfg
34 muon_sel_tool = result.popToolsAndMerge(
MuonSelectionToolCfg(flags, name=
"DRAW_ZMUMU_MuonsSelector",
37 result.addPublicTool(muon_sel_tool)
39 name=
"DRAW_ZMUMU_GoodMuon_SkimmingTool",
40 ContainerName=
"Muons",
41 StoreGateEntryName=
"isMedium_DRAWZmumu",
42 AsgSelectionTool=muon_sel_tool))
44 dimuonMassString =
"( count ( {mass} > 70*GeV && {mass} < 110*GeV ) >= 1 )".
format(
47 muonSkimmingString =
"( count (Muons.pt > 20*GeV && Muons.isMedium_DRAWZmumu == 1) >= 1)"
48 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import xAODStringSkimmingToolCfg
50 name=
"DRAW_ZMUMU_DiMuonMass_SkimmingTool",
51 expression=
"{mass} && {muon} ".
format(mass=dimuonMassString,
52 muon=muonSkimmingString)))
55 from TriggerMenuMT.TriggerAPI.TriggerAPI
import TriggerAPI
56 from TriggerMenuMT.TriggerAPI.TriggerEnums
import TriggerPeriod, TriggerType
57 periods = TriggerPeriod.y2015 | TriggerPeriod.y2016 | TriggerPeriod.y2017 | TriggerPeriod.y2018 | TriggerPeriod.future
58 TriggerAPI.setConfigFlags(flags)
59 allUnprescaledTriggers = TriggerAPI.getLowestUnprescaledAnyPeriod(
60 periods, TriggerType.mu) + [
"HLT_noalg_L1MU14FCH",
"L1_MU14FCH"]
61 print(
"DRAW_ZMUMU: will skim on an OR of the following muon triggers (list provided at run-time by the TriggerAPI):")
62 for trig
in allUnprescaledTriggers:
65 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import TriggerSkimmingToolCfg
67 name=
"DRAWZMUMUTriggerSkimmingTool",
68 TriggerListOR=allUnprescaledTriggers))
71 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import FilterCombinationANDCfg
73 name=
"DRAW_ZMUMU_FinalFilter",
74 FilterList=[dimuonMassSkimmingTool,
75 triggerSkimmingTool]))
77 kwargs.setdefault(
"AugmentationTools", [muonSkimmingTool, mass_tool])
78 kwargs.setdefault(
"SkimmingTools", [DRAW_ZMUMU_SkimmingTool])
79 kwargs.setdefault(
"doChronoStat", flags.Concurrency.NumThreads <= 1)
80 the_alg = CompFactory.DerivationFramework.DerivationKernel(name, **kwargs)
81 result.addEventAlgo(the_alg, primary=
True)
91 formatName=
'DRAW_ZMUMU',
92 filename=flags.Output.DRAW_ZmumuFileName))