def __init__(self, name="InDetTrigTrackSlimmer_EF", type="electron"):
        super(InDet__TrigTrackSlimmer, self).__init__(name)

        from AthenaCommon.AppMgr import ToolSvc
        from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags
        from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackSummaryToolSharedHits

        TrkSlimmingName = "InDetTrigTrackSlimmingTool"
        keepPars = False
        keepOut = False
        if type == "photon" or type == "electron":
            TrkSlimmingName = "InDetTrigTrackSlimmingToolParams"
            keepPars = True
            keepOut = True

        #slimming tool
        from TrkTrackSlimmingTool.TrkTrackSlimmingToolConf import Trk__TrackSlimmingTool as ConfigurableTrackSlimmingTool
        InDetTrkSlimmingTool = \
            ConfigurableTrackSlimmingTool(name = TrkSlimmingName,
                                          KeepParameters = keepPars,
                                          KeepOutliers = keepOut )
        ToolSvc += InDetTrkSlimmingTool
        self.TrackSlimmingTool = InDetTrkSlimmingTool
        if (InDetTrigFlags.doPrintConfigurables()):
            print InDetTrkSlimmingTool

        #optional update of the track summary
        self.SummaryTool = InDetTrigTrackSummaryToolSharedHits
Пример #2
0
    def configure(self):
        mlog = logging.getLogger('tauTrackSlimmer.py::configure:')
        mlog.info('entering')

        # configure TauTrackSlimmer here:
        try:
            from tauRec.tauRecConf import TauTrackSlimmer
            theTauTrackSlimmer = TauTrackSlimmer("tauTrackSlimmer",
                                                 TauContainer="TauJets",
                                                 FilterTaus=True,
                                                 maxNTrack=4,
                                                 maxCharge=2,
                                                 maxEmRadius=0.2,
                                                 maxIsoFrac=0.5)
        except Exception:
            mlog.error("could not get handle to tauTrackSlimmer")
            print traceback.format_exc()
            return False
        self._TauBuilderHandle = theTauTrackSlimmer

        # take care of the slimming Tool
        try:
            from TrkTrackSlimmingTool.TrkTrackSlimmingToolConf import Trk__TrackSlimmingTool as ConfigurableTrackSlimmingTool
            theTrackSlimmer = ConfigurableTrackSlimmingTool(
                name="tauTrackSlimmerTool",
                KeepParameters=True,
                KeepOutliers=True)
        except Exception:
            mlog.error("could not get handle to  tauTrackSlimmer")
            print traceback.format_exc()
            return False
        from AthenaCommon.AppMgr import ToolSvc
        ToolSvc += theTrackSlimmer

        #output:
        from RecExConfig.ObjKeyStore import objKeyStore
        # output to AOD (cluster container only!):
        #DR objKeyStore.addStreamAOD(self.outputType(),self.outputKey())

        # add to topsequence
        mlog.info("now adding to topSequence")

        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()
        topSequence += theTauTrackSlimmer

        return True
