示例#1
0
 def _make_thinning_tools(self, stream):
     stream_name = self.stream_name
     self.thinning_helper = ThinningHelper(stream_name+"ThinningHelper")
     self.thinning_helper.AppendToStream(stream)
     self.thinning_tools = []
     tool = DerivationFramework__TrackParticleThinning(
             stream_name + "TPThinningTool",
             StreamName = stream_name, 
             SelectionString = "InDetTrackParticles.pt > {0}*GeV".format(
                 self.track_threshold) )
     if self.track_sel is not None:
         tool.SelectionString += " || InDetTrackParticles.{0.common_prefix}{0.track_sel}".format(self)
     self.thinning_tools.append(tool)
     self.thinning_tools += [
             DerivationFramework__MuonTrackParticleThinning(
                 stream_name + "MuonTPThinningTool",
                 StreamName             = stream_name,
                 MuonKey                = "Muons",
                 InDetTrackParticlesKey = "InDetTrackParticles"),
             DerivationFramework__EgammaTrackParticleThinning(
                 stream_name + "ElectronTPThinningTool",
                 StreamName             = stream_name,
                 SGKey                  = "Electrons",
                 InDetTrackParticlesKey = "InDetTrackParticles"),
             DerivationFramework__EgammaTrackParticleThinning(
                 stream_name + "PhotonTPThinningTool",
                 StreamName             = stream_name,
                 SGKey                  = "Photons",
                 InDetTrackParticlesKey = "InDetTrackParticles"),
             DerivationFramework__TauTrackParticleThinning(
                 stream_name + "TauTPThinningTool",
                 StreamName             = stream_name,
                 TauKey                 = "TauJets",
                 InDetTrackParticlesKey = "InDetTrackParticles")
             ]
     global ToolSvc
     ToolSvc += self.thinning_tools
示例#2
0
STDM5Stream.AcceptAlgs(["STDM5Kernel"])


#====================================================================                                               
# THINNING TOOLS
#====================================================================                                               

thinningTools=[]

#=====================
# TRIGGER NAV THINNING
#=====================

# Establish the thinning helper
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
STDM5ThinningHelper = ThinningHelper( "STDM5ThinningHelper" )

#trigger navigation content
STDM5ThinningHelper.TriggerChains = 'HLT_e.*|HLT_2e.*|HLT_mu.*|HLT_2mu.*'
STDM5ThinningHelper.AppendToStream( STDM5Stream )


#=====================
# TRACK  THINNING 
#=====================


from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
STDM5JetTPThinningTool = DerivationFramework__JetTrackParticleThinning( name          = "STDM5JetTPThinningTool",
                                                                        ThinningService         = STDM5ThinningHelper.ThinningSvc(),
                                                                        JetKey                  = "AntiKt4EMTopoJets",
示例#3
0
from DerivationFrameworkJetEtMiss.ExtendedJetCommon import *
from DerivationFrameworkEGamma.EGammaCommon import *
from DerivationFrameworkMuons.MuonsCommon import *
from DerivationFrameworkTau.TauTruthCommon import *
from DerivationFrameworkInDet.InDetCommon import *
from DerivationFrameworkJetEtMiss.METCommon import *

### Set up stream
streamName = derivationFlags.WriteDAOD_SUSY2Stream.StreamName
fileName = buildFileName(derivationFlags.WriteDAOD_SUSY2Stream)
SUSY2Stream = MSMgr.NewPoolRootStream(streamName, fileName)
SUSY2Stream.AcceptAlgs(["SUSY2KernelSkim"])

### Init
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
SUSY2ThinningHelper = ThinningHelper("SUSY2ThinningHelper")
thinningTools = []
AugmentationTools = []

# stream-specific sequence for on-the-fly jet building
SeqSUSY2 = CfgMgr.AthSequencer("SeqSUSY2")
DerivationFrameworkJob += SeqSUSY2

#====================================================================
# Trigger navigation thinning
#====================================================================
from DerivationFrameworkSUSY.SUSY2TriggerList import triggersNavThin
SUSY2ThinningHelper.TriggerChains = '|'.join(triggersNavThin)

SUSY2ThinningHelper.AppendToStream(SUSY2Stream)
示例#4
0
ToolSvc += JETM7SkimmingTool

#====================================================================
# SET UP STREAM
#====================================================================
streamName = derivationFlags.WriteDAOD_JETM7Stream.StreamName
fileName = buildFileName(derivationFlags.WriteDAOD_JETM7Stream)
JETM7Stream = MSMgr.NewPoolRootStream(streamName, fileName)
JETM7Stream.AcceptAlgs(["JETM7Kernel"])

#=======================================
# ESTABLISH THE THINNING HELPER
#=======================================

from DerivationFrameworkCore.ThinningHelper import ThinningHelper
JETM7ThinningHelper = ThinningHelper("JETM7ThinningHelper")
JETM7ThinningHelper.TriggerChains = orstr.join(electronTriggers + muonTriggers)
JETM7ThinningHelper.AppendToStream(JETM7Stream)

#====================================================================
# THINNING TOOLS
#====================================================================
thinningTools = []

# TrackParticles associated with Muons
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning
JETM7MuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(
    name="JETM7MuonTPThinningTool",
    ThinningService=JETM7ThinningHelper.ThinningSvc(),
    MuonKey="Muons",
    InDetTrackParticlesKey="InDetTrackParticles")
示例#5
0
    "BTagging_AntiKt4EMTopo_201810SecVtx": "xAOD::VertexContainer",
    "BTagging_AntiKt4EMTopo_201810SecVtxAux": "xAOD::VertexAuxContainer",
    "BTagging_AntiKt2Track": "xAOD::BTaggingContainer",
    "BTagging_AntiKt2TrackAux": "xAOD::BTaggingAuxContainer",
    "BTagging_AntiKt2TrackJFVtx": "xAOD::BTagVertexContainer",
    "BTagging_AntiKt2TrackJFVtxAux": "xAOD::BTagVertexAuxContainer",
    "BTagging_AntiKt2TrackSecVtx": "xAOD::VertexContainer",
    "BTagging_AntiKt2TrackSecVtxAux": "xAOD::VertexAuxContainer",
    "BTagging_AntiKt10TruthWZ": "xAOD::BTaggingContainer",
    "BTagging_AntiKt10TruthWZAux": "xAOD::BTaggingAuxContainer",
    "BTagging_AntiKt10TruthWZJFVtx": "xAOD::BTagVertexContainer",
    "BTagging_AntiKt10TruthWZJFVtxAux": "xAOD::BTagVertexAuxContainer",
    "BTagging_AntiKt10TruthWZSecVtx": "xAOD::VertexContainer",
    "BTagging_AntiKt10TruthWZSecVtxAux": "xAOD::VertexAuxContainer",
}
#----------------------------------------------------------------------
addJetOutputs(FTAG3SlimmingHelper, ["FTAG3"])

