ATLAS Offline Software
Functions | Variables
ParticleJetToolsConfig Namespace Reference

Functions

def isAnalysisRelease ()
 
def getMCTruthClassifier ()
 
def getCopyTruthLabelParticles (truthtype)
 
def getCopyTruthJetParticles (modspec, cflags)
 
def getJetQuarkLabel ()
 
def getJetConeLabeling ()
 
def _getCommonLabelNames (prefix)
 
def getJetDeltaRFlavorLabelTool (name='jetdrlabeler', jet_pt_min=5000)
 
def getJetDeltaRLabelTool (jetdef, modspec)
 
def getJetGhostFlavorLabelTool (name="jetghostlabeler")
 
def getJetGhostLabelTool (jetdef, modspec)
 
def getJetTruthLabelTool (jetdef, modspec)
 
def getJetPileupLabelTool (jetdef, modspec)
 

Variables

 jrtlog = Logging.logging.getLogger('ParticleJetToolsConfig')
 
dictionary truthpartoptions
 

Function Documentation

◆ _getCommonLabelNames()

def ParticleJetToolsConfig._getCommonLabelNames (   prefix)
private
Internal unlity to name labels

Returns a dictionary to configure labeling tools. Takes one
argument which is prefixed to each label.

Definition at line 103 of file ParticleJetToolsConfig.py.

103 def _getCommonLabelNames(prefix):
104  """Internal unlity to name labels
105 
106  Returns a dictionary to configure labeling tools. Takes one
107  argument which is prefixed to each label.
108  """
109  return dict(
110  LabelName=f"{prefix}TruthLabelID",
111  DoubleLabelName=f"{prefix}ExtendedTruthLabelID",
112  LabelPtName=f"{prefix}TruthLabelPt",
113  LabelLxyName=f"{prefix}TruthLabelLxy",
114  LabelDRName=f"{prefix}TruthLabelDR",
115  LabelPdgIdName=f"{prefix}TruthLabelPdgId",
116  LabelPositionDPhiName=f"{prefix}TruthLabelPositionDPhi",
117  LabelPositionDEtaName=f"{prefix}TruthLabelPositionDEta",
118  LabelBarcodeName=f"{prefix}TruthLabelBarcode",
119  ChildLxyName=f"{prefix}TruthLabelChildLxy",
120  ChildPtName=f"{prefix}TruthLabelChildPt",
121  ChildPdgIdName=f"{prefix}TruthLabelChildPdgId",
122  ChildPositionDPhiName=f"{prefix}TruthLabelChildPositionDPhi",
123  ChildPositionDEtaName=f"{prefix}TruthLabelChildPositionDEta",
124  )
125 
126 

◆ getCopyTruthJetParticles()

def ParticleJetToolsConfig.getCopyTruthJetParticles (   modspec,
  cflags 
)

Definition at line 63 of file ParticleJetToolsConfig.py.

63 def getCopyTruthJetParticles(modspec, cflags):
64  truthclassif = getMCTruthClassifier()
65 
66  truthpartcopy = CompFactory.CopyTruthJetParticles(
67  "truthpartcopy"+modspec,
68  OutputName="JetInputTruthParticles"+modspec,
69  MCTruthClassifier=truthclassif)
70  if modspec=="NoWZ":
71  truthpartcopy.IncludePromptLeptons=False
72  truthpartcopy.IncludePromptPhotons=False
73  truthpartcopy.IncludeMuons=True
74  truthpartcopy.IncludeNeutrinos=True
75  if modspec=="DressedWZ":
76  truthpartcopy.IncludePromptLeptons=False
77  truthpartcopy.IncludePromptPhotons=True
78  truthpartcopy.IncludeMuons=True
79  truthpartcopy.IncludeNeutrinos=True
80  truthpartcopy.DressingDecorationName='dressedPhoton'
81 
82  truthpartcopy.ExtraInputs = {( 'xAOD::TruthParticleContainer' , 'StoreGateSvc+TruthParticles.dressedPhoton' )}
83  if modspec=="Charged":
84  truthpartcopy.ChargedParticlesOnly=True
85  return truthpartcopy
86 

◆ getCopyTruthLabelParticles()

def ParticleJetToolsConfig.getCopyTruthLabelParticles (   truthtype)

Definition at line 43 of file ParticleJetToolsConfig.py.

43 def getCopyTruthLabelParticles(truthtype):
44  toolProperties = {}
45  if truthtype == "Partons":
46  truthcategory = "Partons"
47  elif truthtype in ["WBosons", "ZBosons", "HBosons", "TQuarksFinal"]:
48  truthcategory = "BosonTop"
49  toolProperties['ParticleType'] = truthtype
50  else:
51  truthcategory = "FlavourLabel"
52  toolProperties['ParticleType'] = truthtype
53 
54  tooltype = truthpartoptions[truthcategory]["ToolType"]
55  toolProperties.update( PtMin = truthpartoptions[truthcategory]["ptmin"],
56  OutputName = "TruthLabel"+truthtype)
57  ctp = tooltype("truthpartcopy_"+truthtype,
58  **toolProperties
59  )
60  return ctp
61 
62 # Generates input truth particle containers for truth jets

