Exemple #1
0
JETM6ak2TrackThinningTool = ThinAssociatedObjectsTool(name               = "JETM6ak2TrackThinningTool",
                                                      StreamName         = streamName,
                                                      SGKey              = "AntiKt2LCTopoJets",
                                                      ChildThinningTools = [JETM6ak2DeltaRTrackThinningTool])

ToolSvc += JETM6ak2TrackThinningTool
thinningTools.append(JETM6ak2TrackThinningTool)

#########################################
# Tracks associated with other jets
#########################################

from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
JETM6Akt4JetTPThinningTool = DerivationFramework__JetTrackParticleThinning( name          = "JETM6Akt4JetTPThinningTool",
                                                                            StreamName              = streamName,
                                                                            JetKey                  = "AntiKt4EMTopoJets",
                                                                            InDetTrackParticlesKey  = "InDetTrackParticles",
                                                                            ApplyAnd                = False)
ToolSvc += JETM6Akt4JetTPThinningTool
thinningTools.append(JETM6Akt4JetTPThinningTool)

from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
JETM6Akt4PFlowJetTPThinningTool = DerivationFramework__JetTrackParticleThinning( name          = "JETM6Akt4PFlowJetTPThinningTool",
                                                                                 StreamName              = streamName,
                                                                                 JetKey                  = "AntiKt4EMPFlowJets",
                                                                                 InDetTrackParticlesKey  = "InDetTrackParticles",
                                                                                 ApplyAnd                = False)
ToolSvc += JETM6Akt4PFlowJetTPThinningTool
thinningTools.append(JETM6Akt4PFlowJetTPThinningTool)

