ATLAS Offline Software
BjetMenuSequences.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from TrigEDMConfig.TriggerEDM import recordable
4 
5 from ..Config.MenuComponents import MenuSequence, SelectionCA, InViewRecoCA
6 from AthenaConfiguration.AccumulatorCache import AccumulatorCache
7 from AthenaConfiguration.ComponentFactory import CompFactory
8 
9 
10 @AccumulatorCache
11 def 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  BTagName = recordable(f'{jc_key}BTagging')
21 
22  roiTool = CompFactory.ViewCreatorCentredOnJetWithPVConstraintROITool(
23  RoisWriteHandleKey = recordable( outputRoIName ),
24  VertexReadHandleKey = prmVtxKey,
25  PrmVtxLink = prmVtxKey.replace( "HLT_","" ),
26  RoIEtaWidth = flags.Trigger.InDetTracking.bjet.etaHalfWidth,
27  RoIPhiWidth = flags.Trigger.InDetTracking.bjet.phiHalfWidth,
28  RoIZWidth = flags.Trigger.InDetTracking.bjet.zedHalfWidth,
29  )
30 
31  # Second stage of Fast Tracking and Precision Tracking
32  bJetBtagSequence = InViewRecoCA(f"BTagViews_{jc_name}", RoITool = roiTool,
33  InViewRoIs = "InViewRoIs",
34  mergeUsingFeature = True,
35  RequireParentView = False,
36  ViewFallThrough = True,
37  InViewJets = recordable( f'{jc_key}bJets' ),
38  # BJet specific
39  PlaceJetInView = True)
40  InputMakerAlg = bJetBtagSequence.inputMaker()
41 
42  from TriggerMenuMT.HLT.Bjet.BjetTrackingConfig import secondStageBjetTrackingCfg
43  secondStageAlgs = secondStageBjetTrackingCfg(flags,
44  inputRoI=InputMakerAlg.InViewRoIs,
45  inputVertex=prmVtxKey,
46  inputJets=InputMakerAlg.InViewJets)
47 
48  PTTrackParticles = flags.Trigger.InDetTracking.bjet.tracks_IDTrig # Final output xAOD::TrackParticle collection
49 
50  from TriggerMenuMT.HLT.Bjet.BjetFlavourTaggingConfig import flavourTaggingCfg
51  flavourTaggingAlgs = flavourTaggingCfg(flags,
52  inputJets=str(InputMakerAlg.InViewJets),
53  inputVertex=prmVtxKey,
54  inputTracks=PTTrackParticles,
55  BTagName=BTagName,
56  inputMuons=None)
57  bJetBtagSequence.mergeReco(secondStageAlgs)
58  bJetBtagSequence.mergeReco(flavourTaggingAlgs)
59 
60  from TrigGenericAlgs.TrigGenericAlgsConfig import ROBPrefetchingAlgCfg_Si
61  robPrefetch = ROBPrefetchingAlgCfg_Si(flags, nameSuffix=InputMakerAlg.name)
62 
63  BjetAthSequence = SelectionCA( f"BjetAthSequence_{jc_name}_step2", )
64  BjetAthSequence.mergeReco(bJetBtagSequence, robPrefetchCA=robPrefetch)
65 
66  from TrigBjetHypo.TrigBjetMonitoringConfig import TrigBjetOnlineMonitoring
67  hypo = CompFactory.TrigBjetBtagHypoAlg(
68  f"TrigBjetBtagHypoAlg_{jc_name}",
69  # keys
70  BTaggedJetKey = InputMakerAlg.InViewJets,
71  BTaggingKey = BTagName,
72  TracksKey = PTTrackParticles,
73  PrmVtxKey = InputMakerAlg.RoITool.VertexReadHandleKey,
74  # links for navigation
75  BTaggingLink = BTagName.replace( "HLT_","" ),
76  PrmVtxLink = InputMakerAlg.RoITool.PrmVtxLink,
77  # monitoring tool for the global histograms
78  MonTool = TrigBjetOnlineMonitoring(flags)
79  )
80  BjetAthSequence.addHypoAlgo(hypo)
81 
82  from TrigBjetHypo.TrigBjetBtagHypoTool import TrigBjetBtagHypoToolFromDict
83  return MenuSequence(flags,
84  BjetAthSequence,
85  HypoToolGen = TrigBjetBtagHypoToolFromDict)
86 
python.HLT.Bjet.BjetTrackingConfig.secondStageBjetTrackingCfg
ComponentAccumulator secondStageBjetTrackingCfg(flags, str inputRoI, str inputVertex, str inputJets)
Definition: BjetTrackingConfig.py:7
TrigBjetMonitoringConfig.TrigBjetOnlineMonitoring
def TrigBjetOnlineMonitoring(flags, name="TrigBjetOnlineMonitoring")
Definition: TrigBjetMonitoringConfig.py:22
python.HLT.Bjet.BjetFlavourTaggingConfig.flavourTaggingCfg
def flavourTaggingCfg(flags, inputJets, inputVertex, inputTracks, BTagName, inputMuons="")
Definition: BjetFlavourTaggingConfig.py:15
python.TrigGenericAlgsConfig.ROBPrefetchingAlgCfg_Si
def ROBPrefetchingAlgCfg_Si(flags, nameSuffix, **kwargs)
Definition: TrigGenericAlgsConfig.py:57
python.TriggerEDM.recordable
def recordable(arg, runVersion=3)
Definition: TriggerEDM.py:34
str
Definition: BTagTrackIpAccessor.cxx:11
python.HLT.Bjet.BjetMenuSequences.getBJetSequenceGenCfg
def getBJetSequenceGenCfg(flags, jc_name=None)
Definition: BjetMenuSequences.py:11