FTAG3SlimmingHelper.IncludeMuonTriggerContent = True
FTAG3SlimmingHelper.IncludeEGammaTriggerContent = False
FTAG3SlimmingHelper.IncludeJetTriggerContent = True
FTAG3SlimmingHelper.IncludeEtMissTriggerContent = False
FTAG3SlimmingHelper.IncludeBJetTriggerContent = True

#FTAG3 TrigNav Thinning
FTAG3ThinningHelper = ThinningHelper("FTAG3ThinningHelper")
FTAG3ThinningHelper.TriggerChains = 'HLT_mu*_j.*_dr05|HLT_mu*_j.*_bperf_split_dr05_dz02|HLT_mu*_j.*_boffperf_split_dr05_dz02|HLT_mu*_j.*_gsc.*_dr05_dz02'
FTAG3ThinningHelper.AppendToStream(FTAG3Stream)

FTAG3SlimmingHelper.AppendContentToStream(FTAG3Stream)
示例#6
0
from DerivationFrameworkJetEtMiss.ExtendedJetCommon import *
from DerivationFrameworkEGamma.EGammaCommon import *
from DerivationFrameworkMuons.MuonsCommon import *
from DerivationFrameworkTau.TauTruthCommon import *
from DerivationFrameworkInDet.InDetCommon import *
from DerivationFrameworkJetEtMiss.METCommon import *

### Set up stream
streamName = derivationFlags.WriteDAOD_SUSY1Stream.StreamName
fileName = buildFileName(derivationFlags.WriteDAOD_SUSY1Stream)
SUSY1Stream = MSMgr.NewPoolRootStream(streamName, fileName)
SUSY1Stream.AcceptAlgs(["SUSY1KernelSkim"])

### Init
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
SUSY1ThinningHelper = ThinningHelper("SUSY1ThinningHelper")
thinningTools = []
AugmentationTools = []

# stream-specific sequence for on-the-fly jet building
SeqSUSY1 = CfgMgr.AthSequencer("SeqSUSY1")
DerivationFrameworkJob += SeqSUSY1

#====================================================================
# Trigger navigation thinning
#====================================================================
triggerRegEx = [  # FIXME: disable unless tested
    ".?j.*", "xe.*", "e.*", "mu.*", "tau.*", "g.*"
]
SUSY1ThinningHelper.TriggerChains = 'HLT_(' + ' | '.join(triggerRegEx) + ')'
SUSY1ThinningHelper.AppendToStream(SUSY1Stream)
示例#7
0
# Trigger matching decorations
#====================================================================
photonTriggers_matching = ['HLT_g60_loose', 'HLT_g140_loose', 'HLT_g160_loose']

from DerivationFrameworkCore.TriggerMatchingAugmentation import applyTriggerMatching
TrigMatchAug, NewTrigVars = applyTriggerMatching(ToolNamePrefix="JETM6",
                                   ElectronTriggers=electronTriggers,
                                   MuonTriggers=muonTriggers,
                                   PhotonTriggers=photonTriggers_matching)

#====================================================================
# TRIGGER THINNING TOOL
#====================================================================

from DerivationFrameworkCore.ThinningHelper import ThinningHelper
JETM6ThinningHelper = ThinningHelper( "JETM6ThinningHelper" )
JETM6ThinningHelper.TriggerChains = ''

JETM6ThinningHelper.TriggerChains += "|".join(electronTriggers)
JETM6ThinningHelper.TriggerChains += "|".join(muonTriggers)
JETM6ThinningHelper.TriggerChains += "|".join(photonTriggers)
JETM6ThinningHelper.TriggerChains += "|".join(jetTriggers)

JETM6ThinningHelper.AppendToStream( JETM6Stream )

#====================================================================
# THINNING TOOLS
#====================================================================
thinningTools = []

#########################################
示例#8
0
#====================================================================
# SET UP STREAM
#====================================================================
streamName = derivationFlags.WriteDAOD_HIGG2D2Stream.StreamName
fileName = buildFileName(derivationFlags.WriteDAOD_HIGG2D2Stream)
HIGG2D2Stream = MSMgr.NewPoolRootStream( streamName, fileName)
HIGG2D2Stream.AcceptAlgs(["HIGG2D2Kernel"])

#================
# THINNING
#================
thinningTools=[]

# Establish the thinning helper (which will set up the services behind the scenes)
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
HIGG2D2ThinningHelper = ThinningHelper("HIGG2D2ThinningHelper")
#trigger navigation content
HIGG2D2ThinningHelper.TriggerChains = 'HLT_e.*|HLT_2e.*|HLT_3e.*|HLT_mu.*|HLT_2mu.*|HLT_3mu.*'
HIGG2D2ThinningHelper.AppendToStream(HIGG2D2Stream)

# MET/Jet tracks
thinning_expression = "(InDetTrackParticles.pt > 0.5*GeV) && (InDetTrackParticles.numberOfPixelHits > 0) && (InDetTrackParticles.numberOfSCTHits > 5) && (abs(DFCommonInDetTrackZ0AtPV) < 1.5)"

from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
HIGG2D2JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(name                   = "HIGG2D2JetTPThinningTool",
                                                                         StreamName              = streamName,
                                                                         JetKey                 = "AntiKt4LCTopoJets",
                                                                         InDetTrackParticlesKey = "InDetTrackParticles",
                                                                         TrackSelectionString   = thinning_expression)
ToolSvc += HIGG2D2JetTPThinningTool
thinningTools.append(HIGG2D2JetTPThinningTool)
示例#9
0
]
StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Loose_Vertices"]
StaticContent += [
    "xAOD::VertexAuxContainer#SoftBVrtClusterTool_Loose_VerticesAux." +
    excludedVertexAuxData
]
StaticContent += [
    "xAOD::VertexContainer#VrtSecInclusive_SoftBtagCandidateVertices"
]
StaticContent += [
    "xAOD::VertexAuxContainer#VrtSecInclusive_SoftBtagCandidateVerticesAux."
]

FTAG4SlimmingHelper.StaticContent = StaticContent
#----------------------------------------------------------------------

addJetOutputs(FTAG4SlimmingHelper, ["FTAG4"])

FTAG4SlimmingHelper.IncludeMuonTriggerContent = True
FTAG4SlimmingHelper.IncludeEGammaTriggerContent = True
FTAG4SlimmingHelper.IncludeJetTriggerContent = True
FTAG4SlimmingHelper.IncludeEtMissTriggerContent = False
FTAG4SlimmingHelper.IncludeBJetTriggerContent = True

