示例#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 doMultiLevelAlignment(self):
     doMultiLevelAlignment = False
     if align.alignmentLevel() != 3:
         if align.iteration() > 0 or mualign.jobType() == 'misal':
             doMultiLevelAlignment = True
     mualign.doMultiLevelAlignment = doMultiLevelAlignment
     return doMultiLevelAlignment
示例#3
0
    def configure(self):
        mlog = logging.getLogger(self._name + '::configure :')

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

        from TrkAlignGenTools.TrkAlignGenToolsConf import Trk__AlignTrackCreator
        alignTrackCreator = Trk__AlignTrackCreator(
            "AlignTrackCreator",
            OutputLevel=align.OutputLevel(),
            ResidualCalculator=resCalc,
            IncludeScatterers=align.includeScatterers(),
            RemoveATSOSNotInAlignModule=align.removeATSOSNotInAlignModule(),
            RequireOverlap=align.requireOverlap())

        # options for good event list
        if align.writeEventList():
            from TrkAlignGenTools.AlignmentIOFiles import AlignmentIOFiles
            alignIO = AlignmentIOFiles()
            alignTrackCreator.EventList = "goodEvts.txt"
            alignTrackCreator.WriteEventList = True

        self._AlignTrackCreatorHandle = alignTrackCreator

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

        mlog.info(" leaving configure")

        return True
示例#4
0
    def __init__(self):

        # set defaults for muon alignment
        align.alignmentType = 'GlobalChi2'
        align.useSLFitter = True
        align.runOutlierRemoval = False

        if not align.fileRootName.is_locked():
            self.setFileRootName()
        if not align.outputPath.is_locked():
            align.outputPath = align.fileRootName()
        if not mualign.asztFilePath.is_locked():
            mualign.asztFilePath = align.fileRootName()

        #self.muonIO = MuonAlignmentIOFiles()
        #self.muonIO.setInitialAsztFilePath(mualign.initialAsztFilePath())
        #self.muonIO.setAsztFilePath(mualign.asztFilePath())

        if align.alignmentLevel() == 1:
            self.setL1()
        elif align.alignmentLevel() == 23:
            self.setL23()
        elif align.alignmentLevel() == 3:
            self.setL3()
        else:
            print "only L1, L2 and L3 implemented"
            exit
示例#5
0
    def configure(self):
        mlog = logging.getLogger(self._name + '::configure :')

        from TrkAlignGenTools.AlignTrackCreatorGetter import AlignTrackCreatorGetter
        alignTrackCreator = AlignTrackCreatorGetter().AlignTrackCreatorHandle()

        from TrkAlignGenTools.AlignTrackDresserGetter import AlignTrackDresserGetter
        alignTrackDresser = AlignTrackDresserGetter().AlignTrackDresserHandle()

        from TrkAlignGenTools.AlignTrackDresserGetter import AlignTrackDresserGetter
        alignTrackDresser = AlignTrackDresserGetter().AlignTrackDresserHandle()

        from TrkAlignGenAlgs.TrkAlignGenAlgsConf import Trk__AlignAlg
        alignAlg = Trk__AlignAlg("AlignAlg",
                                 OutputLevel=align.OutputLevel(),
                                 AlignTrackCreator=alignTrackCreator,
                                 AlignTrackDresser=alignTrackDresser,
                                 AlignTool=self.getAlignTool(),
                                 WriteNtuple=align.writeNtuple(),
                                 FileName=align.ntupleFileName(),
                                 FilePath=align.ntupleFilePath(),
                                 SolveOnly=align.solveOnly())

        self._alignAlgHandle = alignAlg

        # add to topSequence
        mlog.info(" now adding to topSequence")
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()
        topSequence += self.AlignAlgHandle()

        mlog.info(" leaving configure")

        return True
    def configure(self):
        mlog = logging.getLogger(self._name + '::configure :')

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

        # create tool instance
        from MuonAlignGenTools.MuonAlignGenToolsConf import Muon__MuonTrackCollectionProvider
        muonTrackCollectionProvider = Muon__MuonTrackCollectionProvider(
            "MuonTrackCollectionProvider",
            OutputLevel=align.OutputLevel(),
            InputMuonCol=mualign.MuonContainerName(),
            InputTrackCol=align.inputTrkCol(),
            InputIDTrackCol=mualign.inputIDTrackCol(),
            UseStandaloneTracks=mualign.useStandaloneTracks(),
            TrackType=mualign.inputTrackCollectionType(),
            MomentumCut=mualign.momentumCut(),
            MuonAlignRefitTool=muonAlignRefitTool)

        self._muonTrackCollectionProviderHandle = muonTrackCollectionProvider

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

        mlog.info(" leaving configure")

        return True