from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
Exemple #2
0
#Tracks associated with Muons
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning
EXOT12MuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(
    name="EXOT12MuonTPThinningTool",
    StreamName=streamName,
    MuonKey="Muons",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += EXOT12MuonTPThinningTool
thinningTools.append(EXOT12MuonTPThinningTool)

#Tracks associated with Jets
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
EXOT12AKt4JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="EXOT12AKt4JetTPThinningTool",
    StreamName=streamName,
    JetKey="AntiKt4LCTopoJets",
    SelectionString=
    "AntiKt4LCTopoJets.pt > 15*GeV && abs(AntiKt4LCTopoJets.eta) < 2.8",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += EXOT12AKt4JetTPThinningTool
thinningTools.append(EXOT12AKt4JetTPThinningTool)

EXOT12AKt10JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="EXOT12AKt10JetTPThinningTool",
    StreamName=streamName,
    JetKey="AntiKt10LCTopoJets",
    SelectionString=
    "AntiKt10LCTopoJets.pt > 200*GeV && abs(AntiKt10LCTopoJets.eta) < 2.8",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += EXOT12AKt10JetTPThinningTool
thinningTools.append(EXOT12AKt10JetTPThinningTool)
Exemple #3
0
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")
ToolSvc += HIGG3D3JetTPThinningTool
thinningTools.append(HIGG3D3JetTPThinningTool)

# Tracks associated with Muons
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning
HIGG3D3MuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(
    name="HIGG3D3MuonTPThinningTool",
    StreamName=streamName,
    MuonKey="Muons",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += HIGG3D3MuonTPThinningTool
thinningTools.append(HIGG3D3MuonTPThinningTool)
Exemple #4
0
def setup(TOPQname, streamName, ToolSvc):
    thinningTools = []

    #========================
    # Track Particle Thinning !!! BUGGY (yes, that's a technical term)...CURRENTLY NOT USING !!!
    #========================
    # PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/trunk/src/TrackParticleThinning.cxx
    thinning_expression = "(InDetTrackParticles.pt > 0.5*GeV) && (InDetTrackParticles.numberOfPixelHits > 0) && (InDetTrackParticles.numberOfSCTHits > 5) && (abs(DFCommonInDetTrackZ0AtPV) < 1.5)"
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackParticleThinning
    TOPQTPThinningTool = DerivationFramework__TrackParticleThinning(
        name=TOPQname + "TPThinningTool",
        StreamName=streamName,
        SelectionString=thinning_expression,
        InDetTrackParticlesKey="InDetTrackParticles")

    #ToolSvc += TOPQTPThinningTool
    #thinningTools.append(TOPQTPThinningTool)
    #print (TOPQname+".py", TOPQname+"TPThinningTool: ", TOPQTPThinningTool)

    #============================
    # Jet Track Particle Thinning
    #============================
    # PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/trunk/src/JetTrackParticleThinning.cxx
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
    TOPQJetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
        name=TOPQname + "JetTPThinningTool",
        StreamName=streamName,
        JetKey="AntiKt4EMTopoJets",
        InDetTrackParticlesKey="InDetTrackParticles",
        SelectionString="(AntiKt4EMTopoJets.DFCommonJets_Calib_pt > 20*GeV)")

    ToolSvc += TOPQJetTPThinningTool
    thinningTools.append(TOPQJetTPThinningTool)
    print(TOPQname + ".py", TOPQname + "JetTPThinningTool: ",
          TOPQJetTPThinningTool)

    from DerivationFrameworkTop.DerivationFrameworkTopConf import DerivationFramework__SV1TrackThinning
    TOPQSV1ThinningTool = DerivationFramework__SV1TrackThinning(
        name=TOPQname + "SV1TrackThinning",
        StreamName=streamName,
        JetKey="AntiKt4EMTopoJets",
        InDetTrackParticlesKey="InDetTrackParticles",
        SelectionString="(AntiKt4EMTopoJets.DFCommonJets_Calib_pt > 20*GeV)")

    ToolSvc += TOPQSV1ThinningTool
    thinningTools.append(TOPQSV1ThinningTool)
    print(TOPQname + ".py", TOPQname + "SV1ThinningTool: ",
          TOPQSV1ThinningTool)

    TOPQLargeJetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
        name=TOPQname + "LargeJetTPThinningTool",
        StreamName=streamName,
        JetKey="AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets",
        InDetTrackParticlesKey="InDetTrackParticles",
        SelectionString="AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.pt>25*GeV")

    ToolSvc += TOPQLargeJetTPThinningTool
    thinningTools.append(TOPQLargeJetTPThinningTool)
    print(TOPQname + ".py", TOPQname + "LargeJetTPThinningTool: ",
          TOPQLargeJetTPThinningTool)

    from DerivationFrameworkCalo.DerivationFrameworkCaloConf import DerivationFramework__JetCaloClusterThinning
    TOPQAK4CCThinningTool = DerivationFramework__JetCaloClusterThinning(
        name=TOPQname + "AK4CCThinningTool",
        StreamName=streamName,
        SGKey="AntiKt4EMTopoJets",
        TopoClCollectionSGKey="CaloCalTopoClusters",
        SelectionString="AntiKt4EMTopoJets.DFCommonJets_Calib_pt > 7*GeV",
        ConeSize=0.5)

    ToolSvc += TOPQAK4CCThinningTool
    thinningTools.append(TOPQAK4CCThinningTool)
    print(TOPQname + ".py", TOPQname + "AK4CCThinningTool: ",
          TOPQAK4CCThinningTool)

    from DerivationFrameworkCalo.DerivationFrameworkCaloConf import DerivationFramework__JetCaloClusterThinning
    TOPQLargeJetCCThinningTool = DerivationFramework__JetCaloClusterThinning(
        name=TOPQname + "LargeJetCCThinningTool",
        StreamName=streamName,
        SGKey="AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets",
        TopoClCollectionSGKey="CaloCalTopoClusters",
        SelectionString=
        "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.DFCommonJets_Calib_pt > 7*GeV",
        ConeSize=1.1)

    ToolSvc += TOPQLargeJetCCThinningTool
    thinningTools.append(TOPQLargeJetCCThinningTool)
    print(TOPQname + ".py", TOPQname + "LargeJetCCThinningTool: ",
          TOPQLargeJetCCThinningTool)

    #=================================
    # Electron Track Particle Thinning
    #=================================
    # PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/trunk/src/EgammaTrackParticleThinning.cxx
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__EgammaTrackParticleThinning
    TOPQElectronTPThinningTool = DerivationFramework__EgammaTrackParticleThinning(
        name=TOPQname + "ElectronTPThinningTool",
        StreamName=streamName,
        SGKey="Electrons",
        InDetTrackParticlesKey="InDetTrackParticles")

    ToolSvc += TOPQElectronTPThinningTool
    thinningTools.append(TOPQElectronTPThinningTool)
    print(TOPQname + ".py", TOPQname + "ElectronTPThinningTool: ",
          TOPQElectronTPThinningTool)

    #===============================
    # Electron Calo Cluster Thinning
    #===============================
    # PhysicsAnalysis/DerivationFramework/DerivationFrameworkCalo/trunk/src/CaloClusterThinning.cxx
    from DerivationFrameworkCalo.DerivationFrameworkCaloConf import DerivationFramework__CaloClusterThinning
    TOPQElectronCCThinningTool = DerivationFramework__CaloClusterThinning(
        name=TOPQname + "ElectronCCThinningTool",
        StreamName=streamName,
        SGKey="Electrons",
        CaloClCollectionSGKey="egammaClusters",
        SelectionString=
        "(Electrons.Loose || Electrons.DFCommonElectronsLHLoose)",
        ConeSize=0.4)

    ToolSvc += TOPQElectronCCThinningTool
    thinningTools.append(TOPQElectronCCThinningTool)
    print(TOPQname + ".py", TOPQname + "ElectronCCThinningTool: ",
          TOPQElectronCCThinningTool)

    #========================
    # Photon Track Particle Thinning
    #========================
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__EgammaTrackParticleThinning
    TOPQPhotonTPThinningTool = DerivationFramework__EgammaTrackParticleThinning(
        name=TOPQname + "PhotonTPThinningTool",
        StreamName=streamName,
        SGKey="Photons",
        InDetTrackParticlesKey="InDetTrackParticles")

    ToolSvc += TOPQPhotonTPThinningTool
    thinningTools.append(TOPQPhotonTPThinningTool)
    print(TOPQname + ".py", TOPQname + "PhotonTPThinningTool: ",
          TOPQPhotonTPThinningTool)

    #===============================
    # Photon Calo Cluster Thinning
    #===============================
    # PhysicsAnalysis/DerivationFramework/DerivationFrameworkCalo/trunk/src/CaloClusterThinning.cxx
    from DerivationFrameworkCalo.DerivationFrameworkCaloConf import DerivationFramework__CaloClusterThinning
    TOPQPhotonCCThinningTool = DerivationFramework__CaloClusterThinning(
        name=TOPQname + "PhotonCCThinningTool",
        StreamName=streamName,
        SGKey="Photons",
        CaloClCollectionSGKey="egammaClusters",
        SelectionString="(Photons.Loose || Photons.DFCommonPhotonsIsEMLoose)",
        ConeSize=0.4)

    ToolSvc += TOPQPhotonCCThinningTool
    thinningTools.append(TOPQPhotonCCThinningTool)
    print(TOPQname + ".py", TOPQname + "PhotonCCThinningTool: ",
          TOPQPhotonCCThinningTool)

    #=============================
    # Muon Track Particle Thinning
    #=============================
    # PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/trunk/src/MuonTrackParticleThinning.cxx
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning
    TOPQMuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(
        name=TOPQname + "MuonTPThinningTool",
        StreamName=streamName,
        MuonKey="Muons",
        InDetTrackParticlesKey="InDetTrackParticles")

    ToolSvc += TOPQMuonTPThinningTool
    thinningTools.append(TOPQMuonTPThinningTool)
    print(TOPQname + ".py", TOPQname + "MuonTPThinningTool: ",
          TOPQMuonTPThinningTool)

    #============================
    # Tau Track Particle Thinning
    #============================
    # PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/trunk/src/TauTrackParticleThinning.cxx
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TauTrackParticleThinning
    TOPQTauTPThinningTool = DerivationFramework__TauTrackParticleThinning(
        name=TOPQname + "TauTPThinningTool",
        StreamName=streamName,
        TauKey="TauJets",
        InDetTrackParticlesKey="InDetTrackParticles")

    ToolSvc += TOPQTauTPThinningTool
    thinningTools.append(TOPQTauTPThinningTool)
    print(TOPQname + ".py", TOPQname + "TauTPThinningTool: ",
          TOPQTauTPThinningTool)

    #  #==============================
    #  # Large-R jet thinning
    #  #==============================
    #
    #  # we remove low pT large-R jets from the various collections
    #  from AthenaCommon.GlobalFlags import globalflags
    #  largeRjetCollsToThin = ["AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets"]
    #  if globalflags.DataSource()=='geant4':
    #    largeRjetCollsToThin.append("AntiKt10TruthTrimmedPtFrac5SmallR20Jets")
    #    largeRjetCollsToThin.append("AntiKt10TruthJets")
    #  from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__GenericObjectThinning
    #  for largeRjetColl in largeRjetCollsToThin:
    #    #pTvariableToCutOn = ".DFCommonJets_Calib_pt" # use calibrated pT for reco jets
    #    pTvariableToCutOn = ".pt" # well for now the uncalibrated pT seems a more reasonable option
    #    # use normal pT for truth jets
    #    if largeRjetColl.find('Truth') > -1:
    #      pTvariableToCutOn = ".pt"
    #    TOPQLargeRJetThinning = DerivationFramework__GenericObjectThinning(
    #      name = TOPQname + largeRjetColl + "Thinning_LargeR",
    #      StreamName              = streamName,
    #      ContainerName    = largeRjetColl,
    #      SelectionString  = largeRjetColl + pTvariableToCutOn + " > 150.0*GeV")
    #    ToolSvc += TOPQLargeRJetThinning
    #    thinningTools.append(TOPQLargeRJetThinning)
    #    print (TOPQname+".py", TOPQname+largeRjetColl+"Thinning: ", TOPQLargeRJetThinning)

    #==============================
    # Photon thinning
    #==============================

    # we remove photons below 9GeV
    from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__GenericObjectThinning
    pTPhotonVariableToCutOn = ".pt"
    photonColl = "Photons"
    TOPQPhotonThinning = DerivationFramework__GenericObjectThinning(
        name=TOPQname + photonColl + "Thinning_lowpTphotons",
        StreamName=streamName,
        ContainerName=photonColl,
        SelectionString=photonColl + ".pt > 9.0*GeV")
    ToolSvc += TOPQPhotonThinning
    thinningTools.append(TOPQPhotonThinning)
    print(TOPQname + ".py", TOPQname + photonColl + "Thinning: ",
          TOPQPhotonThinning)

    #==============================================
    # TRUTH THINNING
    #==============================================
    from AthenaCommon.GlobalFlags import globalflags
    if globalflags.DataSource() == 'geant4':
        #==========================
        # MENU TRUTH THINNING
        #==========================
        from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__MenuTruthThinning
        TOPQTruthThinningTool = DerivationFramework__MenuTruthThinning(
            name=TOPQname + "TruthThinningTool",
            StreamName=streamName,
            ParticlesKey="TruthParticles",
            VerticesKey="TruthVertices",
            EventsKey="TruthEvents",
            WritePartons=True,  # keep partons?  ###maybe set to FALSE?
            WriteHadrons=False,  # keep hadrons?
            WriteBHadrons=False,  # keep b-hadrons?
            WriteGeant=False,  # keep Geant particles?
            GeantPhotonPtThresh=
            -1.0,  # Set to <0 to not write any Geant photons; otherwise write with a pT above threshold
            WriteTauHad=True,  # keep hadronic taus?
            PartonPtThresh=-1.0,  # write partons with pT aboe this threhold
            WriteBSM=True,  # keep BSM particles?
            WriteBSMProducts=True,  # keep BSM particle decay products?
            WriteBosons=True,  # keep bosons?
            WriteBosonProducts=True,  # keep boson decay products?
            WriteTopAndDecays=
            True,  # keep top partons and immediate decay products?
            WriteEverything=False,  # keep everything?; overrides all other flags
            WriteAllLeptons=True,  # keep absolutely all leptons?
            WriteLeptonsNotFromHadrons=
            False,  # keep leptons not from hadron decays
            WriteAllStable=
            True,  # keep all stable particles?   ###maybe set to FALSE?
            WriteStatus3=False,  # keep all particles with status code 3?
            WriteFirstN=10,  # keep first N particles in record
            PreserveDescendants=False,  # keep descendants of retained particles?
            PreserveAncestors=True,  # keep ancestors of retained particles?
            SimBarcodeOffset=200000,  # barcode offset for simulation particles
            WritettHFHadrons=True)  # keep tt+HF hadrons

        ToolSvc += TOPQTruthThinningTool
        thinningTools.append(TOPQTruthThinningTool)
        print(TOPQname + ".py", TOPQname + "TruthThinningTool: ",
              TOPQTruthThinningTool)

        #==============================================================================
        # Thinning the photon truth collection : no photons from pi0 (origin=42)
        #==============================================================================
        # PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/trunk/src/GenericTruthThinning.cxx
        from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__GenericTruthThinning
        TOPQPhotonThinning = DerivationFramework__GenericTruthThinning(
            name=TOPQname + "PhotonThinning",
            StreamName=streamName,
            ParticlesKey="TruthPhotons",
            ParticleSelectionString=
            "(TruthPhotons.classifierParticleOrigin != 42) || (TruthPhotons.pt > 20.0*GeV)"
        )

        ToolSvc += TOPQPhotonThinning
        thinningTools.append(TOPQPhotonThinning)
        print(TOPQname + ".py", TOPQname + "PhotonThinning: ",
              TOPQPhotonThinning)

        #==============================================================================
        # Thinning TruthParticles : no gluons
        #==============================================================================
        ## PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/trunk/src/GenericTruthThinning.cxx
        #from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__GenericTruthThinning
        #TOPQGluonThinning = DerivationFramework__GenericTruthThinning(
        #                      name                    = TOPQname + "GluonThinning",
        #                      StreamName              = streamName,
        #                      ParticlesKey            = "TruthParticles",
        #                      ParticleSelectionString = "(TruthParticles.pdgId  != 21)")

        #ToolSvc += TOPQGluonThinning
        #thinningTools.append(TOPQGluonThinning)
        #print (TOPQname+".py", TOPQname+"GluonThinning: ", TOPQGluonThinning)

    return thinningTools