#FTAG4 TrigNav Thinning
FTAG4ThinningHelper = ThinningHelper("FTAG4ThinningHelper")
FTAG4ThinningHelper.TriggerChains = 'HLT_e[2-9][0-9]_.*|HLT_e[1-9][0-9][0-9]_.*|HLT_mu[2-9][0-9]_.*|HLT_mu[1-9][0-9][0-9]_.*|HLT_mu[2-9][0-9]'
FTAG4ThinningHelper.AppendToStream(FTAG4Stream)

FTAG4SlimmingHelper.AppendContentToStream(FTAG4Stream)
示例#10
0
    ToolSvc += MUON5BkgElectronClassificationTool

    augmentationTools.append(MUON5BkgElectronClassificationTool)

    printfunc ("BkgElectronClassificationTool: ", MUON5BkgElectronClassificationTool)

#====================================================================
# THINNING TOOLS
#====================================================================

thinningTools = []

# Establish the thinning helper (which will set up the services behind the scenes)
from DerivationFrameworkCore.ThinningHelper import ThinningHelper

MUON5ThinningHelper = ThinningHelper("MUON5ThinningHelper")

# Trigger Thinning Tool
MUON5ThinningHelper.TriggerChains = 'HLT_e.*|HLT_mu.*|HLT_2e.*|HLT_2mu.*|HLT_tau.*'
MUON5ThinningHelper.AppendToStream(MUON5Stream)

#====================================================================
# TRACK THINNING
#====================================================================

do_track_thinning = False

from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackParticleThinning
MUON5TrackThinningTool = DerivationFramework__TrackParticleThinning(name                    = "MUON5TrackThinningTool",
                                                                    StreamName              = streamName,
                                                                    SelectionString         = "abs(DFCommonInDetTrackZ0AtPV) < 10.0",
示例#11
0
from DerivationFrameworkJetEtMiss.JetCommon import *
from DerivationFrameworkJetEtMiss.ExtendedJetCommon import *
from DerivationFrameworkEGamma.EGammaCommon import *
from DerivationFrameworkMuons.MuonsCommon import *
from DerivationFrameworkInDet.InDetCommon import *
from DerivationFrameworkJetEtMiss.METCommon import *

### Set up stream
streamName = derivationFlags.WriteDAOD_SUSY8Stream.StreamName
fileName = buildFileName(derivationFlags.WriteDAOD_SUSY8Stream)
SUSY8Stream = MSMgr.NewPoolRootStream(streamName, fileName)
SUSY8Stream.AcceptAlgs(["SUSY8KernelSkim"])

### Init
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
SUSY8ThinningHelper = ThinningHelper("SUSY8ThinningHelper")
thinningTools = []
AugmentationTools = []

# stream-specific sequence for on-the-fly jet building
SeqSUSY8 = CfgMgr.AthSequencer("SeqSUSY8")
DerivationFrameworkJob += SeqSUSY8

#====================================================================
# Trigger navigation thinning
#====================================================================
from DerivationFrameworkSUSY.SUSY8TriggerList import *

jetMETTriggers = SUSY8JetMETTriggers
muonTriggers = SUSY8MuonTriggers
dimuonTriggers = SUSY8DimuonTriggers
示例#12
0
        ToolSvc += DecoTool

#====================================================================
# SET UP STREAM
#====================================================================
MUON3Stream = MSMgr.NewPoolRootStream(
    derivationFlags.WriteDAOD_MUON3Stream.StreamName,
    buildFileName(derivationFlags.WriteDAOD_MUON3Stream))
MUON3Stream.AcceptAlgs(["MUON3Kernel"])

### trigger thinning
triggerList = ['HLT_mu14', 'HLT_2mu4', 'HLT_2mu6_bJpsimumu']

from DerivationFrameworkCore.ThinningHelper import ThinningHelper
MUON3ThinningHelper = ThinningHelper("MUON3ThinningHelper")
MUON3ThinningHelper.TriggerChains = '|'.join(triggerList)
MUON3ThinningHelper.AppendToStream(MUON3Stream)

#====================================================================
# SET UP STREAM
#====================================================================
streamName = derivationFlags.WriteDAOD_MUON3Stream.StreamName
fileName = buildFileName(derivationFlags.WriteDAOD_MUON3Stream)
MUON3Stream = MSMgr.NewPoolRootStream(streamName, fileName)
MUON3Stream.AcceptAlgs(["MUON3Kernel"])
# Special lines for thinning
# Thinning service name must match the one passed to the thinning tools
augStream = MSMgr.GetStream(streamName)
evtStream = augStream.GetEventStream()
#====================================================================
# SET UP STREAM
#====================================================================
streamName = derivationFlags.WriteDAOD_TEST10Stream.StreamName
fileName = buildFileName(derivationFlags.WriteDAOD_TEST10Stream)
TEST10Stream = MSMgr.NewPoolRootStream(streamName, fileName)
TEST10Stream.AcceptAlgs(["TEST10Kernel"])

#====================================================================
# THINNING
#====================================================================
# Establish the thinning helper (which will set up the services behind the scenes)
# Plug in the required triggers
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
TEST10ThinningHelper = ThinningHelper("TEST10ThinningHelper")
TEST10ThinningHelper.TriggerChains = 'HLT_e.*|HLT_g.*|HLT_mu.*|HLT_tau.*'
TEST10ThinningHelper.AppendToStream(TEST10Stream)

#====================================================================
# CREATE THE DERIVATION KERNEL ALGORITHM AND PASS THE ABOVE TOOLS
#====================================================================

# The name of the kernel (TEST10Kernel in this case) must be unique to this derivation
from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
DerivationFrameworkJob += CfgMgr.DerivationFramework__DerivationKernel(
    "TEST10Kernel")
TEST10Stream.AcceptAlgs(["TEST10Kernel"])

#====================================================================
# CONTENT LIST
示例#14
0
    "HLT_e15_lhvloose_L1EM7", "HLT_e15_lhvloose_L1EM13VH",
    "HLT_e15_lhvloose_nod0_L1EM13VH", "HLT_e17_lhvloose",
    "HLT_e17_lhvloose_nod0", "HLT_e20_lhvloose_L1EM12", "HLT_e20_lhvloose",
    "HLT_e20_lhvloose_nod0", "HLT_e24_lhvloose_nod0_L1EM18VH",
    "HLT_e24_lhvloose_nod0_L1EM20VH"
]

from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__TriggerSkimmingTool