示例#7
0
    def configureReco(self):
        from AthenaCommon.DetFlags import DetFlags
        DetFlags.Muon_setOn()
        DetFlags.Calo_setOff()

        recAlgsFlags.doMuonIDStandAlone = False
        recAlgsFlags.doMuonIDCombined = False

        # add some more flags available for standalone running
        import MuonRecExample.MuonRecStandaloneFlags

        # configure flags so that only Muon Standalone reco is run
        import MuonRecExample.MuonRecStandaloneOnlySetup

        muonRecFlags.useAlignmentCorrections = mualign.useOpticalAlignment()

        # cosmics setup
        #if align.dataType()=='cosmic' or align.dataType()=='simCosmic':

        ##### no more flags after this line #####
        print "align.dataType()=", align.dataType()
        if align.dataType() == 'data' or align.dataType() == 'cosmic':
            muonRecTopOptions = "MuonAlignGenTools/MuonDataRec_myTopOptions.py"
        else:
            muonRecTopOptions = "MuonRecExample/MuonRec_topOptions.py"
        try:
            include(muonRecTopOptions)

        ###### put any user finetuning before this line #####
        except:
            # always write config so far for debugging
            from AthenaCommon.ConfigurationShelve import saveToAscii
            saveToAscii("config.txt")
            # but still exit with error
            raise
示例#8
0
    def configure(self):
        mlog = logging.getLogger(self._name + '::configure :')

        from TrkAlignGenTools.AlignmentTrackFitter import AlignmentTrackFitter
        #from MuonTrackFinderTools.MuonTrackFinderToolsConf import Muon__MuonRefitTool
        from MuonTrackFinderTools.MuonTrackFinderToolsConf import Muon__MuonRefitTool
        muonRefitTool = Muon__MuonRefitTool(
            "MuonRefitToolForAlignment",
            OutputLevel=align.OutputLevel(),
            Fitter=AlignmentTrackFitter().fitter())

        from __main__ import ToolSvc
        ToolSvc += muonRefitTool

        # create tool instance
        from MuonAlignGenTools.MuonAlignGenToolsConf import Muon__MuonAlignRefitTool
        muonAlignRefitTool = Muon__MuonAlignRefitTool(
            OutputLevel=align.OutputLevel())

        combmu = mualign.selectCombinedMuons()

        muonAlignRefitTool.MuonRefitTool = muonRefitTool

        muonAlignRefitTool.RemoveBIS8Hits = False
        muonAlignRefitTool.RemoveTGCHits = False
        muonAlignRefitTool.RemoveTGCEtaHits = True
        muonAlignRefitTool.RemoveRPCEtaHits = True
        muonAlignRefitTool.RemoveCSCPhiHits = True
        muonAlignRefitTool.DeclusterTGCHits = False
        muonAlignRefitTool.RemoveSmallBarrelHits = False

        muonAlignRefitTool.RemoveCSCHits = mualign.removeCSCHits()
        muonAlignRefitTool.RemoveBEEHits = not mualign.alignEE()
        muonAlignRefitTool.RemoveEEHits = not mualign.alignEE()

        muonAlignRefitTool.RemoveBarrelHits = not mualign.alignBarrel()
        muonAlignRefitTool.RemoveEndcapHits = not mualign.alignEndcap()
        muonAlignRefitTool.RemoveTRTHits = mualign.removeTRTHits()
        muonAlignRefitTool.RemoveScattering = not align.includeScatterers()

        muonAlignRefitTool.RecreateStartingParameters = not mualign.selectCombinedMuons(
        )
        muonAlignRefitTool.ExtrapolateToMuonEntry = not mualign.selectCombinedMuons(
        )

        self._MuonAlignRefitToolHandle = muonAlignRefitTool

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

        mlog.info(" leaving configure")

        return True
 def alignModuleListType(self):
     if align.alignmentLevel() == 0:
         return 0
     elif align.alignmentLevel() == 1:
         return 1
     elif align.alignmentLevel() == 23:
         return 2
     elif align.alignmentLevel() == 3:
         return 3
     else:
         print "bad option"
         return -1
