ATLAS Offline Software
Functions | Variables
JetMomentToolsConfig Namespace Reference

Functions

def idTrackSelToolFromJetCtx (trkOpt, trkProperties)
 
def getEMScaleMomTool (jetdef, modspec="")
 
def getConstitFourMomTool (jetdef, modspec="")
 
def getJVFTool (jetdef, modspec)
 
def getJVTTool (jetdef, modspec)
 
def getNNJvtTool (jetdef, modspec)
 
def getTrackMomentsTool (jetdef, modspec)
 
def getTrackSumMomentsTool (jetdef, modspec)
 
def getOriginCorrVxTool (jetdef, modspec)
 
def getJetPtAssociationTool (jetdef, modspec)
 
def getQGTaggingTool (jetdef, modspec)
 
def getPFlowfJVTTool (jetdef, modspec)
 
def getPFlowbJVTTool (jetdef, modspec)
 
def getBoostedJetTaggerTool (jetdef, modspec)
 

Variables

 jetmomentlog = Logging.logging.getLogger('JetMomentToolsConfig')
 

Function Documentation

◆ getBoostedJetTaggerTool()

def JetMomentToolsConfig.getBoostedJetTaggerTool (   jetdef,
  modspec 
)

Definition at line 244 of file JetMomentToolsConfig.py.

244 def getBoostedJetTaggerTool(jetdef, modspec):
245 
246  jssutils = CompFactory.JSSTaggerUtils("JSSTaggerUtils/MyTagger")
247 
248 
249  bjtTool = CompFactory.BoostedJetTaggerTool("BoostedJetTaggerTool",
250  MLTagger = jssutils,
251  DecorationName = "QGTransformer",
252  CalibArea = "QGConstituentTagger/Nov24",
253  ConfigFile = "QGTagger_AntiKt04PFlow_Transformer.dat"
254  )
255 
256  return bjtTool

◆ getConstitFourMomTool()

def JetMomentToolsConfig.getConstitFourMomTool (   jetdef,
  modspec = "" 
)

Definition at line 54 of file JetMomentToolsConfig.py.

54 def getConstitFourMomTool(jetdef, modspec=""):
55 
59  CaloClusterStates = {
60  "UNKNOWN" : -1,
61  "UNCALIBRATED" : 0,
62  "CALIBRATED" : 1,
63  "ALTCALIBRATED" : 2,
64  "NSTATES" : 3
65  }
66 
67  cfourmom = CompFactory.JetConstitFourMomTool("constitfourmom_{0}".format(jetdef.basename))
68  if "LCTopo" in jetdef.basename or "EMTopo" in jetdef.basename:
69  cfourmom.JetScaleNames = ["DetectorEtaPhi"]
70  if "HLT_" in jetdef.fullname():
71  cfourmom.AltConstitColls = [""]
72  cfourmom.AltConstitScales = [0]
73  cfourmom.AltJetScales = ["JetConstitScaleMomentum"]
74  else:
75  clstate = "CALIBRATED" if "LCTopo" in jetdef.basename else "UNCALIBRATED"
76  cfourmom.AltConstitColls = [jetdef.inputdef.inputname]
77  cfourmom.AltConstitScales = [CaloClusterStates[clstate]]
78  cfourmom.AltJetScales = [""]
79  # Drop the LC-calibrated four-mom for EMTopo jets as we only wanted it as a possibility
80  # in MET CST calculations but never used it
81  elif "PFlow" in jetdef.basename or "UFO" in jetdef.basename:
82  cfourmom.JetScaleNames = ["DetectorEtaPhi"]
83  cfourmom.AltConstitColls = [""]
84  cfourmom.AltConstitScales = [0]
85  cfourmom.AltJetScales = ["JetConstitScaleMomentum"]
86 
87  return cfourmom
88 
89 # Jet vertex fraction with selection.

◆ getEMScaleMomTool()

def JetMomentToolsConfig.getEMScaleMomTool (   jetdef,
  modspec = "" 
)

Definition at line 32 of file JetMomentToolsConfig.py.

32 def getEMScaleMomTool(jetdef, modspec=""):
33  # This may need updating e.g. for evolving trigger cluster container names
34  # We do the non-trivial summation over constituents unless the jets were
35  # built directly from EM-scale topoclusters, in which case we can just
36  # copy the constituent scale
37  useUncalibConstits = False
38  if jetdef.inputdef.basetype==xAODType.CaloCluster:
39  builtFromEMClusters = jetdef.inputdef.inputname in ["CaloCalTopoClusters","HLT_CaloTopoClustersFS"] and jetdef.inputdef.modifiers==["EM"]
40  useUncalibConstits = not builtFromEMClusters
41  elif (jetdef.inputdef.basetype==xAODType.ParticleFlow or jetdef.inputdef.basetype==xAODType.FlowElement):
42  useUncalibConstits = True
43  else:
44  raise ValueError("EM scale momentum not defined for input type {}".format(jetdef.inputdef.basetype))
45 
46  emscalemom = CompFactory.JetEMScaleMomTool(
47  "emscalemom_{}".format(jetdef.basename),
48  UseUncalibConstits = useUncalibConstits,
49  JetContainer = jetdef.fullname(),
50  )
51 
52  return emscalemom
53 