Exemple #5
0
# 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
TAUP1JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="TAUP1JetTPThinningTool",
    ThinningService=TAUP1ThinningHelper.ThinningSvc(),
    JetKey="AntiKt4LCTopoJets",
    InDetTrackParticlesKey="InDetTrackParticles",
    ApplyAnd=True)
ToolSvc += TAUP1JetTPThinningTool

from DerivationFrameworkCalo.DerivationFrameworkCaloConf import DerivationFramework__CaloClusterThinning
TAUP1CaloClusterThinning = DerivationFramework__CaloClusterThinning(
    name="TAUP1ClusterThinning",
    ThinningService=TAUP1ThinningHelper.ThinningSvc(),
    SGKey="TauJets",
    TopoClCollectionSGKey="CaloCalTopoClusters")
ToolSvc += TAUP1CaloClusterThinning

# Tracks associated with electrons
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__EgammaTrackParticleThinning
TAUP1ElectronTPThinningTool = DerivationFramework__EgammaTrackParticleThinning(
# 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
# HIGG5D2TPThinningTool = DerivationFramework__TrackParticleThinning( name                = "HIGG5D2TPThinningTool",
#                                                                 ThinningService         = HIGG5D2ThinningHelper.ThinningSvc(),
#                                                                 SelectionString         = thinning_expression,
#                                                                 InDetTrackParticlesKey  = "InDetTrackParticles",
#                                                                 ApplyAnd                = True)
# ToolSvc += HIGG5D2TPThinningTool
# thinningTools.append(HIGG5D2TPThinningTool)

from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
HIGG5D2JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="HIGG5D2JetTPThinningTool",
    ThinningService=HIGG5D2ThinningHelper.ThinningSvc(),
    JetKey="AntiKt4EMTopoJets",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += HIGG5D2JetTPThinningTool
thinningTools.append(HIGG5D2JetTPThinningTool)

# Tracks associated with Muons
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning
HIGG5D2MuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(
    name="HIGG5D2MuonTPThinningTool",
    ThinningService=HIGG5D2ThinningHelper.ThinningSvc(),
    MuonKey="Muons",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += HIGG5D2MuonTPThinningTool
thinningTools.append(HIGG5D2MuonTPThinningTool)
Exemple #7
0
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",
                                                                        SelectionString         = "AntiKt4EMTopoJets.pt > 15*GeV",
                                                                        InDetTrackParticlesKey  = "InDetTrackParticles",
                                                                        ApplyAnd                = True)
ToolSvc += STDM5JetTPThinningTool


# Tracks associated with Muons
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning
STDM5MuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(name                    = "STDM5MuonTPThinningTool",
                                                                         ThinningService         = STDM5ThinningHelper.ThinningSvc(),
                                                                         MuonKey                 = "Muons",
                                                                         InDetTrackParticlesKey  = "InDetTrackParticles")
ToolSvc += STDM5MuonTPThinningTool

# Tracks associated with Electrons
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__EgammaTrackParticleThinning
Exemple #8
0
thinning_expression = "(InDetTrackParticles.pt > 0.5*GeV) && (InDetTrackParticles.numberOfPixelHits > 0) && (InDetTrackParticles.numberOfSCTHits > 5) && (abs(DFCommonInDetTrackZ0AtPV) < 1.5)"
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackParticleThinning
STDM2TPThinningTool = DerivationFramework__TrackParticleThinning(
    name="STDM2TPThinningTool",
    ThinningService="STDM2ThinningSvc",
    SelectionString=thinning_expression,
    InDetTrackParticlesKey="InDetTrackParticles",
    ApplyAnd=False)
ToolSvc += STDM2TPThinningTool

# Tracks associated with Jets
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
STDM2JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="STDM2JetTPThinningTool",
    ThinningService="STDM2ThinningSvc",
    JetKey="AntiKt4LCTopoJets",
    InDetTrackParticlesKey="InDetTrackParticles",
    SelectionString="AntiKt4LCTopoJets.pt > 15*GeV",
    ApplyAnd=False)