示例#10
0
    def configure(self):
        mlog = logging.getLogger(self._name + '::configure :')

        # create tool instance
        from TrkAlignGenTools.TrkAlignGenToolsConf import Trk__TrackCollectionProvider
        trackCollectionProvider = Trk__TrackCollectionProvider(
            "TrackCollectionProvider",
            OutputLevel=align.OutputLevel(),
            InputTrkCol=align.inputTrkCol())

        self._trackCollectionProviderHandle = trackCollectionProvider

        mlog.info(" leaving configure")

        return True
示例#11
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
    def configure ( self ) :
        mlog = logging.getLogger( self._name+'::configure :' )

        # create tool instance
        from TrkAlignGenTools.AlignResidualCalculatorGetter import AlignResidualCalculatorGetter
        resCalc = AlignResidualCalculatorGetter().ResidualPullCalculatorHandle()
        
        from MuonAlignGenTools.MuonAlignGenToolsConf import Muon__MuonFillNtupleTool
        from MuonAlignGenTools.MuonAlignmentIOFiles import MuonAlignmentIOFiles
        muonIO = MuonAlignmentIOFiles()
        muonFillNtupleTool = Muon__MuonFillNtupleTool(OutputLevel = align.OutputLevel(),
                                                      ResidualPullCalculator = resCalc,
                                                      MuonContainer = mualign.MuonContainerName())

        from MuonAlignGenTools.MuonAlignModuleToolGetter import MuonAlignModuleToolGetter
        muonAlignModuleTool = MuonAlignModuleToolGetter().MuonAlignModuleToolHandle()
        muonFillNtupleTool.AlignModuleTool = muonAlignModuleTool
        muonFillNtupleTool.BigNtuple = mualign.doBigNtuple()

        
        from MuTagTools.MuTagToolsConf import MuTagEDMHelper
        ConfiguredMuTagEDMHelper = MuTagEDMHelper("ConfiguredMuTagEDMHelper")
        from __main__ import ToolSvc
        ToolSvc += ConfiguredMuTagEDMHelper        
        muonFillNtupleTool.muTagEDMHelperTool = ConfiguredMuTagEDMHelper

        self._MuonFillNtupleToolHandle = muonFillNtupleTool

        mlog.info(" leaving configure" )

        return True
    def configure ( self ) :
        mlog = logging.getLogger( self._name+'::configure :' )

        muonIO = MuonAlignmentIOFiles()

        # create tool instance

        from __main__ import ToolSvc

        from MuonAlignGenTools.MuonAlignGenToolsConf import Muon__CscAlignDBTool
        muonAlignDBTool = Muon__CscAlignDBTool(OutputLevel = align.OutputLevel(),
                                               ABLineDbTool = ToolSvc.MGM_AlignmentDbTool,
                                               ASZTOutputFile = muonIO.asztOutputFile(),
                                               AlternateASZTFile = str(''),
                                               SigmaOutputFile = '',
                                               SigmaInputFile = '',
                                               UseMultiLevelDbTool = mualign.doMultiLevelAlignment()) 
        if mualign.useAlternateASZT() : 
            muonAlignDBTool.AlternateASZTFile = muonIO.asztInputFile()
        self._CscAlignDBToolHandle = muonAlignDBTool

        if mualign.doMultiLevelAlignment :
            MultiLevelAlignmentDbTool = ToolSvc.MultiLevelAlignmentDbTool
        else:
            from MuonCondTool.MuonCondToolConf import MultiLevelAlignmentDbTool
            MultiLevelAlignmentDbTool = MultiLevelAlignmentDbTool("MultiLevelAlignmentDbTool")
            MultiLevelAlignmentDbTool.ABLineDbTool = ToolSvc.MGM_AlignmentDbTool

        mlog.info(" leaving configure" )

        return True
