 |
ATLAS Offline Software
|
|
def | isAnalysisRelease () |
|
def | getMCTruthClassifier () |
|
def | getCopyTruthLabelParticles (truthtype) |
|
def | getCopyTruthJetParticles (modspec, cflags) |
|
def | _getCommonLabelNames (prefix) |
|
def | getJetDeltaRFlavorLabelTool (name='jetdrlabeler', jet_pt_min=5000, collection="Final", dr_max=0.3) |
|
def | getJetQuarkChargeLabelTool (name='jetquarkcharge', output_label="QuarkChargeTruthLabelID", hadron_label="HadronGhostInitialTruthLabelPdgId", parton_label="PartonExtendedTruthLabelID") |
|
def | getJetDeltaRLabelTool (jetdef, modspec) |
|
def | getJetQuarkChargeTool (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) |
|
◆ _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 89 of file ParticleJetToolsConfig.py.
90 """Internal unlity to name labels
92 Returns a dictionary to configure labeling tools. Takes one
93 argument which is prefixed to each label.
96 LabelName=f
"{prefix}TruthLabelID",
97 DoubleLabelName=f
"{prefix}ExtendedTruthLabelID",
98 LabelPtName=f
"{prefix}TruthLabelPt",
99 LabelLxyName=f
"{prefix}TruthLabelLxy",
100 LabelDRName=f
"{prefix}TruthLabelDR",
101 LabelPdgIdName=f
"{prefix}TruthLabelPdgId",
102 LabelPositionDPhiName=f
"{prefix}TruthLabelPositionDPhi",
103 LabelPositionDEtaName=f
"{prefix}TruthLabelPositionDEta",
104 LabelBarcodeName=f
"{prefix}TruthLabelBarcode",
105 ChildLxyName=f
"{prefix}TruthLabelChildLxy",
106 ChildPtName=f
"{prefix}TruthLabelChildPt",
107 ChildPdgIdName=f
"{prefix}TruthLabelChildPdgId",
108 ChildPositionDPhiName=f
"{prefix}TruthLabelChildPositionDPhi",
109 ChildPositionDEtaName=f
"{prefix}TruthLabelChildPositionDEta",
◆ getCopyTruthJetParticles()
def ParticleJetToolsConfig.getCopyTruthJetParticles |
( |
|
modspec, |
|
|
|
cflags |
|
) |
| |
Definition at line 63 of file ParticleJetToolsConfig.py.
66 truthpartcopy = CompFactory.CopyTruthJetParticles(
67 "truthpartcopy"+modspec,
68 OutputName=
"JetInputTruthParticles"+modspec,
69 MCTruthClassifier=truthclassif)
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.DressingDecorationNames=[
'TruthParticles.dressedPhoton_e',
'TruthParticles.dressedPhoton_mu']
82 truthpartcopy.ExtraInputs = {(
'xAOD::TruthParticleContainer' ,
'StoreGateSvc+TruthParticles.dressedPhoton_e' ),
83 (
'xAOD::TruthParticleContainer' ,
'StoreGateSvc+TruthParticles.dressedPhoton_mu' )}
84 if modspec==
"Charged":
85 truthpartcopy.ChargedParticlesOnly=
True
◆ getCopyTruthLabelParticles()
def ParticleJetToolsConfig.getCopyTruthLabelParticles |
( |
|
truthtype | ) |
|
Definition at line 43 of file ParticleJetToolsConfig.py.
45 if truthtype ==
"Partons":
46 truthcategory =
"Partons"
47 elif truthtype
in [
"WBosons",
"ZBosons",
"HBosons",
"TQuarksFinal"]:
48 truthcategory =
"BosonTop"
49 toolProperties[
'ParticleType'] = truthtype
51 truthcategory =
"FlavourLabel"
52 toolProperties[
'ParticleType'] = truthtype
54 tooltype = truthpartoptions[truthcategory][
"ToolType"]
55 toolProperties.update( PtMin = truthpartoptions[truthcategory][
"ptmin"],
56 OutputName =
"TruthLabel"+truthtype)
57 ctp = tooltype(
"truthpartcopy_"+truthtype,
◆ getJetDeltaRFlavorLabelTool()
def ParticleJetToolsConfig.getJetDeltaRFlavorLabelTool |
( |
|
name = 'jetdrlabeler' , |
|
|
|
jet_pt_min = 5000 , |
|
|
|
collection = "Final" , |
|
|
|
dr_max = 0.3 |
|
) |
| |
Get the standard flavor tagging delta-R labeling tool
Uses cone matching to B, C and tau truth particles.
Definition at line 113 of file ParticleJetToolsConfig.py.
114 """Get the standard flavor tagging delta-R labeling tool
116 Uses cone matching to B, C and tau truth particles.
118 prefix_to_name =
"HadronConeExcl"
119 if collection !=
"Final":
120 prefix_to_name += collection
123 return CompFactory.ParticleJetDeltaRLabelTool(
126 BLabelName =
"ConeExclBHadrons"+collection,
127 CLabelName =
"ConeExclCHadrons"+collection,
128 TauLabelName =
"ConeExclTausFinal",
129 BParticleCollection =
"TruthLabelBHadrons"+collection,
130 CParticleCollection =
"TruthLabelCHadrons"+collection,
131 TauParticleCollection =
"TruthLabelTausFinal",
135 JetPtMin = jet_pt_min,
◆ 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 184 of file ParticleJetToolsConfig.py.
185 """returns a ParticleJetDeltaRLabelTool
186 Cone matching for B, C and tau truth for all but track jets.
188 This function is meant to be used as callback from JetRecConfig where
189 it is called as func(jetdef, modspec). Hence the jetdef argument even if not used in this case.
191 jetptmin =
float(modspec)
192 name =
"jetdrlabeler_jetpt{0}GeV".
format(
int(jetptmin/1000))
◆ 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 158 of file ParticleJetToolsConfig.py.
159 """returns a ParticleJetDeltaRLabelTool
160 Cone matching for B, C and tau truth for all but track jets.
162 This function is meant to be used as callback from JetRecConfig where
163 it is called as func(jetdef, modspec). Hence the jetdef argument even if not used in this case.
165 jetptmin =
float(modspec)
166 name =
"jetdrlabeler_jetpt{0}GeV".
format(
int(jetptmin/1000))
◆ getJetGhostFlavorLabelTool()
def ParticleJetToolsConfig.getJetGhostFlavorLabelTool |
( |
|
name = "jetghostlabeler" , |
|
|
|
collection = "Final" |
|
) |
| |
Definition at line 196 of file ParticleJetToolsConfig.py.
198 prefix_to_name =
"HadronGhost"
199 if collection !=
"Final":
200 prefix_to_name += collection
202 return CompFactory.ParticleJetGhostLabelTool(
205 GhostBName =
"GhostBHadrons"+collection,
206 GhostCName =
"GhostCHadrons"+collection,
207 GhostTauName =
"GhostTausFinal",
◆ 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 211 of file ParticleJetToolsConfig.py.
212 """get ghost-based flavor tagging labeling
214 This is a wrapper for JetRecConfig where it's called as
215 func(jetdef, modspec)
◆ 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 219 of file ParticleJetToolsConfig.py.
220 """get ghost-based flavor tagging labeling
222 This is a wrapper for JetRecConfig where it's called as
223 func(jetdef, modspec)
◆ getJetPileupLabelTool()
def ParticleJetToolsConfig.getJetPileupLabelTool |
( |
|
jetdef, |
|
|
|
modspec |
|
) |
| |
Definition at line 247 of file ParticleJetToolsConfig.py.
249 jetPileupLabelTool = CompFactory.JetPileupLabelingTool(
'pileuplabeler',
250 RecoJetContainer = jetdef.fullname(),
251 TruthJetContainer=
"AntiKt4TruthDressedWZJets")
253 return jetPileupLabelTool
◆ getJetQuarkChargeLabelTool()
def ParticleJetToolsConfig.getJetQuarkChargeLabelTool |
( |
|
name = 'jetquarkcharge' , |
|
|
|
output_label = "QuarkChargeTruthLabelID" , |
|
|
|
hadron_label = "HadronGhostInitialTruthLabelPdgId" , |
|
|
|
parton_label = "PartonExtendedTruthLabelID" |
|
) |
| |
Get the flavor tagging labeling tool to store the quark charge of a jet
It is necessary to have saved before an hadron label and a parton label, otherwise the code will break
Definition at line 139 of file ParticleJetToolsConfig.py.
140 output_label = "QuarkChargeTruthLabelID",
141 hadron_label = "HadronGhostInitialTruthLabelPdgId",
142 parton_label = "PartonExtendedTruthLabelID"):
143 """Get the flavor tagging labeling tool to store the quark charge of a jet
144 It is necessary to have saved before an hadron label and a parton label, otherwise the code will break
147 import ParticleJetTools.quarkChargeMap
as qcMap
148 charge_map = qcMap.hadrons_dict
150 return CompFactory.JetQuarkChargeLabelingTool(
152 HadronDecorationName = hadron_label,
153 PartonDecorationName = parton_label,
154 HadronChargeMap = charge_map,
155 OutputName = output_label,
◆ getJetQuarkChargeTool()
def ParticleJetToolsConfig.getJetQuarkChargeTool |
( |
|
jetdef, |
|
|
|
modspec |
|
) |
| |
returns a JetQuarkChargeLabelingTool
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.
Definition at line 170 of file ParticleJetToolsConfig.py.
171 """returns a JetQuarkChargeLabelingTool
173 This function is meant to be used as callback from JetRecConfig where
174 it is called as func(jetdef, modspec). Hence the jetdef argument even if not used.
179 outputLabel,hadronLabel,partonLabel = modspec.split(
",")
181 name = f
"jetquarkcharge_{outputLabel}_{hadronLabel}_{partonLabel}"
◆ getJetTruthLabelTool()
def ParticleJetToolsConfig.getJetTruthLabelTool |
( |
|
jetdef, |
|
|
|
modspec |
|
) |
| |
Definition at line 228 of file ParticleJetToolsConfig.py.
230 isTruthJet =
'Truth' in jetdef.fullname()
232 if not isinstance(modspec, str):
233 raise ValueError(
"JetTruthLabelingTool can only be scheduled with str as modspec")
235 truthLabel =
str(modspec)
237 jetTruthLabelTool = CompFactory.JetTruthLabelingTool(
'truthlabeler_{0}'.
format(truthLabel),
238 RecoJetContainer = jetdef.fullname(),
239 IsTruthJetCollection = isTruthJet,
240 TruthLabelName = truthLabel)
242 return jetTruthLabelTool
◆ getJetTruthLabelToolPrereqs()
def ParticleJetToolsConfig.getJetTruthLabelToolPrereqs |
( |
|
jetdef, |
|
|
|
modspec |
|
) |
| |
Definition at line 244 of file ParticleJetToolsConfig.py.
245 return [
"input:AntiKt10TruthDressedWZSoftDropBeta100Zcut10Jets"]
if modspec ==
"R10WZTruthLabel_R22v1" and jetdef._cflags.Input.isMC
else []
◆ getMCTruthClassifier()
def ParticleJetToolsConfig.getMCTruthClassifier |
( |
| ) |
|
Definition at line 23 of file ParticleJetToolsConfig.py.
25 truthclassif = CompFactory.MCTruthClassifier(
26 "JetMCTruthClassifier"
29 truthclassif.xAODTruthLinkVector=
""
32 if "AtlasProject" in os.environ.keys():
33 if os.environ[
"AtlasProject"]
in [
"Athena",
"AthDerivation"]:
34 truthclassif.ParticleCaloExtensionTool=
""
◆ isAnalysisRelease()
def ParticleJetToolsConfig.isAnalysisRelease |
( |
| ) |
|
◆ jrtlog
ParticleJetToolsConfig.jrtlog = Logging.logging.getLogger('ParticleJetToolsConfig') |
◆ truthpartoptions
dictionary ParticleJetToolsConfig.truthpartoptions |
Initial value:
2 "Partons":{
"ToolType":CompFactory.CopyTruthPartons,
"ptmin":5000},
3 "BosonTop":{
"ToolType":CompFactory.CopyBosonTopLabelTruthParticles,
"ptmin":100000},
4 "FlavourLabel":{
"ToolType":CompFactory.CopyFlavorLabelTruthParticles,
"ptmin":5000},
Definition at line 38 of file ParticleJetToolsConfig.py.
def getJetGhostLabelTool(jetdef, modspec)
def getJetTruthLabelTool(jetdef, modspec)
def getJetTruthLabelToolPrereqs(jetdef, modspec)
def getJetDeltaRLabelTool(jetdef, modspec)
def getMCTruthClassifier()
def getJetDeltaRFlavorLabelTool(name='jetdrlabeler', jet_pt_min=5000, collection="Final", dr_max=0.3)
def getJetQuarkChargeTool(jetdef, modspec)
def getJetDeltaRInitialLabelTool(jetdef, modspec)
def getJetGhostFlavorLabelTool(name="jetghostlabeler", collection="Final")
def getJetGhostInitialLabelTool(jetdef, modspec)
def getJetQuarkChargeLabelTool(name='jetquarkcharge', output_label="QuarkChargeTruthLabelID", hadron_label="HadronGhostInitialTruthLabelPdgId", parton_label="PartonExtendedTruthLabelID")
def _getCommonLabelNames(prefix)
def getCopyTruthLabelParticles(truthtype)
def getJetPileupLabelTool(jetdef, modspec)
def getCopyTruthJetParticles(modspec, cflags)