HIGG3D3TrigSkimmingTool = DerivationFramework__TriggerSkimmingTool(
    name="HIGG3D3TrigSkimmingTool", TriggerListOR=TriggerChains)
ToolSvc += HIGG3D3TrigSkimmingTool

from DerivationFrameworkCore.ThinningHelper import ThinningHelper

HIGG3D3ThinningHelper = ThinningHelper("HIGG3D3ThinningHelper")
HIGG3D3ThinningHelper.TriggerChains = " | ".join(TriggerChains)
HIGG3D3ThinningHelper.AppendToStream(HIGG3D3Stream)

#================
# THINNING
#================
thinningTools = []

# MET/Jet tracks
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning

HIGG3D3JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="HIGG3D3JetTPThinningTool",
    ThinningService=HIGG3D3ThinningHelper.ThinningSvc(),
    JetKey="AntiKt4EMTopoJets",
示例#15
0
ToolSvc += JETM4SkimmingTool

#====================================================================
# SET UP STREAM   
#====================================================================
streamName = derivationFlags.WriteDAOD_JETM4Stream.StreamName
fileName   = buildFileName( derivationFlags.WriteDAOD_JETM4Stream )
JETM4Stream = MSMgr.NewPoolRootStream( streamName, fileName )
JETM4Stream.AcceptAlgs(["JETM4Kernel"])

#=======================================
# ESTABLISH THE THINNING HELPER
#=======================================

from DerivationFrameworkCore.ThinningHelper import ThinningHelper
JETM4ThinningHelper = ThinningHelper( "JETM4ThinningHelper" )
JETM4ThinningHelper.TriggerChains = triggers
JETM4ThinningHelper.AppendToStream( JETM4Stream )

#====================================================================
# THINNING TOOLS 
#====================================================================
thinningTools = []

# TrackParticles associated with Muons
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning
JETM4MuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(name     = "JETM4MuonTPThinningTool",
                                                                    ThinningService         = JETM4ThinningHelper.ThinningSvc(),
                                                                    MuonKey                 = "Muons",
                                                                    InDetTrackParticlesKey  = "InDetTrackParticles")
ToolSvc += JETM4MuonTPThinningTool
示例#16
0
TOPQ2Stream = MSMgr.NewPoolRootStream(streamName, fileName)
# Accept the most selective kernel (last one in sequence; later in derivation)
TOPQ2Stream.AcceptAlgs(["TOPQ2Kernel"])

#====================================================================
# PDF Weight Metadata
#====================================================================
if DFisMC:
    from DerivationFrameworkCore.WeightMetadata import *

#====================================================================
# TRIGGER NAVIGATION THINNING
#====================================================================
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
import DerivationFrameworkTop.TOPQCommonThinning
TOPQ2ThinningHelper = ThinningHelper("TOPQ2ThinningHelper")
TOPQ2ThinningHelper.TriggerChains = DerivationFrameworkTop.TOPQCommonThinning.TOPQTriggerChains(
)
TOPQ2ThinningHelper.AppendToStream(TOPQ2Stream)

#====================================================================
# SKIMMING TOOLS
#====================================================================
import DerivationFrameworkTop.TOPQCommonSelection
skimmingTools_lep = DerivationFrameworkTop.TOPQCommonSelection.setup_lep(
    'TOPQ2', ToolSvc)
skimmingTools_jet = DerivationFrameworkTop.TOPQCommonSelection.setup_jet(
    'TOPQ2', ToolSvc)

#====================================================================
# THINNING TOOLS
示例#17
0
from DerivationFrameworkFlavourTag.HbbCommon import *
from TriggerMenu.api.TriggerAPI import TriggerAPI
from TriggerMenu.api.TriggerEnums import TriggerPeriod, TriggerType
from DerivationFrameworkTrigger.TriggerMatchingHelper import TriggerMatchingHelper

#====================================================================
# SET UP STREAM   
#====================================================================
streamName = derivationFlags.WriteDAOD_PHYSLITEStream.StreamName
fileName   = buildFileName( derivationFlags.WriteDAOD_PHYSLITEStream )
PHYSLITEStream = MSMgr.NewPoolRootStream( streamName, fileName )
PHYSLITEStream.AcceptAlgs(["PHYSLITEKernel"])

### Thinning and augmentation tools lists
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
PHYSLITEThinningHelper = ThinningHelper( "PHYSLITEThinningHelper" )
PHYSLITEThinningHelper.AppendToStream( PHYSLITEStream )
thinningTools       = []
AugmentationTools   = []

# Special sequence 
SeqPHYSLITE = CfgMgr.AthSequencer("SeqPHYSLITE")

#====================================================================
# TRUTH CONTENT
#====================================================================
if DerivationFrameworkIsMonteCarlo:
  from DerivationFrameworkMCTruth.MCTruthCommon import addStandardTruthContents,addPVCollection
  addStandardTruthContents(SeqPHYSLITE)
  addPVCollection(SeqPHYSLITE)
  from DerivationFrameworkMCTruth.HFHadronsCommon import *
示例#18
0
#====================================================================

from DerivationFrameworkCalo.DerivationFrameworkCaloConf import DerivationFramework__MaxCellDecorator
EGAM9_MaxCellDecoratorTool = DerivationFramework__MaxCellDecorator(
    name="EGAM9_MaxCellDecoratorTool",
    SGKey_electrons="Electrons",
    SGKey_photons="Photons",
)
ToolSvc += EGAM9_MaxCellDecoratorTool

#====================================================================
# SET UP THINNING
#====================================================================

from DerivationFrameworkCore.ThinningHelper import ThinningHelper
EGAM9ThinningHelper = ThinningHelper("EGAM9ThinningHelper")
EGAM9ThinningHelper.TriggerChains = '(^(?!.*_[0-9]*(mu|j|xe|tau|ht|xs|te))(?!HLT_[eg].*_[0-9]*[eg][0-9].*)(?!HLT_eb.*)(?!.*larpeb.*)(?!HLT_.*_AFP_.*)(HLT_[eg].*))'
if globalflags.DataSource() != 'geant4':
    ExtraContainersTrigger += ExtraContainersTriggerDataOnly
EGAM9ThinningHelper.AppendToStream(EGAM9Stream, ExtraContainersTrigger)

thinningTools = []