示例#14
0
 def __init__(self):
     mlog = logging.getLogger('MuonAlignmentIOFiles::__init__')
     if not MuonAlignmentIOFiles._rootFilePathIsSet:
         self.setRootFilePath(align.outputPath())
     if not MuonAlignmentIOFiles._asztFilePathIsSet:
         self.setAsztFilePath(mualign.asztFilePath())
     if not MuonAlignmentIOFiles._initialAsztFilePathIsSet:
         self.setInitialAsztFilePath(mualign.initialAsztFilePath())
示例#15
0
    def __init__(self):

        # set defaults for muon alignment
        align.alignmentType = 'GlobalChi2'
        align.useSLFitter = True
        align.runOutlierRemoval = False

        self.setFileRootName()
        self.muonIO = MuonAlignmentIOFiles()

        if align.alignmentLevel() == 1:
            self.setL1()
        elif align.alignmentLevel() == 3:
            self.setL3()
        else:
            print "only L1 and L3 implemented"
            exit
示例#16
0
    def configure(self):
        mlog = logging.getLogger(self._name + '::configure :')
        outputLevel = AlignmentFlags.OutputLevel()

        # create tool instance
        from AthenaCommon.AppMgr import ToolSvc

        from MuonResidualPullCalculators.MuonResidualPullCalculatorsConf import Muon__TGC_ResidualPullCalculator
        tgc_respullcalc = Muon__TGC_ResidualPullCalculator(
            "TGC_ResidualPullCalculator")
        #OutputLevel=outputLevel)
        ToolSvc += tgc_respullcalc

        from InDetTrackValidation.InDetTrackValidationConf import InDet__SCT_ResidualPullCalculator
        sct_respullcalc = InDet__SCT_ResidualPullCalculator()
        ToolSvc += sct_respullcalc

        #from TrkValTools.TrkValToolsConf import Trk__ResidualPullCalculator
        from TrkResidualPullCalculator.TrkResidualPullCalculatorConf import \
            Trk__ResidualPullCalculator
        resPullCalc = Trk__ResidualPullCalculator(
            "ResidualPullCalculator",
            #OutputLevel=outputLevel,
            ResidualPullCalculatorForTGC=tgc_respullcalc,
            ResidualPullCalculatorForSCT=sct_respullcalc)
        ToolSvc += resPullCalc

        self._ResidualPullCalculatorHandle = ToolSvc.ResidualPullCalculator

        from TrkAlignGenTools.TrkAlignGenToolsConf import Trk__AlignResidualCalculator
        resCalc = Trk__AlignResidualCalculator(
            "AlignResidualCalculator",
            OutputLevel=outputLevel,
            ResidualType=0,
            ResidualPullCalculator=resPullCalc,
            IncludeScatterers=AlignmentFlags.includeScatteringResiduals())

        self._AlignResidualCalculatorHandle = resCalc

        mlog.info(" now adding to ToolSvc")
        ToolSvc += self.AlignResidualCalculatorHandle()

        mlog.info(" leaving configure")

        return True