◆ getJetPtAssociationTool()

def JetMomentToolsConfig.getJetPtAssociationTool (   jetdef,
  modspec 
)

Definition at line 169 of file JetMomentToolsConfig.py.

169 def getJetPtAssociationTool(jetdef, modspec):
170 
171  from JetRecConfig.JetDefinition import buildJetAlgName
172 
173  truthJetAlg = buildJetAlgName(jetdef.algorithm, jetdef.radius)+'Truth'+str(modspec)+'Jets'
174 
175  jetPtAssociation = CompFactory.JetPtAssociationTool('jetPtAssociation',
176  MatchingJetContainer = truthJetAlg,
177  AssociationName = "GhostTruth")
178 
179  return jetPtAssociation
180 
181 

◆ getJVFTool()

def JetMomentToolsConfig.getJVFTool (   jetdef,
  modspec 
)

Definition at line 90 of file JetMomentToolsConfig.py.

90 def getJVFTool(jetdef, modspec):
91  trkopt = modspec or jetdef.context # allow to overide jetdef.context if modspec is specified
92  trackingKeys = jetdef._cflags.Jet.Context[trkopt]
93  jvf = CompFactory.JetVertexFractionTool(
94  "jvf",
95  VertexContainer = trackingKeys["Vertices"],
96  AssociatedTracks = trackingKeys["GhostTracksLabel"],
97  TrackVertexAssociation = trackingKeys["TVA"],
98  TrackParticleContainer = trackingKeys["Tracks"],
99  TrackSelector = idTrackSelToolFromJetCtx(trkopt, trackingKeys),
100  SuppressInputDependence = True,
101  UseOriginVertex = jetdef.byVertex
102  )
103  return jvf
104 
105 
106 # Jet vertex tagger with selection.

◆ getJVTTool()

def JetMomentToolsConfig.getJVTTool (   jetdef,
  modspec 
)

Definition at line 107 of file JetMomentToolsConfig.py.

107 def getJVTTool(jetdef, modspec):
108  jvt = CompFactory.JetVertexTaggerTool(
109  "jvt",
110  VertexContainer = jetdef._cflags.Jet.Context[modspec or jetdef.context]["Vertices"],
111  SuppressInputDependence = True,
112  UseOriginVertex = jetdef.byVertex
113  )
114  return jvt
115 
116 # Jet vertex tagger with neural network.

◆ getNNJvtTool()

def JetMomentToolsConfig.getNNJvtTool (   jetdef,
  modspec 
)

Definition at line 117 of file JetMomentToolsConfig.py.

117 def getNNJvtTool(jetdef, modspec):
118  nnjvt = CompFactory.getComp("JetPileupTag::JetVertexNNTagger")(
119  "nnjvt",
120  VertexContainer = jetdef._cflags.Jet.Context[modspec or jetdef.context]["Vertices"],
121  SuppressInputDependence = True
122  )
123  return nnjvt
124 
125 

◆ getOriginCorrVxTool()

def JetMomentToolsConfig.getOriginCorrVxTool (   jetdef,
  modspec 
)

Definition at line 159 of file JetMomentToolsConfig.py.

159 def getOriginCorrVxTool(jetdef, modspec):
160  origin_setpv = CompFactory.JetOriginCorrectionTool(
161  "jetorigin_setpv",
162  VertexContainer = jetdef._cflags.Jet.Context[modspec or jetdef.context]["Vertices"],
163  OriginCorrectedName = "",
164  OnlyAssignPV = True,
165  )
166  return origin_setpv
167 
168 

◆ getPFlowbJVTTool()

def JetMomentToolsConfig.getPFlowbJVTTool (   jetdef,
  modspec 
)

Definition at line 223 of file JetMomentToolsConfig.py.