# Truth thinning
if globalflags.DataSource() == 'geant4':
    truth_cond_WZH = "((abs(TruthParticles.pdgId) >= 23) && (abs(TruthParticles.pdgId) <= 25))"  # W, Z and Higgs
    truth_cond_lep = "((abs(TruthParticles.pdgId) >= 11) && (abs(TruthParticles.pdgId) <= 16))"  # Leptons
    truth_cond_top = "((abs(TruthParticles.pdgId) ==  6))"  # Top quark
    truth_cond_gam = "((abs(TruthParticles.pdgId) == 22) && (TruthParticles.pt > 1*GeV))"  # Photon
    truth_cond_finalState = '(TruthParticles.status == 1 && TruthParticles.barcode < 200000)'  # stable particles
    truth_expression = '(' + truth_cond_WZH + ' ||  ' + truth_cond_lep + ' || ' + truth_cond_top + ' || ' + truth_cond_gam + ') || (' + truth_cond_finalState + ')'
示例#19
0
    "HLT_e5_lhvloose", "HLT_e5_lhvloose_nod0", "HLT_e10_lhvloose_L1EM7",
    "HLT_e12_lhvloose_L1EM10VH", "HLT_e12_lhvloose_nod0_L1EM10VH",
    "HLT_e15_lhvloose_L1EM7", "HLT_e15_lhvloose_L1EM13VH",
    "HLT_e15_lhvloose_nod0_L1EM13VH", "HLT_e17_lhvloose",
    "HLT_e17_lhvloose_nod0", "HLT_e20_lhvloose_L1EM12", "HLT_e20_lhvloose",
    "HLT_e20_lhvloose_nod0", "HLT_e24_lhvloose_nod0_L1EM18VH",
    "HLT_e24_lhvloose_nod0_L1EM20VH"
]

from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__TriggerSkimmingTool
HIGG3D3TrigSkimmingTool = DerivationFramework__TriggerSkimmingTool(
    name="HIGG3D3TrigSkimmingTool", TriggerListOR=TriggerChains)
ToolSvc += HIGG3D3TrigSkimmingTool

from DerivationFrameworkCore.ThinningHelper import ThinningHelper
HIGG3D3ThinningHelper = ThinningHelper("HIGG3D3ThinningHelper")
HIGG3D3ThinningHelper.TriggerChains = " | ".join(TriggerChains)
HIGG3D3ThinningHelper.AppendToStream(HIGG3D3Stream)

#================
# THINNING
#================
thinningTools = []

# MET/Jet tracks
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
HIGG3D3JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="HIGG3D3JetTPThinningTool",
    StreamName=streamName,
    JetKey="AntiKt4EMTopoJets",
    InDetTrackParticlesKey="InDetTrackParticles")
示例#20
0
from DerivationFrameworkEGamma.EGammaCommon import *
from DerivationFrameworkMuons.MuonsCommon import *
from DerivationFrameworkTau.TauTruthCommon import *
from DerivationFrameworkInDet.InDetCommon import *
from DerivationFrameworkJetEtMiss.METCommon import *

### Set up stream
streamName = derivationFlags.WriteDAOD_SUSY11Stream.StreamName
fileName = buildFileName(derivationFlags.WriteDAOD_SUSY11Stream)
SUSY11Stream = MSMgr.NewPoolRootStream(streamName, fileName)
SUSY11Stream.AcceptAlgs(["SUSY11KernelSkim"])

### Init
from DerivationFrameworkCore.ThinningHelper import ThinningHelper

SUSY11ThinningHelper = ThinningHelper("SUSY11ThinningHelper")
thinningTools = []
AugmentationTools = []

# stream-specific sequence for on-the-fly jet building
SeqSUSY11 = CfgMgr.AthSequencer("SeqSUSY11")
DerivationFrameworkJob += SeqSUSY11

#====================================================================
# Trigger navigation thinning
#====================================================================
# To be added.
SUSY11ThinningHelper.AppendToStream(SUSY11Stream)

