예제 #1
0
    def setMCTBFitter(self):

        from AthenaCommon.AppMgr import ToolSvc

        # this assumes that MCTBFitter has already been set
        from MuonRecExample import MuonRecTools
        #ToolSvc.MCTBFitter.OutputLevel = align.OutputLevel()
        #ToolSvc.MCTBSLFitter.OutputLevel = align.OutputLevel()

        MCTBFitter = MuonRecTools.getPublicToolClone(
            "myMCTBFitter", "MCTBFitterMaterialFromTrack")
        MCTBFitter.FillDerivativeMatrix = True
        MCTBFitter.OutputLevel = align.OutputLevel()
        #MCTBFitter.OutputLevel = VERBOSE
        #MCTBFitter.GetMaterialFromTrack = True
        #MCTBFitter.PrintDerivatives = True
        ToolSvc += MCTBFitter
        self._fitter = ToolSvc.myMCTBFitter

        if align.useSLFitter():
            MCTBSLFitter = MuonRecTools.getPublicToolClone(
                "myMCTBSLFitter", "MCTBSLFitterMaterialFromTrack")
            MCTBSLFitter.FillDerivativeMatrix = True
            MCTBSLFitter.OutputLevel = align.OutputLevel()
            #MCTBSLFitter.OutputLevel = VERBOSE
            #MCTBSLFitter.GetMaterialFromTrack = True
            ##rdh MCTBSLFitter.Momentum = 0
            #MCTBSLFitter.PrintDerivatives = True
            ToolSvc += MCTBSLFitter
            self._slfitter = ToolSvc.myMCTBSLFitter
예제 #2
0
 def setGlobalChi2Fitter(self):
     mlog = logging.getLogger('AlignmentTrackFitter::setGlobalChi2Fitter')
     from AthenaCommon.AppMgr import ToolSvc
     from TrkGlobalChi2Fitter.TrkGlobalChi2FitterConf import Trk__GlobalChi2Fitter
     Fitter = Trk__GlobalChi2Fitter()
     ToolSvc += Fitter
     self._fitter = Fitter
     if align.useSLFitter():
         mlog.warning("SL Fitter set to default (curved) fitter!")
         self._slfitter = Fitter
예제 #3
0
    def setCombMuonTrackFitter(self):
        mlog = logging.getLogger(
            'AlignmentTrackFitter::setCombMuonTrackFitter')
        from AthenaCommon.Include import include
        include('MuonCombinedRecExample/CombinedMuonFitTools.py')

        from AthenaCommon.AppMgr import ToolSvc
        ToolSvc.MuonCombinedTrackFitter.FillDerivativeMatrix = True

        self._fitter = ToolSvc.MuonCombinedTrackFitter
        self._fitter.OutputLevel = align.OutputLevel()

        if align.useSLFitter():
            mlog.warning("SL Fitter set to default (curved) fitter!")
            self._slfitter = ToolSvc.MuonCombinedTrackFitter
예제 #4
0
    def configure(self):
        mlog = logging.getLogger(self._name + '::configure :')

        # create tool instance
        from TrkAlignGenTools.AlignResidualCalculatorGetter import AlignResidualCalculatorGetter
        resCalc = AlignResidualCalculatorGetter(
        ).AlignResidualCalculatorHandle()

        from TrkAlignGenTools.AlignmentTrackFitter import AlignmentTrackFitter
        from TrkAlignGenTools.TrkAlignGenToolsConf import Trk__ShiftingDerivCalcTool
        shiftingDerivCalcTool = Trk__ShiftingDerivCalcTool(
            "ShiftingDerivCalcTool",
            OutputLevel=AlignmentFlags.OutputLevel(),
            TrackFitterTool=AlignmentTrackFitter().fitter(),
            ResidualCalculator=resCalc,
            TranslationSize=mualign.shiftSizeTranslations(),
            RotationSize=mualign.shiftSizeRotations(),
            NumberOfShifts=mualign.numberOfShifts(),
            doChi2VChamberShiftsMeasType=mualign.doChi2VChamberShiftsMeasType(
            ))
        if AlignmentFlags.useSLFitter():
            shiftingDerivCalcTool.SLTrackFitterTool = AlignmentTrackFitter(
            ).slfitter()

        # configure other jobOptions
        shiftingDerivCalcTool.RunOutlierRemoval = AlignmentFlags.runOutlierRemoval(
        )
        shiftingDerivCalcTool.ParticleNumber = AlignmentFlags.particleNumber()
        shiftingDerivCalcTool.TrackAlignParamCut = AlignmentFlags.trackAlignParamCut(
        )
        shiftingDerivCalcTool.SetMinIterations = AlignmentFlags.setMinIterations(
        )

        self._ShiftingDerivCalcToolHandle = shiftingDerivCalcTool

        mlog.info(" now adding to ToolSvc")
        from __main__ import ToolSvc
        ToolSvc += self.ShiftingDerivCalcToolHandle()

        mlog.info(" leaving configure")

        return True
