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 name=
"DRZmumuMassTool",
22 ContainerName=
"Muons",
23 ObjectRequirements=sel_muon1,
24 SecondObjectRequirements=sel_muon2,
25 MassHypothesis=105.66,
26 SecondMassHypothesis=105.66,
27 StoreGateEntryName=massEntryName,
28 InputDecorNames=[
"Muons.ptcone40"]))
30 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import AsgSelectionToolWrapperCfg
31 from MuonSelectorTools.MuonSelectorToolsConfig
import MuonSelectionToolCfg
32 muon_sel_tool = result.popToolsAndMerge(
MuonSelectionToolCfg(flags, name=
"DRAW_ZMUMU_MuonsSelector",
35 result.addPublicTool(muon_sel_tool)
37 name=
"DRAW_ZMUMU_GoodMuon_SkimmingTool",
38 ContainerName=
"Muons",
39 StoreGateEntryName=
"isMedium_DRAWZmumu",
40 AsgSelectionTool=muon_sel_tool))
42 dimuonMassString =
"( count ( {mass} > 70*GeV && {mass} < 110*GeV ) >= 1 )".
format(
45 muonSkimmingString =
"( count (Muons.pt > 20*GeV && Muons.isMedium_DRAWZmumu == 1) >= 1)"
46 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import xAODStringSkimmingToolCfg
48 name=
"DRAW_ZMUMU_DiMuonMass_SkimmingTool",
49 expression=
"{mass} && {muon} ".
format(mass=dimuonMassString,
50 muon=muonSkimmingString)))
53 from TriggerMenuMT.TriggerAPI.TriggerAPI
import TriggerAPI
54 from TriggerMenuMT.TriggerAPI.TriggerEnums
import TriggerPeriod, TriggerType
55 periods = TriggerPeriod.y2015 | TriggerPeriod.y2016 | TriggerPeriod.y2017 | TriggerPeriod.y2018 | TriggerPeriod.future
56 TriggerAPI.setConfigFlags(flags)
57 allUnprescaledTriggers = TriggerAPI.getLowestUnprescaledAnyPeriod(
58 periods, TriggerType.mu) + [
"HLT_noalg_L1MU14FCH",
"L1_MU14FCH"]
59 print(
"DRAW_ZMUMU: will skim on an OR of the following muon triggers (list provided at run-time by the TriggerAPI):")
60 for trig
in allUnprescaledTriggers:
63 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import TriggerSkimmingToolCfg
65 name=
"DRAWZMUMUTriggerSkimmingTool",
66 TriggerListOR=allUnprescaledTriggers))
69 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import FilterCombinationANDCfg
71 name=
"DRAW_ZMUMU_FinalFilter",
72 FilterList=[dimuonMassSkimmingTool,
73 triggerSkimmingTool]))
75 kwargs.setdefault(
"AugmentationTools", [muonSkimmingTool, mass_tool])
76 kwargs.setdefault(
"SkimmingTools", [DRAW_ZMUMU_SkimmingTool])
77 kwargs.setdefault(
"doChronoStat", flags.Concurrency.NumThreads <= 1)
78 the_alg = CompFactory.DerivationFramework.DerivationKernel(name, **kwargs)
79 result.addEventAlgo(the_alg, primary=
True)
89 formatName=
'DRAW_ZMUMU',
90 filename=flags.Output.DRAW_ZmumuFileName))