Esempio n. 1
0
    colsTP = [ "ExtrapolatedMuonTrackParticles", "CombinedMuonTrackParticles", "MSOnlyExtrapolatedMuonTrackParticles" ]
    cols = [ "ExtrapolatedMuonTracks", "CombinedMuonTracks", "MSOnlyExtrapolatedTracks" ]
    topSequence+= MuonDetailedTrackTruthMaker("MuonCombinedDetailedTrackTruthMaker")
    topSequence.MuonCombinedDetailedTrackTruthMaker.TrackCollectionNames = cols 
    from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
    topSequence.MuonCombinedDetailedTrackTruthMaker.HasCSC = MuonGeometryFlags.hasCSC()
    topSequence.MuonCombinedDetailedTrackTruthMaker.HasSTgc = MuonGeometryFlags.hasSTGC()
    topSequence.MuonCombinedDetailedTrackTruthMaker.HasMM = MuonGeometryFlags.hasMM()
        
    from TrkTruthAlgs.TrkTruthAlgsConf import TrackParticleTruthAlg
    for i in range(0, len(cols)):
        topSequence += TrackTruthSelector(name= cols[i] + "Selector",
                                          DetailedTrackTruthName   = cols[i] + "DetailedTruth",
                                          OutputName               = cols[i] + "Truth" )
        topSequence += TrackParticleTruthAlg(name = cols[i]+"TruthAlg",
                                             TrackTruthName=cols[i]+"Truth",
                                             TrackParticleName = colsTP[i] )
        
    from MuonTruthAlgs.MuonTruthAlgsConf import MuonTruthAssociationAlg
    topSequence += MuonTruthAssociationAlg("MuonTruthAssociationAlg")

    try:
        from PyUtils.MetaReaderPeeker import metadata
        truthStrategy = metadata['TruthStrategy']

        if truthStrategy in ['MC15','MC18','MC18LLP']:
            topSequence.MuonTruthAssociationAlg.BarcodeOffset=10000000
    except:
        printfunc ("Failed to read /Simulation/Parameters/ metadata")
        pass
    from MuonRecExample.MuonRec import muonRec

    if rec.doTruth():
        from MuonTruthAlgs.MuonTruthAlgsConf import MuonDetailedTrackTruthMaker
        from MuonTruthAlgs.MuonTruthAlgsConf import Muon__MuonSegmentTruthAssociationAlg
        from TrkTruthAlgs.TrkTruthAlgsConf import TrackTruthSelector
        from TrkTruthAlgs.TrkTruthAlgsConf import TrackParticleTruthAlg
        col = "MuonSpectrometerTracks"
        topSequence += MuonDetailedTrackTruthMaker(
            name="MuonStandaloneDetailedTrackTruthMaker",
            TrackCollectionNames=[col])
        topSequence += TrackTruthSelector(name=col + "Selector",
                                          DetailedTrackTruthName=col + "Truth",
                                          OutputName=col + "Truth")
        topSequence += TrackParticleTruthAlg(
            name=col + "TruthAlg",
            TrackTruthName=col + "Truth",
            TrackParticleName="MuonSpectrometerTrackParticles")

        topSequence += Muon__MuonSegmentTruthAssociationAlg(
            "MuonSegmentTruthAssociationAlg")

        try:
            from RecExConfig.InputFilePeeker import inputFileSummary
            truthStrategy = inputFileSummary['metadata'][
                '/Simulation/Parameters']['TruthStrategy']
            if truthStrategy in ['MC15', 'MC18', 'MC18LLP']:
                topSequence.MuonSegmentTruthAssociationAlg.BarcodeOffset = 10000000
        except:
            print "Failed to read /Simulation/Parameters/ metadata"
            pass
Esempio n. 3
0
    "HLT_xAOD__TrackParticleContainer_MuonEFInfo_ExtrapTrackParticles",
    "HLT_xAOD__TrackParticleContainer_MuonEFInfo_CombTrackParticles"
]

topSequence += MuonDetailedTrackTruthMaker(
    name="TrigMuEFDetailedTrackTruthMaker",
    TrackCollectionNames=cols,
    OutputLevel=INFO)

for i in range(0, len(cols)):
    topSequence += TrackTruthSelector(name=cols[i] + "Selector",
                                      DetailedTrackTruthName=cols[i] + "Truth",
                                      OutputName=cols[i] + "Truth",
                                      OutputLevel=INFO)
    topSequence += TrackParticleTruthAlg(name=cols[i] + "TruthAlg",
                                         TrackTruthName=cols[i] + "Truth",
                                         TrackParticleName=colsTP[i],
                                         OutputLevel=INFO)
from MuonTruthAlgs.MuonTruthAlgsConf import Muon__MuonTruthDecorationAlg

topSequence += Muon__MuonTruthDecorationAlg(
    "EFMuonTruthDecorationAlg",
    MuonTruthParticleContainerName="HLT_EFMuonTruthParticle",
    CreateTruthSegments=False,
    OutputLevel=INFO)
from MuonTruthAlgs.MuonTruthAlgsConf import MuonTruthAssociationAlg

topSequence += MuonTruthAssociationAlg(
    "EFMuonTruthAssociation",
    MuonContainerName="HLT_xAOD__MuonContainer_MuonEFInfo",
    MuonTruthParticleContainerName="HLT_EFMuonTruthParticle",
    OutputLevel=INFO)