#====================================================================
# THINNING TOOL
示例#21
0
class METTriggerDerivationContentManager(object):
    """ Helper class to assemble MET trigger derivation content """
    def __init__(
            self, stream_name, stream, common_prefix="DFMETTrig",
            jet_algorithms = ["AntiKt4EMTopo", "AntiKt4EMPFlow"],
            track_threshold = 10*GeV, track_sel=None, all_vars=None):
        """ Create the manager

        Parameters
        ------------
        stream_name: The name of the stream (e.g JETM10)
        stream: The stream object returned by MSMgr.NewPoolRootStream
        common_prefix: The prefix used by shared tools and decorations to prevent duplication
        jet_algorithms: The different jet algorithms (+ associated MET containers) to write
        track_threshold: Write out all tracks with pT above this threshold (in MeV)
        track_sel: The track selection string
        all_vars: Extra containers to add to 'AllVariables'
        """
        self.stream_name = stream_name
        self._common_prefix = common_prefix
        self.track_threshold = track_threshold
        track_sel = track_sel
        self.track_sel = track_sel
        self.all_vars = [] if all_vars is None else all_vars
        # Create the tools
        if any(x in self.all_vars for x in ("JetETMissNeutralParticleFlowObjects", "JetETMissChargedParticleFlowObjects") ):
            applyPFOAugmentation()
        self._make_slimming_tools(stream, jet_algorithms)
        self._make_augmentation_tools(stream)
        self._make_thinning_tools(stream)

    @classmethod
    def make_loose_manager(cls, stream_name, stream):
        return cls(
                stream_name, stream, track_threshold=1*GeV, track_sel="Loose",
                all_vars = [
                    "HLT_xAOD__MuonContainer_MuonEFInfo",
                    "CaloCalTopoClusters",
                    "JetETMissChargedParticleFlowObjects",
                    "JetETMissNeutralParticleFlowObjects",
                    "Kt4EMPFlowEventShape"])

    @classmethod
    def make_tight_manager(cls, stream_name, stream):
        return cls(stream_name, stream, track_threshold=10*GeV)

    @property
    def common_prefix(self):
        return self._common_prefix

    def make_kernel(self, *skimming_tools):
        return CfgMgr.DerivationFramework__DerivationKernel(
                self.stream_name + "Kernel",
                AugmentationTools = self.augmentation_tools,
                SkimmingTools = list(skimming_tools),
                ThinningTools = self.thinning_tools)


    def _mk_common_tool(self, cls, name, **kwargs):
        """ Create a common tool, if it isn't already in the ToolSvc """
        global ToolSvc
        # Resolve the full name
        if not name.startswith(self.common_prefix):
            name = self.common_prefix + name
        try:
            return getattr(ToolSvc, name)
        except AttributeError:
            ToolSvc += cls(name, **kwargs)
            return getattr(ToolSvc, name)

    def _make_slimming_tools(self, stream, jet_algorithms):
        self.slimming_helper = SlimmingHelper(self.stream_name + "SlimmingHelper")
        smart_collections = ["Electrons", "Muons", "Photons", "TauJets", "PrimaryVertices", "InDetTrackParticles"]
        smart_collections += ["{0}Jets".format(a) for a in jet_algorithms]
        smart_collections += ["MET_Reference_{0}".format(a) for a in jet_algorithms]
        if "AntiKt4EMTopo" in jet_algorithms:
            smart_collections += [
                    "AntiKt4EMTopoJets_BTagging201810", "BTagging_AntiKt4EMTopo_201810"]
        if "AntiKt4EMPFlow" in jet_algorithms:
            smart_collections += [
                    "AntiKt4EMPFlowJets_BTagging201810", "BTagging_AntiKt4EMPFlow_201810",
                    "AntiKt4EMPFlowJets_BTagging201903", "BTagging_AntiKt4EMPFlow_201903"]
        self.slimming_helper.SmartCollections = smart_collections
        self.slimming_helper.ExtraVariables = [
                "{0}Jets.Timing".format(a) for a in jet_algorithms]
        self.slimming_helper.AllVariables = [
                "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET",
                "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht",
                "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PS",
                "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PUC",
                "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl",
                "LVL1EnergySumRoI",
                "LVL1JetRoIs",
                "LVL1JetEtRoI"] \
                        + ["MET_Core_{0}".format(a) for a in jet_algorithms] \
                        + ["METAssoc_{0}".format(a) for a in jet_algorithms] \
                        + self.all_vars

    def _make_augmentation_tools(self, stream):
        """ Create any common augmentation tools """
        self.augmentation_tools = []
        if self.track_sel is not None:
            tool = self._mk_common_tool(
                    CfgMgr.DerivationFramework__InDetTrackSelectionToolWrapper,
                    "{0.track_sel}TrackSelWrapper".format(self),
                    ContainerName = "InDetTrackParticles",
                    DecorationName = self.common_prefix + self.track_sel)
            tool.TrackSelectionTool.CutLevel = self.track_sel
            self.augmentation_tools.append(tool)
            self.slimming_helper.ExtraVariables.append(
                    "InDetTrackParticles." + tool.DecorationName)
        tva_tool = self._mk_common_tool(
                CfgMgr.DerivationFramework__TVAAugmentationTool,
                "NominalTVAAugmentationTool",
                LinkName = self.common_prefix+"NominalTVA",
                TrackName = "InDetTrackParticles",
                TVATool = self._mk_common_tool(
                    CfgMgr.CP__TrackVertexAssociationTool,
                    "NominalTVATool",
                    WorkingPoint="Nominal") )
        self.augmentation_tools.append(tva_tool)
        self.slimming_helper.ExtraVariables.append(
            "{0.TrackName}.{0.LinkName}".format(tva_tool) )

    def _make_thinning_tools(self, stream):
        stream_name = self.stream_name
        self.thinning_helper = ThinningHelper(stream_name+"ThinningHelper")
        self.thinning_helper.AppendToStream(stream)
        self.thinning_tools = []
        tool = DerivationFramework__TrackParticleThinning(
                stream_name + "TPThinningTool",
                StreamName = stream_name, 
                SelectionString = "InDetTrackParticles.pt > {0}*GeV".format(
                    self.track_threshold) )
        if self.track_sel is not None:
            tool.SelectionString += " || InDetTrackParticles.{0.common_prefix}{0.track_sel}".format(self)
        self.thinning_tools.append(tool)
        self.thinning_tools += [
                DerivationFramework__MuonTrackParticleThinning(
                    stream_name + "MuonTPThinningTool",
                    StreamName             = stream_name,
                    MuonKey                = "Muons",
                    InDetTrackParticlesKey = "InDetTrackParticles"),
                DerivationFramework__EgammaTrackParticleThinning(
                    stream_name + "ElectronTPThinningTool",
                    StreamName             = stream_name,
                    SGKey                  = "Electrons",
                    InDetTrackParticlesKey = "InDetTrackParticles"),
                DerivationFramework__EgammaTrackParticleThinning(
                    stream_name + "PhotonTPThinningTool",
                    StreamName             = stream_name,
                    SGKey                  = "Photons",
                    InDetTrackParticlesKey = "InDetTrackParticles"),
                DerivationFramework__TauTrackParticleThinning(
                    stream_name + "TauTPThinningTool",
                    StreamName             = stream_name,
                    TauKey                 = "TauJets",
                    InDetTrackParticlesKey = "InDetTrackParticles")
                ]
        global ToolSvc
        ToolSvc += self.thinning_tools
示例#22
0
    from DerivationFrameworkTau.TauTruthCommon import *
from DerivationFrameworkTau.TauCommon import *

# ==========================================================================================================================
# Set up stream
# ==========================================================================================================================
streamName = derivationFlags.WriteDAOD_TAUP1Stream.StreamName
fileName = buildFileName(derivationFlags.WriteDAOD_TAUP1Stream)
TAUP1Stream = MSMgr.NewPoolRootStream(streamName, fileName)
TAUP1Stream.AcceptAlgs(["TAUP1Kernel"])

# ==========================================================================================================================
# Thinning tool
# ==========================================================================================================================
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
TAUP1ThinningHelper = ThinningHelper("TAUP1ThinningHelper")
TAUP1ThinningHelper.TriggerChains = "HLT_e24.*|HLT_e60.*"
TAUP1ThinningHelper.AppendToStream(TAUP1Stream)

# MET/Jet tracks
thinning_expression = "(InDetTrackParticles.pt > 0.5*GeV) && (InDetTrackParticles.numberOfPixelHits > 0) && (InDetTrackParticles.numberOfSCTHits > 5) && (abs(DFCommonInDetTrackZ0AtPV) < 1.5)"
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackParticleThinning
TAUP1MetTPThinningTool = DerivationFramework__TrackParticleThinning(
    name="TAUP1MetTPThinningTool",
    ThinningService=TAUP1ThinningHelper.ThinningSvc(),
    SelectionString=thinning_expression,
    InDetTrackParticlesKey="InDetTrackParticles",
    ApplyAnd=True)
ToolSvc += TAUP1MetTPThinningTool

from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
示例#23
0
from DerivationFrameworkMuons.MuonsCommon import *
if DerivationFrameworkIsMonteCarlo:
    from DerivationFrameworkMCTruth.MCTruthCommon import *
    from DerivationFrameworkTau.TauTruthCommon import *
from DerivationFrameworkInDet.InDetCommon import *
from DerivationFrameworkJetEtMiss.METCommon import *

### Set up stream
streamName = derivationFlags.WriteDAOD_SUSY5Stream.StreamName
fileName = buildFileName(derivationFlags.WriteDAOD_SUSY5Stream)
SUSY5Stream = MSMgr.NewPoolRootStream(streamName, fileName)
SUSY5Stream.AcceptAlgs(["SUSY5KernelSkim"])