◆ getJetConeLabeling()

def ParticleJetToolsConfig.getJetConeLabeling ( )

Definition at line 94 of file ParticleJetToolsConfig.py.

94 def getJetConeLabeling():
95  jetquarklabel = getJetQuarkLabel()
96  truthpartonlabel = CompFactory.Analysis.JetConeLabeling(
97  "truthpartondr",
98  JetTruthMatchTool = jetquarklabel
99  )
100  return truthpartonlabel
101 
102 

◆ getJetDeltaRFlavorLabelTool()

def ParticleJetToolsConfig.getJetDeltaRFlavorLabelTool (   name = 'jetdrlabeler',
  jet_pt_min = 5000 
)
Get the standard flavor tagging delta-R labeling tool

Uses cone matching to B, C and tau truth particles.

Definition at line 127 of file ParticleJetToolsConfig.py.

127 def getJetDeltaRFlavorLabelTool(name='jetdrlabeler', jet_pt_min=5000):
128  """Get the standard flavor tagging delta-R labeling tool
129 
130  Uses cone matching to B, C and tau truth particles.
131  """
132  return CompFactory.ParticleJetDeltaRLabelTool(
133  name,
134  **_getCommonLabelNames("HadronConeExcl"),
135  BLabelName = "ConeExclBHadronsFinal",
136  CLabelName = "ConeExclCHadronsFinal",
137  TauLabelName = "ConeExclTausFinal",
138  BParticleCollection = "TruthLabelBHadronsFinal",
139  CParticleCollection = "TruthLabelCHadronsFinal",
140  TauParticleCollection = "TruthLabelTausFinal",
141  PartPtMin = 5000.,
142  DRMax = 0.3,
143  MatchMode = "MinDR",
144  JetPtMin = jet_pt_min,
145  )
146 
147 

◆ getJetDeltaRLabelTool()

def ParticleJetToolsConfig.getJetDeltaRLabelTool (   jetdef,
  modspec 
)
returns a ParticleJetDeltaRLabelTool
Cone matching for B, C and tau truth for all but track jets.

This function is meant to be used as callback from JetRecConfig where
it is called as func(jetdef, modspec). Hence the jetdef argument even if not used in this case.

Definition at line 148 of file ParticleJetToolsConfig.py.

148 def getJetDeltaRLabelTool(jetdef, modspec):
149  """returns a ParticleJetDeltaRLabelTool
150  Cone matching for B, C and tau truth for all but track jets.
151 
152  This function is meant to be used as callback from JetRecConfig where
153  it is called as func(jetdef, modspec). Hence the jetdef argument even if not used in this case.
154  """
155  jetptmin = float(modspec)
156  name = "jetdrlabeler_jetpt{0}GeV".format(int(jetptmin/1000))
157  return getJetDeltaRFlavorLabelTool(name, jetptmin)
158 
159 

◆ getJetGhostFlavorLabelTool()

def ParticleJetToolsConfig.getJetGhostFlavorLabelTool (   name = "jetghostlabeler")

Definition at line 160 of file ParticleJetToolsConfig.py.

160 def getJetGhostFlavorLabelTool(name="jetghostlabeler"):
161  return CompFactory.ParticleJetGhostLabelTool(
162  name,
163  **_getCommonLabelNames('HadronGhost'),
164  GhostBName = "GhostBHadronsFinal",
165  GhostCName = "GhostCHadronsFinal",
166  GhostTauName = "GhostTausFinal",
167  PartPtMin = 5000.0
168  )
169 
170 

◆ getJetGhostLabelTool()

def ParticleJetToolsConfig.getJetGhostLabelTool (   jetdef,
  modspec 
)
get ghost-based flavor tagging labeling

This is a wrapper for JetRecConfig where it's called as
func(jetdef, modspec)

Definition at line 171 of file ParticleJetToolsConfig.py.

171 def getJetGhostLabelTool(jetdef, modspec):
172  """get ghost-based flavor tagging labeling
173 
174  This is a wrapper for JetRecConfig where it's called as
175  func(jetdef, modspec)
176  """
178 
179 

◆ getJetPileupLabelTool()

def ParticleJetToolsConfig.getJetPileupLabelTool (   jetdef,
  modspec 
)

Definition at line 196 of file ParticleJetToolsConfig.py.

196 def getJetPileupLabelTool(jetdef, modspec):
197 
198  jetPileupLabelTool = CompFactory.JetPileupLabelingTool('pileuplabeler',
199  RecoJetContainer = jetdef.fullname(),
200  TruthJetContainer= "AntiKt4TruthDressedWZJets")
201 
202  return jetPileupLabelTool

◆ getJetQuarkLabel()

def ParticleJetToolsConfig.getJetQuarkLabel ( )

Definition at line 87 of file ParticleJetToolsConfig.py.

87 def getJetQuarkLabel():
88  jetquarklabel = CompFactory.Analysis.JetQuarkLabel(
89  "jetquarklabel",
90  McEventCollection = "TruthEvents"
91  )
92  return jetquarklabel
93 

