Commit 3a0e0d57 authored by scott snyder's avatar scott snyder Committed by scott snyder
Browse files

DerivationFrameworkSM: Update GenericTruthThinning for MT thinning.

    
Convert GenericTruthThinning to use MT-compatible thinning.
Update uses of it (pass stream name rather than thinning service).
parent fdaa9862
......@@ -7,6 +7,20 @@ from DerivationFrameworkCore.DerivationFrameworkMaster import *
from DerivationFrameworkJetEtMiss.JetCommon import *
from DerivationFrameworkJetEtMiss.ExtendedJetCommon import *
#====================================================================
# SET UP STREAM
#====================================================================
streamName = derivationFlags.WriteDAOD_STDM1Stream.StreamName
fileName = buildFileName( derivationFlags.WriteDAOD_STDM1Stream )
STDM1Stream = MSMgr.NewPoolRootStream( streamName, fileName )
STDM1Stream.AcceptAlgs(["STDM1Kernel"])
from AthenaServices.Configurables import ThinningSvc, createThinningSvc
augStream = MSMgr.GetStream( streamName )
evtStream = augStream.GetEventStream()
svcMgr += createThinningSvc( svcName="STDM1ThinningSvc", outStreams=[evtStream] )
#=======================================
# SKIMMING TOOL
#=======================================
......@@ -68,7 +82,7 @@ if doTruthThinning and globalflags.DataSource()=='geant4':
from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__GenericTruthThinning
STDM1TruthThinningTool = DerivationFramework__GenericTruthThinning( name = "STDM1TruthThinningTool",
ThinningService = "STDM1ThinningSvc",
StreamName = streamName,
ParticlesKey = "TruthParticles",
VerticesKey = "TruthVertices",
ParticleSelectionString = truth_expression,
......@@ -124,20 +138,6 @@ for radius in [0.2, 0.3, 0.5, 0.6, 0.7, 0.8]:
addDefaultTrimmedJets(stdm1Seq,"STDM1")
#====================================================================
# SET UP STREAM
#====================================================================
streamName = derivationFlags.WriteDAOD_STDM1Stream.StreamName
fileName = buildFileName( derivationFlags.WriteDAOD_STDM1Stream )
STDM1Stream = MSMgr.NewPoolRootStream( streamName, fileName )
STDM1Stream.AcceptAlgs(["STDM1Kernel"])
from AthenaServices.Configurables import ThinningSvc, createThinningSvc
augStream = MSMgr.GetStream( streamName )
evtStream = augStream.GetEventStream()
svcMgr += createThinningSvc( svcName="STDM1ThinningSvc", outStreams=[evtStream] )
#====================================================================
# Add the containers to the output stream - slimming done here
#====================================================================
......
......@@ -99,21 +99,21 @@ if globalflags.DataSource()=='geant4':
from DerivationFrameworkSM.STDMCommonTruthTools import *
STDM3TruthLepTool = DerivationFramework__GenericTruthThinning(name = "STDM3TruthLepTool",
ThinningService = STDM3ThinningHelper.ThinningSvc(),
StreamName = streamName,
ParticleSelectionString = truth_cond_lepton,
PreserveDescendants = False,
PreserveGeneratorDescendants = False,
PreserveAncestors = True)
STDM3TruthBosTool = DerivationFramework__GenericTruthThinning(name = "STDM3TruthBosTool",
ThinningService = STDM3ThinningHelper.ThinningSvc(),
StreamName = streamName,
ParticleSelectionString = truth_cond_boson,
PreserveDescendants = False,
PreserveGeneratorDescendants = True,
PreserveAncestors = False)
STDM3PhotonThinning = DerivationFramework__GenericTruthThinning(name = "STDM3PhotonThinning",
ThinningService = STDM3ThinningHelper.ThinningSvc(),
StreamName = streamName,
ParticlesKey = "TruthPhotons",
ParticleSelectionString = photonthinningexpr)
......@@ -177,13 +177,6 @@ DerivationFrameworkJob += STDM3Sequence
#STDM3Stream = MSMgr.NewPoolRootStream( streamName, fileName )
#STDM3Stream.AcceptAlgs(["STDM3Kernel"])
# Special lines for thinning
# Thinning service name must match the one passed to the thinning tools
# from AthenaServices.Configurables import ThinningSvc, createThinningSvc
# augStream = MSMgr.GetStream( streamName )
# evtStream = augStream.GetEventStream()
# svcMgr += createThinningSvc( svcName="STDM3ThinningSvc", outStreams=[evtStream] )
#====================================================================
# Add the containers to the output stream - slimming done here
#====================================================================
......
......@@ -96,21 +96,21 @@ if globalflags.DataSource()=='geant4':
from DerivationFrameworkSM.STDMCommonTruthTools import *
STDM4TruthLepTool = DerivationFramework__GenericTruthThinning(name = "STDM4TruthLepTool",
ThinningService = STDM4ThinningHelper.ThinningSvc(),
StreamName = streamName,
ParticleSelectionString = truth_cond_lepton,
PreserveDescendants = False,
PreserveGeneratorDescendants = False,
PreserveAncestors = True)
STDM4TruthBosTool = DerivationFramework__GenericTruthThinning(name = "STDM4TruthBosTool",
ThinningService = STDM4ThinningHelper.ThinningSvc(),
StreamName = streamName,
ParticleSelectionString = truth_cond_boson,
PreserveDescendants = False,
PreserveGeneratorDescendants = True,
PreserveAncestors = False)
STDM4PhotonThinning = DerivationFramework__GenericTruthThinning(name = "STDM4PhotonThinning",
ThinningService = STDM4ThinningHelper.ThinningSvc(),
StreamName = streamName,
ParticlesKey = "TruthPhotons",
ParticleSelectionString = photonthinningexpr)
......@@ -174,12 +174,6 @@ DerivationFrameworkJob += STDM4Sequence
#fileName = buildFileName( derivationFlags.WriteDAOD_STDM4Stream )
#STDM4Stream = MSMgr.NewPoolRootStream( streamName, fileName )
#STDM4Stream.AcceptAlgs(["STDM4Kernel"])
# Special lines for thinning
# Thinning service name must match the one passed to the thinning tools
#from AthenaServices.Configurables import ThinningSvc, createThinningSvc
#augStream = MSMgr.GetStream( streamName )
#evtStream = augStream.GetEventStream()
#svcMgr += createThinningSvc( svcName="STDM4ThinningSvc", outStreams=[evtStream] )
#====================================================================
# Add the containers to the output stream - slimming done here
......
......@@ -97,19 +97,19 @@ if globalflags.DataSource()=='geant4':
from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__GenericTruthThinning
STDM5TruthLepTool = DerivationFramework__GenericTruthThinning(name = "STDM5TruthLepTool",
ThinningService = STDM5ThinningHelper.ThinningSvc(),
StreamName = streamName,
ParticleSelectionString = truth_cond_Lepton,
PreserveDescendants = False,
PreserveGeneratorDescendants = False,
PreserveAncestors = True)
STDM5PhotonThinning = DerivationFramework__GenericTruthThinning(name = "STDM5PhotonThinning",
ThinningService = STDM5ThinningHelper.ThinningSvc(),
StreamName = streamName,
ParticlesKey = "TruthPhotons",
ParticleSelectionString = photonthinningexpr)
STDM5TruthBosTool = DerivationFramework__GenericTruthThinning(name = "STDM5TruthBosTool",
ThinningService = STDM5ThinningHelper.ThinningSvc(),
StreamName = streamName,
ParticleSelectionString = truth_cond_boson,
PreserveDescendants = False,
PreserveGeneratorDescendants = True,
......@@ -184,12 +184,6 @@ DerivationFrameworkJob += STDM5Sequence
#fileName = buildFileName( derivationFlags.WriteDAOD_STDM5Stream )
#STDM5Stream = MSMgr.NewPoolRootStream( streamName, fileName )
#STDM5Stream.AcceptAlgs(["STDM5Kernel"])
# Special lines for thinning
# Thinning service name must match the one passed to the thinning tools
#from AthenaServices.Configurables import ThinningSvc, createThinningSvc
#augStream = MSMgr.GetStream( streamName )
#evtStream = augStream.GetEventStream()
#svcMgr += createThinningSvc( svcName="STDM5ThinningSvc", outStreams=[evtStream] )
#====================================================================
# Add the containers to the output stream - slimming done here
......
......@@ -66,26 +66,26 @@ if globalflags.DataSource()=='geant4':
from DerivationFrameworkSM.STDMCommonTruthTools import *
STDM7TruthLepTool = DerivationFramework__GenericTruthThinning(name = "STDM7TruthLepTool",
ThinningService = STDM7ThinningHelper.ThinningSvc(),
StreamName = streamName,
ParticleSelectionString = truth_cond_lepton,
PreserveDescendants = False,
PreserveGeneratorDescendants = False,
PreserveAncestors = True)
STDM7TruthBosTool = DerivationFramework__GenericTruthThinning(name = "STDM7TruthBosTool",
ThinningService = STDM7ThinningHelper.ThinningSvc(),
StreamName = streamName,
ParticleSelectionString = truth_cond_boson,
PreserveDescendants = False,
PreserveGeneratorDescendants = True,
PreserveAncestors = False)
STDM7PhotonThinning = DerivationFramework__GenericTruthThinning(name = "STDM7PhotonThinning",
ThinningService = STDM7ThinningHelper.ThinningSvc(),
StreamName = streamName,
ParticlesKey = "TruthPhotons",
ParticleSelectionString = photonthinningexpr)
STDM7TruthHadTool = DerivationFramework__GenericTruthThinning(name = "STDM7TruthHadTool",
ThinningService = STDM7ThinningHelper.ThinningSvc(),
StreamName = streamName,
ParticleSelectionString = truth_cond_hadrons,
PreserveDescendants = False,
PreserveGeneratorDescendants = False,
......@@ -154,13 +154,6 @@ DerivationFrameworkJob += STDM7Sequence
#STDM7Stream = MSMgr.NewPoolRootStream( streamName, fileName )
#STDM7Stream.AcceptAlgs(["STDM7Kernel"])
# Special lines for thinning
# Thinning service name must match the one passed to the thinning tools
# from AthenaServices.Configurables import ThinningSvc, createThinningSvc
# augStream = MSMgr.GetStream( streamName )
# evtStream = augStream.GetEventStream()
# svcMgr += createThinningSvc( svcName="STDM7ThinningSvc", outStreams=[evtStream] )
#====================================================================
# Add the containers to the output stream - slimming done here
#====================================================================
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment