예제 #1
0
def addGSFTrackDecoratorAlg():
    '''
   Search egamma algorithm and add the GSF TrackParticle decorator after the it.
   '''
    from InDetPhysValMonitoring.InDetPhysValDecoration import _addDecorators

    from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags
    if InDetPhysValFlags.doValidateGSFTracks():
        # print ('DEBUG add addGSFTrackDecoratorAlg')
        decorators = getGSFTrackDecorators()
        from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags
        from InDetPhysValMonitoring.ConfigUtils import extractCollectionPrefix
        for col in InDetPhysValFlags.validateExtraTrackCollections():
            prefix = extractCollectionPrefix(col)
            decorators += getTrackDecorators(
                TrackParticleContainerName=prefix + "TrackParticles")
        # add the InDetPhysValDecoratorAlgGSF after the egamma algorithms ran
        # they build the GSF track particles.
        _addDecorators(decorators, ['egamma', 'egammaTruthAssociationAlg'])

        # To allow for proper decoration of GSF TrackParticles
        #  - have to switch of slimming for GSF Tracks at time of creation
        #  - must slim GSF Tracks after decoration since the unslimmed GSF Tracks cannot be persistified

        from AthenaCommon.AppMgr import ToolSvc
        # print (ToolSvc)
        # print ('DEBUG has EMBremCollectionBuilder %s' % hasattr(ToolSvc,'EMBremCollectionBuilder'))
        if hasattr(ToolSvc, 'EMBremCollectionBuilder'):
            decor_index = findAlg([decorators[0].getName()],
                                  search_outputstream_otherwise=False)
            if decor_index is not None:
                from TrkTrackSlimmer.TrkTrackSlimmerConf import Trk__TrackSlimmer as ConfigurableTrackSlimmer
                slimmer = ConfigurableTrackSlimmer(
                    name="RealGSFTrackSlimmer",
                    TrackLocation=[InDetPhysValKeys.GSFTracksUnslimmed],
                    SlimmedTrackLocation=[InDetPhysValKeys.GSFTracks],
                    TrackSlimmingTool=ToolSvc.EMBremCollectionBuilder.
                    TrackSlimmingTool)

                from InDetPhysValMonitoring.InDetPhysValMonitoringConf import DummyTrackSlimmingTool
                slimming_tool = DummyTrackSlimmingTool()
                ToolSvc += slimming_tool
                ToolSvc.EMBremCollectionBuilder.TrackSlimmingTool = slimming_tool
                ToolSvc.EMBremCollectionBuilder.OutputTrackContainerName = InDetPhysValKeys.GSFTracksUnslimmed
                # ToolSvc.ResidualPullCalculator.OutputLevel = 1

                from AthenaCommon.AlgSequence import AlgSequence
                topSequence = AlgSequence()
                topSequence.insert(decor_index + 1, slimmer)
예제 #2
0
    excludedVertexAuxData = "-vxTrackAtVertex.-MvfFitInfo.-isInitialized.-VTAV"

    if InDetFlags.keepAdditionalHitsOnTrackParticle():
        excludedAuxData = "-caloExtension.-cellAssociation.-clusterAssociation"
    InDetESDList += [
        'xAOD::TrackParticleContainer#' +
        InDetKeys.xAODTrackParticleContainer()
    ]
    InDetESDList += [
        'xAOD::TrackParticleAuxContainer#' +
        InDetKeys.xAODTrackParticleContainer() + 'Aux.' + excludedAuxData
    ]

    from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags
    from InDetPhysValMonitoring.ConfigUtils import extractCollectionPrefix
    for col in InDetPhysValFlags.validateExtraTrackCollections():
        prefix = extractCollectionPrefix(col)
        InDetESDList += [
            'xAOD::TrackParticleContainer#' + prefix + 'TrackParticles'
        ]
        InDetESDList += [
            'xAOD::TrackParticleAuxContainer#' + prefix +
            'TrackParticlesAux.' + excludedAuxData
        ]

    if InDetFlags.doStoreTrackSeeds():
        InDetESDList += [
            'xAOD::TrackParticleContainer#' + InDetKeys.SiSPSeedSegments() +
            "TrackParticle"
        ]
        InDetESDList += [