ToolSvc += STDM2JetTPThinningTool

# All Track within a cone DeltaR=0.6 around Electrons
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__EgammaTrackParticleThinning
STDM2ElectronTPThinningTool = DerivationFramework__EgammaTrackParticleThinning(
    name="STDM2ElectronTPThinningTool",
    ThinningService="STDM2ThinningSvc",
    SGKey="Electrons",
    GSFTrackParticlesKey="GSFTrackParticles",
    InDetTrackParticlesKey="InDetTrackParticles",
    SelectionString=electronRequirements,
    BestMatchOnly=True,
Exemple #9
0
def setup(HIGG4DxName, streamName, ToolSvc):
    thinningTools = []

    #jets and tracks
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
    HIGG4DxJetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
        name=HIGG4DxName + "JetTPThinningTool",
        StreamName=streamName,
        JetKey="AntiKt4EMTopoJets",
        SelectionString="AntiKt4EMTopoJets.pt > 18*GeV",
        InDetTrackParticlesKey="InDetTrackParticles",
        ApplyAnd=True)
    ToolSvc += HIGG4DxJetTPThinningTool
    thinningTools.append(HIGG4DxJetTPThinningTool)

    HIGG4DxJetLCTPThinningTool = DerivationFramework__JetTrackParticleThinning(
        name=HIGG4DxName + "JetLCTPThinningTool",
        StreamName=streamName,
        JetKey="AntiKt4LCTopoJets",
        SelectionString="AntiKt4LCTopoJets.pt > 18*GeV",
        InDetTrackParticlesKey="InDetTrackParticles",
        ApplyAnd=True)
    ToolSvc += HIGG4DxJetLCTPThinningTool
    thinningTools.append(HIGG4DxJetLCTPThinningTool)

    #fat jets and track thinning
    if HIGG4DxName in ['HIGG4D2', 'HIGG4D3']:
        from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
        HIGG4DxJetTrackThinningTool1 = DerivationFramework__JetTrackParticleThinning(
            name=HIGG4DxName + "JetTrackThinningTool1",
            StreamName=streamName,
            JetKey="AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets",
            SelectionString=
            "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.pt > 150*GeV",
            InDetTrackParticlesKey="InDetTrackParticles",
            ApplyAnd=True)
        ToolSvc += HIGG4DxJetTrackThinningTool1
        thinningTools.append(HIGG4DxJetTrackThinningTool1)

    if HIGG4DxName in ['HIGG4D2', 'HIGG4D3']:
        from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
        HIGG4DxJetTrackThinningTool2 = DerivationFramework__JetTrackParticleThinning(
            name=HIGG4DxName + "JetTrackThinningTool2",
            StreamName=streamName,
            JetKey="AntiKt2PV0TrackJets",
            SelectionString="AntiKt2PV0TrackJets.pt > 6*GeV",
            InDetTrackParticlesKey="InDetTrackParticles",
            ApplyAnd=True)
        #ToolSvc += HIGG4DxJetTrackThinningTool2
        #thinningTools.append(HIGG4DxJetTrackThinningTool2)

    # Tracks associated with Muons
    HIGG4DxMuonSelectionString = ""
    if HIGG4DxName in ['HIGG4D3', 'HIGG4D4']:
        HIGG4DxMuonSelectionString = "Muons.pt > 1*GeV"
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning
    HIGG4DxMuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(
        name=HIGG4DxName + "MuonTPThinningTool",
        StreamName=streamName,
        MuonKey="Muons",
        SelectionString=HIGG4DxMuonSelectionString,
        InDetTrackParticlesKey="InDetTrackParticles")
    ToolSvc += HIGG4DxMuonTPThinningTool
    thinningTools.append(HIGG4DxMuonTPThinningTool)

    # Tracks associated with Electrons
    HIGG4DxElectronSelectionString = ""
    if HIGG4DxName in ['HIGG4D3', 'HIGG4D4']:
        HIGG4DxElectronSelectionString = "Electrons.pt > 1*GeV"
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__EgammaTrackParticleThinning
    HIGG4DxElectronTPThinningTool = DerivationFramework__EgammaTrackParticleThinning(
        name=HIGG4DxName + "ElectronTPThinningTool",
        StreamName=streamName,
        SGKey="Electrons",
        SelectionString=HIGG4DxElectronSelectionString,
        InDetTrackParticlesKey="InDetTrackParticles")
    ToolSvc += HIGG4DxElectronTPThinningTool
    thinningTools.append(HIGG4DxElectronTPThinningTool)

    # Tracks associated with taus
    HIGG4DxTauSelectionString = "TauJets.pt > 18*GeV"
    if HIGG4DxName == 'HIGG4D4':
        HIGG4DxTauSelectionString = "TauJets.pt > 40*GeV"
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TauTrackParticleThinning
    HIGG4DxTauTPThinningTool = DerivationFramework__TauTrackParticleThinning(
        name=HIGG4DxName + "TauTPThinningTool",
        StreamName=streamName,
        TauKey="TauJets",
        SelectionString=HIGG4DxTauSelectionString,
        ConeSize=0.6,
        InDetTrackParticlesKey="InDetTrackParticles")
    ToolSvc += HIGG4DxTauTPThinningTool
    thinningTools.append(HIGG4DxTauTPThinningTool)

    #Truth tau/nutau and their ancestors and descendants
    truth_cond_tau = "((abs(TruthParticles.pdgId) == 15 || abs(TruthParticles.pdgId) == 16) && (TruthParticles.pt > 0.01*GeV) && (TruthParticles.barcode<200000))"
    truth_cond_lep = "((abs(TruthParticles.pdgId) >= 11 && abs(TruthParticles.pdgId) <= 14) && (TruthParticles.pt > 4.0*GeV) && (TruthParticles.status == 1) && (TruthParticles.barcode<200000))"
    truth_cond_comb = "(" + truth_cond_lep + "||" + truth_cond_tau + ")"

    #truth_photon_thinning = "(TruthPhotons.pt > 1.0*GeV) && (abs(TruthPhotons.eta)<3.0)"
    # PreserveGeneratorDescendants only keeps particles that came directly from the event generator
    # PreserveDescendants keeps all particles including those that come from Geant processes

    if DFisMC:
        #thin special containers
        from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__GenericTruthThinning
        #thin taus
        HIGG4DxTruthTool_TAU = DerivationFramework__GenericTruthThinning(
            name=HIGG4DxName + "TruthTool_TAU",
            StreamName=streamName,
            ParticleSelectionString=truth_cond_tau,
            PreserveDescendants=False,
            PreserveGeneratorDescendants=True,
            PreserveAncestors=False,
            TauHandling=False)
        ToolSvc += HIGG4DxTruthTool_TAU
        thinningTools.append(HIGG4DxTruthTool_TAU)

        #thin leptons and taus
        HIGG4DxTruthTool_COMB = DerivationFramework__GenericTruthThinning(
            name=HIGG4DxName + "TruthTool_COMB",
            StreamName=streamName,
            ParticleSelectionString=truth_cond_comb,
            PreserveDescendants=False,
            PreserveGeneratorDescendants=False,
            PreserveAncestors=True,
            TauHandling=False)

        ToolSvc += HIGG4DxTruthTool_COMB
        thinningTools.append(HIGG4DxTruthTool_COMB)

        #thin photons
        """HIGG4DxTruthTool_PHO = DerivationFramework__GenericTruthThinning(name                    = "HIGG4DxTruthTool_PHO",
                                                                     StreamName              = streamName,
                                                                     ParticlesKey            = "TruthPhotons",
                                                                     ParticleSelectionString = truth_photon_thinning)
    
                                                                     ToolSvc += HIGG4DxTruthTool_PHO
                                                                     thinningTools.append(HIGG4DxTruthTool_PHO)"""

        #thinning the master truth collection
        from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__MenuTruthThinning
        HIGG4DxTruthTool_MENU = DerivationFramework__MenuTruthThinning(
            name=HIGG4DxName + "TruthTool_MENU",
            StreamName=streamName,
            WritePartons=False,
            WriteHadrons=False,
            WriteBHadrons=False,
            WriteGeant=False,
            GeantPhotonPtThresh=-1.0,
            WriteTauHad=False,
            PartonPtThresh=-1.0,
            WriteBSM=False,
            WriteBosons=False,
            WriteBSMProducts=False,
            WriteBosonProducts=False,
            WriteTopAndDecays=False,
            WriteEverything=False,
            WriteAllLeptons=False,
            WriteStatus3=False,
            PreserveDescendants=False,
            PreserveGeneratorDescendants=False,
            PreserveAncestors=True,
            WriteFirstN=15)

        ToolSvc += HIGG4DxTruthTool_MENU
        thinningTools.append(HIGG4DxTruthTool_MENU)
    #end of MC

    # return thinning tools
    return thinningTools
