Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Functions | Variables
ParticleJetToolsConfig Namespace Reference

Functions

def isAnalysisRelease ()
 
def getMCTruthClassifier ()
 
def getCopyTruthLabelParticles (truthtype)
 
def getCopyTruthJetParticles (modspec, cflags)
 
def _getCommonLabelNames (prefix)
 
def getJetDeltaRFlavorLabelTool (name='jetdrlabeler', jet_pt_min=5000, collection="Final")
 
def getJetDeltaRLabelTool (jetdef, modspec)
 
def getJetDeltaRInitialLabelTool (jetdef, modspec)
 
def getJetGhostFlavorLabelTool (name="jetghostlabeler", collection="Final")
 
def getJetGhostInitialLabelTool (jetdef, modspec)
 
def getJetGhostLabelTool (jetdef, modspec)
 
def getJetTruthLabelTool (jetdef, modspec)
 
def getJetTruthLabelToolPrereqs (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 88 of file ParticleJetToolsConfig.py.

88 def _getCommonLabelNames(prefix):
89  """Internal unlity to name labels
90 
91  Returns a dictionary to configure labeling tools. Takes one
92  argument which is prefixed to each label.
93  """
94  return dict(
95  LabelName=f"{prefix}TruthLabelID",
96  DoubleLabelName=f"{prefix}ExtendedTruthLabelID",
97  LabelPtName=f"{prefix}TruthLabelPt",
98  LabelLxyName=f"{prefix}TruthLabelLxy",
99  LabelDRName=f"{prefix}TruthLabelDR",
100  LabelPdgIdName=f"{prefix}TruthLabelPdgId",
101  LabelPositionDPhiName=f"{prefix}TruthLabelPositionDPhi",
102  LabelPositionDEtaName=f"{prefix}TruthLabelPositionDEta",
103  LabelBarcodeName=f"{prefix}TruthLabelBarcode",
104  ChildLxyName=f"{prefix}TruthLabelChildLxy",
105  ChildPtName=f"{prefix}TruthLabelChildPt",
106  ChildPdgIdName=f"{prefix}TruthLabelChildPdgId",
107  ChildPositionDPhiName=f"{prefix}TruthLabelChildPositionDPhi",
108  ChildPositionDEtaName=f"{prefix}TruthLabelChildPositionDEta",
109  )
110 
111 

◆ 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 
87 

◆ 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

◆ getJetDeltaRFlavorLabelTool()

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

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

Definition at line 112 of file ParticleJetToolsConfig.py.

112 def getJetDeltaRFlavorLabelTool(name='jetdrlabeler', jet_pt_min=5000, collection="Final"):
113  """Get the standard flavor tagging delta-R labeling tool
114 
115  Uses cone matching to B, C and tau truth particles.
116  """
117  prefix_to_name = "HadronConeExcl"
118  if collection != "Final":
119  prefix_to_name += collection
120  name+=collection
121 
122  return CompFactory.ParticleJetDeltaRLabelTool(
123  name,
124  **_getCommonLabelNames(prefix_to_name),
125  BLabelName = "ConeExclBHadrons"+collection,
126  CLabelName = "ConeExclCHadrons"+collection,
127  TauLabelName = "ConeExclTausFinal",
128  BParticleCollection = "TruthLabelBHadrons"+collection,
129  CParticleCollection = "TruthLabelCHadrons"+collection,
130  TauParticleCollection = "TruthLabelTausFinal",
131  PartPtMin = 5000.,
132  DRMax = 0.3,
133  MatchMode = "MinDR",
134  JetPtMin = jet_pt_min,
135  )
136 
137 

◆ getJetDeltaRInitialLabelTool()

def ParticleJetToolsConfig.getJetDeltaRInitialLabelTool (   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 149 of file ParticleJetToolsConfig.py.

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

◆ 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 138 of file ParticleJetToolsConfig.py.

138 def getJetDeltaRLabelTool(jetdef, modspec):
139  """returns a ParticleJetDeltaRLabelTool
140  Cone matching for B, C and tau truth for all but track jets.
141 
142  This function is meant to be used as callback from JetRecConfig where
143  it is called as func(jetdef, modspec). Hence the jetdef argument even if not used in this case.
144  """
145  jetptmin = float(modspec)
146  name = "jetdrlabeler_jetpt{0}GeV".format(int(jetptmin/1000))
147  return getJetDeltaRFlavorLabelTool(name, jetptmin)
148 

◆ getJetGhostFlavorLabelTool()

def ParticleJetToolsConfig.getJetGhostFlavorLabelTool (   name = "jetghostlabeler",
  collection = "Final" 
)

Definition at line 161 of file ParticleJetToolsConfig.py.

161 def getJetGhostFlavorLabelTool(name="jetghostlabeler", collection="Final"):
162 
163  prefix_to_name = "HadronGhost"
164  if collection != "Final":
165  prefix_to_name += collection
166  name+=collection
167  return CompFactory.ParticleJetGhostLabelTool(
168  name,
169  **_getCommonLabelNames(prefix_to_name),
170  GhostBName = "GhostBHadrons"+collection,
171  GhostCName = "GhostCHadrons"+collection,
172  GhostTauName = "GhostTausFinal",
173  PartPtMin = 5000.0
174  )
175 

◆ getJetGhostInitialLabelTool()

def ParticleJetToolsConfig.getJetGhostInitialLabelTool (   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 176 of file ParticleJetToolsConfig.py.

176 def getJetGhostInitialLabelTool(jetdef, modspec):
177  """get ghost-based flavor tagging labeling
178 
179  This is a wrapper for JetRecConfig where it's called as
180  func(jetdef, modspec)
181  """
182  return getJetGhostFlavorLabelTool(modspec,collection = "Initial")
183 

◆ 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 184 of file ParticleJetToolsConfig.py.

184 def getJetGhostLabelTool(jetdef, modspec):
185  """get ghost-based flavor tagging labeling
186 
187  This is a wrapper for JetRecConfig where it's called as
188  func(jetdef, modspec)
189  """
190  return getJetGhostFlavorLabelTool(modspec)
191 
192 

◆ getJetPileupLabelTool()

def ParticleJetToolsConfig.getJetPileupLabelTool (   jetdef,
  modspec 
)

Definition at line 212 of file ParticleJetToolsConfig.py.

212 def getJetPileupLabelTool(jetdef, modspec):
213 
214  jetPileupLabelTool = CompFactory.JetPileupLabelingTool('pileuplabeler',
215  RecoJetContainer = jetdef.fullname(),
216  TruthJetContainer= "AntiKt4TruthDressedWZJets")
217 
218  return jetPileupLabelTool

◆ getJetTruthLabelTool()

def ParticleJetToolsConfig.getJetTruthLabelTool (   jetdef,
  modspec 
)

Definition at line 193 of file ParticleJetToolsConfig.py.

193 def getJetTruthLabelTool(jetdef, modspec):
194 
195  isTruthJet = 'Truth' in jetdef.fullname()
196 
197  if not isinstance(modspec, str):
198  raise ValueError("JetTruthLabelingTool can only be scheduled with str as modspec")
199  else:
200  truthLabel = str(modspec)
201 
202  jetTruthLabelTool = CompFactory.JetTruthLabelingTool('truthlabeler_{0}'.format(truthLabel),
203  RecoJetContainer = jetdef.fullname(),
204  IsTruthJetCollection = isTruthJet,
205  TruthLabelName = truthLabel)
206 
207  return jetTruthLabelTool
208 

◆ getJetTruthLabelToolPrereqs()

def ParticleJetToolsConfig.getJetTruthLabelToolPrereqs (   jetdef,
  modspec 
)

Definition at line 209 of file ParticleJetToolsConfig.py.

209 def getJetTruthLabelToolPrereqs(jetdef, modspec):
210  return ["input:AntiKt10TruthDressedWZSoftDropBeta100Zcut10Jets"] if modspec == "R10WZTruthLabel_R22v1" and jetdef._cflags.Input.isMC else []
211 

◆ 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:184
ParticleJetToolsConfig.getJetTruthLabelTool
def getJetTruthLabelTool(jetdef, modspec)
Definition: ParticleJetToolsConfig.py:193
vtune_athena.format
format
Definition: vtune_athena.py:14
ParticleJetToolsConfig.getJetTruthLabelToolPrereqs
def getJetTruthLabelToolPrereqs(jetdef, modspec)
Definition: ParticleJetToolsConfig.py:209
ParticleJetToolsConfig.getJetDeltaRLabelTool
def getJetDeltaRLabelTool(jetdef, modspec)
Definition: ParticleJetToolsConfig.py:138
ParticleJetToolsConfig.getMCTruthClassifier
def getMCTruthClassifier()
Definition: ParticleJetToolsConfig.py:23
ParticleJetToolsConfig.getJetDeltaRInitialLabelTool
def getJetDeltaRInitialLabelTool(jetdef, modspec)
Definition: ParticleJetToolsConfig.py:149
ParticleJetToolsConfig.getJetGhostFlavorLabelTool
def getJetGhostFlavorLabelTool(name="jetghostlabeler", collection="Final")
Definition: ParticleJetToolsConfig.py:161
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
ParticleJetToolsConfig.isAnalysisRelease
def isAnalysisRelease()
Definition: ParticleJetToolsConfig.py:19
ParticleJetToolsConfig.getJetGhostInitialLabelTool
def getJetGhostInitialLabelTool(jetdef, modspec)
Definition: ParticleJetToolsConfig.py:176
ParticleJetToolsConfig._getCommonLabelNames
def _getCommonLabelNames(prefix)
Definition: ParticleJetToolsConfig.py:88
str
Definition: BTagTrackIpAccessor.cxx:11
ParticleJetToolsConfig.getJetDeltaRFlavorLabelTool
def getJetDeltaRFlavorLabelTool(name='jetdrlabeler', jet_pt_min=5000, collection="Final")
Definition: ParticleJetToolsConfig.py:112
ParticleJetToolsConfig.getCopyTruthLabelParticles
def getCopyTruthLabelParticles(truthtype)
Definition: ParticleJetToolsConfig.py:43
ParticleJetToolsConfig.getJetPileupLabelTool
def getJetPileupLabelTool(jetdef, modspec)
Definition: ParticleJetToolsConfig.py:212
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65
ParticleJetToolsConfig.getCopyTruthJetParticles
def getCopyTruthJetParticles(modspec, cflags)
Definition: ParticleJetToolsConfig.py:63