示例#17
0
    def getAlignTool(self):

        if align.alignmentType() == 'GlobalChi2':
            from TrkGlobalChi2AlignTools.GlobalChi2AlignToolGetter import GlobalChi2AlignToolGetter
            return GlobalChi2AlignToolGetter().GlobalChi2AlignToolHandle()

        else:
            print "only global chi2 supported for now!"
            return
示例#18
0
 def derivativeCalcTool(self):
     try:
         self._derivCalcTool
     except:
         derivativeType = AlignmentFlags.derivativeType()
         if derivativeType == 'Analytical':
             from TrkAlignGenTools.TrkAlignGenToolsConf import Trk__AnalyticalDerivCalcTool
             self._derivCalcTool = Trk__AnalyticalDerivCalcTool(
                 "AnalyticalDerivCalcTool",
                 OutputLevel=AlignmentFlags.OutputLevel())
         elif derivativeType == 'Numerical':
             from TrkAlignGenTools.ShiftingDerivCalcToolGetter import ShiftingDerivCalcToolGetter
             self._derivCalcTool = ShiftingDerivCalcToolGetter(
             ).ShiftingDerivCalcToolHandle()
         else:
             print "bad option!"
     print "have derivCalcTool"
     return self._derivCalcTool
示例#19
0
 def inputLevel1File(self):
     if not MuonAlignmentIOFiles._inputLevel1File:
         if align.iteration() > 0:
             MuonAlignmentIOFiles._inputLevel1File = MuonAlignmentIOFiles._IOFiles.inputLevel1File(
                 align.fileRootName(), align.iteration(), align.jobIndex())
         elif align.dataType() == 'MC' or align.dataType() == 'simCosmic':
             MuonAlignmentIOFiles._inputLevel1File = MuonAlignmentIOFiles._IOFiles.inputLevel1File(
                 align.fileRootName(), align.iteration())
         else:
             MuonAlignmentIOFiles._inputLevel1File = ""
         print "level1AsciiFile: ", MuonAlignmentIOFiles._inputLevel1File
     return MuonAlignmentIOFiles._inputLevel1File
