ATLAS Offline Software
DVTriggerConfiguration.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 from AthenaCommon.CFElements import seqAND
3 from AthenaCommon.Logging import logging
4 
5 from TrigInDetConfig.utils import cloneFlagsToActiveConfig
6 from TrigInDetConfig.TrigInDetConfig import trigInDetLRTCfg
7 
8 from AthenaConfiguration.ComponentFactory import CompFactory
9 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10 from TriggerMenuMT.HLT.Config.MenuComponents import MenuSequence, SelectionCA, InViewRecoCA, InEventRecoCA
11 
12 from TrigEDMConfig.TriggerEDM import recordable
13 
14 logging.getLogger().info("Importing %s",__name__)
15 log = logging.getLogger(__name__)
16 
17 trkPairOutName = "HLT_TrigDV_VSITrkPair"
18 vtxOutName = "HLT_TrigDV_VSIVertex"
19 vtxCountName = "HLT_TrigDV_VtxCount"
20 
21 def 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.name)
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  )
grepfile.info
info
Definition: grepfile.py:38
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.TrigInDetConfig.trigInDetLRTCfg
def trigInDetLRTCfg(flags, LRTInputCollection, roisKey, in_view, extra_view_inputs=tuple())
Definition: TrigInDetConfig.py:87
python.utils.cloneFlagsToActiveConfig
AthConfigFlags cloneFlagsToActiveConfig(AthConfigFlags flags, str config_name)
Definition: Trigger/TrigTools/TrigInDetConfig/python/utils.py:55
python.CFElements.seqAND
def seqAND(name, subs=[])
Definition: CFElements.py:25
DVTriggerConfiguration.DVRecoSequenceGenCfg
def DVRecoSequenceGenCfg(flags)
Definition: DVTriggerConfiguration.py:77
TrigVrtSecInclusiveConfig.TrigVrtSecInclusiveCfg
def TrigVrtSecInclusiveCfg(flags, name, FirstPassTracksName, SecondPassTracksName, PrimaryVertexInputName, VxCandidatesOutputName, TrkPairOutputName, recordTrkPair=True)
Definition: TrigVrtSecInclusiveConfig.py:94
python.TriggerEDM.recordable
def recordable(arg, runVersion=3)
Definition: TriggerEDM.py:34
DVTriggerConfiguration.DVRecoFragment
def DVRecoFragment(flags)
Definition: DVTriggerConfiguration.py:21
python.TrigVrtSecInclusiveHypoConfig.createTrigVSIHypoAlgCfg
CompFactory createTrigVSIHypoAlgCfg(AthConfigFlags flags, str name, **kwargs)
Definition: TrigVrtSecInclusiveHypoConfig.py:11
DVTriggerConfiguration.DVTriggerEDSequenceGenCfg
def DVTriggerEDSequenceGenCfg(flags)
Definition: DVTriggerConfiguration.py:94