Пример #3
0
    def __init__(self, name="EMBremCollectionBuilder", **kw):
        mlog = logging.getLogger(name + '::__init__')
        mlog.info("entering")

        super(egammaBremCollectionBuilder, self).__init__(name, **kw)

        # do the configuration
        import egammaRec.EMCommonRefitter
        GSFBuildInDetExtrapolator = egammaExtrapolator()

        from egammaTrackTools.egammaTrackToolsConf import egammaTrkRefitterTool
        GSFRefitterTool = egammaTrkRefitterTool(
            name='GSFRefitterTool',
            FitterTool=egammaRec.EMCommonRefitter.GSFTrackFitter,
            useBeamSpot=False,
            ReintegrateOutliers=True)
        from AthenaCommon.AppMgr import ToolSvc
        ToolSvc += GSFRefitterTool

        # ----------- load association tool from Inner Detector to handle pixel ganged ambiguities
        #
        from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
        GSFBuildInDetPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(
            name="GSFBuildInDetPrdAssociationTool",
            PixelClusterAmbiguitiesMapName='PixelClusterAmbiguitiesMap')
        ToolSvc += GSFBuildInDetPrdAssociationTool
        #
        # ----------- Load SummaryTool
        #
        # Loading Configurable HoleSearchTool
        #
        from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool
        GSFBuildHoleSearchTool = InDet__InDetTrackHoleSearchTool(
            name="GSFBuildHoleSearchTool",
            Extrapolator=GSFBuildInDetExtrapolator,
            usePixel=DetFlags.haveRIO.pixel_on(),
            useSCT=DetFlags.haveRIO.SCT_on(),
            checkBadSCTChip=InDetFlags.checkDeadElementsOnTrack(),
            CountDeadModulesAfterLastHit=True)

        from AthenaCommon.AppMgr import ServiceMgr
        if (DetFlags.haveRIO.SCT_on()):
            from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConditionsSummarySvc
            InDetSCT_ConditionsSummarySvc = SCT_ConditionsSummarySvc(
                name="InDetSCT_ConditionsSummarySvc")
            ServiceMgr += InDetSCT_ConditionsSummarySvc
            GSFBuildHoleSearchTool.SctSummarySvc = ServiceMgr.InDetSCT_ConditionsSummarySvc
        else:
            GSFBuildHoleSearchTool.SctSummarySvc = None

        ToolSvc += GSFBuildHoleSearchTool
        #
        # Load BLayer tool
        #
        GSFBuildTestBLayerTool = None
        if DetFlags.haveRIO.pixel_on():
            from InDetTestBLayer.InDetTestBLayerConf import InDet__InDetTestBLayerTool
            from PixelConditionsServices.PixelConditionsServicesConf import PixelConditionsSummarySvc
            ServiceMgr += PixelConditionsSummarySvc()
            GSFBuildTestBLayerTool = InDet__InDetTestBLayerTool(
                name="GSFBuildTestBLayerTool",
                PixelSummarySvc=ServiceMgr.PixelConditionsSummarySvc,
                Extrapolator=GSFBuildInDetExtrapolator)
            ToolSvc += GSFBuildTestBLayerTool

        # Configurable version of TRT_ElectronPidTools
        #
        GSFBuildTRT_ElectronPidTool = None
        if DetFlags.haveRIO.TRT_on(
        ) and not InDetFlags.doSLHC() and not InDetFlags.doHighPileup():

            from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_LocalOccupancy
            GSFBuildTRT_LocalOccupancy = InDet__TRT_LocalOccupancy(
                name="GSF_TRT_LocalOccupancy")
            ToolSvc += GSFBuildTRT_LocalOccupancy

            from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_ElectronPidToolRun2
            GSFBuildTRT_ElectronPidTool = InDet__TRT_ElectronPidToolRun2(
                name="GSFBuildTRT_ElectronPidTool",
                TRT_LocalOccupancyTool=GSFBuildTRT_LocalOccupancy,
                isData=(globalflags.DataSource == 'data'))

            ToolSvc += GSFBuildTRT_ElectronPidTool

        #
        # Configurable version of PixelToTPIDTOol
        #
        GSFBuildPixelToTPIDTool = None
        if DetFlags.haveRIO.pixel_on():
            from PixelToTPIDTool.PixelToTPIDToolConf import InDet__PixelToTPIDTool
            GSFBuildPixelToTPIDTool = InDet__PixelToTPIDTool(
                name="GSFBuildPixelToTPIDTool")
            GSFBuildPixelToTPIDTool.ReadFromCOOL = True
            ToolSvc += GSFBuildPixelToTPIDTool
        #
        # Configrable version of loading the InDetTrackSummaryHelperTool
        #
        from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool
        GSFBuildTrackSummaryHelperTool = InDet__InDetTrackSummaryHelperTool(
            name="GSFBuildTrackSummaryHelperTool",
            AssoTool=GSFBuildInDetPrdAssociationTool,
            PixelToTPIDTool=GSFBuildPixelToTPIDTool,
            TestBLayerTool=GSFBuildTestBLayerTool,
            DoSharedHits=False,
            HoleSearch=GSFBuildHoleSearchTool,
            usePixel=DetFlags.haveRIO.pixel_on(),
            useSCT=DetFlags.haveRIO.SCT_on(),
            useTRT=DetFlags.haveRIO.TRT_on())
        ToolSvc += GSFBuildTrackSummaryHelperTool
        #
        # Configurable version of TrkTrackSummaryTool: no TRT_PID tool needed here (no shared hits)
        #
        from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool
        GSFBuildInDetTrackSummaryTool = Trk__TrackSummaryTool(
            name="GSFBuildInDetTrackSummaryTool",
            InDetSummaryHelperTool=GSFBuildTrackSummaryHelperTool,
            doSharedHits=False,
            InDetHoleSearchTool=GSFBuildHoleSearchTool,
            TRT_ElectronPidTool=GSFBuildTRT_ElectronPidTool,
            PixelToTPIDTool=GSFBuildPixelToTPIDTool)
        ToolSvc += GSFBuildInDetTrackSummaryTool
        #
        # --- load patricle creator tool
        #
        from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
        GSFBuildInDetParticleCreatorTool = Trk__TrackParticleCreatorTool(
            name="GSFBuildInDetParticleCreatorTool",
            KeepParameters=True,
            Extrapolator=GSFBuildInDetExtrapolator,
            TrackSummaryTool=GSFBuildInDetTrackSummaryTool,
            UseTrackSummaryTool=False,
            ForceTrackSummaryUpdate=False)
        ToolSvc += GSFBuildInDetParticleCreatorTool
        #
        # --- do track slimming
        #
        from TrkTrackSlimmingTool.TrkTrackSlimmingToolConf import Trk__TrackSlimmingTool as ConfigurableTrackSlimmingTool
        GSFBuildInDetTrkSlimmingTool = ConfigurableTrackSlimmingTool(
            name="GSFBuildInDetTrackSlimmingTool",
            KeepParameters=False,
            KeepOutliers=True)
        ToolSvc += GSFBuildInDetTrkSlimmingTool

        # do the configuration
        self.ClusterContainerName = "LArClusterEM"
        from InDetRecExample.InDetKeys import InDetKeys
        self.TrackParticleContainerName = InDetKeys.xAODTrackParticleContainer(
        )
        self.OutputTrkPartContainerName = "GSFTrackParticles"
        self.OutputTrackContainerName = "GSFTracks"
        self.TrackRefitTool = GSFRefitterTool
        self.TrackParticleCreatorTool = GSFBuildInDetParticleCreatorTool
        self.TrackSlimmingTool = GSFBuildInDetTrkSlimmingTool
        self.TrackSummaryTool = GSFBuildInDetTrackSummaryTool

        # do the configuration (from old EMBremCollectionBuilderBase)
        self.minNoSiHits = 4
        self.broadDeltaEta = 0.1  # this is multiplied by 2 for the Candidate Match , so +- 0.2 in eta
        self.broadDeltaPhi = 0.15  # this is multiplied by 2 for the Candidate Match , so +- 0.3 in phi
        self.narrowDeltaEta = 0.05
        #These have to be relaxed enough for the conversions
        self.narrowDeltaPhi = 0.05
        self.narrowDeltaPhiBrem = 0.20  #Dominated by the needs of assymetric conversions
        self.narrowDeltaPhiRescale = 0.05
        self.narrowDeltaPhiRescaleBrem = 0.1
