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
conddb.dbname = "COMP200" conddb.addFolderSplitOnline('MUONALIGN', '/MUONALIGN/Onl/MDT/BARREL', '/MUONALIGN/MDT/BARREL') conddb.addFolderSplitOnline('MUONALIGN', '/MUONALIGN/Onl/MDT/ENDCAP/SIDEA', '/MUONALIGN/MDT/ENDCAP/SIDEA') conddb.addFolderSplitOnline('MUONALIGN', '/MUONALIGN/Onl/MDT/ENDCAP/SIDEC', '/MUONALIGN/MDT/ENDCAP/SIDEC') conddb.addFolderSplitOnline('MUONALIGN', '/MUONALIGN/Onl/TGC/SIDEA', '/MUONALIGN/TGC/SIDEA') conddb.addFolderSplitOnline('MUONALIGN', '/MUONALIGN/Onl/TGC/SIDEC', '/MUONALIGN/TGC/SIDEC') 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" ] ToolSvc += MuonAlignmentDbTool MGM_AlignmentDbTool = ToolSvc.MGM_AlignmentDbTool MGM_AlignmentDbTool.OutputLevel = DEBUG #***************************************************** HERE setup MuonDetectorManager from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool MuonDetectorTool = MuonDetectorTool() # memory management MuonDetectorTool.FillCacheInitTime = 0 # default is 0 #MuonDetectorTool.DumpMemoryBreakDown = True # default is false # selection of active stations MuonDetectorTool.StationSelection = 0 # default is 0 #MuonDetectorTool.SelectedStations = [ "X" ] # irrelevant if stationselection is 0 - this will switch off all stations
def setAlignmentDbTool(self, useAlternateAscii, isMC): from AtlasGeoModel.MuonGM import GeoModelSvc MuonDetectorTool = GeoModelSvc.DetectorTools["MuonDetectorTool"] MuonDetectorTool.OutputLevel = align.OutputLevel() #MuonDetectorTool.OutputLevel = INFO print "in setAlignmentDbTool, useAlternateAscii=", useAlternateAscii if isMC: #altASZTFile = "" if mualign.doMultiLevelAlignment(): MuonDetectorTool.UseAsciiConditionData = 1 MuonDetectorTool.UseConditionDb = 0 from MuonAlignGenTools.MuonAlignmentIOFiles import MuonAlignmentIOFiles if useAlternateAscii: #altASZTFile = self.muonIO.asztInputFile() MuonDetectorTool.AlternateASZTFile = "asztInput.txt" MuonDetectorTool.UseAsciiConditionData = 1 # get MuonAlignmentDbTool if already configured, create one if not from __main__ import ToolSvc try: muonAlignmentDbTool = ToolSvc.MGM_AlignmentDbTool except: from MuonCondTool.MuonCondToolConf import MuonAlignmentDbTool muonAlignmentDbTool = MuonAlignmentDbTool("MGM_AlignmentDbTool") ToolSvc += muonAlignmentDbTool MuonDetectorTool.TheMuonAlignmentTool = muonAlignmentDbTool muonAlignmentDbTool.OutputLevel = align.OutputLevel() #muonAlignmentDbTool.OutputLevel = DEBUG muonAlignmentDbTool.DumpALines = False if isMC and useAlternateAscii and align.alignmentLevel == 3: muonAlignmentDbTool.ALinesFile = "asztInput.txt" if not isMC: muonAlignmentDbTool.ParlineFolders = [ "/MUONALIGN/MDT/BARREL", "/MUONALIGN/MDT/ENDCAP/SIDEA", "/MUONALIGN/MDT/ENDCAP/SIDEC", "/MUONALIGN/TGC/SIDEA", "/MUONALIGN/TGC/SIDEC" ] print "doMultiLevelAlignment: ", mualign.doMultiLevelAlignment() if mualign.doMultiLevelAlignment(): from MuonCondTool.MuonCondToolConf import MultiLevelAlignmentDbTool MultiLevelAlignmentDbTool = MultiLevelAlignmentDbTool( "MultiLevelAlignmentDbTool") MultiLevelAlignmentDbTool.ABLineDbTool = muonAlignmentDbTool if align.alignmentLevel == 1: MultiLevelAlignmentDbTool.L1AsciiFile = "level1input.txt" elif align.alignmentLevel == 23: MultiLevelAlignmentDbTool.L23AsciiFile = "level23input.txt" elif align.alignmentLevel == 3: MultiLevelAlignmentDbTool.L3AsciiFile = "asztInput.txt" else: print "*** Alignment level: ", align.alignmentLevel,\ "not yet implemented in MultiLevelAlignmentDbTool ***" MultiLevelAlignmentDbTool.OutputLevel = align.OutputLevel() #MultiLevelAlignmentDbTool.OutputLevel = INFO #MultiLevelAlignmentDbTool.MuonIdHelperTool = ToolSvc.MuonIdHelperTool ToolSvc += MultiLevelAlignmentDbTool MuonDetectorTool.TheMuonAlignmentTool = MultiLevelAlignmentDbTool #from IOVDbSvc.CondDB import conddb #conddb.addOverride("/MUONALIGN/MDT/ENDCAP/SIDEA","MuonAlignMDTEndCapAAlign-2010-01-02") #conddb.addOverride("/MUONALIGN/MDT/ENDCAP/SIDEC","MuonAlignMDTEndCapCAlign-2010-01-02") print ToolSvc