From 80e4ae8205d28772b8b2faae0a691ea515887a5f Mon Sep 17 00:00:00 2001
From: Giacinto Piacquadio <giacinto.piacquadio@cern.ch>
Date: Sun, 10 Jun 2018 17:55:44 -0400
Subject: [PATCH] migrate to using Truth3 also in HIGG2D4 and HIGG5D1

Former-commit-id: 2d18e33e837bec616f051139066339acd58025e1
---
 .../python/HIGG2D4ExtraContent.py             |  2 +-
 .../python/HIGG5D1ExtraContent.py             |  2 +-
 .../DerivationFrameworkHiggs/share/HIGG2D4.py | 35 ++++++++++++++++---
 .../DerivationFrameworkHiggs/share/HIGG5D1.py | 34 +++++++++++++++---
 4 files changed, 63 insertions(+), 10 deletions(-)

diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG2D4ExtraContent.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG2D4ExtraContent.py
index b28442857b0c..8d87a561bd0b 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG2D4ExtraContent.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG2D4ExtraContent.py
@@ -15,4 +15,4 @@ ExtraContentTruth=HIGG5Common.getHIGG5CommonTruth()
 
 ExtraContainers=[]
 
-ExtraContainersTruth=[]
+ExtraContainersTruth=HIGG5Common.getHIGG5CommonTruthContainers()
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG5D1ExtraContent.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG5D1ExtraContent.py
index 73bfe12ccd68..3df1c3856608 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG5D1ExtraContent.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG5D1ExtraContent.py
@@ -11,4 +11,4 @@ ExtraContent+=[
 ExtraContentTruth=HIGG5Common.getHIGG5CommonTruth()
 
 ExtraContainers=[]
-ExtraContainersTruth=[]
+ExtraContainersTruth=HIGG5Common.getHIGG5CommonTruthContainers()
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/share/HIGG2D4.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/share/HIGG2D4.py
index 502c506e4da4..3a7669422e52 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/share/HIGG2D4.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/share/HIGG2D4.py
@@ -57,10 +57,6 @@ thinningTools.append( HIGG5Common.getTCCTrackParticleThinning(          'HIGG2D4
 thinningTools.append( HIGG5Common.getAntiKt10LCTopoTrimmedPtFrac5SmallR20Thinning('HIGG2D4',HIGG2D4ThinningHelper) )
 thinningTools.append( HIGG5Common.getAntiKt10TrackCaloClusterTrimmedPtFrac5SmallR20Thinning('HIGG2D4',HIGG2D4ThinningHelper) )
 
-# Truth particles
-if DerivationFrameworkIsMonteCarlo:
-    thinningTools.append(HIGG5Common.getTruthThinningTool('HIGG2D4', HIGG2D4ThinningHelper))
-
 print "HIGG2D4.py thinningTools", thinningTools
 
 #====================================================================
@@ -280,6 +276,13 @@ BTaggingFlags.CalibrationChannelAliases += ["AntiKtVR30Rmax4Rmin02Track->AntiKtV
 import JetTagNonPromptLepton.JetTagNonPromptLeptonConfig as JetTagConfig
 higg2d4Seq += JetTagConfig.GetDecoratePromptLeptonAlgs()
 
+#====================================================================
+# SET UP CUSTOM TRUTH3 INFORMATION (only for higg5D2Kernel)
+#====================================================================
+if DerivationFrameworkIsMonteCarlo :
+    HIGG5Common.getTruth3Collections(higg2d4Seq)
+
+
 # Main selection
 higg2d4Seq += CfgMgr.DerivationFramework__DerivationKernel(
     "HIGG2D4Kernel",
@@ -301,6 +304,30 @@ HIGG2D4SlimmingHelper.AppendToDictionary = {
   "AntiKtVR30Rmax4Rmin02TrackJetsAux"             :   "xAOD::JetAuxContainer"     ,
   "BTagging_AntiKtVR30Rmax4Rmin02Track"           :   "xAOD::BTaggingContainer"   ,
   "BTagging_AntiKtVR30Rmax4Rmin02TrackAux"        :   "xAOD::BTaggingAuxContainer",
+ "TruthBoson" : "xAOD::TruthParticleContainer" ,
+  "TruthBosonAux" : "xAOD::TruthParticleAuxContainer" ,
+  "TruthTop" : "xAOD::TruthParticleContainer" ,
+  "TruthTopAux" : "xAOD::TruthParticleAuxContainer" ,
+  "TruthBSM" : "xAOD::TruthParticleContainer" ,
+  "TruthBSMAux" : "xAOD::TruthParticleAuxContainer" ,
+  "HardScatterParticles" : "xAOD::TruthParticleContainer" ,
+  "HardScatterParticlesAux" : "xAOD::TruthParticleAuxContainer" ,
+  "TruthBosonWithDecayParticles" : "xAOD::TruthParticleContainer" ,
+  "TruthBosonWithDecayParticlesAux" : "xAOD::TruthParticleAuxContainer" ,
+  "TruthTopQuarkWithDecayParticles" : "xAOD::TruthParticleContainer" ,
+  "TruthTopQuarkWithDecayParticlesAux" : "xAOD::TruthParticleAuxContainer" ,
+  "TruthHFWithDecayParticles" : "xAOD::TruthParticleContainer" ,
+  "TruthHFWithDecayParticlesAux" : "xAOD::TruthParticleAuxContainer" ,
+  "HardScatterVertices" : "xAOD::TruthVertexContainer" ,
+  "HardScatterVerticesAux" : "xAOD::TruthVertexAuxContainer" ,
+  "TruthBosonWithDecayVertices" : "xAOD::TruthVertexContainer" ,
+  "TruthBosonWithDecayVerticesAux" : "xAOD::TruthVertexAuxContainer" ,
+  "TruthTopQuarkWithDecayVertices" : "xAOD::TruthVertexContainer" ,
+  "TruthTopQuarkWithDecayVerticesAux" : "xAOD::TruthVertexAuxContainer" ,
+  "TruthPrimaryVertices" : "xAOD::TruthVertexContainer",
+  "TruthPrimaryVerticesAux" : "xAOD::TruthVertexAuxContainer",
+  "TruthHFWithDecayVertices" : "xAOD::TruthVertexContainer",
+  "TruthHFWithDecayVerticesAux" : "xAOD::TruthVertexAuxContainer",
   }
 
 HIGG2D4SlimmingHelper.SmartCollections = ["Electrons",
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/share/HIGG5D1.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/share/HIGG5D1.py
index e8b54b051185..690b55016b3b 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/share/HIGG5D1.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/share/HIGG5D1.py
@@ -57,10 +57,6 @@ thinningTools.append( HIGG5Common.getTCCTrackParticleThinning(          'HIGG5D1
 thinningTools.append( HIGG5Common.getAntiKt10LCTopoTrimmedPtFrac5SmallR20Thinning('HIGG5D1',HIGG5D1ThinningHelper) )
 thinningTools.append( HIGG5Common.getAntiKt10TrackCaloClusterTrimmedPtFrac5SmallR20Thinning('HIGG5D1',HIGG5D1ThinningHelper) )
 
-# MC truth thinning (not for data)
-if DerivationFrameworkIsMonteCarlo :
-    thinningTools.append(HIGG5Common.getTruthThinningTool('HIGG5D1', HIGG5D1ThinningHelper))
-
 #====================================================================
 # jet selection 
 #====================================================================
@@ -250,6 +246,12 @@ BTaggingFlags.CalibrationChannelAliases += ["AntiKtVR30Rmax4Rmin02Track->AntiKtV
 import JetTagNonPromptLepton.JetTagNonPromptLeptonConfig as JetTagConfig
 higg5d1Seq += JetTagConfig.GetDecoratePromptLeptonAlgs()
 
+#====================================================================
+# SET UP CUSTOM TRUTH3 INFORMATION (only for higg5D2Kernel)
+#====================================================================
+if DerivationFrameworkIsMonteCarlo :
+  HIGG5Common.getTruth3Collections(higg5d1Seq)
+
 
 higg5d1Seq += CfgMgr.DerivationFramework__DerivationKernel(
     "HIGG5D1Kernel_jet",
@@ -283,6 +285,30 @@ HIGG5D1SlimmingHelper.AppendToDictionary = {
   "AntiKtVR30Rmax4Rmin02TrackJetsAux"            :   "xAOD::JetAuxContainer"     ,
   "BTagging_AntiKtVR30Rmax4Rmin02Track"          :   "xAOD::BTaggingContainer"   ,
   "BTagging_AntiKtVR30Rmax4Rmin02TrackAux"       :   "xAOD::BTaggingAuxContainer",
+  "TruthBoson" : "xAOD::TruthParticleContainer" ,
+  "TruthBosonAux" : "xAOD::TruthParticleAuxContainer" ,
+  "TruthTop" : "xAOD::TruthParticleContainer" ,
+  "TruthTopAux" : "xAOD::TruthParticleAuxContainer" ,
+  "TruthBSM" : "xAOD::TruthParticleContainer" ,
+  "TruthBSMAux" : "xAOD::TruthParticleAuxContainer" ,
+  "HardScatterParticles" : "xAOD::TruthParticleContainer" ,
+  "HardScatterParticlesAux" : "xAOD::TruthParticleAuxContainer" ,
+  "TruthBosonWithDecayParticles" : "xAOD::TruthParticleContainer" ,
+  "TruthBosonWithDecayParticlesAux" : "xAOD::TruthParticleAuxContainer" ,
+  "TruthTopQuarkWithDecayParticles" : "xAOD::TruthParticleContainer" ,
+  "TruthTopQuarkWithDecayParticlesAux" : "xAOD::TruthParticleAuxContainer" ,
+  "TruthHFWithDecayParticles" : "xAOD::TruthParticleContainer" ,
+  "TruthHFWithDecayParticlesAux" : "xAOD::TruthParticleAuxContainer" ,
+  "HardScatterVertices" : "xAOD::TruthVertexContainer" ,
+  "HardScatterVerticesAux" : "xAOD::TruthVertexAuxContainer" ,
+  "TruthBosonWithDecayVertices" : "xAOD::TruthVertexContainer" ,
+  "TruthBosonWithDecayVerticesAux" : "xAOD::TruthVertexAuxContainer" ,
+  "TruthTopQuarkWithDecayVertices" : "xAOD::TruthVertexContainer" ,
+  "TruthTopQuarkWithDecayVerticesAux" : "xAOD::TruthVertexAuxContainer" ,
+  "TruthPrimaryVertices" : "xAOD::TruthVertexContainer",
+  "TruthPrimaryVerticesAux" : "xAOD::TruthVertexAuxContainer",
+  "TruthHFWithDecayVertices" : "xAOD::TruthVertexContainer",
+  "TruthHFWithDecayVerticesAux" : "xAOD::TruthVertexAuxContainer",
   }
 
 HIGG5D1SlimmingHelper.SmartCollections = [ "Electrons",
-- 
GitLab