Skip to content
Snippets Groups Projects
Commit 7cb7c390 authored by Giacinto Piacquadio's avatar Giacinto Piacquadio Committed by Goetz Gaycken
Browse files

change truth handling to alternative option suggested at HIGG5 meeting

Former-commit-id: 6e531e92979de8a691ba1ff3b25bf81a532cdf97
parent 6ff8fa77
No related branches found
No related tags found
No related merge requests found
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
# commont content for Hbb DAODs
......@@ -24,7 +25,7 @@ def getHIGG5Common() :
]
def getHIGG5CommonTruthContainers() :
return ["TruthElectrons", "TruthMuons", "TruthTaus", "TruthPhotons", "TruthNeutrinos", "TruthTop", "TruthBSM", "TruthBoson"]
return ["TruthElectrons", "TruthMuons", "TruthTaus"]#decided not to keep "TruthPhotons", "TruthNeutrinos", "TruthTop", "TruthBSM", "TruthBoson"
def getHIGG5CommonTruth() :
return [
......@@ -53,24 +54,24 @@ def filterContentList(pattern, content_list) :
# --- common thinning tools
def getTruthThinningTool(tool_prefix, thinning_helper) :
from DerivationFrameworkCore.DerivationFrameworkMaster import DerivationFrameworkIsMonteCarlo
from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__GenericTruthThinning
if not DerivationFrameworkIsMonteCarlo :
return None
# MC truth thinning (not for data)
# truth_cond_WZH = "((abs(TruthParticles.pdgId) >= 23) && (abs(TruthParticles.pdgId) <= 25))" # W, Z and Higgs
# truth_cond_Lepton = "((abs(TruthParticles.pdgId) >= 11) && (abs(TruthParticles.pdgId) <= 16))" # Leptons
truth_cond_Quark = "((abs(TruthParticles.pdgId) == 5))||((abs(TruthParticles.pdgId) == 4))" # C quark and Bottom quark
truth_cond_Hadrons = "((abs(TruthParticles.pdgId) >= 400)&&(abs(TruthParticles.pdgId)<500))||((abs(TruthParticles.pdgId) >= 5000)&&(abs(TruthParticles.pdgId)<6000))"
# truth_cond_Photon = "((abs(TruthParticles.pdgId) == 22) && (TruthParticles.pt > 1*GeV))" # Photon
# truth_expression = '('+truth_cond_WZH+' || '+truth_cond_Lepton +' || '+truth_cond_Quark +' || '+truth_cond_Photon+')'
truth_expression = '('+truth_cond_Quark+' || '+ truth_cond_Hadrons+')&&(sqrt(TruthParticles.px*TruthParticles.px+TruthParticles.py*TruthParticles.py)>5000)'
truth_cond_WZH = "((abs(TruthParticles.pdgId) >= 23) && (abs(TruthParticles.pdgId) <= 25))" # W, Z and Higgs
truth_cond_Lepton = "((abs(TruthParticles.pdgId) >= 11) && (abs(TruthParticles.pdgId) <= 16))" # Leptons
truth_cond_Top_Quark = "((abs(TruthParticles.pdgId) == 6))"
truth_cond_BC_Quark = "((abs(TruthParticles.pdgId) == 5))||((abs(TruthParticles.pdgId) == 4))" # C quark and Bottom quark
truth_cond_Hadrons = "((abs(TruthParticles.pdgId) >= 400)&&(abs(TruthParticles.pdgId)<600))||((abs(TruthParticles.pdgId) >= 4000)&&(abs(TruthParticles.pdgId)<6000))||((abs(TruthParticles.pdgId) >= 10400)&&(abs(TruthParticles.pdgId)<10600))||((abs(TruthParticles.pdgId) >= 20400)&&(abs(TruthParticles.pdgId)<20600))"
truth_expression = '('+truth_cond_WZH+' || '+truth_cond_Lepton +' || '+truth_cond_Top_Quark+') || (('+ truth_cond_BC_Quark + " || " + truth_cond_Hadrons+')&&(sqrt(TruthParticles.px*TruthParticles.px+TruthParticles.py*TruthParticles.py)>5000))'
from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__GenericTruthThinning
MCThinningTool = DerivationFramework__GenericTruthThinning(
name = tool_prefix + "MCThinningTool",
ThinningService = thinning_helper.ThinningSvc(),
ParticleSelectionString = truth_expression,
PreserveDescendants = False,
PreserveGeneratorDescendants = False,
PreserveAncestors = False)
PreserveAncestors = True)
from AthenaCommon.AppMgr import ToolSvc
ToolSvc += MCThinningTool
return MCThinningTool
......
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