示例#20
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
示例#21
0
    def setAlignmentDbTool(self, useAlternateAscii):

        from AtlasGeoModel.MuonGM import GeoModelSvc
        MuonDetectorTool = GeoModelSvc.DetectorTools["MuonDetectorTool"]
        MuonDetectorTool.OutputLevel = align.OutputLevel()
        altASZTFile = ""
        if mualign.doMultiLevelAlignment():
            MuonDetectorTool.UseAsciiConditionData = 1
            MuonDetectorTool.UseConditionDb = 1
        else:
            print "doMultiLevelAlignment=False"
        from MuonAlignGenTools.MuonAlignmentIOFiles import MuonAlignmentIOFiles
        if useAlternateAscii:
            altASZTFile = self.muonIO.asztInputFile()
            MuonDetectorTool.AlternateASZTFile = altASZTFile
        print MuonDetectorTool

        from MuonCondTool.MuonCondToolConf import MuonAlignmentDbTool
        MuonAlignmentDbTool = MuonAlignmentDbTool("MGM_AlignmentDbTool")
        MuonAlignmentDbTool.ParlineFolders = [
            "/MUONALIGN/MDT/BARREL", "/MUONALIGN/MDT/ENDCAP/SIDEA",
            "/MUONALIGN/MDT/ENDCAP/SIDEC", "/MUONALIGN/TGC/SIDEA",
            "/MUONALIGN/TGC/SIDEC"
        ]
        MuonAlignmentDbTool.OutputLevel = align.OutputLevel()

        from __main__ import ToolSvc
        ToolSvc += MuonAlignmentDbTool

        if mualign.doMultiLevelAlignment():
            from MuonCondTool.MuonCondToolConf import MultiLevelAlignmentDbTool
            MultiLevelAlignmentDbTool = MultiLevelAlignmentDbTool(
                "MultiLevelAlignmentDbTool")
            MultiLevelAlignmentDbTool.ABLineDbTool = ToolSvc.MGM_AlignmentDbTool
            MultiLevelAlignmentDbTool.L1AsciiFile = self.muonIO.inputLevel1File(
            )
            MultiLevelAlignmentDbTool.OutputLevel = align.OutputLevel()
            ToolSvc += MultiLevelAlignmentDbTool

            MuonDetectorTool.TheMuonAlignmentTool = MultiLevelAlignmentDbTool
        else:
            MuonDetectorTool.TheMuonAlignmentTool = MuonAlignmentDbTool
    def configure ( self ) :
        mlog = logging.getLogger( self._name+'::configure :' )

        # create tool instance
        from MuonAlignGenTools.MuonAlignGenToolsConf import Muon__MuonGeometryManagerTool, Muon__MdtGeometryManagerTool, Muon__CscGeometryManagerTool, Muon__TgcGeometryManagerTool

        # MDT
        mdtGeometryManagerTool =  Muon__MdtGeometryManagerTool(OutputLevel = align.OutputLevel(),
                                                               AlignLevel = align.alignmentLevel(),
                                                               AlignTraX=mualign.mdtAlignTraX(),
                                                               AlignTraY=mualign.mdtAlignTraY(),
                                                               AlignTraZ=mualign.mdtAlignTraZ(),
                                                               AlignRotX=mualign.mdtAlignRotX(),
                                                               AlignRotY=mualign.mdtAlignRotY(),
                                                               AlignRotZ=mualign.mdtAlignRotZ())
        self._MdtGeometryManagerToolHandle = mdtGeometryManagerTool

        # CSC
        cscGeometryManagerTool =  Muon__CscGeometryManagerTool(OutputLevel = align.OutputLevel(),
                                                               AlignLevel = align.alignmentLevel())
        self._CscGeometryManagerToolHandle = cscGeometryManagerTool

        # TGC
        tgcGeometryManagerTool =  Muon__TgcGeometryManagerTool(OutputLevel = align.OutputLevel(),
                                                               AlignLevel = align.alignmentLevel())
        self._TgcGeometryManagerToolHandle = tgcGeometryManagerTool
        
        mlog.info(" now adding geometryManagerTools to ToolSvc" )
        from __main__ import ToolSvc
        ToolSvc += self.MdtGeometryManagerToolHandle()
        ToolSvc += self.CscGeometryManagerToolHandle()
        ToolSvc += self.TgcGeometryManagerToolHandle()

        muonGeometryManagerTool = Muon__MuonGeometryManagerTool(OutputLevel = align.OutputLevel(),
                                                                AlignLevel = align.alignmentLevel(),
                                                                MdtGeometryManager = mdtGeometryManagerTool,
                                                                CscGeometryManager = cscGeometryManagerTool,
                                                                TgcGeometryManager = tgcGeometryManagerTool,
                                                                doModuleSelection = mualign.doModuleSelection(),
                                                                AlignMdt = mualign.alignMDT(),
                                                                AlignTgc = False, #mualign.alignTGC(),
                                                                AlignCsc = False, #mualign.alignCSC(),
                                                                ModuleSelection = mualign.modulesToAlign())
        self._MuonGeometryManagerToolHandle = muonGeometryManagerTool
        
        mlog.info(" now adding MuonGeometryManagerTool to ToolSvc" )
        ToolSvc += self.MuonGeometryManagerToolHandle()

        mlog.info(" leaving configure" )

        return True
示例#23
0
    def configure(self):
        mlog = logging.getLogger(self._name + '::configure :')

        from TrkAlignGenAlgs.TrkAlignGenAlgsConf import Trk__SelectEventNumber
        selEvtNumber = Trk__SelectEventNumber("SelectEventNumber",
                                              OutputLevel=align.OutputLevel(),
                                              EventList=align.eventList())

        self._selectEventNumberHandle = selEvtNumber

        mlog.info("created selectEventNumber:")
        mlog.info(selEvtNumber)

        # add to sequencer
        mlog.info(" now adding to sequencer")
        from AthenaCommon.AppMgr import athFilterSeq
        sequencer = athFilterSeq
        sequencer += self.SelectEventNumberHandle()

        mlog.info(" leaving configure")

        return True
