def InDetGlobalChi2FitterBase(name='GlobalChi2FitterBase', **kwargs): from TrkDetDescrSvc.AtlasTrackingGeometrySvc import AtlasTrackingGeometrySvc from InDetRecExample.TrackingCommon import setDefaults from AthenaCommon.AppMgr import ToolSvc from InDetRecExample.InDetJobProperties import InDetFlags import InDetRecExample.TrackingCommon as TrackingCommon kwargs = setDefaults( kwargs, ExtrapolationTool=TrackingCommon.getInDetExtrapolator(), NavigatorTool=TrackingCommon.getInDetNavigator(), PropagatorTool=TrackingCommon.getInDetPropagator(), MultipleScatteringTool=TrackingCommon. getInDetMultipleScatteringUpdator(), MeasurementUpdateTool=ToolSvc.InDetUpdator, TrackingGeometrySvc=AtlasTrackingGeometrySvc, MaterialUpdateTool=TrackingCommon.getInDetMaterialEffectsUpdator(), StraightLine=not InDetFlags.solenoidOn(), OutlierCut=4, SignedDriftRadius=True, ReintegrateOutliers=True, RecalibrateSilicon=True, RecalibrateTRT=True, TRTTubeHitCut= 1.75, # use tighter hit classification, old: TrackingCommon.default_ScaleHitUncertainty MaxIterations=40, Acceleration=True, RecalculateDerivatives=InDetFlags.doMinBias() or InDetFlags.doCosmics() or InDetFlags.doBeamHalo(), TRTExtensionCuts=True, TrackChi2PerNDFCut=7) from TrkGlobalChi2Fitter.TrkGlobalChi2FitterConf import Trk__GlobalChi2Fitter return Trk__GlobalChi2Fitter(name, **kwargs)
def TMEF_MuonCombinedTrackFitter(name='TMEF_MuonCombinedTrackFitter', **kwargs): kwargs.setdefault('ExtrapolationTool', 'AtlasExtrapolator') #gpt kwargs.setdefault('NavigatorTool', ToolSvc.MuonNavigator) kwargs.setdefault('PropagatorTool', 'TMEF_MuonCombinedPropagator') #gpt kwargs.setdefault('RotCreatorTool', 'MuonRotCreator') #gpt kwargs.setdefault('MeasurementUpdateTool', 'MuonMeasUpdator') #gpt kwargs.setdefault('TrackingGeometrySvc', ServiceMgr.AtlasTrackingGeometrySvc) kwargs.setdefault('ExtrapolatorMaterial', True) kwargs.setdefault('MuidTool', None) kwargs.setdefault('MuidToolParam', 'TMEF_CombMuonMEOTPParam') #gpt kwargs.setdefault('MuidMat', False) kwargs.setdefault( 'StraightLine', False ) #FIX? StraightLine = not jobproperties.BField.solenoidOn() and not jobproperties.BField.allToroidOn(), kwargs.setdefault('MaxIterations', 50) kwargs.setdefault( 'GetMaterialFromTrack', True ) #FIX? jobproperties.BField.solenoidOn() and jobproperties.BField.allToroidOn(), kwargs.setdefault('RecalculateDerivatives', False) kwargs.setdefault("UseCaloTG", True) kwargs.setdefault("CaloMaterialProvider", "TMEF_TrkMaterialProviderTool") from TrkGlobalChi2Fitter.TrkGlobalChi2FitterConf import Trk__GlobalChi2Fitter return Trk__GlobalChi2Fitter(name, **kwargs)
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
def MuonChi2TrackFitter(name='MuonChi2TrackFitter', **kwargs): from TrkGlobalChi2Fitter.TrkGlobalChi2FitterConf import Trk__GlobalChi2Fitter kwargs.setdefault("ExtrapolationTool", "MuonExtrapolator") kwargs.setdefault("RotCreatorTool", "MuonRotCreator") kwargs.setdefault("MeasurementUpdateTool", "MuonMeasUpdator") kwargs.setdefault("StraightLine", False) kwargs.setdefault("OutlierCut", 3.0) kwargs.setdefault("GetMaterialFromTrack", False) kwargs.setdefault("RejectLargeNScat", True) # take propagator and navigator from the extrapolator Extrapolator = getPublicTool(kwargs["ExtrapolationTool"]) kwargs.setdefault("PropagatorTool", Extrapolator.Propagators[0].getName()) kwargs.setdefault("NavigatorTool", Extrapolator.Navigator.getName()) return Trk__GlobalChi2Fitter(name, **kwargs)
def __init__(self, name="ConfiguredTrigFTKTrackConverter", DoTrackFit=False, DoTruth=False, TrackFitter=None, UsePixelCalibSvc=True): TrigFTKTrackConverter.__init__(self, name) from AthenaCommon.AppMgr import ToolSvc from TrkGlobalChi2Fitter.TrkGlobalChi2FitterConf import Trk__GlobalChi2Fitter from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigExtrapolator, \ InDetTrigNavigator, InDetTrigPropagator, InDetTrigRefitRotCreator, InDetTrigBroadInDetRotCreator, \ InDetTrigUpdator, AtlasTrackingGeometrySvc, InDetTrigMaterialUpdator TrigFTKTrackFitter = Trk__GlobalChi2Fitter( name='TrigFTKTrackFitter', ExtrapolationTool=InDetTrigExtrapolator, NavigatorTool=InDetTrigNavigator, PropagatorTool=InDetTrigPropagator, RotCreatorTool=InDetTrigRefitRotCreator, BroadRotCreatorTool=InDetTrigBroadInDetRotCreator, MeasurementUpdateTool=InDetTrigUpdator, TrackingGeometrySvc=AtlasTrackingGeometrySvc, #MaterialUpdateTool = InDetTrigMaterialUpdator, StraightLine=False, OutlierCut=4, SignedDriftRadius=True, RecalibrateSilicon=True, RecalibrateTRT=True, ReintegrateOutliers=True, TrackChi2PerNDFCut=7, TRTExtensionCuts=False, MaxIterations=40, Acceleration=True, Momentum=1000., ) ToolSvc += TrigFTKTrackFitter if TrackFitter is None: self.DoFit = DoTrackFit self.DoTruth = False self.TrackFitter = TrigFTKTrackFitter self.UsePixelCalibSvc = UsePixelCalibSvc self.PixelOfflineCalibSvc = PixelConditionsSetup.instanceName( 'PixelOfflineCalibSvc')
####### GX2 Realted Packaages ######## ############################################################################### ############################################################################### from TrkGlobalChi2Fitter.TrkGlobalChi2FitterConf import Trk__GlobalChi2Fitter GX2TrackFitter = Trk__GlobalChi2Fitter( name='GX2TrackFitter', OutputLevel=4, ExtrapolationTool=ElectronTrkExtrapolator, NavigatorTool=ElectronTrkNavigator, PropagatorTool=ElectronTrkPropagator, RotCreatorTool=ElectronRotCreator, BroadRotCreatorTool=None, MeasurementUpdateTool=ElectronUpdator, MagneticFieldTool=ElectronTrkMagField, StraightLine=not InDetFlags.solenoidOn(), OutlierCut=4, SignedDriftRadius=True, ReintegrateOutliers=False, RecalibrateSilicon=False, RecalibrateTRT=False, TRTTubeHitCut=2.5, MaxIterations=40, Acceleration=True, RecalculateDerivatives=InDetFlags.doCosmics() or InDetFlags.doBeamHalo(), TRTExtensionCuts=True, TrackChi2PerNDFCut=10) ToolSvc += GX2TrackFitter ############################################################################### ###############################################################################
from TrkGlobalChi2Fitter.TrkGlobalChi2FitterConf import Trk__GlobalChi2Fitter from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigExtrapolator, InDetTrigNavigator, InDetTrigPropagator, InDetTrigRefitRotCreator,InDetTrigBroadInDetRotCreator, \ InDetTrigUpdator, InDetTrigMaterialUpdator, InDetTrigUpdator, InDetTrigMaterialUpdator from TrkDetDescrSvc.AtlasTrackingGeometrySvc import AtlasTrackingGeometrySvc FTK_TrackFitter = Trk__GlobalChi2Fitter( name='FTK_TrackFitter', ExtrapolationTool=InDetTrigExtrapolator, NavigatorTool=InDetTrigNavigator, PropagatorTool=InDetTrigPropagator, RotCreatorTool=InDetTrigRefitRotCreator, BroadRotCreatorTool=InDetTrigBroadInDetRotCreator, MeasurementUpdateTool=InDetTrigUpdator, TrackingGeometrySvc=AtlasTrackingGeometrySvc, MaterialUpdateTool=InDetTrigMaterialUpdator, StraightLine=False, OutlierCut=4, SignedDriftRadius=True, RecalibrateSilicon=True, RecalibrateTRT=True, ReintegrateOutliers=True, TrackChi2PerNDFCut=7, TRTExtensionCuts=False, MaxIterations=40, Acceleration=True, Momentum=1000., ) ToolSvc += FTK_TrackFitter print "added FTK_TrackFitter to ToolSvc" from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigExtrapolator, InDetTrigTrackSelectorTool, InDetTrigHoleSearchTool from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackSummaryToolSharedHits, InDetTrigPrdAssociationTool
ForwardKalmanFitterHandle=VP1FKF, KalmanSmootherHandle=VP1BKS, KalmanOutlierLogicHandle=VP1KOL, DynamicNoiseAdjustorHandle=VP1DNAdjustor, AlignableSurfaceProviderHandle=None) ToolSvc += VP1KalmanFitterDNA os.putenv("VP1_JOBCFG_EXTRA_VP1_FITTERS", VP1KalmanFitterDNA.name()) from TrkGlobalChi2Fitter.TrkGlobalChi2FitterConf import Trk__GlobalChi2Fitter VP1GlobalChi2Fitter = Trk__GlobalChi2Fitter( name='VP1GlobalChi2Fitter', ExtrapolationTool=VP1Extrapolator, NavigatorTool=VP1Navigator, PropagatorTool=VP1Propagator, RotCreatorTool=VP1RotCreator, MeasurementUpdateTool=VP1Updator, StraightLine=False, OutlierCut=3.0, SignedDriftRadius=True, RecalculateDerivatives=True) print VP1GlobalChi2Fitter ToolSvc += VP1GlobalChi2Fitter VP1GlobalChi2Fitter.OutputLevel = DEBUG os.putenv( "VP1_JOBCFG_EXTRA_VP1_FITTERS", "Trk::KalmanFitter/" + VP1KalmanFitter.name() + ";" + "Trk::KalmanFitter/" + VP1KalmanFitterDNA.name() + ";" + "Trk::GlobalChi2Fitter/" + VP1GlobalChi2Fitter.name())
from TrkGlobalChi2Fitter.TrkGlobalChi2FitterConf import Trk__GlobalChi2Fitter GlobalChi2FitterComb = Trk__GlobalChi2Fitter( name='GlobalChi2FitterComb', StraightLine=not jobproperties.BField.solenoidOn(), ExtrapolationTool=InDetExtrapolator, NavigatorTool=InDetNavigator, PropagatorTool=InDetPropagator, RotCreatorTool=InDetRotCreator, OutlierCut=5., ExternalMat=True, sortingReferencePoint=[0, 25000, 0]) ToolSvc += GlobalChi2FitterComb print GlobalChi2FitterComb from CombinedMuonRefit.CombinedMuonRefitConf import ReFitMuon MuonReFitTrack2 = ReFitMuon(name="CombMuonRefit", FitterTool=GlobalChi2FitterComb, Cosmics=True, IDTrackName="Tracks", MSTrackName="MooreTracks", matEffects=0, runOutlier=False, NewTrackName="Combined_Tracks", OutputLevel=3) topSequence += MuonReFitTrack2 print MuonReFitTrack2 #GlobalChi2FitterBarrel.OutputLevel=1
def __init__(self, name="ConfiguredFTK_DataProviderSvc"): print "In FTK_DataProviderSvc_Config.py" FTK_DataProviderSvc.__init__(self, name) # Track Fitter from TrkGlobalChi2Fitter.TrkGlobalChi2FitterConf import Trk__GlobalChi2Fitter from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigExtrapolator, InDetTrigNavigator, InDetTrigPropagator, InDetTrigRefitRotCreator,InDetTrigBroadInDetRotCreator, \ InDetTrigUpdator, InDetTrigMaterialUpdator, InDetTrigUpdator, InDetTrigMaterialUpdator from TrkDetDescrSvc.AtlasTrackingGeometrySvc import AtlasTrackingGeometrySvc from TrkDistributedKalmanFilter.DistributedKalmanFilter_Config import ConfiguredDistributedKalmanFilter FTK_TrackFitter = Trk__GlobalChi2Fitter( name="FTK_TrackFitter", ExtrapolationTool=InDetTrigExtrapolator, NavigatorTool=InDetTrigNavigator, PropagatorTool=InDetTrigPropagator, RotCreatorTool=InDetTrigRefitRotCreator, BroadRotCreatorTool=InDetTrigBroadInDetRotCreator, MeasurementUpdateTool=InDetTrigUpdator, TrackingGeometrySvc=AtlasTrackingGeometrySvc, MaterialUpdateTool=InDetTrigMaterialUpdator, StraightLine=False, OutlierCut=4, SignedDriftRadius=True, RecalibrateSilicon=True, RecalibrateTRT=True, ReintegrateOutliers=True, TrackChi2PerNDFCut=7, TRTExtensionCuts=False, MaxIterations=40, Acceleration=True, Momentum=1000., ) from AthenaCommon.AppMgr import ToolSvc print "printing FTK_TrackFitter configured with DKF" print FTK_TrackFitter ToolSvc += FTK_TrackFitter print "added FTK_TrackFitter to ToolSvc" from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigExtrapolator, InDetTrigTrackSelectorTool, InDetTrigHoleSearchTool from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackSummaryToolSharedHits, InDetTrigPrdAssociationTool from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool FTK_TrackSummaryHelperTool = InDet__InDetTrackSummaryHelperTool( name="FTK_TrackSummaryHelperTool", AssoTool=InDetTrigPrdAssociationTool, DoSharedHits=False, HoleSearch=InDetTrigHoleSearchTool, TestBLayerTool=None, PixelToTPIDTool=None, usePixel=True, useSCT=True, useTRT=False) ToolSvc += FTK_TrackSummaryHelperTool print "added FTK_TrackSummaryHelperTool to ToolSvc" from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool FTK_TrackSummaryTool = Trk__TrackSummaryTool( name="FTK_TrackSummaryTool", InDetSummaryHelperTool=FTK_TrackSummaryHelperTool, InDetHoleSearchTool=None, doSharedHits=False, TRT_ElectronPidTool=None) ToolSvc += FTK_TrackSummaryTool print "added FTK_TrackSummaryTool to ToolSvc" from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool FTK_TrackParticleCreatorTool = Trk__TrackParticleCreatorTool( name="FTK_ParticleCreatorTool", Extrapolator=InDetTrigExtrapolator, TrackSummaryTool=FTK_TrackSummaryTool, KeepParameters=True, ForceTrackSummaryUpdate= False, #summary update moved (in the slimmer now) ) ToolSvc += FTK_TrackParticleCreatorTool print FTK_TrackParticleCreatorTool print " added FTK_TrackParticleCreatorTool to ToolSvc" from TrigInDetConf.TrigInDetRecVtxTools import InDetTrigLinFactory, InDetTrigVxEdmCnv from TrigInDetConf.TrigInDetRecVtxTools import InDetTrigLinFactory, InDetTrigVxEdmCnv from TrkVertexSeedFinderTools.TrkVertexSeedFinderToolsConf import Trk__ZScanSeedFinder FTK_VtxSeedFinder = Trk__ZScanSeedFinder( name="FTK_ZScanSeedFinder" #Mode1dFinder = # default, no setting needed ) ToolSvc += FTK_VtxSeedFinder from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__ImpactPoint3dEstimator, Trk__DetAnnealingMaker FTK_ImpactPoint3dEstimator = Trk__ImpactPoint3dEstimator( name="FTK_TrkImpactPoint3dEstimator", Extrapolator=InDetTrigExtrapolator, ) ToolSvc += FTK_ImpactPoint3dEstimator FTK_AnnealingMaker = Trk__DetAnnealingMaker( name="FTK_TrkAnnealingMaker") FTK_AnnealingMaker.SetOfTemperatures = [64., 16., 4., 2., 1.5, 1.] # not default ToolSvc += FTK_AnnealingMaker from TrkVertexFitters.TrkVertexFittersConf import Trk__SequentialVertexSmoother FTK_VertexSmoother = Trk__SequentialVertexSmoother( name="FTK_SequentialVertexSmoother") ToolSvc += FTK_VertexSmoother from TrkVertexFitters.TrkVertexFittersConf import Trk__AdaptiveVertexFitter FTK_VxFitterTool = Trk__AdaptiveVertexFitter( name="FTK_AdaptiveVxFitterTool", SeedFinder=FTK_VtxSeedFinder, LinearizedTrackFactory=InDetTrigLinFactory, ImpactPoint3dEstimator=FTK_ImpactPoint3dEstimator, AnnealingMaker=FTK_AnnealingMaker, #TrackCompatibilityEstimator = VertexSmoother=FTK_VertexSmoother, #VertexUpdator = , #does not use any tools? #onlyzseed = , ) FTK_VxFitterTool.XAODConverter = InDetTrigVxEdmCnv ToolSvc += FTK_VxFitterTool from InDetPriVxFinderTool.InDetPriVxFinderToolConf import InDet__InDetIterativePriVxFinderTool FTK_PriVxFinderTool = InDet__InDetIterativePriVxFinderTool( name="FTK_PriVxFinderTool", VertexFitterTool=FTK_VxFitterTool, TrackSelector=InDetTrigTrackSelectorTool, SeedFinder=FTK_VtxSeedFinder, ImpactPoint3dEstimator=FTK_ImpactPoint3dEstimator, LinearizedTrackFactory=InDetTrigLinFactory, useBeamConstraint=True, significanceCutSeeding=12, maximumChi2cutForSeeding=49, maxVertices=200, InternalEdmFactory=InDetTrigVxEdmCnv) ToolSvc += FTK_PriVxFinderTool from FTK_DataProviderSvc.FTK_DataProviderSvcConf import FTK_UncertaintyTool theFTK_UncertaintyTool = FTK_UncertaintyTool( name="FTK_UncertaintyTool") ToolSvc += theFTK_UncertaintyTool from FTK_RecTools.FTK_RecToolsConf import FTK_VertexFinderTool FTK_RawVertexFinderTool = FTK_VertexFinderTool( name="FTK_RawVertexFinderTool", VertexInternalEdmFactory=InDetTrigVxEdmCnv) ToolSvc += FTK_RawVertexFinderTool self.TrackCollectionName = "FTK_TrackCollection" self.TrackParticleContainerName = "FTK_TrackParticleContainer" self.VxContainerName = "FTK_VxContainer" self.VertexContainerName = "FTK_VertexContainer" self.PixelTruthName = "FTK_PRD_MultiTruthPixel" self.SctTruthName = "FTK_PRD_MultiTruthSCT" self.PixelClusterContainerName = "FTK_PixelClusterContainer" self.SCT_ClusterContainerName = "FTK_SCT_ClusterContainer" self.TrackFitter = FTK_TrackFitter self.UncertaintyTool = theFTK_UncertaintyTool self.TrackSummaryTool = FTK_TrackSummaryTool self.TrackParticleCreatorTool = FTK_TrackParticleCreatorTool self.RawVertexFinderTool = FTK_RawVertexFinderTool self.VertexFinderTool = FTK_PriVxFinderTool from RecExConfig.RecFlags import rec self.doTruth = rec.doTruth() self.TrainingBeamspotX = 0.0 self.TrainingBeamspotY = 0.0 self.TrainingBeamspotZ = 0.0 self.TrainingBeamspotTiltX = 0.0 self.TrainingBeamspotTiltY = 0.0 self.PixelBarrelPhiOffsets = [0.0, 0.0, 0.0, 0.0] self.PixelBarrelEtaOffsets = [0.0, 0.0, 0.0, 0.0] self.PixelEndCapPhiOffsets = [0.0, 0.0, 0.0] self.PixelEndCapEtaOffsets = [0.0, 0.0, 0.0]