### Init
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
SUSY5ThinningHelper = ThinningHelper("SUSY5ThinningHelper")
thinningTools = []
AugmentationTools = []

# stream-specific sequence for on-the-fly jet building
SeqSUSY5 = CfgMgr.AthSequencer("SeqSUSY5")
DerivationFrameworkJob += SeqSUSY5

#====================================================================
# Trigger navigation thinning
#====================================================================
triggerRegEx = ["e.*", "mu.*", "tau.*"]
SUSY5ThinningHelper.TriggerChains = 'HLT_(' + ' | '.join(triggerRegEx) + ')'
SUSY5ThinningHelper.AppendToStream(SUSY5Stream)

#====================================================================
示例#24
0
#====================================================================
# SET UP STREAM
#====================================================================
streamName = derivationFlags.WriteDAOD_EXOT10Stream.StreamName
fileName = buildFileName(derivationFlags.WriteDAOD_EXOT10Stream)
EXOT10Stream = MSMgr.NewPoolRootStream(streamName, fileName)
EXOT10Stream.AcceptAlgs(["EXOT10Kernel"])

#====================================================================
# THINNING
#====================================================================

# Establish the thinning helper (which will set up the services behind the scenes)
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
EXOT10ThinningHelper = ThinningHelper("EXOT10ThinningHelper")
beamEnergy = jobproperties.Beam.energy()
if (beamEnergy < 4.1e+06):
    EXOT10ThinningHelper.TriggerChains = 'EF_2g20_tight1 | EF_2g50_loose | HLT_g35_medium_g25_medium'
if (beamEnergy > 6.0e+06):
    EXOT10ThinningHelper.TriggerChains = 'HLT_2g20_loose | HLT_2g50_loose | HLT_g35_medium_g25_medium'
EXOT10ThinningHelper.AppendToStream(EXOT10Stream)

#====================================================================
# THINNING TOOLS
#====================================================================
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackParticleThinning

EXOT10TPThinningTool = DerivationFramework__TrackParticleThinning(
    name="EXOT10TPThinningTool",
    StreamName=streamName,
示例#25
0
    DAOD_StreamID, 'MC' if DFisMC else 'Data')

#==============
# SET UP STREAM
#==============
streamName = derivationFlags.WriteDAOD_HIGG4D2Stream.StreamName
fileName = buildFileName(derivationFlags.WriteDAOD_HIGG4D2Stream)
HIGG4D2Stream = MSMgr.NewPoolRootStream(streamName, fileName)
HIGG4D2Stream.AcceptAlgs([DAOD_StreamID + "Kernel"])

#============
# Setup tools
#============
# Establish the thinning helper
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
HIGG4D2ThinningHelper = ThinningHelper(DAOD_StreamID + "ThinningHelper")

#trigger navigation thinning
import DerivationFrameworkHiggs.HIGG4DxThinning
HIGG4D2ThinningHelper.TriggerChains = DerivationFrameworkHiggs.HIGG4DxThinning.TriggerChains(
    DAOD_StreamID)
HIGG4D2ThinningHelper.AppendToStream(HIGG4D2Stream)

# thinning tools
thinningTools = DerivationFrameworkHiggs.HIGG4DxThinning.setup(
    DAOD_StreamID, streamName, ToolSvc)

# skimming tools
import DerivationFrameworkHiggs.HIGG4DxSkimming
skimmingTools = DerivationFrameworkHiggs.HIGG4DxSkimming.setup(
    DAOD_StreamID, ToolSvc)
示例#26
0
ToolSvc += JETM4SkimmingTool

#====================================================================
# SET UP STREAM
#====================================================================
streamName = derivationFlags.WriteDAOD_JETM4Stream.StreamName
fileName = buildFileName(derivationFlags.WriteDAOD_JETM4Stream)
JETM4Stream = MSMgr.NewPoolRootStream(streamName, fileName)
JETM4Stream.AcceptAlgs(["JETM4Kernel"])

#=======================================
# ESTABLISH THE THINNING HELPER
#=======================================

from DerivationFrameworkCore.ThinningHelper import ThinningHelper
JETM4ThinningHelper = ThinningHelper("JETM4ThinningHelper")
JETM4ThinningHelper.TriggerChains = triggers
JETM4ThinningHelper.AppendToStream(JETM4Stream)

#====================================================================
# THINNING TOOLS
#====================================================================
thinningTools = []

# TrackParticles associated with Muons
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning
JETM4MuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(
    name="JETM4MuonTPThinningTool",
    ThinningService=JETM4ThinningHelper.ThinningSvc(),
    MuonKey="Muons",
    InDetTrackParticlesKey="InDetTrackParticles")
示例#27
0
applyJetCalibration_xAODColl(
    "AntiKt4EMTopo")  # adds this to DerivationFrameworkJob by default
updateJVT_xAODColl(
    "AntiKt4EMTopo")  # adds this to DerivationFrameworkJob by default

from DerivationFrameworkFlavourTag.FlavourTagCommon import applyBTagging_xAODColl
applyJetCalibration_xAODColl("AntiKt4EMTopo_BTagging201810")
updateJVT_xAODColl('AntiKt4EMTopo_BTagging201810')
applyBTagging_xAODColl('AntiKt4EMTopo_BTagging201810')

#=======================================
# ESTABLISH THE THINNING HELPER
#=======================================

from DerivationFrameworkCore.ThinningHelper import ThinningHelper
JETM7ThinningHelper = ThinningHelper("JETM7ThinningHelper")
# JETM7ThinningHelper.TriggerChains = orstr.join(electronTriggers+muonTriggers)
JETM7ThinningHelper.AppendToStream(JETM7Stream)

#====================================================================
# THINNING TOOLS
#====================================================================
thinningTools = []

# TrackParticles associated with Muons
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning
JETM7MuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(
    name="JETM7MuonTPThinningTool",
    StreamName=streamName,
    MuonKey="Muons",
    InDetTrackParticlesKey="InDetTrackParticles")
示例#28
0
from DerivationFrameworkCore.WeightMetadata import *

from AthenaCommon.GlobalFlags import globalflags

#====================================================================
# SET UP STREAM
#====================================================================
streamName = derivationFlags.WriteDAOD_HIGG3D1Stream.StreamName
fileName = buildFileName(derivationFlags.WriteDAOD_HIGG3D1Stream)
HIGG3D1Stream = MSMgr.NewPoolRootStream(streamName, fileName)
HIGG3D1Stream.AcceptAlgs(["HIGG3D1Kernel"])