Exemple #10
0
# Track thinning
if jobproperties.egammaDFFlags.doEGammaDAODTrackThinning:

    TrackThinningKeepElectronTracks = True
    TrackThinningKeepPhotonTracks = True
    TrackThinningKeepJetTracks = False
    TrackThinningKeepMuonTracks = True
    TrackThinningKeepTauTracks = False
    TrackThinningKeepPVTracks = False

    # Tracks associated with Jets
    if (TrackThinningKeepJetTracks) : 
        from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
        EGAM8JetTPThinningTool = DerivationFramework__JetTrackParticleThinning( name                    = "EGAM8JetTPThinningTool",
                                                                                StreamName              = streamName,
                                                                                InDetTrackParticlesKey  = "InDetTrackParticles")
        ToolSvc += EGAM8JetTPThinningTool
        print EGAM8JetTPThinningTool
        thinningTools.append(EGAM8JetTPThinningTool)
    
    # Tracks associated with Muons
    if (TrackThinningKeepMuonTracks) :
        from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning
        EGAM8MuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning( name                    = "EGAM8MuonTPThinningTool",
                                                                                  StreamName              = streamName,
                                                                                  MuonKey                 = "Muons",
                                                                                  InDetTrackParticlesKey  = "InDetTrackParticles")
        ToolSvc += EGAM8MuonTPThinningTool
        print EGAM8MuonTPThinningTool
        thinningTools.append(EGAM8MuonTPThinningTool)
Exemple #11
0
thinningTools.append(EXOT3ElectronTPThinningTool)

EXOT3PhotonTPThinningTool = DerivationFramework__EgammaTrackParticleThinning(
    name="EXOT3PhotonTPThinningTool",
    ThinningService="EXOT3ThinningSvc",
    SGKey="Photons",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += EXOT3PhotonTPThinningTool
thinningTools.append(EXOT3PhotonTPThinningTool)

#Tracks associated with Jets
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
EXOT3AKt4JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="EXOT3AKt4JetTPThinningTool",
    ThinningService="EXOT3ThinningSvc",
    JetKey="AntiKt4LCTopoJets",
    SelectionString=
    "AntiKt4LCTopoJets.pt > 15*GeV && abs(AntiKt4LCTopoJets.eta) < 2.8",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += EXOT3AKt4JetTPThinningTool
thinningTools.append(EXOT3AKt4JetTPThinningTool)

EXOT3AKt10JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="EXOT3AKt10JetTPThinningTool",
    ThinningService="EXOT3ThinningSvc",
    JetKey="AntiKt10LCTopoJets",
    SelectionString=
    "AntiKt10LCTopoJets.pt > 150*GeV && abs(AntiKt10LCTopoJets.eta) < 2.8",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += EXOT3AKt10JetTPThinningTool
thinningTools.append(EXOT3AKt10JetTPThinningTool)
Exemple #12
0
#                                                                   SelectionString         = thinning_expression,
#                                                                   InDetTrackParticlesKey  = "InDetTrackParticles")

# from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
# JETM8JetTPThinningTool = DerivationFramework__JetTrackParticleThinning( name          = "JETM8Akt4JetTPThinningTool",
#                                                                         ThinningService         = "JETM8ThinningSvc",
#                                                                         JetKey                  = "AntiKt4EMTopoJets",
#                                                                         InDetTrackParticlesKey  = "InDetTrackParticles",
#                                                                         ApplyAnd                = True)
# ToolSvc += JETM8JetTPThinningTool
# thinningTools.append(JETM8JetTPThinningTool)

from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
JETM8Akt4JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="JETM8Akt4JetTPThinningTool",
    ThinningService="JETM8ThinningSvc",
    JetKey="AntiKt4EMTopoJets",
    InDetTrackParticlesKey="InDetTrackParticles",
    ApplyAnd=False)
ToolSvc += JETM8Akt4JetTPThinningTool
thinningTools.append(JETM8Akt4JetTPThinningTool)

from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
JETM8Akt10JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="JETM8Akt10JetTPThinningTool",
    ThinningService="JETM8ThinningSvc",
    JetKey="AntiKt10LCTopoJets",
    InDetTrackParticlesKey="InDetTrackParticles",
    ApplyAnd=False)
ToolSvc += JETM8Akt10JetTPThinningTool
thinningTools.append(JETM8Akt10JetTPThinningTool)
Exemple #13
0
#from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackParticleThinning
#EXOT4D1TPThinningTool = DerivationFramework__TrackParticleThinning( name                    =  "EXOT4D1TPThinningTool",
#                                                                    StreamName              =  streamName,
#                                                                    SelectionString         =  thinning_expression,
#                                                                    InDetTrackParticlesKey  =  "InDetTrackParticles")
#ToolSvc += EXOT4D1TPThinningTool