示例#24
0
 def asztInputFile(self):
     if not MuonAlignmentIOFiles._asztInputFile:
         if align.iteration()>0 or \
                 align.dataType()=='MC' or align.dataType()=='simCosmic' :
             MuonAlignmentIOFiles._asztInputFile = MuonAlignmentIOFiles._IOFiles.asztInputFile(
                 align.fileRootName(), align.iteration(), align.jobIndex())
         else:
             print "setting asztInputFile to ''"
             MuonAlignmentIOFiles._asztInputFile = ""
         print "asztInputFile: ", MuonAlignmentIOFiles._asztInputFile
     return MuonAlignmentIOFiles._asztInputFile
示例#25
0
    def configure(self):
        mlog = logging.getLogger(self._name + '::configure :')

        # create tool instance
        from MuonAlignGenTools.MuonAlignGenToolsConf import Muon__MdtGeometryManagerTool
        mdtGeometryManagerTool = Muon__MdtGeometryManagerTool(
            OutputLevel=align.OutputLevel(),
            MdtAlignParameters=mualign.mdtAlignParams())
        self._MdtGeometryManagerToolHandle = mdtGeometryManagerTool

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

        mlog.info(" leaving configure")

        return True
    def configure(self):
        mlog = logging.getLogger(self._name + '::configure :')

        # create tool instance
        from MuonAlignGenTools.MuonAlignGenToolsConf import Muon__MuonAlignModuleTool
        muonAlignModuleTool = Muon__MuonAlignModuleTool(
            OutputLevel=align.OutputLevel(),
            AlignModuleListType=mualign.alignModuleListType())

        self._MuonAlignModuleToolHandle = muonAlignModuleTool

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

        mlog.info(" leaving configure")

        return True
示例#27
0
    def configure(self):
        mlog = logging.getLogger(self._name + '::configure :')

        from TrkAlignGenAlgs.TrkAlignGenAlgsConf import Trk__AlignSolve
        alignAlg = Trk__AlignSolve("AlignSolve",
                                   OutputLevel=align.OutputLevel(),
                                   AlignTool=self.getAlignTool())

        self._alignAlgHandle = alignAlg

        # add to topSequence
        mlog.info(" now adding to topSequence")
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()
        topSequence += self.AlignSolveHandle()

        mlog.info(" leaving configure")

        return True
示例#28
0
    def configure(self):
        mlog = logging.getLogger(self._name + '::configure :')

        # create tool instance
        from TrkAlignGenTools.TrkAlignGenToolsConf import Trk__AlignTrackDresser
        alignTrackDresser = Trk__AlignTrackDresser(
            "AlignTrackDresser",
            OutputLevel=AlignmentFlags.OutputLevel(),
            DerivCalcTool=self.derivativeCalcTool())

        self._AlignTrackDresserHandle = alignTrackDresser

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

        mlog.info(" leaving configure")

        return True
示例#29
0
    def __init__(self):
        mlog = logging.getLogger('AlignmentTrackFitter::__init__')
        self._nInitialized += 1
        if self._nInitialized == 1:
            mlog.debug(" : First instance->configure()")
        else:
            mlog.debug("already initialized")
            return

        fitterType = align.fitterType()
        if fitterType == 'iPat':
            self.set_iPatFitter()
        elif fitterType == 'GlobalChi2':
            self.setGlobalChi2Fitter()
        elif fitterType == 'MCTB':
            self.setMCTBFitter()
        elif fitterType == 'CombMuonTrackFitter':
            self.setCombMuonTrackFitter()
        else:
            mlog.warning("no fitter!")
            return
示例#30
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