ATLAS Offline Software
Loading...
Searching...
No Matches
TriggerJetMods.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2from AthenaConfiguration.ComponentFactory import CompFactory
3from JetRecConfig.JetDefinition import JetModifier
4
5
8
9
10# HLT settings for Jet vertex tagger with neural network.
11def getTrkAugNNJvtTool(jetdef, modspec):
12 nnjvt_trkaug = CompFactory.getComp("JetPileupTag::JetVertexNNTagger")(
13 "nnjvt_trkaugv1",
14 VertexContainer = jetdef._cflags.Jet.Context[modspec or jetdef.context]["Vertices"],
15 SuppressInputDependence = True,
16 UseTrkAugNN = True,
17 TrkAugNNConfigDir = jetdef._cflags.Trigger.Jet.nnJVTConfigDir,
18 TrkAugNNParamFile = "TrkAugNNJVT.Network.graph.HLT.json",
19 TrkAugNNCutFile = "TrkAugNNJVT.Cuts.HLT.json",
20 )
21 return nnjvt_trkaug
22
23# Many JetMoment tools need to know the name of the container they operate on.
24# We set the function below as the 'JetContainer' property so the config system
25# can assign the right name to the c++ tool.
26def _jetname(jetdef,modspec):
27 return jetdef.fullname()
28
29from JetRecConfig.StandardJetMods import stdJetModifiers
30stdJetModifiers.update(
31
32 # No need for the special momentum scales, just copy the basic four-vec
33 # to "DetectorEtaPhi", because we're not doing origin correction
34 # and certainly not with the offline collection names
35 ConstitFourMom_copy = JetModifier("JetConstitFourMomTool", "constitfourmom_copy",
36 JetScaleNames = ["DetectorEtaPhi"],
37 AltConstitColls = [""],
38 AltConstitScales = [0],
39 AltJetScales = ["JetConstitScaleMomentum"]
40 ),
41 Cleaning = JetModifier("JetCleaningTool","jetcleaning_{modspec}",
42 # This allows to set the modifier using a string like
43 # "Cleaning:CLEAN_LEVEL" as defined in JetCleaningTool
44 # (example "Cleaning:LooseBad")
45 CutLevel=lambda _, modspec: str(modspec),
46 prereqs=[f"mod:{mod}" for mod in ['CaloQuality']],
47 JetContainer = _jetname,
48 ),
49 # Note that in the current implementation, if we were to change only the NN model
50 # and keep the same input variables (or some subset of them), there would be
51 # repeated attempts to write the input branches, causing the job to fail.
52 #
53 # Suffixes could be added on the inputs, but this would add a lot of redundant
54 # info, so it may be more practical at some stage to refactor and generate the
55 # input decorations in an independent tool run as a precursor.
56 NNJVT_TrkAugV1 = JetModifier("JetVertexNNTagger", "nnjvt_trkaugv1",
57 createfn=getTrkAugNNJvtTool,
58 prereqs = [ "mod:TrackMoments" ],
59 JetContainer = _jetname,
60 JVTName = 'NNJvtTrkAugV1',
61 passJvtName = 'NNJvtTrkAugV1Pass',
62 )
63)
getTrkAugNNJvtTool(jetdef, modspec)
Special modifier setups used by jet trigger, but not in offline We just extend the stdJetModifiers fr...