예제 #5
0
    def set_iPatFitter(self):
        from AthenaCommon.AppMgr import ToolSvc
        from MuonRecExample import MuonRecTools
        MuonExtrapolator = MuonRecTools.getPublicTool('MuonExtrapolator')

        from AthenaCommon.Include import include
        include('TrkDetDescrSvc/AtlasTrackingGeometrySvc.py')

        # set up the extrapolator and fitter as used by Muid
        from TrkExRungeKuttaIntersector.TrkExRungeKuttaIntersectorConf import \
            Trk__IntersectorWrapper as Propagator
        MuidPropagator = Propagator(name='MuidPropagator')
        ToolSvc += MuidPropagator

        from TrkExTools.TrkExToolsConf import Trk__MaterialEffectsUpdator
        MuidMaterialUpdator = Trk__MaterialEffectsUpdator(
            name="MuidMaterialEffectsUpdator")
        ToolSvc += MuidMaterialUpdator

        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
        from TrkExTools.TrkExToolsConf import Trk__Navigator
        MuidNavigator = Trk__Navigator(
            name='MuidNavigator',
            TrackingGeometrySvc=svcMgr.AtlasTrackingGeometrySvc)
        ToolSvc += MuidNavigator

        from TrkExTools.TrkExToolsConf import Trk__Extrapolator
        MuidExtrapolator = Trk__Extrapolator(
            name='MuidExtrapolator',
            Propagators=[MuidPropagator],
            MaterialEffectsUpdators=[MuidMaterialUpdator],
            Navigator=MuidNavigator)
        ToolSvc += MuidExtrapolator

        # material allocation
        from TrkiPatFitter.TrkiPatFitterConf import Trk__MaterialAllocator
        MuidMaterialAllocator = Trk__MaterialAllocator(
            name='MuidMaterialAllocator',
            AggregateMaterial=True,
            Extrapolator=MuidExtrapolator,
            TrackingGeometrySvc=svcMgr.AtlasTrackingGeometrySvc)
        ToolSvc += MuidMaterialAllocator

        from TrkiPatFitter.TrkiPatFitterConf import Trk__iPatGlobalFitter
        Fitter = Trk__iPatGlobalFitter(
            name='iPatGlobalFitter',
            #from TrkiPatFitter.TrkiPatFitterConf import Trk__iPatFitter
            #Fitter = Trk__iPatFitter(
            #    name='iPatFitter',
            AggregateMaterial=True,
            AsymmetricCaloEnergy=False,
            FullCombinedFit=True,
            MaterialAllocator=MuidMaterialAllocator,
            OutputLevel=align.OutputLevel())
        #OutputLevel = VERBOSE)

        ToolSvc += Fitter
        self._fitter = ToolSvc.iPatGlobalFitter
        #self._fitter = ToolSvc.iPatFitter

        if align.useSLFitter():
            SLFitter = Trk__iPatGlobalFitter(
                name='iPatGlobalSLFitter',
                #SLFitter = Trk__iPatFitter(
                #    name                    = 'iPatSLFitter',
                AggregateMaterial=True,
                FullCombinedFit=True,
                LineFit=True,
                MaterialAllocator=MuidMaterialAllocator,
                OutputLevel=align.OutputLevel())
            ToolSvc += SLFitter
            self._slfitter = ToolSvc.iPatGlobalSLFitter