Пример #4
0
    topSequence += InDetReFitTrack
    print          InDetReFitTrack
    # set input track name
    InputTrackCollection = OutputTrackCollection
    
 #
 # set output track name
 #
 OutputTrackCollection = InDetKeys.Tracks()
 #
 # --- slimm the tracks down before writing them
 #
 if InDetFlags.doSlimming():
    from TrkTrackSlimmingTool.TrkTrackSlimmingToolConf import Trk__TrackSlimmingTool as ConfigurableTrackSlimmingTool
    InDetTrkSlimmingTool = ConfigurableTrackSlimmingTool(name           = "InDetTrackSlimmingTool",
                                                         KeepParameters = True,
                                                         KeepOutliers   = True )
    ToolSvc += InDetTrkSlimmingTool
    print      InDetTrkSlimmingTool
    
    from TrkTrackSlimmer.TrkTrackSlimmerConf import Trk__TrackSlimmer as ConfigurableTrackSlimmer
    InDetTrkSlimmer = ConfigurableTrackSlimmer(name                 = "InDetTrackSlimmer",
                                               TrackLocation        = [ InputTrackCollection ],
                                               SlimmedTrackLocation = [ OutputTrackCollection ],
                                               TrackSlimmingTool    = InDetTrkSlimmingTool)
    #InDetTrkSlimmer.OutputLevel=VERBOSE
    topSequence += InDetTrkSlimmer
    print          InDetTrkSlimmer
    # --- for output
    InDetKeys.AliasToTracks = 'none'
                                                                            
