Ejemplo n.º 1
0
 def setL3(self):
     if mualign.alignMDT():
         align.derivativeType = 'Numerical'
     elif mualign.alignCSC():
         align.derivativeType = 'Analytical'
     else:
         align.derivativeType = 'unknown'
     align.alignmentLevel = 3
     self.setFullReco(False)
Ejemplo n.º 2
0
    def newConfigureSolveAlignment(self):

        self.setAlignmentDbTool()

        # setup MCTB fitter (not used but needed for AlignTrackPreProcessor)

        # get AlignAlg without muon-specific tools
        from TrkAlignGenAlgs.AlignAlgGetter import AlignAlgGetter
        solveAlign = AlignAlgGetter().AlignAlgHandle()

        # add muon-specific tools using current MuonAlignment flags

        # MuonGeometryManagerTool
        from MuonAlignGenTools.MuonGeometryManagerToolGetter import MuonGeometryManagerToolGetter
        solveAlign.GeometryManagerTool = MuonGeometryManagerToolGetter(
        ).MuonGeometryManagerToolHandle()

        # Csc/MdtAlignDBTool
        if mualign.alignMDT():
            from MuonAlignGenTools.MdtAlignDBToolGetter import MdtAlignDBToolGetter
            solveAlign.AlignDBTool = MdtAlignDBToolGetter(
            ).MdtAlignDBToolHandle()
        elif mualign.alignCSC():
            from MuonAlignGenTools.CscAlignDBToolGetter import CscAlignDBToolGetter
            solveAlign.AlignDBTool = CscAlignDBToolGetter(
            ).CscAlignDBToolHandle()
        else:
            print '************ At the moment set to MdtAlignDBTool  *************'
            print '*********** but please make sure what you are doing ***********'
            from MuonAlignGenTools.MdtAlignDBToolGetter import MdtAlignDBToolGetter
            solveAlign.AlignDBTool = MdtAlignDBToolGetter(
            ).MdtAlignDBToolHandle()

# create MuonAlignModuleTool and configure tools
        from MuonAlignGenTools.MuonAlignModuleToolGetter import MuonAlignModuleToolGetter
        alignModTool = MuonAlignModuleToolGetter().MuonAlignModuleToolHandle()
        solveAlign.AlignTool.AlignModuleTool = alignModTool
        solveAlign.AlignTool.MatrixTool.AlignModuleTool = alignModTool

        # set matrix tool output to DEBUG
        solveAlign.AlignTool.MatrixTool.OutputLevel = 2

        # configure GlobalChi2AlignTool's output tree
        globalChi2AlignTool = solveAlign.AlignTool
        globalChi2AlignTool.DoShiftDerivTree = mualign.doShiftDerivTree()

        # add RegionSelectionSvc
        self.addRegionSelectionSvc()

        solveAlign.SolveOnly = True
