Skip to content
Snippets Groups Projects
Commit 1fcf3af6 authored by Ines Ochoa's avatar Ines Ochoa :cat2: Committed by Emmanuel Le Guirriec
Browse files

ExKt collections with Ghost track association for b-tagging (FTAG5)

Former-commit-id: 0d710ac44e3fc84937a732c9db36efc8fbb1eb67
parent c977b32e
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,10 @@ ContainersOnTheFly = [
["AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2SubJetsAux","xAOD::JetAuxContainer"],
["AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubJets","xAOD::JetContainer"],
["AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubJetsAux","xAOD::JetAuxContainer"],
["AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2GASubJets","xAOD::JetContainer"],
["AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2GASubJetsAux","xAOD::JetAuxContainer"],
["AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3GASubJets","xAOD::JetContainer"],
["AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3GASubJetsAux","xAOD::JetAuxContainer"],
["AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJets","xAOD::JetContainer"],
["AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJetsAux","xAOD::JetAuxContainer"],
["AntiKt4TruthJets","xAOD::JetContainer"],
......@@ -54,6 +58,10 @@ ContainersOnTheFly = [
["BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2SubAux","xAOD::BTaggingAuxContainer"],
["BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3Sub","xAOD::BTaggingContainer"],
["BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubAux","xAOD::BTaggingAuxContainer"],
["BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2GASub","xAOD::BTaggingContainer"],
["BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2GASubAux","xAOD::BTaggingAuxContainer"],
["BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3GASub","xAOD::BTaggingContainer"],
["BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3GASubAux","xAOD::BTaggingAuxContainer"],
["BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2Sub","xAOD::BTaggingContainer"],
["BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubAux","xAOD::BTaggingAuxContainer"],
["BTagging_AntiKt4EMPFlow","xAOD::BTaggingContainer"],
......
......@@ -20,6 +20,9 @@ FullListOfSmartContainers = [
"AntiKt10TrackCaloClusterTrimmedPtFrac5SmallR20Jets",
"AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2SubJets",
"AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubJets",
"AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2GASubJets",
"AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3GASubJets",
"AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJets",
"AntiKt4EMPFlowJets",
"AntiKt2LCTopoJets",
"AntiKt3LCTopoJets",
......@@ -46,6 +49,8 @@ FullListOfSmartContainers = [
"BTagging_AntiKt8EMTopoExCoM2Sub",
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2Sub_expert",
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3Sub_expert",
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2GASub_expert",
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3GASub_expert",
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2Sub_expert",
"InDetTrackParticles",
"PrimaryVertices",
......
......@@ -479,6 +479,12 @@ class SlimmingHelper:
elif collectionName=="BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3Sub_expert":
from DerivationFrameworkFlavourTag.BTaggingContent import BTaggingExpertContent
items.extend(BTaggingExpertContent("AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubJets"))
elif collectionName=="BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2GASub_expert":
from DerivationFrameworkFlavourTag.BTaggingContent import BTaggingExpertContent
items.extend(BTaggingExpertContent("AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2GASubJets"))
elif collectionName=="BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3GASub_expert":
from DerivationFrameworkFlavourTag.BTaggingContent import BTaggingExpertContent
items.extend(BTaggingExpertContent("AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3GASubJets"))
elif collectionName=="BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2Sub_expert":
from DerivationFrameworkFlavourTag.BTaggingContent import BTaggingExpertContent
items.extend(BTaggingExpertContent("AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJets"))
......
......@@ -14,7 +14,7 @@ from JetRec.JetRecConf import JetAlgorithm
#===================================================================
# make exkt subjet finding tool
def buildExclusiveSubjets(ToolSvc, JetCollectionName, subjet_mode, nsubjet, doTrackSubJet, ExGhostLabels=["GhostBHadronsFinal", "GhostCHadronsFinal"], min_subjet_pt_mev = 0):
def buildExclusiveSubjets(ToolSvc, JetCollectionName, subjet_mode, nsubjet, doGhostAssoc, doTrackSubJet, ExGhostLabels=["GhostBHadronsFinal", "GhostCHadronsFinal"], min_subjet_pt_mev = 0):
#
# a full list of ExGhostLabels = ["GhostBHadronsFinal", "GhostBHadronsInitial", "GhostBQuarksFinal", "GhostCHadronsFinal", "GhostCHadronsInitial",
# "GhostCQuarksFinal", "GhostHBosons", "GhostPartons", "GhostTQuarksFinal", "GhostTausFinal", "GhostTruth", "GhostTrack"]
......@@ -34,9 +34,17 @@ def buildExclusiveSubjets(ToolSvc, JetCollectionName, subjet_mode, nsubjet, doTr
# "FastJetPlugin" for EECambridge plugin
algj = "ee_kt"
if doTrackSubJet:
subjet_mode += "Track"
talabel = ""
if doGhostAssoc:
talabel = "GA"
subjetlabel = "Ex%s%i%sSubJets" % (subjet_mode, nsubjet, talabel)
if globalflags.DataSource()=='data': ExGhostLabels = []
SubjetContainerName = "%sEx%s%iSubJets" % (JetCollectionName.replace("Jets", ""), subjet_mode, nsubjet)
ExKtbbTagToolName = str( "Ex%sbbTagTool%i_%s" % (subjet_mode, nsubjet, JetCollectionName) )
SubjetContainerName = "%sEx%s%i%sSubJets" % (JetCollectionName.replace("Jets", ""), subjet_mode, nsubjet, talabel)
ExKtbbTagToolName = str( "Ex%s%sbbTagTool%i_%s" % (subjet_mode, talabel, nsubjet, JetCollectionName) )
if hasattr(jtm, ExKtbbTagToolName):
ExKtbbTagToolInstance = jtm[ ExKtbbTagToolName ]
print " ExKtbbTagTool ", ExKtbbTagToolName, "is alredy in jtm.tools"
......@@ -46,7 +54,7 @@ def buildExclusiveSubjets(ToolSvc, JetCollectionName, subjet_mode, nsubjet, doTr
from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import SubjetFinderTool
from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import SubjetRecorderTool
subjetrecorder = SubjetRecorderTool("subjetrecorder_%s%i_%s" % (subjet_mode, nsubjet, JetCollectionName))
subjetrecorder = SubjetRecorderTool("subjetrecorder_%s%i%s_%s" % (subjet_mode, nsubjet, talabel, JetCollectionName))
ToolSvc += subjetrecorder
subjetrecorder.SubjetLabel = subjetlabel
subjetrecorder.SubjetContainerName = SubjetContainerName
......@@ -84,14 +92,14 @@ def buildExclusiveSubjets(ToolSvc, JetCollectionName, subjet_mode, nsubjet, doTr
#===================================================================
# Build ExKt or CoM Subjets, default is ExKt
#===================================================================
def addExKtCoM(sequence, ToolSvc, JetCollectionExCoM, nSubjets, doTrackSubJet, ExGhostLabels=["GhostBHadronsFinal","GhostCHadronsFinal"], min_subjet_pt_mev = 0, subjetAlgName = "Kt"):
def addExKtCoM(sequence, ToolSvc, JetCollectionExCoM, nSubjets, doTrackSubJet, doGhostAssoc=False, ExGhostLabels=["GhostBHadronsFinal","GhostCHadronsFinal","GhostTrack"], min_subjet_pt_mev = 0, subjetAlgName = "Kt"):
if(subjetAlgName != "Kt" and subjetAlgName != "CoM"):
print "WARNING: Subjet type must be Kt or CoM. Using Kt as default!"
subjetAlgName = "Kt"
from JetRec.JetRecStandard import jtm
ExCoMJetCollection__SubJet = []
(ExCoMbbTagToolInstance, SubjetContainerName) = buildExclusiveSubjets(ToolSvc, JetCollectionExCoM, subjetAlgName, nSubjets, doTrackSubJet, ExGhostLabels, min_subjet_pt_mev)
(ExCoMbbTagToolInstance, SubjetContainerName) = buildExclusiveSubjets(ToolSvc, JetCollectionExCoM, subjetAlgName, nSubjets, doGhostAssoc, doTrackSubJet, ExGhostLabels, min_subjet_pt_mev)
ExCoMJetCollection__SubJet += [SubjetContainerName]
......@@ -147,6 +155,7 @@ def addExKtCoM(sequence, ToolSvc, JetCollectionExCoM, nSubjets, doTrackSubJet, E
},
SetupScheme = "",
TaggerList = BTaggingFlags.StandardTaggers,
TrackAssociatorName="GhostTrack" if doGhostAssoc else "MatchedTracks"
)
# running association + b-tagging on subjets now
from BTagging.BTaggingConfiguration import comTrackAssoc, comMuonAssoc, defaultTrackAssoc, defaultMuonAssoc
......
......@@ -127,6 +127,8 @@ FTAG5BTaggedJets = [
"AntiKtVR30Rmax4Rmin02TrackGhostTagJets",
"AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2SubJets",
"AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubJets",
"AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2GASubJets",
"AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3GASubJets"]
"AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJets"]
OutputJets["FTAG5"] = FTAG5BTaggedJets[:]
......@@ -159,15 +161,21 @@ BTaggingFlags.CalibrationChannelAliases += ["AntiKtVR30Rmax4Rmin02Track->AntiKtV
# ExKt subjets for each trimmed large-R jet
#===================================================================
ExKtJetCollection__FatJet = "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets"
addExKtCoM(FTAG5Seq, ToolSvc, ExKtJetCollection__FatJet, 2, False)
addExKtCoM(FTAG5Seq, ToolSvc, ExKtJetCollection__FatJet, 3, False)
addExKtCoM(FTAG5Seq, ToolSvc, ExKtJetCollection__FatJet, 2, doGhostAssoc=True, doTrackSubJet=False)
addExKtCoM(FTAG5Seq, ToolSvc, ExKtJetCollection__FatJet, 3, doGhostAssoc=True, doTrackSubJet=False)
addExKtCoM(FTAG5Seq, ToolSvc, ExKtJetCollection__FatJet, 2, doTrackSubJet=False)
addExKtCoM(FTAG5Seq, ToolSvc, ExKtJetCollection__FatJet, 3, doTrackSubJet=False)
addExKtCoM(FTAG5Seq, ToolSvc, ExKtJetCollection__FatJet, 2, False, subjetAlgName = "CoM")
BTaggingFlags.CalibrationChannelAliases += ["AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2Sub->AntiKt4LCTopo,AntiKt4TopoEM,AntiKt4EMTopo",
"AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3Sub->AntiKt4LCTopo,AntiKt4TopoEM,AntiKt4EMTopo",
"AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2GASub->AntiKt4LCTopo,AntiKt4TopoEM,AntiKt4EMTopo",
"AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3GASub->AntiKt4LCTopo,AntiKt4TopoEM,AntiKt4EMTopo",
"AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2Sub->AntiKt4LCTopo,AntiKt4TopoEM,AntiKt4EMTopo"]
#==================================================================
# Augment tracks and jets with additional information
#==================================================================
......@@ -224,7 +232,9 @@ FTAG5SlimmingHelper.SmartCollections = [
"BTagging_AntiKtVR30Rmax4Rmin02Track_expert",
"BTagging_AntiKtVR30Rmax4Rmin02TrackGhostTag_expert",
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2Sub_expert",
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3Sub_expert",
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3Sub_expert",
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2GASub_expert",
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3GASub_expert",
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2Sub_expert",
fatJetCollection]
......@@ -245,6 +255,8 @@ FTAG5SlimmingHelper.ExtraVariables += [
"BTagging_AntiKtVR30Rmax4Rmin02TrackGhostTag.JetFitter_JFvertices.SV1_vertices.IP2D_nTrks.IP3D_nTrks",
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2Sub.JetFitter_JFvertices.SV1_vertices.IP2D_nTrks.IP3D_nTrks",
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3Sub.JetFitter_JFvertices.SV1_vertices.IP2D_nTrks.IP3D_nTrks",
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2GASub.JetFitter_JFvertices.SV1_vertices.IP2D_nTrks.IP3D_nTrks",
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3GASub.JetFitter_JFvertices.SV1_vertices.IP2D_nTrks.IP3D_nTrks"
"BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2Sub.JetFitter_JFvertices.SV1_vertices.IP2D_nTrks.IP3D_nTrks"
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment