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)
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
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
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()