Ejemplo n.º 3
0
    def configureAlignment(self, useAlternateAscii=False, isMC=True):

        print "in configureAlignment"

        self.setAlignmentDbTool(useAlternateAscii, isMC)

        # get AlignAlg without muon-specific tools
        from TrkAlignGenAlgs.AlignAlgGetter import AlignAlgGetter
        alignAlg = AlignAlgGetter().AlignAlgHandle()

        # add muon-specific tools using current MuonAlignment flags

        # MuonTrackCollectionProvider
        if mualign.trackCollectionProvider() == 'MuonTrackCollectionProvider':
            from MuonAlignGenTools.MuonTrackCollectionProviderGetter import MuonTrackCollectionProviderGetter
            alignAlg.TrackCollectionProvider = MuonTrackCollectionProviderGetter(
            ).MuonTrackCollectionProviderHandle()

            # create instance of MuonMatchQuality
            #from MuonTrackThroughCalo.ConfMuonTrackThroughCalo import ConfMuonTrackThroughCalo
            #MuonTTC = ConfMuonTrackThroughCalo("MuonTrackThroughCalo")

            from AthenaCommon.AppMgr import ToolSvc
            #ToolSvc += MuonTTC

            from MuonRecExample import MuonRecTools
            muonCombiTrackMaker = MuonRecTools.getPublicTool(
                'MooTrackSteering')
            #muonCombiTrackMaker.OutputLevel = DEBUG
            muonCombiTrackMaker.OutputLevel = align.OutputLevel()

            atlasExtrapolator = MuonRecTools.getPublicTool('AtlasExtrapolator')
            from MuonCombinedTestTools.MuonCombinedTestToolsConf import MuonCombined__MuonTrackTagTestTool
            combinedMuonTag = MuonCombined__MuonTrackTagTestTool(
                name="CombinedMuonTag",
                ExtrapolatorTool=atlasExtrapolator,
                #TTCTool          = MuonTTC,
                Chi2Cut=2500.)
            ToolSvc += combinedMuonTag

            alignAlg.TrackCollectionProvider.TagTool = combinedMuonTag

        # create tool instance
        elif mualign.trackCollectionProvider() == 'TrackCollectionProvider':
            from TrkAlignGenTools.TrackCollectionProviderGetter import TrackCollectionProviderGetter
            alignAlg.TrackCollectionProvider = TrackCollectionProviderGetter(
            ).TrackCollectionProviderGetterHandle()
        else:
            print "Using default TrackCollectionProvider!"

# MuonTrackPreProcessor
        from MuonAlignGenTools.MuonTrackPreProcessorGetter import MuonTrackPreProcessorGetter
        alignAlg.AlignTrackPreProcessor = MuonTrackPreProcessorGetter(
        ).MuonTrackPreProcessorHandle()

        # MuonGeometryManagerTool
        from MuonAlignGenTools.MuonGeometryManagerToolGetter import MuonGeometryManagerToolGetter
        alignAlg.GeometryManagerTool = MuonGeometryManagerToolGetter(
        ).MuonGeometryManagerToolHandle()

        # MuonFillNtupleTool
        from MuonAlignGenTools.MuonFillNtupleToolGetter import MuonFillNtupleToolGetter
        alignAlg.FillNtupleTool = MuonFillNtupleToolGetter(
        ).MuonFillNtupleToolHandle()

        # MdtAlignDBTool
        if mualign.alignMDT():
            from MuonAlignGenTools.MdtAlignDBToolGetter import MdtAlignDBToolGetter
            alignAlg.AlignDBTool = MdtAlignDBToolGetter().MdtAlignDBToolHandle(
            )
        elif mualign.alignCSC():
            from MuonAlignGenTools.CscAlignDBToolGetter import CscAlignDBToolGetter
            alignAlg.AlignDBTool = CscAlignDBToolGetter().CscAlignDBToolHandle(
            )
        else:
            print '************ At the moment set to MdtAlignDBTool  *************'
            print '*********** but please make sure what you are doing ***********'
            from MuonAlignGenTools.MdtAlignDBToolGetter import MdtAlignDBToolGetter
            alignAlg.AlignDBTool = MdtAlignDBToolGetter().MdtAlignDBToolHandle(
            )

# create MuonAlignModuleTool and configure tools
        from MuonAlignGenTools.MuonAlignModuleToolGetter import MuonAlignModuleToolGetter
        alignModTool = MuonAlignModuleToolGetter().MuonAlignModuleToolHandle()
        alignAlg.AlignTool.AlignModuleTool = alignModTool
        alignAlg.AlignTool.MatrixTool.AlignModuleTool = alignModTool
        alignAlg.AlignTrackCreator.AlignModuleTool = alignModTool
        alignAlg.AlignTrackDresser.DerivCalcTool.AlignModuleTool = alignModTool

        # set matrix tool output to DEBUG
        alignAlg.AlignTool.MatrixTool.OutputLevel = 2

        # configure GlobalChi2AlignTool's output tree
        globalChi2AlignTool = alignAlg.AlignTool

        # add RegionSelectionSvc
        self.addRegionSelectionSvc()