# define thinning tool
thinningTools = []
# Tracks associated with jets (for e-in-jet OR)
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning

EXOT4JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="EXOT4JetTPThinningTool",
    StreamName=streamName,
    JetKey="AntiKt4EMTopoJets",
    SelectionString=
    "AntiKt4EMTopoJets.DFCommonJets_Calib_pt > 15*GeV && AntiKt4EMTopoJets.DFCommonJets_Calib_eta > -2.8 && AntiKt4EMTopoJets.DFCommonJets_Calib_eta < 2.8",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += EXOT4JetTPThinningTool
thinningTools.append(EXOT4JetTPThinningTool)

EXOT4CA15JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="EXOT4CA15JetTPThinningTool",
    StreamName=streamName,
    JetKey="CamKt15LCTopoJets",
    SelectionString=
    "CamKt15LCTopoJets.pt > 150*GeV && CamKt15LCTopoJets.eta > -2.7 && CamKt15LCTopoJets.eta < 2.7",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += EXOT4CA15JetTPThinningTool
thinningTools.append(EXOT4CA15JetTPThinningTool)
Exemple #14
0
# TrackParticles associated with electrons
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__EgammaTrackParticleThinning
JETM1ElectronTPThinningTool = DerivationFramework__EgammaTrackParticleThinning(
    name="JETM1ElectronTPThinningTool",
    StreamName=streamName,
    SGKey="Electrons",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += JETM1ElectronTPThinningTool
thinningTools.append(JETM1ElectronTPThinningTool)

# TrackParticles associated with small-R jets
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
JETM1Akt4JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="JETM1Akt4JetTPThinningTool",
    StreamName=streamName,
    JetKey="AntiKt4EMTopoJets",
    SelectionString="AntiKt4EMTopoJets.pt > 18*GeV",
    InDetTrackParticlesKey="InDetTrackParticles",
    ApplyAnd=False)
ToolSvc += JETM1Akt4JetTPThinningTool
thinningTools.append(JETM1Akt4JetTPThinningTool)

JETM1Akt4PFlowJetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="JETM1Akt4PFlowJetTPThinningTool",
    StreamName=streamName,
    JetKey="AntiKt4EMPFlowJets",
    SelectionString="AntiKt4EMPFlowJets.pt > 18*GeV",
    InDetTrackParticlesKey="InDetTrackParticles",
    ApplyAnd=False)
ToolSvc += JETM1Akt4PFlowJetTPThinningTool
thinningTools.append(JETM1Akt4PFlowJetTPThinningTool)
Exemple #15
0
#====================================================================
triggerRegEx = ["e.*", "mu.*", "tau.*"]
SUSY5ThinningHelper.TriggerChains = 'HLT_(' + ' | '.join(triggerRegEx) + ')'
SUSY5ThinningHelper.AppendToStream(SUSY5Stream)

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

# 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
SUSY5JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="SUSY5JetTPThinningTool",
    StreamName=streamName,
    JetKey="AntiKt4EMTopoJets",
    InDetTrackParticlesKey="InDetTrackParticles",
    TrackSelectionString=thinning_expression)
ToolSvc += SUSY5JetTPThinningTool
thinningTools.append(SUSY5JetTPThinningTool)

# TrackParticles directly
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackParticleThinning
SUSY5TPThinningTool = DerivationFramework__TrackParticleThinning(
    name="SUSY5TPThinningTool",
    StreamName=streamName,
    SelectionString="InDetTrackParticles.pt > 10*GeV",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += SUSY5TPThinningTool
thinningTools.append(SUSY5TPThinningTool)
Exemple #16
0
from DerivationFrameworkCore.TriggerMatchingAugmentation import applyTriggerMatching
TrigMatchAug, NewTrigVars = applyTriggerMatching(ToolNamePrefix="JETM15",
                                                 ElectronTriggers=[],
                                                 MuonTriggers=muonTriggers,
                                                 PhotonTriggers=[])

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

#Track particles associated to any of the large-R jet collections
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
JETM15Akt10JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="JETM15Akt10JetLCTopoTPThinningTool",
    StreamName=streamName,
    JetKey="AntiKt10LCTopoJets",
    InDetTrackParticlesKey="InDetTrackParticles",
    ApplyAnd=False)
ToolSvc += JETM15Akt10JetTPThinningTool
thinningTools.append(JETM15Akt10JetTPThinningTool)

JETM15Akt10JetTPThinningToolCSSK = DerivationFramework__JetTrackParticleThinning(
    name="JETM15Akt10CSSKLCTopoJetTPThinningTool",
    StreamName=streamName,
    JetKey="AntiKt10LCTopoCSSKJets",
    InDetTrackParticlesKey="InDetTrackParticles",
    ApplyAnd=False)
ToolSvc += JETM15Akt10JetTPThinningToolCSSK
thinningTools.append(JETM15Akt10JetTPThinningToolCSSK)