Пример #5
0
    def __init__(self, name="EMBremCollectionBuilder", **kw):
        mlog = logging.getLogger(name + '::__init__')
        mlog.info("entering")

        super(egammaBremCollectionBuilder, self).__init__(name, **kw)

        import egammaRec.EMCommonRefitter

        # Extrapolator to be used for GSF (private)
        GSFBuildInDetExtrapolator = egammaExtrapolator()

        # GsfReffiter (private not in ToolSvc)
        from egammaTrackTools.egammaTrackToolsConf import egammaTrkRefitterTool
        GSFRefitterTool = egammaTrkRefitterTool(
            name='GSFRefitterTool',
            FitterTool=egammaRec.EMCommonRefitter.getGSFTrackFitter(),
            useBeamSpot=False,
            Extrapolator=GSFBuildInDetExtrapolator,
            ReintegrateOutliers=True)

        #
        #  BLayer and Pixel Related Tools (private = True)
        #
        GSFBuildTestBLayerTool = None
        GSFBuildPixelToTPIDTool = None
        if DetFlags.haveRIO.pixel_on():
            GSFPixelConditionsSummaryTool = (
                TrackingCommon.getInDetPixelConditionsSummaryTool())
            if InDetFlags.usePixelDCS():
                GSFPixelConditionsSummaryTool.IsActiveStates = [
                    'READY', 'ON', 'UNKNOWN', 'TRANSITION', 'UNDEFINED'
                ]
                GSFPixelConditionsSummaryTool.IsActiveStatus = [
                    'OK', 'WARNING', 'ERROR', 'FATAL'
                ]

            GSFBuildTestBLayerTool = TrackingCommon.getInDetRecTestBLayerTool(
                name="GSFBuildTestBLayerTool",
                PixelSummaryTool=GSFPixelConditionsSummaryTool,
                Extrapolator=GSFBuildInDetExtrapolator,
                private=True)

            GSFBuildPixelToTPIDTool = TrackingCommon.getInDetPixelToTPIDTool(
                name="GSFBuildPixelToTPIDTool", private=True)
        #
        #  TRT_ElectronPidTool (private =True)
        #
        GSFBuildTRT_ElectronPidTool = None
        if DetFlags.haveRIO.TRT_on(
        ) and not InDetFlags.doSLHC() and not InDetFlags.doHighPileup():
            GSFBuildTRT_ElectronPidTool = (
                TrackingCommon.getInDetTRT_ElectronPidTool(
                    name="GSFBuildTRT_ElectronPidTool", private=True))

        #
        #  InDet Track Summary Helper, no Association and no hole
        #  as we do not redo them (private = true)
        #
        GSFBuildTrackSummaryHelperTool = TrackingCommon.getInDetSummaryHelper(
            name="GSFBuildTrackSummaryHelperTool",
            AssoTool=None,
            HoleSearch=None,
            PixelToTPIDTool=GSFBuildPixelToTPIDTool,
            TestBLayerTool=GSFBuildTestBLayerTool,
            DoSharedHits=False,
            private=True)

        #
        #  TrkTrackSummaryTool: no shared hits  no hole search
        #  still public due to TrackParticleCreatorTool
        #
        GSFBuildInDetTrackSummaryTool = (
            TrackingCommon.getInDetTrackSummaryTool(
                name="GSFBuildInDetTrackSummaryTool",
                InDetSummaryHelperTool=GSFBuildTrackSummaryHelperTool,
                doSharedHits=False,
                doHolesInDet=False,
                TRT_ElectronPidTool=GSFBuildTRT_ElectronPidTool,
                PixelToTPIDTool=GSFBuildPixelToTPIDTool))

        #
        #  Track Particle Creator tool (private not in ToolSvc)
        #  But needs a public extrapolator and
        #  InDetTrackSummaryTool still...
        #
        from TrkParticleCreator.TrkParticleCreatorConf import (
            Trk__TrackParticleCreatorTool)

        GSFBuildInDetParticleCreatorTool = Trk__TrackParticleCreatorTool(
            name="GSFBuildInDetParticleCreatorTool",
            KeepParameters=True,
            Extrapolator=AtlasPublicExtrapolator(),
            TrackSummaryTool=GSFBuildInDetTrackSummaryTool,
            UseTrackSummaryTool=False)
        #
        #  Track slimming (private not in ToolSvc)
        #
        from TrkTrackSlimmingTool.TrkTrackSlimmingToolConf import (
            Trk__TrackSlimmingTool as ConfigurableTrackSlimmingTool)
        GSFBuildInDetTrkSlimmingTool = ConfigurableTrackSlimmingTool(
            name="GSFBuildInDetTrackSlimmingTool",
            KeepParameters=False,
            KeepOutliers=True)
        #
        #  Default Configuration
        #
        self.TrackRefitTool = GSFRefitterTool
        self.TrackParticleCreatorTool = GSFBuildInDetParticleCreatorTool
        self.TrackSlimmingTool = GSFBuildInDetTrkSlimmingTool
        self.TrackSummaryTool = GSFBuildInDetTrackSummaryTool