5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from AthenaConfiguration.Enums
import MetadataCategory
8 from AthenaCommon.CFElements
import seqAND
13 """Configure the example skimming tool"""
17 ExtraData += [
'xAOD::MuonContainer/Muons']
18 ExtraData += [
'xAOD::ElectronContainer/Electrons']
19 ExtraData += [
'xAOD::PhotonContainer/Photons']
20 ExtraData += [
'xAOD::TrackParticleContainer/InDetTrackParticles']
22 acc.addSequence(
seqAND(
"HION4Sequence") )
23 acc.getSequence(
"HION4Sequence").ExtraDataForDynamicConsumers = ExtraData
24 acc.getSequence(
"HION4Sequence").ProcessDynamicDataDependencies =
True
26 muonsRequirements =
'(Muons.pt >= 2.0*GeV) && (abs(Muons.eta) < 2.6)'
27 muonOnlySelection =
'count('+muonsRequirements+
') >= 1'
29 electronsRequirements =
'(Electrons.pt > 2.0*GeV) && (abs(Electrons.eta) < 2.6)'
30 electronOnlySelection =
'count('+electronsRequirements+
') >= 1'
32 photonsRequirements =
'(Photons.pt >= 2.0*GeV)'
33 photonOnlySelection =
'count('+photonsRequirements+
') >=2'
35 electronPhotonSelection =
'(count('+electronsRequirements+
') + count('+photonsRequirements+
')) >= 2'
37 trackRequirements =
'(InDetTrackParticles.pt >= 0.2*GeV) && (abs(InDetTrackParticles.eta) < 2.5)'
38 trackOnlySelection =
'( count('+trackRequirements+
') >= 2 && 5 >= count('+trackRequirements+
') )'
40 tightTrackRequirements =
'(InDetTrackParticles.pt >= 1*GeV) && (abs(InDetTrackParticles.eta) < 2.5)'
41 tightTrackOnlySelection =
'( count('+tightTrackRequirements+
') == 2 )'
43 objectSelection =
'('+muonOnlySelection+
' || '+electronOnlySelection+
' || '+photonOnlySelection+
' || '+electronPhotonSelection+
' || '+trackOnlySelection+
')'
45 from DerivationFrameworkHI
import ListTriggers
49 expression =
'( (' +
' || '.
join(triggers) +
') && '+objectSelection+
') || ( '+
' || '.
join(VMtrigger)+
' && '+tightTrackOnlySelection+
')'
51 from TrigDecisionTool.TrigDecisionToolConfig
import TrigDecisionToolCfg
53 acc.addPublicTool(CompFactory.DerivationFramework.xAODStringSkimmingTool(name =
"HION4StringSkimmingTool",
54 expression = expression,
55 TrigDecisionTool=tdt),
61 """Configure the example augmentation tool"""
63 acc.addPublicTool(CompFactory.DerivationFramework.AugmentationDeltaPoverP(name =
"HION4AugmentationTool"),
69 """Configure the derivation framework driving algorithm (kernel)"""
73 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, SkimmingTools = [skimmingTool]),
74 sequenceName=
"HION4Sequence")
81 acc.merge(
HION4KernelCfg(flags, name=
"HION4Kernel",StreamName =
"StreamDAOD_HION4"))
83 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
84 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
85 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
89 from DerivationFrameworkHI
import ListSlimming
91 HION4SlimmingHelper =
SlimmingHelper(
"HION4SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
100 HION4SlimmingHelper.AllVariables = AllVariables
103 HION4SlimmingHelper.IncludeEGammaTriggerContent =
True
105 HION4SlimmingHelper.IncludeMuonTriggerContent =
True
107 HION4ItemList = HION4SlimmingHelper.GetItemList()
109 acc.merge(
OutputStreamCfg(flags,
"DAOD_HION4", ItemList=HION4ItemList, AcceptAlgs=[
"HION4Kernel"]))
110 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_HION4", AcceptAlgs=[
"HION4Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))