JETM15Akt10JetTPThinningToolPFO = DerivationFramework__JetTrackParticleThinning(
Exemple #17
0
from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__xAODStringSkimmingTool
EXOT7StringSkimmingTool = DerivationFramework__xAODStringSkimmingTool(
    name="EXOT7StringSkimmingTool", expression=expression)

ToolSvc += EXOT7StringSkimmingTool
printfunc(EXOT7StringSkimmingTool)

# define thinning tool
thinningTools = []
# Tracks associated with jets (for e-in-jet OR)
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
EXOT7JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="EXOT7JetTPThinningTool",
    StreamName=streamName,
    JetKey="AntiKt4LCTopoJets",
    SelectionString=
    "AntiKt4LCTopoJets.pt > 15*GeV && AntiKt4LCTopoJets.eta > -2.8 && AntiKt4LCTopoJets.eta < 2.8",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += EXOT7JetTPThinningTool
thinningTools.append(EXOT7JetTPThinningTool)

# for HTT
EXOT7CA8JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="EXOT7CA8JetTPThinningTool",
    StreamName=streamName,
    JetKey="CamKt8LCTopoJets",
    SelectionString=
    "CamKt8LCTopoJets.pt > 150*GeV && CamKt8LCTopoJets.eta > -2.7 && CamKt8LCTopoJets.eta < 2.7",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += EXOT7CA8JetTPThinningTool
Exemple #18
0
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
STDM3ThinningHelper = ThinningHelper("STDM3ThinningHelper")

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

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

# Tracks associated with Jets
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
STDM3JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="STDM3JetTPThinningTool",
    StreamName=streamName,
    JetKey="AntiKt4EMTopoJets",
    #                                                                        SelectionString         = "AntiKt4EMTopoJets.pt > 10*GeV",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += STDM3JetTPThinningTool
thinningTools.append(STDM3JetTPThinningTool)

# Tracks associated with Muons
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning
STDM3MuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(
    name="STDM3MuonTPThinningTool",
    StreamName=streamName,
    MuonKey="Muons",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += STDM3MuonTPThinningTool
thinningTools.append(STDM3MuonTPThinningTool)
Exemple #19
0
HIGG6D1GenTPThinningTool = DerivationFramework__TrackParticleThinning(
    name="HIGG6D1GenTPThinningTool",
    ThinningService="HIGG6D1ThinningSvc",
    SelectionString=thinning_expression,
    InDetTrackParticlesKey="InDetTrackParticles",
    ApplyAnd=True)
thinningTools.append(HIGG6D1GenTPThinningTool)
ToolSvc += HIGG6D1GenTPThinningTool

#====================================================================
# JetTrackParticleThinning
#====================================================================
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
HIGG6D1JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="HIGG6D1JetTPThinningTool",
    ThinningService="HIGG6D1ThinningSvc",
    JetKey="AntiKt4EMTopoJets",
    InDetTrackParticlesKey="InDetTrackParticles",
    ApplyAnd=True)

thinningTools.append(HIGG6D1JetTPThinningTool)
ToolSvc += HIGG6D1JetTPThinningTool

#====================================================================
# TauTrackParticleThinning
#====================================================================
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TauTrackParticleThinning
HIGG6D1TauTPThinningTool = DerivationFramework__TauTrackParticleThinning(
    name="HIGG6D1TauTPThinningTool",
    ThinningService="HIGG6D1ThinningSvc",
    TauKey="TauJets",
    InDetTrackParticlesKey="InDetTrackParticles",
Exemple #20
0
#thinning_expression = "(InDetTrackParticles.pt > 0.5*GeV)"
#from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackParticleThinning
#EXOT16D1TPThinningTool = DerivationFramework__TrackParticleThinning( name                    =  "EXOT16D1TPThinningTool",
#                                                                    StreamName              =  streamName,
#                                                                    SelectionString         =  thinning_expression,
#                                                                    InDetTrackParticlesKey  =  "InDetTrackParticles")
#ToolSvc += EXOT16D1TPThinningTool

# define thinning tool
thinningTools = []
# Tracks associated with jets (for e-in-jet OR)
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
EXOT16JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="EXOT16JetTPThinningTool",
    StreamName=streamName,
    JetKey="AntiKt4LCTopoJets",
    SelectionString=
    "AntiKt4LCTopoJets.pt > 15*GeV && AntiKt4LCTopoJets.eta > -2.8 && AntiKt4LCTopoJets.eta < 2.8",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += EXOT16JetTPThinningTool
thinningTools.append(EXOT16JetTPThinningTool)

##EXOT16CA15JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(name                    = "EXOT16CA15JetTPThinningTool",
##                                                                       StreamName              = streamName,
##                                                                       JetKey                  = "CamKt15LCTopoJets",
##                                                                       SelectionString         = "CamKt15LCTopoJets.pt > 150*GeV && CamKt15LCTopoJets.eta > -2.7 && CamKt15LCTopoJets.eta < 2.7",
##                                                                       InDetTrackParticlesKey  = "InDetTrackParticles")
##ToolSvc += EXOT16CA15JetTPThinningTool
##thinningTools.append(EXOT16CA15JetTPThinningTool)

# Tracks associated with Muons
Exemple #21
0
    StreamName=streamName,
    SGKey="Electrons",
    InDetTrackParticlesKey="InDetTrackParticles",
    SelectionString="Electrons.pt > 25*GeV",
    ConeSize=0.4)
ToolSvc += EXOT8ElectronTPThinningTool
thinningTools.append(EXOT8ElectronTPThinningTool)

#########################################
# Tracks associated with R=0.4 jets
#########################################
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
EXOT8Ak4JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="EXOT8Ak4JetTPThinningTool",
    StreamName=streamName,
    JetKey="AntiKt4LCTopoJets",
    SelectionString=
    "AntiKt4LCTopoJets.pt > 50*GeV && AntiKt4LCTopoJets.eta > -2.7 && AntiKt4LCTopoJets.eta < 2.7",
    InDetTrackParticlesKey="InDetTrackParticles")
ToolSvc += EXOT8Ak4JetTPThinningTool
thinningTools.append(EXOT8Ak4JetTPThinningTool)

############################################
# Tracks associated with large-R jets (0.2)
############################################
EXOT8Ak10r2JetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
    name="EXOT8Ak10r2JetTPThinningTool",
    StreamName=streamName,
    JetKey="AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets",
    SelectionString=
    "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.DFCommonJets_Calib_pt > 200*GeV && AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.DFCommonJets_Calib_eta > -2.7 && AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.DFCommonJets_Calib_eta < 2.7",