◆ getJetTruthLabelTool()

def ParticleJetToolsConfig.getJetTruthLabelTool (   jetdef,
  modspec 
)

Definition at line 180 of file ParticleJetToolsConfig.py.

180 def getJetTruthLabelTool(jetdef, modspec):
181 
182  isTruthJet = 'Truth' in jetdef.fullname()
183 
184  if not isinstance(modspec, str):
185  raise ValueError("JetTruthLabelingTool can only be scheduled with str as modspec")
186  else:
187  truthLabel = str(modspec)
188 
189  jetTruthLabelTool = CompFactory.JetTruthLabelingTool('truthlabeler_{0}'.format(truthLabel),
190  RecoJetContainer = jetdef.fullname(),
191  IsTruthJetCollection = isTruthJet,
192  TruthLabelName = truthLabel)
193 
194  return jetTruthLabelTool
195 

◆ getMCTruthClassifier()

def ParticleJetToolsConfig.getMCTruthClassifier ( )

Definition at line 23 of file ParticleJetToolsConfig.py.

24  # Assume mc15 value
25  truthclassif = CompFactory.MCTruthClassifier(
26  "JetMCTruthClassifier"
27  )
28  if not isAnalysisRelease() :
29  truthclassif.xAODTruthLinkVector= ""
30  # Config neessary only for Athena releases
31  import os
32  if "AtlasProject" in os.environ.keys():
33  if os.environ["AtlasProject"] in ["Athena","AthDerivation"]:
34  truthclassif.ParticleCaloExtensionTool=""
35  return truthclassif
36 
37 # Generates truth particle containers for truth labeling

◆ isAnalysisRelease()

def ParticleJetToolsConfig.isAnalysisRelease ( )

Definition at line 19 of file ParticleJetToolsConfig.py.

19  def isAnalysisRelease():
20  return True
21 
22 # Putting MCTruthClassifier here as we needn't stick jet configs in really foreign packages

Variable Documentation

◆ jrtlog

ParticleJetToolsConfig.jrtlog = Logging.logging.getLogger('ParticleJetToolsConfig')

Definition at line 12 of file ParticleJetToolsConfig.py.

◆ truthpartoptions

dictionary ParticleJetToolsConfig.truthpartoptions
Initial value:
1 = {
2  "Partons":{"ToolType":CompFactory.CopyTruthPartons,"ptmin":5000},
3  "BosonTop":{"ToolType":CompFactory.CopyBosonTopLabelTruthParticles,"ptmin":100000},
4  "FlavourLabel":{"ToolType":CompFactory.CopyFlavorLabelTruthParticles,"ptmin":5000},
5 }

Definition at line 38 of file ParticleJetToolsConfig.py.

ParticleJetToolsConfig.getJetGhostLabelTool
def getJetGhostLabelTool(jetdef, modspec)
Definition: ParticleJetToolsConfig.py:171
ParticleJetToolsConfig.getJetTruthLabelTool
def getJetTruthLabelTool(jetdef, modspec)
Definition: ParticleJetToolsConfig.py:180
vtune_athena.format
format
Definition: vtune_athena.py:14
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
ParticleJetToolsConfig.getJetDeltaRLabelTool
def getJetDeltaRLabelTool(jetdef, modspec)
Definition: ParticleJetToolsConfig.py:148
ParticleJetToolsConfig.getJetDeltaRFlavorLabelTool
def getJetDeltaRFlavorLabelTool(name='jetdrlabeler', jet_pt_min=5000)
Definition: ParticleJetToolsConfig.py:127
ParticleJetToolsConfig.getMCTruthClassifier
def getMCTruthClassifier()
Definition: ParticleJetToolsConfig.py:23
ParticleJetToolsConfig.isAnalysisRelease
def isAnalysisRelease()
Definition: ParticleJetToolsConfig.py:19
ParticleJetToolsConfig.getJetGhostFlavorLabelTool
def getJetGhostFlavorLabelTool(name="jetghostlabeler")
Definition: ParticleJetToolsConfig.py:160
ParticleJetToolsConfig.getJetQuarkLabel
def getJetQuarkLabel()
Definition: ParticleJetToolsConfig.py:87
ParticleJetToolsConfig.getJetConeLabeling
def getJetConeLabeling()
Definition: ParticleJetToolsConfig.py:94
ParticleJetToolsConfig._getCommonLabelNames
def _getCommonLabelNames(prefix)
Definition: ParticleJetToolsConfig.py:103
str
Definition: BTagTrackIpAccessor.cxx:11
ParticleJetToolsConfig.getCopyTruthLabelParticles
def getCopyTruthLabelParticles(truthtype)
Definition: ParticleJetToolsConfig.py:43
readCCLHist.float
float
Definition: readCCLHist.py:83
ParticleJetToolsConfig.getJetPileupLabelTool
def getJetPileupLabelTool(jetdef, modspec)
Definition: ParticleJetToolsConfig.py:196
ParticleJetToolsConfig.getCopyTruthJetParticles
def getCopyTruthJetParticles(modspec, cflags)
Definition: ParticleJetToolsConfig.py:63