ATLAS Offline Software
Loading...
Searching...
No Matches
DVTriggerConfiguration.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2from AthenaCommon.CFElements import seqAND
3from AthenaCommon.Logging import logging
4
5from TrigInDetConfig.utils import cloneFlagsToActiveConfig
6from TrigInDetConfig.TrigInDetConfig import trigInDetLRTCfg
7
8from AthenaConfiguration.ComponentFactory import CompFactory
9from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10from TriggerMenuMT.HLT.Config.MenuComponents import MenuSequence, SelectionCA, InViewRecoCA, InEventRecoCA
11
12from TrigEDMConfig.TriggerEDM import recordable
13
14logging.getLogger().info("Importing %s",__name__)
15log = logging.getLogger(__name__)
16
17trkPairOutName = "HLT_TrigDV_VSITrkPair"
18vtxOutName = "HLT_TrigDV_VSIVertex"
19vtxCountName = "HLT_TrigDV_VtxCount"
20
21def DVRecoFragment(flags):
22
23 selAcc = SelectionCA("DVRecoSequence1")
24
25 inputMakerAlg = CompFactory.EventViewCreatorAlgorithm(
26 "IMDVRoILRT",
27 mergeUsingFeature = False,
28 RoITool = CompFactory.ViewCreatorDVROITool(
29 'ViewCreatorDVRoI',
30 RoisWriteHandleKey = recordable( flags.Trigger.InDetTracking.DVtxLRT.roi ),
31 RoIEtaWidth = flags.Trigger.InDetTracking.DVtxLRT.etaHalfWidth,
32 RoIPhiWidth = flags.Trigger.InDetTracking.DVtxLRT.phiHalfWidth,
33 ),
34 Views = "DVRoIViews",
35 InViewRoIs = "InViewRoIs",
36 RequireParentView = False,
37 ViewFallThrough = True,
38 ViewNodeName = selAcc.name+'InView',
39 )
40
41 reco = InViewRecoCA('DVRecoStep',viewMaker=inputMakerAlg)
42
43 flagsWithTrk = cloneFlagsToActiveConfig(flags, flags.Trigger.InDetTracking.DVtxLRT.input_name, log)
44
45 lrt_algs = trigInDetLRTCfg(
46 flagsWithTrk,
47 flags.Tracking.ActiveConfig.trkTracks_FTF,
48 inputMakerAlg.InViewRoIs,
49 in_view=True,
50 extra_view_inputs=(
51 ( 'xAOD::TrackParticleContainer' , flags.Tracking.ActiveConfig.tracks_FTF ),
52 ( 'xAOD::VertexContainer' , flags.Tracking.ActiveConfig.vertex ),
53 )
54 )
55
56 from TrigVrtSecInclusive.TrigVrtSecInclusiveConfig import TrigVrtSecInclusiveCfg
57 vertexingAlgs = TrigVrtSecInclusiveCfg( flags, "TrigVrtSecInclusive_TrigDV",
58 FirstPassTracksName = flags.Tracking.ActiveConfig.tracks_FTF,
59 SecondPassTracksName = flags.Trigger.InDetTracking.DVtxLRT.tracks_FTF,
60 PrimaryVertexInputName = flags.Tracking.ActiveConfig.vertex,
61 VxCandidatesOutputName = recordable(vtxOutName),
62 TrkPairOutputName = recordable(trkPairOutName) )
63
64 recoAlgSequence = seqAND("DVRecoSeq")
65 acc = ComponentAccumulator()
66
67 acc.addSequence(recoAlgSequence)
68
69 acc.merge(lrt_algs)
70 acc.merge(vertexingAlgs)
71
72 reco.mergeReco(acc)
73 selAcc.mergeReco(reco)
74 return selAcc
75
76
78 from TrigStreamerHypo.TrigStreamerHypoConfig import StreamerHypoToolGenerator
79
80 selAcc = DVRecoFragment(flags)
81
82 HypoAlg = CompFactory.TrigStreamerHypoAlg("TrigDVRecoDummyStream")
83 selAcc.addHypoAlgo(HypoAlg)
84
85 log.debug("Building the Step dictinary for TrigDV reco")
86 return MenuSequence(flags,
87 selAcc,
88 HypoToolGen = StreamerHypoToolGenerator
89 )
90
91
92
93
95 from TrigLongLivedParticlesHypo.TrigVrtSecInclusiveHypoConfig import TrigVSIHypoToolFromDict
96 from TrigLongLivedParticlesHypo.TrigVrtSecInclusiveHypoConfig import createTrigVSIHypoAlgCfg
97
98 selAcc = SelectionCA("TrigDVEDEmptyStep")
99
100 theHypoAlg = createTrigVSIHypoAlgCfg(flags, "TrigDVHypoAlg",
101 verticesKey = recordable(vtxOutName),
102 vtxCountKey = recordable(vtxCountName))
103
104
105 #run at the event level
106 inputMakerAlg = CompFactory.InputMakerForRoI( "IM_TrigDV_ED" )
107 inputMakerAlg.RoITool = CompFactory.ViewCreatorInitialROITool()
108
109 reco = InEventRecoCA('DVEDStep',inputMaker=inputMakerAlg)
110
111 selAcc.mergeReco(reco)
112 selAcc.addHypoAlgo(theHypoAlg)
113
114 log.info("Building the Step dictinary for DisVtxTrigger!")
115 return MenuSequence(flags,
116 selAcc,
117 HypoToolGen = TrigVSIHypoToolFromDict,
118 )