Exemple #22
0
def setup(TOPQname, TOPQThinningSvc, ToolSvc):
    thinningTools = []

    #========================
    # Track Particle Thinning !!! BUGGY (yes, that's a technical term)...CURRENTLY NOT USING !!!
    #========================
    # PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/trunk/src/TrackParticleThinning.cxx
    thinning_expression = "(InDetTrackParticles.pt > 0.5*GeV) && (InDetTrackParticles.numberOfPixelHits > 0) && (InDetTrackParticles.numberOfSCTHits > 5) && (abs(DFCommonInDetTrackZ0AtPV) < 1.5)"
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackParticleThinning
    TOPQTPThinningTool = DerivationFramework__TrackParticleThinning(
        name=TOPQname + "TPThinningTool",
        ThinningService=TOPQThinningSvc,
        SelectionString=thinning_expression,
        InDetTrackParticlesKey="InDetTrackParticles",
        ApplyAnd=False)

    #ToolSvc += TOPQTPThinningTool
    #thinningTools.append(TOPQTPThinningTool)
    #print TOPQname+".py", TOPQname+"TPThinningTool: ", TOPQTPThinningTool

    #============================
    # Jet Track Particle Thinning
    #============================
    # PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/trunk/src/JetTrackParticleThinning.cxx
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__JetTrackParticleThinning
    TOPQJetTPThinningTool = DerivationFramework__JetTrackParticleThinning(
        name=TOPQname + "JetTPThinningTool",
        ThinningService=TOPQThinningSvc,
        JetKey="AntiKt4EMTopoJets",
        InDetTrackParticlesKey="InDetTrackParticles",
        ApplyAnd=False)

    ToolSvc += TOPQJetTPThinningTool
    thinningTools.append(TOPQJetTPThinningTool)
    print TOPQname + ".py", TOPQname + "JetTPThinningTool: ", TOPQJetTPThinningTool

    #=================================
    # Electron Track Particle Thinning
    #=================================
    # PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/trunk/src/EgammaTrackParticleThinning.cxx
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__EgammaTrackParticleThinning
    TOPQElectronTPThinningTool = DerivationFramework__EgammaTrackParticleThinning(
        name=TOPQname + "ElectronTPThinningTool",
        ThinningService=TOPQThinningSvc,
        SGKey="Electrons",
        InDetTrackParticlesKey="InDetTrackParticles",
        ApplyAnd=False)

    ToolSvc += TOPQElectronTPThinningTool
    thinningTools.append(TOPQElectronTPThinningTool)
    print TOPQname + ".py", TOPQname + "ElectronTPThinningTool: ", TOPQElectronTPThinningTool

    #===============================
    # Electron Calo Cluster Thinning
    #===============================
    # PhysicsAnalysis/DerivationFramework/DerivationFrameworkCalo/trunk/src/CaloClusterThinning.cxx
    from DerivationFrameworkCalo.DerivationFrameworkCaloConf import DerivationFramework__CaloClusterThinning
    TOPQElectronCCThinningTool = DerivationFramework__CaloClusterThinning(
        name=TOPQname + "ElectronCCThinningTool",
        ThinningService=TOPQThinningSvc,
        SGKey="Electrons",
        CaloClCollectionSGKey="egammaClusters",
        SelectionString=
        "(Electrons.Loose || Electrons.DFCommonElectronsLHLoose)",
        ConeSize=0.4,
        ApplyAnd=False)

    ToolSvc += TOPQElectronCCThinningTool
    thinningTools.append(TOPQElectronCCThinningTool)
    print TOPQname + ".py", TOPQname + "ElectronCCThinningTool: ", TOPQElectronCCThinningTool

    #===============================
    # Photon Calo Cluster Thinning
    #===============================
    # PhysicsAnalysis/DerivationFramework/DerivationFrameworkCalo/trunk/src/CaloClusterThinning.cxx
    from DerivationFrameworkCalo.DerivationFrameworkCaloConf import DerivationFramework__CaloClusterThinning
    TOPQPhotonCCThinningTool = DerivationFramework__CaloClusterThinning(
        name=TOPQname + "PhotonCCThinningTool",
        ThinningService=TOPQThinningSvc,
        SGKey="Photons",
        CaloClCollectionSGKey="egammaClusters",
        SelectionString="(Photons.Loose || Photons.DFCommonPhotonsIsEMLoose)",
        ConeSize=0.4,
        ApplyAnd=False)

    ToolSvc += TOPQPhotonCCThinningTool
    thinningTools.append(TOPQPhotonCCThinningTool)
    print TOPQname + ".py", TOPQname + "PhotonCCThinningTool: ", TOPQPhotonCCThinningTool

    #=============================
    # Muon Track Particle Thinning
    #=============================
    # PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/trunk/src/MuonTrackParticleThinning.cxx
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning
    TOPQMuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(
        name=TOPQname + "MuonTPThinningTool",
        ThinningService=TOPQThinningSvc,
        MuonKey="Muons",
        InDetTrackParticlesKey="InDetTrackParticles",
        ApplyAnd=False)

    ToolSvc += TOPQMuonTPThinningTool
    thinningTools.append(TOPQMuonTPThinningTool)
    print TOPQname + ".py", TOPQname + "MuonTPThinningTool: ", TOPQMuonTPThinningTool

    #============================
    # Tau Track Particle Thinning
    #============================
    # PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/trunk/src/TauTrackParticleThinning.cxx
    from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TauTrackParticleThinning
    TOPQTauTPThinningTool = DerivationFramework__TauTrackParticleThinning(
        name=TOPQname + "TauTPThinningTool",
        ThinningService=TOPQThinningSvc,
        TauKey="TauJets",
        ConeSize=0.6,
        InDetTrackParticlesKey="InDetTrackParticles",
        ApplyAnd=False)

    ToolSvc += TOPQTauTPThinningTool
    thinningTools.append(TOPQTauTPThinningTool)
    print TOPQname + ".py", TOPQname + "TauTPThinningTool: ", TOPQTauTPThinningTool

    #==============================================
    # TRUTH THINNING
    #==============================================
    from AthenaCommon.GlobalFlags import globalflags
    if globalflags.DataSource() == 'geant4':
        #==========================
        # MENU TRUTH THINNING
        #==========================
        from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__MenuTruthThinning
        TOPQTruthThinningTool = DerivationFramework__MenuTruthThinning(
            name=TOPQname + "TruthThinningTool",
            ThinningService=TOPQThinningSvc,
            ParticlesKey="TruthParticles",
            VerticesKey="TruthVertices",
            EventsKey="TruthEvents",
            WritePartons=True,  # keep partons?  ###maybe set to FALSE?
            WriteHadrons=False,  # keep hadrons?
            WriteBHadrons=False,  # keep b-hadrons?
            WriteGeant=False,  # keep Geant particles?
            GeantPhotonPtThresh=
            -1.0,  # Set to <0 to not write any Geant photons; otherwise write with a pT above threshold
            WriteTauHad=True,  # keep hadronic taus?
            PartonPtThresh=-1.0,  # write partons with pT aboe this threhold
            WriteBSM=True,  # keep BSM particles?
            WriteBSMProducts=True,  # keep BSM particle decay products?
            WriteBosons=True,  # keep bosons?
            WriteBosonProducts=True,  # keep boson decay products?
            WriteTopAndDecays=
            True,  # keep top partons and immediate decay products?
            WriteEverything=False,  # keep everything?; overrides all other flags
            WriteAllLeptons=True,  # keep absolutely all leptons?
            WriteLeptonsNotFromHadrons=
            False,  # keep leptons not from hadron decays
            WriteAllStable=
            True,  # keep all stable particles?   ###maybe set to FALSE?
            WriteStatus3=False,  # keep all particles with status code 3?
            WriteFirstN=10,  # keep first N particles in record
            PreserveDescendants=False,  # keep descendants of retained particles?
            PreserveAncestors=True,  # keep ancestors of retained particles?
            SimBarcodeOffset=200000,  # barcode offset for simulation particles
            WritettHFHadrons=True)  # keep tt+HF hadrons

        ToolSvc += TOPQTruthThinningTool
        thinningTools.append(TOPQTruthThinningTool)
        print TOPQname + ".py", TOPQname + "TruthThinningTool: ", TOPQTruthThinningTool

        #==============================================================================
        # Thinning the photon truth collection : no photons from pi0 (origin=42)
        #==============================================================================
        # PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/trunk/src/GenericTruthThinning.cxx
        from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__GenericTruthThinning
        TOPQPhotonThinning = DerivationFramework__GenericTruthThinning(
            name=TOPQname + "PhotonThinning",
            ThinningService=TOPQThinningSvc,
            ParticlesKey="TruthPhotons",
            ParticleSelectionString=
            "(TruthPhotons.classifierParticleOrigin != 42) || (TruthPhotons.pt > 20.0*GeV)"
        )

        ToolSvc += TOPQPhotonThinning
        thinningTools.append(TOPQPhotonThinning)
        print TOPQname + ".py", TOPQname + "PhotonThinning: ", TOPQPhotonThinning

        #==============================================================================
        # Thinning TruthParticles : no gluons
        #==============================================================================
        ## PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/trunk/src/GenericTruthThinning.cxx
        #from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__GenericTruthThinning
        #TOPQGluonThinning = DerivationFramework__GenericTruthThinning(
        #                      name                    = TOPQname + "GluonThinning",
        #                      ThinningService         = TOPQThinningSvc,
        #                      ParticlesKey            = "TruthParticles",
        #                      ParticleSelectionString = "(TruthParticles.pdgId  != 21)")

        #ToolSvc += TOPQGluonThinning
        #thinningTools.append(TOPQGluonThinning)
        #print TOPQname+".py", TOPQname+"GluonThinning: ", TOPQGluonThinning

    return thinningTools