예제 #6
0
 def slfitter(self):
     if align.useSLFitter():
         return self._slfitter
     else:
         return
    def configure(self):
        mlog = logging.getLogger(self._name + '::configure :')

        # create tool instance
        from TrkAlignGenTools.AlignmentTrackFitter import AlignmentTrackFitter
        from MuonAlignGenTools.MuonAlignGenToolsConf import Muon__MuonAlignHelperTool, Muon__MuonTrackPreProcessor

        from MuonAlignGenTools.MuonAlignRefitToolGetter import MuonAlignRefitToolGetter
        muonAlignRefitTool = MuonAlignRefitToolGetter(
        ).MuonAlignRefitToolHandle()

        muonAlignHelperTool = Muon__MuonAlignHelperTool(
            OutputLevel=align.OutputLevel())

        from __main__ import ToolSvc
        ToolSvc += muonAlignHelperTool

        muonTrackPreProcessor = Muon__MuonTrackPreProcessor(
            OutputLevel=align.OutputLevel(),
            TrackFitterTool=AlignmentTrackFitter().fitter(),
            MuonAlignRefitTool=muonAlignRefitTool)

        if align.useSLFitter():
            muonTrackPreProcessor.SLTrackFitterTool = AlignmentTrackFitter(
            ).slfitter()

        muonTrackPreProcessor.RefitTracks = align.refitTracks()
        muonTrackPreProcessor.ParticleNumber = align.particleNumber()
        muonTrackPreProcessor.RunOutlierRemoval = align.runOutlierRemoval()
        muonTrackPreProcessor.RedoErrorScaling = mualign.redoErrorScaling()
        muonTrackPreProcessor.pTCorrectTrack = mualign.pTCorrectTrack()
        muonTrackPreProcessor.RemovePerigeeBeforeRefit = mualign.removePerigeeBeforeRefit(
        )

        muonTrackPreProcessor.ResetScatteringAngles = mualign.resetScatteringAngles(
        )

        muonTrackPreProcessor.ApplyStandardSelectionCuts = mualign.applyStandardSelectionCuts(
        )
        muonTrackPreProcessor.ApplySelectionCuts = mualign.applySelectionCuts()
        muonTrackPreProcessor.RequireOneHitPerTubeLayerEC = mualign.requireOneHitPerTubeLayerEC(
        )
        muonTrackPreProcessor.RequireInnerLayerEndcapMdt = mualign.requireInnerLayerECTracks(
        )
        muonTrackPreProcessor.RequireOuterLayerEndcapMdt = mualign.requireOuterLayerECTracks(
        )
        muonTrackPreProcessor.RequireBarrelECOverlap = mualign.requireBarrelECOverlap(
        )
        muonTrackPreProcessor.CutOnBarrel = mualign.cutOnBarrelTracks()
        muonTrackPreProcessor.RequireRPCPhiHit = mualign.requireRPCPhiHit()
        muonTrackPreProcessor.RequireSmallLargeOverlap = mualign.requireSmallLargeOverlap(
        )

        muonTrackPreProcessor.MuonContainer = mualign.MuonContainerName()
        muonTrackPreProcessor.SelectCombinedMuons = mualign.selectCombinedMuons(
        )

        muonTrackPreProcessor.MSID_ptDiffCut = mualign.msidPtDiffCut()
        muonTrackPreProcessor.chiSqCut = mualign.cutOnTrackChisquare()
        muonTrackPreProcessor.nAllowedHoles = mualign.cutOnNumHolesOnTrack()
        muonTrackPreProcessor.nAllowedOutliers = mualign.cutOnNumOutlierOnTrack(
        )
        muonTrackPreProcessor.MaxDriftSignSum = mualign.cutOnMaxDriftSignSum()

        self._MuonTrackPreProcessorHandle = muonTrackPreProcessor

        mlog.info(" adding MuonTrackPreProcessor to ToolSvc")
        ToolSvc += muonAlignHelperTool

        mlog.info(" leaving configure")

        return True