ATLAS Offline Software
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)
 
def getJetDeltaRLabelTool (jetdef, modspec)
 
def getJetGhostFlavorLabelTool (name="jetghostlabeler")
 
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 
)
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):
113  """Get the standard flavor tagging delta-R labeling tool
114 
115  Uses cone matching to B, C and tau truth particles.
116  """
117  return CompFactory.ParticleJetDeltaRLabelTool(
118  name,
119  **_getCommonLabelNames("HadronConeExcl"),
120  BLabelName = "ConeExclBHadronsFinal",
121  CLabelName = "ConeExclCHadronsFinal",
122  TauLabelName = "ConeExclTausFinal",
123  BParticleCollection = "TruthLabelBHadronsFinal",
124  CParticleCollection = "TruthLabelCHadronsFinal",
125  TauParticleCollection = "TruthLabelTausFinal",
126  PartPtMin = 5000.,
127  DRMax = 0.3,
128  MatchMode = "MinDR",
129  JetPtMin = jet_pt_min,
130  )
131 
132 

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

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

◆ getJetGhostFlavorLabelTool()

def ParticleJetToolsConfig.getJetGhostFlavorLabelTool (   name = "jetghostlabeler")

Definition at line 145 of file ParticleJetToolsConfig.py.

145 def getJetGhostFlavorLabelTool(name="jetghostlabeler"):
146  return CompFactory.ParticleJetGhostLabelTool(
147  name,
148  **_getCommonLabelNames('HadronGhost'),
149  GhostBName = "GhostBHadronsFinal",
150  GhostCName = "GhostCHadronsFinal",
151  GhostTauName = "GhostTausFinal",
152  PartPtMin = 5000.0
153  )
154 
155 

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

156 def getJetGhostLabelTool(jetdef, modspec):
157  """get ghost-based flavor tagging labeling
158 
159  This is a wrapper for JetRecConfig where it's called as
160  func(jetdef, modspec)
161  """
163 
164 

◆ getJetPileupLabelTool()

def ParticleJetToolsConfig.getJetPileupLabelTool (   jetdef,
  modspec 
)

Definition at line 184 of file ParticleJetToolsConfig.py.

184 def getJetPileupLabelTool(jetdef, modspec):
185 
186  jetPileupLabelTool = CompFactory.JetPileupLabelingTool('pileuplabeler',
187  RecoJetContainer = jetdef.fullname(),
188  TruthJetContainer= "AntiKt4TruthDressedWZJets")
189 
190  return jetPileupLabelTool

◆ getJetTruthLabelTool()

def ParticleJetToolsConfig.getJetTruthLabelTool (   jetdef,
  modspec 
)

Definition at line 165 of file ParticleJetToolsConfig.py.

165 def getJetTruthLabelTool(jetdef, modspec):
166 
167  isTruthJet = 'Truth' in jetdef.fullname()
168 
169  if not isinstance(modspec, str):
170  raise ValueError("JetTruthLabelingTool can only be scheduled with str as modspec")
171  else:
172  truthLabel = str(modspec)
173 
174  jetTruthLabelTool = CompFactory.JetTruthLabelingTool('truthlabeler_{0}'.format(truthLabel),
175  RecoJetContainer = jetdef.fullname(),
176  IsTruthJetCollection = isTruthJet,
177  TruthLabelName = truthLabel)
178 
179  return jetTruthLabelTool
180 

◆ getJetTruthLabelToolPrereqs()

def ParticleJetToolsConfig.getJetTruthLabelToolPrereqs (   jetdef,
  modspec 
)

Definition at line 181 of file ParticleJetToolsConfig.py.

181 def getJetTruthLabelToolPrereqs(jetdef, modspec):
182  return ["input:AntiKt10TruthDressedWZSoftDropBeta100Zcut10Jets"] if modspec == "R10WZTruthLabel_R22v1" and jetdef._cflags.Input.isMC else []
183 

◆ 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:156
ParticleJetToolsConfig.getJetTruthLabelTool
def getJetTruthLabelTool(jetdef, modspec)
Definition: ParticleJetToolsConfig.py:165
vtune_athena.format
format
Definition: vtune_athena.py:14
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
ParticleJetToolsConfig.getJetTruthLabelToolPrereqs
def getJetTruthLabelToolPrereqs(jetdef, modspec)
Definition: ParticleJetToolsConfig.py:181
ParticleJetToolsConfig.getJetDeltaRLabelTool
def getJetDeltaRLabelTool(jetdef, modspec)
Definition: ParticleJetToolsConfig.py:133
ParticleJetToolsConfig.getJetDeltaRFlavorLabelTool
def getJetDeltaRFlavorLabelTool(name='jetdrlabeler', jet_pt_min=5000)
Definition: ParticleJetToolsConfig.py:112
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:145
ParticleJetToolsConfig._getCommonLabelNames
def _getCommonLabelNames(prefix)
Definition: ParticleJetToolsConfig.py:88
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:184
ParticleJetToolsConfig.getCopyTruthJetParticles
def getCopyTruthJetParticles(modspec, cflags)
Definition: ParticleJetToolsConfig.py:63