## Prepare thinning service and add trigger chains for TrigNavigation thinning
from DerivationFrameworkCore.ThinningHelper import ThinningHelper

HIGG3D1ThinningHelper = ThinningHelper("HIGG3D1ThinningHelper")
HIGG3D1ThinningHelper.TriggerChains = "HLT_mu.* | HLT_e.* | HLT_2e.* | HLT_2mu.*"
HIGG3D1ThinningHelper.AppendToStream(HIGG3D1Stream)

#================
# THINNING
#================
thinningTools = []

# MET/Jet tracks
thinning_expression = "(InDetTrackParticles.pt > 0.5*GeV) && (InDetTrackParticles.numberOfPixelHits > 0) && (InDetTrackParticles.numberOfSCTHits > 5) && (abs(DFCommonInDetTrackZ0AtPV) < 1.5)"

from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning

HIGG3D1JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="HIGG3D1JetTPThinningTool",
示例#29
0
#====================================================================
# SET UP STREAM
#====================================================================
streamName = derivationFlags.WriteDAOD_HIGG5D2Stream.StreamName
fileName = buildFileName(derivationFlags.WriteDAOD_HIGG5D2Stream)
HIGG5D2Stream = MSMgr.NewPoolRootStream(streamName, fileName)
HIGG5D2Stream.AcceptAlgs(["HIGG5D2Kernel"])

#====================================================================
# THINNING TOOLS
#====================================================================
thinningTools = []

# Establish the thinning helper (which will set up the services behind the scenes)
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
HIGG5D2ThinningHelper = ThinningHelper("HIGG5D2ThinningHelper")
#trigger navigation content
HIGG5D2ThinningHelper.TriggerChains = 'HLT_e.*|HLT_mu.*|HLT_xe.*|HLT_j.*'
HIGG5D2ThinningHelper.AppendToStream(HIGG5D2Stream)

# 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) ==  6) || (abs(TruthParticles.pdgId) ==  5))"  # Top quark and Bottom quark
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 + ')'
from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__GenericTruthThinning
HIGG5D2MCThinningTool = DerivationFramework__GenericTruthThinning(
    name="HIGG5D2MCThinningTool",
    ThinningService=HIGG5D2ThinningHelper.ThinningSvc(),
    ParticleSelectionString=truth_expression,
示例#30
0
STDM7Stream = MSMgr.NewPoolRootStream(streamName, fileName)
STDM7Stream.AcceptAlgs(["STDM7Kernel"])

#====================================================================
# THINNING TOOLS
#====================================================================

thinningTools = []

#=====================
# TRIGGER NAV THINNING
#=====================

# Establish the thinning helper
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
STDM7ThinningHelper = ThinningHelper("STDM7ThinningHelper")

#trigger navigation content
STDM7ThinningHelper.TriggerChains = 'HLT_e.*|HLT_2e.*|HLT_mu.*|HLT_2mu.*'
STDM7ThinningHelper.AppendToStream(STDM7Stream)

#=====================
# TRACK  THINNING
#=====================

# removed for full tracking info...

# Truth leptons and their ancestors and descendants + final-state hadrons
truth_cond_boson = "((abs(TruthParticles.pdgId) == 23) || (abs(TruthParticles.pdgId) == 24))"
truth_cond_lepton = "((abs(TruthParticles.pdgId) >= 11) && (abs(TruthParticles.pdgId) <= 14) &&(TruthParticles.pt > 1*GeV) && (TruthParticles.status ==1) && (TruthParticles.barcode<200000))"
photonthinningexpr = "(TruthPhotons.classifierParticleOrigin != 42) && !(TruthPhotons.classifierParticleOrigin >= 23 && TruthPhotons.classifierParticleOrigin <= 35)"
示例#31
0
print "Hello, my name is {} and I am running on {}".format(DAOD_StreamID, 'MC' if DFisMC else 'Data')

#==============
# SET UP STREAM
#==============
streamName = derivationFlags.WriteDAOD_HIGG4D3Stream.StreamName
fileName   = buildFileName( derivationFlags.WriteDAOD_HIGG4D3Stream )
HIGG4D3Stream = MSMgr.NewPoolRootStream( streamName, fileName )
HIGG4D3Stream.AcceptAlgs([DAOD_StreamID+"Kernel"])

#============
# Setup tools
#============
# Establish the thinning helper
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
HIGG4D3ThinningHelper = ThinningHelper( DAOD_StreamID+"ThinningHelper" )

#trigger navigation thinning
import DerivationFrameworkHiggs.HIGG4DxThinning
HIGG4D3ThinningHelper.TriggerChains = DerivationFrameworkHiggs.HIGG4DxThinning.TriggerChains(DAOD_StreamID)
HIGG4D3ThinningHelper.AppendToStream( HIGG4D3Stream )

# thinning tools
thinningTools = DerivationFrameworkHiggs.HIGG4DxThinning.setup(DAOD_StreamID, HIGG4D3ThinningHelper.ThinningSvc(), ToolSvc)

# skimming tools
import DerivationFrameworkHiggs.HIGG4DxSkimming
skimmingTools = DerivationFrameworkHiggs.HIGG4DxSkimming.setup(DAOD_StreamID, ToolSvc)

#augmentation tools
from DerivationFrameworkHiggs.HIGG4DxAugmentation import *
示例#32
0
ToolSvc += JETM2SkimmingTool

#====================================================================
# SET UP STREAM   
#====================================================================
streamName = derivationFlags.WriteDAOD_JETM2Stream.StreamName
fileName   = buildFileName( derivationFlags.WriteDAOD_JETM2Stream )
JETM2Stream = MSMgr.NewPoolRootStream( streamName, fileName )
JETM2Stream.AcceptAlgs(["JETM2Kernel"])

#=======================================
# ESTABLISH THE THINNING HELPER
#=======================================

from DerivationFrameworkCore.ThinningHelper import ThinningHelper
JETM2ThinningHelper = ThinningHelper( "JETM2ThinningHelper" )
JETM2ThinningHelper.TriggerChains = orstr.join(electronTriggers+muonTriggers)
JETM2ThinningHelper.AppendToStream( JETM2Stream )

#====================================================================
# THINNING TOOLS 
#====================================================================
thinningTools = []

# TrackParticles associated with Muons
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning
JETM2MuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(name     = "JETM2MuonTPThinningTool",
                                                                    ThinningService         = JETM2ThinningHelper.ThinningSvc(),
                                                                    MuonKey                 = "Muons",
                                                                    InDetTrackParticlesKey  = "InDetTrackParticles")
ToolSvc += JETM2MuonTPThinningTool