223 def getPFlowbJVTTool(jetdef, modspec):
224 
225  from JetCalibTools import JetCalibToolsConfig
226  jetCalibrationTool = JetCalibToolsConfig.getJetCalibToolFromString(jetdef, "AnalysisLatest:mc:JetArea_Residual_EtaJES")
227 
228  wPFOTool = CompFactory.getComp('CP::WeightPFOTool')("bJVT__wPFO")
229 
230  trackingKeys = jetdef._cflags.Jet.Context[modspec or jetdef.context]
231 
232  bJVTTool = CompFactory.JetBalancePFlowJvtTool('bJVT',
233  verticesName = trackingKeys["Vertices"],
234  TrackVertexAssociation = trackingKeys["TVA"],
235  WeightPFOTool = wPFOTool,
236  JetCalibrationTool = jetCalibrationTool,
237  FEName = jetdef.inputdef.containername,
238  ORNameFE = "",
239  BjvtRawName = 'DFCommonJets_bJvt',
240  includePV = True)
241 
242  return bJVTTool
243 

◆ getPFlowfJVTTool()

def JetMomentToolsConfig.getPFlowfJVTTool (   jetdef,
  modspec 
)

Definition at line 195 of file JetMomentToolsConfig.py.

195 def getPFlowfJVTTool(jetdef, modspec):
196 
197  from JetCalibTools import JetCalibToolsConfig
198  calibString = "AnalysisLatest:mc:JetArea_Residual_EtaJES"
199  if( modspec and modspec == "CustomVtx" ) :
200  if jetdef._cflags.GeoModel.Run is LHCPeriod.Run3:
201  calibString = "AnalysisLatest:mc:JetArea_Residual_EtaJES:Kt4EMPFlowNeutEventShape:HggPrimaryVertices"
202  else:
203  calibString = "AnalysisLatest:mc:JetArea_Residual_EtaJES:Kt4EMPFlowCustomVtxEventShape:HggPrimaryVertices"
204  jetCalibrationTool = JetCalibToolsConfig.getJetCalibToolFromString(jetdef, calibString)
205 
206  wPFOTool = CompFactory.getComp('CP::WeightPFOTool')("fJVT__wPFO")
207 
208  trackingKeys = jetdef._cflags.Jet.Context[modspec or jetdef.context]
209 
210  fJVTTool = CompFactory.JetForwardPFlowJvtTool("fJVT",
211  verticesName = trackingKeys["Vertices"],
212  TrackVertexAssociation = trackingKeys["TVA"],
213  WeightPFOTool = wPFOTool,
214  JetCalibrationTool = jetCalibrationTool,
215  FEName = jetdef.inputdef.containername,
216  ORName = "",
217  FjvtRawName = "DFCommonJets_fJvt",
218  includePV = False)
219 
220  return fJVTTool
221 
222 

◆ getQGTaggingTool()

def JetMomentToolsConfig.getQGTaggingTool (   jetdef,
  modspec 
)

Definition at line 182 of file JetMomentToolsConfig.py.

182 def getQGTaggingTool(jetdef, modspec):
183  trkopt = modspec or jetdef.context # allow to overide jetdef.context if modspec is specified
184  trackingKeys = jetdef._cflags.Jet.Context[trkopt]
185 
186  qgtagging = CompFactory.JetQGTaggerVariableTool('qgtagging',
187  VertexContainer = trackingKeys["Vertices"],
188  TrackVertexAssociation = trackingKeys["TVA"],
189  TrackSelector = idTrackSelToolFromJetCtx(trkopt,trackingKeys),
190  )
191 
192  return qgtagging
193 
194 

◆ getTrackMomentsTool()

def JetMomentToolsConfig.getTrackMomentsTool (   jetdef,
  modspec 
)

Definition at line 126 of file JetMomentToolsConfig.py.

126 def getTrackMomentsTool(jetdef, modspec):
127  # retrieve the tracking keys to be used with modspec :
128  trkopt = modspec or jetdef.context # allow to overide jetdef.context if modspec is specified
129  trackingKeys = jetdef._cflags.Jet.Context[trkopt]
130 
131  trackmoments = CompFactory.JetTrackMomentsTool(
132  "trkmoms",
133  VertexContainer = trackingKeys["Vertices"],
134  AssociatedTracks = trackingKeys["GhostTracksLabel"],
135  TrackVertexAssociation = trackingKeys["TVA"],
136  TrackMinPtCuts = [500, 1000],
137  TrackSelector = idTrackSelToolFromJetCtx(trkopt,trackingKeys),
138  DoPFlowMoments = 'PFlow' in jetdef.fullname() or 'UFO' in jetdef.fullname() ,
139  )
140  return trackmoments
141 

◆ getTrackSumMomentsTool()

def JetMomentToolsConfig.getTrackSumMomentsTool (   jetdef,
  modspec 
)

Definition at line 142 of file JetMomentToolsConfig.py.

