ATLAS Offline Software
Loading...
Searching...
No Matches
BjetMenuSequences.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3from TrigEDMConfig.TriggerEDM import recordable
4
5from ..Config.MenuComponents import MenuSequence, SelectionCA, InViewRecoCA
6from AthenaConfiguration.AccumulatorCache import AccumulatorCache
7from AthenaConfiguration.ComponentFactory import CompFactory
8
9
10@AccumulatorCache
11def getBJetSequenceGenCfg(flags, jc_name=None):
12 if not jc_name:
13 raise ValueError("jet collection name is empty - pass the full HLT jet collection name to getBJetSequenceCfg().")
14
15 prmVtxKey = flags.Trigger.InDetTracking.fullScan.vertex
16 outputRoIName = flags.Trigger.InDetTracking.bjet.roi
17
18 jc_key = f'{jc_name}_'
19 # Output container names as defined in TriggerEDMRun3
20
21 roiTool = CompFactory.ViewCreatorCentredOnJetWithPVConstraintROITool(
22 RoisWriteHandleKey = recordable( outputRoIName ),
23 VertexReadHandleKey = prmVtxKey,
24 PrmVtxLink = prmVtxKey.replace( "HLT_","" ),
25 RoIEtaWidth = flags.Trigger.InDetTracking.bjet.etaHalfWidth,
26 RoIPhiWidth = flags.Trigger.InDetTracking.bjet.phiHalfWidth,
27 RoIZWidth = flags.Trigger.InDetTracking.bjet.zedHalfWidth,
28 )
29
30 # Second stage of Fast Tracking and Precision Tracking
31 bJetBtagSequence = InViewRecoCA(f"BTagViews_{jc_name}", RoITool = roiTool,
32 InViewRoIs = "InViewRoIs",
33 mergeUsingFeature = True,
34 RequireParentView = False,
35 ViewFallThrough = True,
36 InViewJets = recordable( f'{jc_key}bJets' ),
37 # BJet specific
38 PlaceJetInView = True)
39 InputMakerAlg = bJetBtagSequence.inputMaker()
40
41 from TriggerMenuMT.HLT.Bjet.BjetTrackingConfig import secondStageBjetTrackingCfg
42 secondStageAlgs = secondStageBjetTrackingCfg(flags,
43 inputRoI=InputMakerAlg.InViewRoIs,
44 inputVertex=prmVtxKey,
45 inputJets=InputMakerAlg.InViewJets)
46
47 PTTrackParticles = flags.Trigger.InDetTracking.bjet.tracks_IDTrig # Final output xAOD::TrackParticle collection
48
49 from TriggerMenuMT.HLT.Bjet.BjetFlavourTaggingConfig import flavourTaggingCfg
50 flavourTaggingAlgs = flavourTaggingCfg(flags,
51 inputJets=str(InputMakerAlg.InViewJets),
52 inputVertex=prmVtxKey,
53 inputTracks=PTTrackParticles,
54 inputMuons=None)
55 bJetBtagSequence.mergeReco(secondStageAlgs)
56 bJetBtagSequence.mergeReco(flavourTaggingAlgs)
57
58 from TrigGenericAlgs.TrigGenericAlgsConfig import ROBPrefetchingAlgCfg_Si
59 robPrefetch = ROBPrefetchingAlgCfg_Si(flags, nameSuffix=InputMakerAlg.name)
60
61 BjetAthSequence = SelectionCA( f"BjetAthSequence_{jc_name}_step2", )
62 BjetAthSequence.mergeReco(bJetBtagSequence, robPrefetchCA=robPrefetch)
63
64 from TrigBjetHypo.TrigBjetMonitoringConfig import TrigBjetOnlineMonitoring
65 hypo = CompFactory.TrigBjetBtagHypoAlg(
66 f"TrigBjetBtagHypoAlg_{jc_name}",
67 # keys
68 BTaggedJetKey = InputMakerAlg.InViewJets,
69 TracksKey = PTTrackParticles,
70 PrmVtxKey = InputMakerAlg.RoITool.VertexReadHandleKey,
71 # links for navigation
72 PrmVtxLink = InputMakerAlg.RoITool.PrmVtxLink,
73 # monitoring tool for the global histograms
74 MonTool = TrigBjetOnlineMonitoring(flags)
75 )
76 BjetAthSequence.addHypoAlgo(hypo)
77
78 from TrigBjetHypo.TrigBjetBtagHypoTool import TrigBjetBtagHypoToolFromDict
79 return MenuSequence(flags,
80 BjetAthSequence,
81 HypoToolGen = TrigBjetBtagHypoToolFromDict)
82
getBJetSequenceGenCfg(flags, jc_name=None)