4from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
5from AthenaConfiguration.ComponentFactory
import CompFactory
6from AthenaConfiguration.Enums
import MetadataCategory
7from AthenaCommon.CFElements
import seqAND
12 """Configure the example skimming tool"""
13 acc = ComponentAccumulator()
16 ExtraData += [
'xAOD::MuonContainer/Muons']
17 ExtraData += [
'xAOD::ElectronContainer/Electrons']
18 ExtraData += [
'xAOD::PhotonContainer/Photons']
19 ExtraData += [
'xAOD::TrackParticleContainer/InDetTrackParticles']
21 acc.addSequence( seqAND(
"HION4Sequence") )
22 acc.getSequence(
"HION4Sequence").ExtraDataForDynamicConsumers = ExtraData
23 acc.getSequence(
"HION4Sequence").ProcessDynamicDataDependencies =
True
25 muonsRequirements =
'(Muons.pt >= 2.0*GeV) && (abs(Muons.eta) < 2.6)'
26 muonOnlySelection =
'count('+muonsRequirements+
') >= 1'
28 electronsRequirements =
'(Electrons.pt > 1.5*GeV) && (abs(Electrons.eta) < 2.6)'
29 electronOnlySelection =
'count('+electronsRequirements+
') >= 1'
31 photonsRequirements =
'(Photons.pt >= 1.5*GeV)'
32 photonOnlySelection =
'count('+photonsRequirements+
') >=2'
34 electronPhotonSelection =
'(count('+electronsRequirements+
') + count('+photonsRequirements+
')) >= 2'
36 trackRequirements =
'(InDetTrackParticles.pt >= 0.2*GeV) && (abs(InDetTrackParticles.eta) < 2.5)'
37 trackOnlySelection =
'( count('+trackRequirements+
') >= 2 && 5 >= count('+trackRequirements+
') )'
39 tightTrackRequirements =
'(InDetTrackParticles.pt >= 1*GeV) && (abs(InDetTrackParticles.eta) < 2.5)'
40 tightTrackOnlySelection =
'( count('+tightTrackRequirements+
') == 2 )'
42 objectSelection =
'('+muonOnlySelection+
' || '+electronOnlySelection+
' || '+photonOnlySelection+
' || '+electronPhotonSelection+
' || '+trackOnlySelection+
')'
44 if flags.Trigger.EDMVersion != -1:
45 from DerivationFrameworkHI
import ListTriggers
46 VMtrigger=ListTriggers.HION4SkimmingTriggersVM()
47 triggers=ListTriggers.HION4SkimmingTriggersALL()
48 expression =
'( (' +
' || '.join(triggers) +
') && '+objectSelection+
') || ( '+
' || '.join(VMtrigger)+
' && '+tightTrackOnlySelection+
')'
50 expression =
'( '+objectSelection+
' ) || ( '+tightTrackOnlySelection+
' )'
52 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import (
53 xAODStringSkimmingToolCfg)
54 acc.addPublicTool(acc.getPrimaryAndMerge(xAODStringSkimmingToolCfg(
55 flags, name =
"HION4StringSkimmingTool", expression = expression)), primary =
True)
60 """Configure the example augmentation tool"""
61 acc = ComponentAccumulator()
62 acc.addPublicTool(CompFactory.DerivationFramework.AugmentationDeltaPoverP(name =
"HION4AugmentationTool"),
68 """Configure the derivation framework driving algorithm (kernel)"""
69 acc = ComponentAccumulator()
72 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, SkimmingTools = [skimmingTool]),
73 sequenceName=
"HION4Sequence")
79 acc = ComponentAccumulator()
80 acc.merge(
HION4KernelCfg(flags, name=
"HION4Kernel",StreamName =
"StreamDAOD_HION4"))
82 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
83 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
84 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
88 from DerivationFrameworkHI
import ListSlimming
90 HION4SlimmingHelper =
SlimmingHelper(
"HION4SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
93 AllVariables += ListSlimming.HION4ExtraContainersElectrons()
94 AllVariables += ListSlimming.HION4ExtraContainersTrigger()
95 AllVariables += ListSlimming.HION4AllVariablesGeneral()
97 HION4SlimmingHelper.SmartCollections = ListSlimming.HION4SmartCollections()
98 HION4SlimmingHelper.ExtraVariables = ListSlimming.HION4ExtraContentAll()
99 HION4SlimmingHelper.AllVariables = AllVariables
102 HION4SlimmingHelper.IncludeEGammaTriggerContent =
True
104 HION4SlimmingHelper.IncludeMuonTriggerContent =
True
106 HION4ItemList = HION4SlimmingHelper.GetItemList()
108 acc.merge(OutputStreamCfg(flags,
"DAOD_HION4", ItemList=HION4ItemList, AcceptAlgs=[
"HION4Kernel"]))
109 acc.merge(SetupMetaDataForStreamCfg(flags,
"DAOD_HION4", AcceptAlgs=[
"HION4Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
HION4KernelCfg(flags, name='HION4Kernel', **kwargs)
HION4SkimmingToolCfg(flags)
Skiming.
HION4AugmentationToolCfg(flags)