142 def getTrackSumMomentsTool(jetdef, modspec):
143  trkopt = modspec or jetdef.context # allow to overide jetdef.context if modspec is specified
144  trackingKeys = jetdef._cflags.Jet.Context[trkopt]
145  jettrackselloose = idTrackSelToolFromJetCtx(trkopt,trackingKeys)
146  # retrieve the tracking keys to be used with modspec :
147  tracksummoments = CompFactory.JetTrackSumMomentsTool(
148  "trksummoms",
149  VertexContainer = trackingKeys["Vertices"],
150  AssociatedTracks = trackingKeys["GhostTracksLabel"],
151  TrackVertexAssociation = trackingKeys["TVA"],
152  RequireTrackPV = True,
153  TrackSelector = jettrackselloose
154  )
155  return tracksummoments
156 
157 # This tool sets a decoration saying which the nominal HS PV was.
158 # Historically it did the origin correction, but now we do this to constituents

◆ idTrackSelToolFromJetCtx()

def JetMomentToolsConfig.idTrackSelToolFromJetCtx (   trkOpt,
  trkProperties 
)
returns a InDetTrackSelectionTool configured with the jet context corresponding to trkOpt

Definition at line 25 of file JetMomentToolsConfig.py.

25 def idTrackSelToolFromJetCtx(trkOpt,trkProperties):
26  """returns a InDetTrackSelectionTool configured with the jet context corresponding to trkOpt
27  """
28  from JetRecTools.JetRecToolsConfig import getIDTrackSelectionTool #
29  return getIDTrackSelectionTool(f"trackSel{trkOpt}", **trkProperties["trackSelOptions"])
30 
31 

Variable Documentation

◆ jetmomentlog

JetMomentToolsConfig.jetmomentlog = Logging.logging.getLogger('JetMomentToolsConfig')

Definition at line 17 of file JetMomentToolsConfig.py.

JetMomentToolsConfig.getJetPtAssociationTool
def getJetPtAssociationTool(jetdef, modspec)
Definition: JetMomentToolsConfig.py:169
JetMomentToolsConfig.idTrackSelToolFromJetCtx
def idTrackSelToolFromJetCtx(trkOpt, trkProperties)
Definition: JetMomentToolsConfig.py:25
vtune_athena.format
format
Definition: vtune_athena.py:14
JetMomentToolsConfig.getConstitFourMomTool
def getConstitFourMomTool(jetdef, modspec="")
Definition: JetMomentToolsConfig.py:54
JetMomentToolsConfig.getOriginCorrVxTool
def getOriginCorrVxTool(jetdef, modspec)
Definition: JetMomentToolsConfig.py:159
python.JetDefinition.buildJetAlgName
def buildJetAlgName(finder, mainParam, variableRMassScale=-1.0, variableRMinRadius=-1.0)
Definition: JetDefinition.py:50
JetMomentToolsConfig.getPFlowbJVTTool
def getPFlowbJVTTool(jetdef, modspec)
Definition: JetMomentToolsConfig.py:223
JetCalibToolsConfig.getJetCalibToolFromString
def getJetCalibToolFromString(jetdef, modspec)
Definition: JetCalibToolsConfig.py:249
JetMomentToolsConfig.getNNJvtTool
def getNNJvtTool(jetdef, modspec)
Definition: JetMomentToolsConfig.py:117
JetMomentToolsConfig.getBoostedJetTaggerTool
def getBoostedJetTaggerTool(jetdef, modspec)
Definition: JetMomentToolsConfig.py:244
JetMomentToolsConfig.getPFlowfJVTTool
def getPFlowfJVTTool(jetdef, modspec)
Definition: JetMomentToolsConfig.py:195
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
JetMomentToolsConfig.getJVFTool
def getJVFTool(jetdef, modspec)
Definition: JetMomentToolsConfig.py:90
str
Definition: BTagTrackIpAccessor.cxx:11
JetMomentToolsConfig.getTrackMomentsTool
def getTrackMomentsTool(jetdef, modspec)
Definition: JetMomentToolsConfig.py:126
JetMomentToolsConfig.getJVTTool
def getJVTTool(jetdef, modspec)
Definition: JetMomentToolsConfig.py:107
JetRecToolsConfig.getIDTrackSelectionTool
def getIDTrackSelectionTool(toolname, **toolProps)
Definition: JetRecToolsConfig.py:19
JetMomentToolsConfig.getQGTaggingTool
def getQGTaggingTool(jetdef, modspec)
Definition: JetMomentToolsConfig.py:182
JetMomentToolsConfig.getTrackSumMomentsTool
def getTrackSumMomentsTool(jetdef, modspec)
Definition: JetMomentToolsConfig.py:142
JetMomentToolsConfig.getEMScaleMomTool
def getEMScaleMomTool(jetdef, modspec="")
Definition: JetMomentToolsConfig.py:32