def __init__(self, name=Configurable.DefaultName): super(MuGirlNS__CandidateToolConfig, self).__init__(name) global ToolSvc, ServiceMgr from RegionSelector.RegSelSvcDefault import RegSelSvcDefault MuGirlCandidateRegSelSvc = RegSelSvcDefault() MuGirlCandidateRegSelSvc.enableMuon = True ServiceMgr += MuGirlCandidateRegSelSvc self.doCSC = True self.RegionSelector = MuGirlCandidateRegSelSvc from DCMathSegmentMaker.DCMathSegmentMakerConf import Muon__MdtMathSegmentFinder finder_candidate = Muon__MdtMathSegmentFinder( "MuGirlCandidateSegmentFinder") ToolSvc += finder_candidate #from DCMathSegmentMaker.DCMathSegmentMakerConf import Muon__DCMathSegmentMaker #maker_candidate = Muon__DCMathSegmentMaker("MuGirlCandidateSegmentMaker") #maker_candidate.MdtSegmentFinder = finder_candidate # maker_candidate.CurvedErrorScaling=True #ToolSvc += maker_candidate #from MdtDriftCircleOnTrackCreator.MdtDriftCircleOnTrackCreatorConf import Muon__MdtDriftCircleOnTrackCreator #DriftCircleOnTrack = Muon__MdtDriftCircleOnTrackCreator("MuGirlCandidateDriftCircleOnTrack") #ToolSvc += DriftCircleOnTrack #self.MdtSegmentMaker = maker_candidate self.MdtSegmentMaker = MuonRecTools.getPublicTool("DCMathSegmentMaker") self.MdtDriftCircleOnTrackCreator = MuonRecTools.getPublicTool( "MdtDriftCircleOnTrackCreator") #self.MdtDriftCircleOnTrackCreator = DriftCircleOnTrack import MuonRecExample.MuonReadCalib # setup the calibration service #from CscSegmentMakers.Csc2dSegmentMaker import Csc2dSegmentMaker #from CscSegmentMakers.Csc4dSegmentMaker import Csc4dSegmentMaker self.CscSegmentMaker = MuonRecTools.getPublicTool("Csc4dSegmentMaker") #from MuidCaloEnergyTools.MuidCaloEnergyToolsConf import Rec__MuidCaloEnergyTool #ToolSvc += Rec__MuidCaloEnergyTool(name = 'MuidCaloEnergyToolParam',EnergyLossMeasurement = False) #ToolSvc += Rec__MuidCaloEnergyTool(name = 'MuidCaloEnergyTool') from MuonRecExample import MuonPrdProviderToolsConfig from AthenaCommon.DetFlags import DetFlags if DetFlags.haveRDO.MDT_on(): self.MdtRdoToPrepDataTool = ToolSvc.MdtPrepDataProviderTool else: self.MdtRdoToPrepDataTool = None if DetFlags.haveRDO.RPC_on(): self.RpcRdoToPrepDataTool = ToolSvc.RpcPrepDataProviderTool else: self.RpcRdoToPrepDataTool = None if DetFlags.haveRDO.TGC_on(): self.TgcRdoToPrepDataTool = ToolSvc.TgcPrepDataProviderTool else: self.TgcRdoToPrepDataTool = None if DetFlags.haveRDO.CSC_on(): self.CscRdoToPrepDataTool = ToolSvc.CscPrepDataProviderTool else: self.CscRdoToPrepDataTool = None #from CscClusterization.CscThresholdClusterBuilderTool import CscThresholdClusterBuilderTool self.CscClusterProviderTool = MuonRecTools.getPublicTool( "CscThresholdClusterBuilderTool")
'MuonTrkErrorScaling_nominal') from MuonErrorScalingTools.MuonErrorScalingToolsConf import Muon__MuonRIO_OnTrackErrorScalingTool, Muon__MuonErrorScaleDbTool muonErrorScaleDbTool = Muon__MuonErrorScaleDbTool("MuonErrorScaleDbTool", OutputLevel=outputLevel) ToolSvc += muonErrorScaleDbTool muonErrorScalingTool = Muon__MuonRIO_OnTrackErrorScalingTool( "MuonRIO_OnTrackErrorScalingTool", OutputLevel=outputLevel, ErrorScaleDbTool=muonErrorScaleDbTool) ToolSvc += muonErrorScalingTool from MuonRecExample import MuonRecTools MdtDriftCircleOnTrackCreator = MuonRecTools.getPublicTool( "MdtDriftCircleOnTrackCreator") MdtDriftCircleOnTrackCreator.DoErrorScaling = True MdtDriftCircleOnTrackCreator.ScaleErrorsManually = False MdtDriftCircleOnTrackCreator.OutputLevel = outputLevel MdtDriftCircleOnTrackCreator.ErrorScalingTool = muonErrorScalingTool CscClusterOnTrackCreator = MuonRecTools.getPublicTool( "CscClusterOnTrackCreator") CscClusterOnTrackCreator.DoRpcErrorScaling = True CscClusterOnTrackCreator.DoTgcErrorScaling = True CscClusterOnTrackCreator.DoCscErrorScaling = True CscClusterOnTrackCreator.OutputLevel = outputLevel CscClusterOnTrackCreator.ErrorScalingTool = muonErrorScalingTool MuonClusterOnTrackCreator = MuonRecTools.getPublicTool( "MuonClusterOnTrackCreator")
ToolSvc += VP1DNAdjustor from TrkKalmanFitter.TrkKalmanFitterConf import Trk__ForwardKalmanFitter as PublicFKF VP1FKF = PublicFKF(name='VP1FKF', StateChi2PerNDFPreCut=25.0) ToolSvc += VP1FKF from TrkKalmanFitter.TrkKalmanFitterConf import Trk__KalmanSmoother as PublicBKS VP1BKS = PublicBKS(name='VP1BKS', InitialCovarianceSeedFactor=200.) ToolSvc += VP1BKS from TrkKalmanFitter.TrkKalmanFitterConf import Trk__KalmanOutlierLogic as PublicKOL VP1KOL = PublicKOL(name='VP1KOL', StateChi2PerNDFCut=12.5) ToolSvc += VP1KOL #FIXME! Only do this for Muons? from MuonRecExample import MuonRecTools MdtTubeHitOnTrackCreator = MuonRecTools.getPublicTool( "MdtTubeHitOnTrackCreator") from TrkRIO_OnTrackCreator.TrkRIO_OnTrackCreatorConf import Trk__RIO_OnTrackCreator VP1RotCreator = Trk__RIO_OnTrackCreator( name='VP1RotCreator', ToolMuonDriftCircle=MdtTubeHitOnTrackCreator, Mode='all') ToolSvc += VP1RotCreator print VP1RotCreator print MdtTubeHitOnTrackCreator from TrkKalmanFitter.TrkKalmanFitterConf import Trk__KalmanFitter as ConfiguredKalmanFitter VP1KalmanFitter = ConfiguredKalmanFitter( name='VP1KalmanFitter', ExtrapolatorHandle=VP1Extrapolator, RIO_OnTrackCreatorHandle=VP1RotCreator,
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
'MuonTrkErrorScaling_nominal') # configure muon hit creator tools to use error scaling from MuonRecExample import MuonRecTools from MuonErrorScalingTools.MuonErrorScalingToolsConf import Muon__MuonErrorScaleDbTool, Muon__MuonRIO_OnTrackErrorScalingTool muonErrorScaleDbTool = Muon__MuonErrorScaleDbTool("MuonErrorScaleDbTool") ToolSvc += muonErrorScaleDbTool muonRIO_OnTrackErrorScalingTool = \ Muon__MuonRIO_OnTrackErrorScalingTool("MuonRIO_OnTrackErrorScalingTool", ErrorScaleDbTool=muonErrorScaleDbTool) ToolSvc += muonRIO_OnTrackErrorScalingTool muonClusterOnTrackCreator = MuonRecTools.getPublicTool( "MuonClusterOnTrackCreator") muonClusterOnTrackCreator.OutputLevel = 1 muonClusterOnTrackCreator.ErrorScalingTool = ToolSvc.MuonRIO_OnTrackErrorScalingTool muonClusterOnTrackCreator.ErrorScalingTool.OutputLevel = 1 mdtDriftCircleOnTrackCreator = MuonRecTools.getPublicTool( "MdtDriftCircleOnTrackCreator") mdtDriftCircleOnTrackCreator.DoFixedError = False mdtDriftCircleOnTrackCreator.DoErrorScaling = True mdtDriftCircleOnTrackCreator.OutputLevel = 1 mdtDriftCircleOnTrackCreator.ErrorScalingTool = ToolSvc.MuonRIO_OnTrackErrorScalingTool mdtDriftCircleOnTrackCreator.ErrorScalingTool.OutputLevel = 1
MCTBSLFitter.FillDerivativeMatrix = False MCTBSLFitter.SortHits = False MCTBSLFitter.OutputLevel = INFO MCTBSLFitter.GetMaterialFromTrack = True MCTBSLFitter.Momentum = 0. ToolSvc += MCTBSLFitter # create instance of MuonTrackTagTestTool from MuonTrackThroughCalo.ConfMuonTrackThroughCalo import ConfMuonTrackThroughCalo MuonTTC = ConfMuonTrackThroughCalo("MuonTrackThroughCalo") from AthenaCommon.AppMgr import ToolSvc ToolSvc += MuonTTC from MuonRecExample import MuonRecTools atlasExtrapolator = MuonRecTools.getPublicTool('AtlasExtrapolator') from MuonCombinedTestTools.MuonCombinedTestToolsConf import MuonCombined__MuonTrackTagTestTool combinedMuonTag = MuonCombined__MuonTrackTagTestTool( name="CombinedMuonTag", ExtrapolatorTool=atlasExtrapolator, TTCTool=MuonTTC, Chi2Cut=2500.) ToolSvc += combinedMuonTag from MuonAlignGenTools.MuonAlignGenToolsConf import Muon__UnbiasedMuonResiduals topSequence += Muon__UnbiasedMuonResiduals( "UnbiasedMuonResiduals", WhichSegmCollections=[1, 1], SegmentCollectionName=["MooreSegments", "ConvertedMBoySegments"], #MuonTrackCollections = ["MuidMuonCollection","StacoMuonCollection"], MuonTrackCollections=["MooreTracks", "ConvertedMBoyTracks"],
TMEF_MuonHoughPatternToolCosmic = MuonHoughPatternTool( "TMEF_MuonHoughPatternToolCosmic", UseCosmics=True, NumberOfMaximaPerIterations=1) ToolSvc += TMEF_MuonHoughPatternToolCosmic from DCMathSegmentMaker.DCMathSegmentMakerConf import Muon__MdtMathSegmentFinder TMEF_MdtMathSegmentFinderCosmic = Muon__MdtMathSegmentFinder( "TMEF_MdtMathSegmentFinderCosmic", AssociationRoadWidth=15, SortSegmentWithAllHits=True) if doT0Fit: if muonRecFlags.doSegmentT0Fit(): TMEF_MdtSegmentT0Fitter = MuonRecTools.getPublicTool( "MdtSegmentT0Fitter", "TMEF_MdtSegmentT0Fitter") TMEF_MdtMathSegmentFinderCosmic.DCFitProvider = TMEF_MdtSegmentT0Fitter ToolSvc += TMEF_MdtMathSegmentFinderCosmic from DCMathSegmentMaker.DCMathSegmentMakerConf import Muon__DCMathSegmentMaker TMEF_DCMathSegmentMakerCosmic = Muon__DCMathSegmentMaker( "TMEF_DCMathSegmentMakerCosmic", SinAngleCut=0.9, AddUnassociatedPhiHits=True, #SortSegmentWithAllHits = True, CurvedErrorScaling=False, MdtCreator=TMEF_MdtDriftCircleOnTrackCreatorCosmic, MdtSegmentFinder=TMEF_MdtMathSegmentFinderCosmic)
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()