def vertexFitterTool_builder( signature, linearTrackFactory, extrapolator ) : from AthenaCommon.AppMgr import ToolSvc from TrkVertexBilloirTools.TrkVertexBilloirToolsConf import Trk__FastVertexFitter vertexFitterTool = Trk__FastVertexFitter( name = "InDetTrigFastVertexFitterTool" + signature, LinearizedTrackFactory = linearTrackFactory, Extrapolator = extrapolator ) ToolSvc += vertexFitterTool return vertexFitterTool
print TrkV0Fitter #------------------------------------------------------------------------------ # Load linearized track factory #------------------------------------------------------------------------------ from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory InDetLinFactory = Trk__FullLinearizedTrackFactory(name = 'InDetFullLinearizedTrackFactory', Extrapolator = InDetExtrapolator, MagneticFieldTool = InDetMagField) ToolSvc += InDetLinFactory print InDetLinFactory from TrkVertexBilloirTools.TrkVertexBilloirToolsConf import Trk__FastVertexFitter InDetFastVxFitterTool = Trk__FastVertexFitter(name = 'InDetFastVertexFitterTool', LinearizedTrackFactory = InDetLinFactory, Extrapolator = InDetExtrapolator) ToolSvc += InDetFastVxFitterTool print InDetFastVxFitterTool from TrkVertexBilloirTools.TrkVertexBilloirToolsConf import Trk__FullVertexFitter InDetFullVxFitterTool = Trk__FullVertexFitter(name = 'InDetFullVertexFitterTool', LinearizedTrackFactory = InDetLinFactory, Extrapolator = InDetExtrapolator) ToolSvc += InDetFullVxFitterTool print InDetFullVxFitterTool #------------------------------------------------------------------------------ # Primary vertex refitting #------------------------------------------------------------------------------
##eta=0.0..0.5 0.5..1.5 1.5..2.5 0.9000, 0.8593, 0.9034, ## pt=-5 .. 30 0.9208, 0.8791, 0.9132, ## pt=30 .. 40 0.9359, 0.9231, 0.9033 ## pt=40 .. 1000 ] TrigTauRec_h5_EF.TrigTauCalibrate.FudgeFactor = 1.011 # Cut values in TrigTauCuts to select tau's #TrigTauRec_h5_EF.TrigTauCuts.NumTrackMin = 1 # Min. number tracks #TrigTauRec_h5_EF.TrigTauCuts.NumTrackMax = 3 # Max. number tracks #TrigTauRec_h5_EF.TrigTauCuts.EMRadiusMax = 0.15 # Max. EM radius #TrigTauRec_h5_EF.TrigTauCuts.IsolationFracMax = 0.3 # Max. isolation fraction #TrigTauRec_h5_EF.TrigTauCuts.EMFractionMin = 0.6 # Min. fraction of Et in the EM layers #TrigTauRec_h5_EF.TrigTauCuts.PtMaxTrackMin = 10000.0 # Min. Pt of the hardest track TrigTauRec_h5_EF.TrigTauTracks.tauRecTTCExtrapolator.Extrapolator='Trk::Extrapolator/InDetExtrapolator' TrigTauRec_h5_EF.TrigTauTracks.tauRecTTCExtrapolator.CaloDepthTool.DepthChoice = "entrance" from TrkVertexBilloirTools.TrkVertexBilloirToolsConf import Trk__FastVertexFitter TauRecFitterTool = Trk__FastVertexFitter( Extrapolator = "Trk::Extrapolator/InDetExtrapolator" ) ToolSvc += TauRecFitterTool print TauRecFitterTool
def GeneralVertexer(system='Combined', setup=None, tracksName=None, suffix=""): """ attempt to make a simple tool for any type of combination of vertexing """ ToolSvc = Service('ToolSvc') hasPix = True if system in ['Combined', 'Pix', 'Resolved'] else False hasSCT = True if system in ['Combined', 'SCT', 'Resolved'] else False hasTRT = True if system in ['Combined', 'TRT'] else False nHitBLayer = InDetPrimaryVertexingCuts.nHitBLayer() if hasPix else 0 nHitPix = InDetPrimaryVertexingCuts.nHitPix() if hasPix else 0 nHitBLayerPlusPix = InDetPrimaryVertexingCuts.nHitBLayerPlusPix( ) if hasPix else 0 nHitSct = InDetPrimaryVertexingCuts.nHitSct() if hasSCT else 0 nHitSi = InDetPrimaryVertexingCuts.nHitSi() if hasSCT else 0 nHitTrt = InDetPrimaryVertexingCuts.nHitTrt() if hasTRT else 0 vxSetup = InDetFlags.primaryVertexSetup() if setup == None else setup print "JW: Setup is: ", system, hasPix, hasSCT, hasTRT, tracksName, setup, vxSetup #Extras try: InDetTrackZ0SortingTool = ToolSvc.InDetTrackZ0SortingTool except: from InDetMultipleVertexSeedFinderUtils.InDetMultipleVertexSeedFinderUtilsConf import InDet__InDetTrackZ0SortingTool InDetTrackZ0SortingTool = InDet__InDetTrackZ0SortingTool( name="InDetTrackZ0SortingTool") ToolSvc += InDetTrackZ0SortingTool if (InDetFlags.doPrintConfigurables()): print InDetTrackZ0SortingTool try: InDetSlidingWindowMultiSeedFinder = ToolSvc.InDetSlidingWindowMultiSeedFinder except: from InDetMultipleVertexSeedFinder.InDetMultipleVertexSeedFinderConf import InDet__SlidingWindowMultiSeedFinder InDetSlidingWindowMultiSeedFinder = InDet__SlidingWindowMultiSeedFinder( name="InDetSlidingWindowMultiSeedFinder", clusterLength=5. * mm, TrackSelector=InDetTrackSelectorTool, Extrapolator=InDetExtrapolator, SortingTool=InDetTrackZ0SortingTool, #UseMaxInCluster = True ) ToolSvc += InDetSlidingWindowMultiSeedFinder #Load additional fitters: try: InDetVKalVrtFitter = ToolSvc.InDetVKalVrtFitter print " JW Found InDetVKalVrtFitter" except: print " JW no InDetVKalVrtFitter" from TrkVKalVrtFitter.TrkVKalVrtFitterConf import Trk__TrkVKalVrtFitter InDetVKalVrtFitter = Trk__TrkVKalVrtFitter(name="InDetVKalVrtFitter") ToolSvc += InDetVKalVrtFitter if (InDetFlags.doPrintConfigurables()): print InDetVKalVrtFitter try: InDetVxFitterToolFastFinder = ToolSvc.InDetVxFitterToolFastFinder print " JW: found InDetVxFitterToolFastFinder" except: print "JW no InDetVxFitterToolFastFinder" from TrkVertexBilloirTools.TrkVertexBilloirToolsConf import Trk__FastVertexFitter InDetVxFitterToolFastFinder = Trk__FastVertexFitter( name="InDetVxFitterToolFastFinder", LinearizedTrackFactory=InDetLinFactory, Extrapolator=InDetExtrapolator) ToolSvc += InDetVxFitterToolFastFinder if (InDetFlags.doPrintConfigurables()): print InDetVxFitterToolFastFinder try: InDetVxFitterToolFullFinder = ToolSvc.InDetVxFitterToolFullFinder print "JW found InDetVxFitterToolFullFinder" except: print "JW no InDetVxFitterToolFullFinder" from TrkVertexBilloirTools.TrkVertexBilloirToolsConf import Trk__FullVertexFitter InDetVxFitterToolFullFinder = Trk__FullVertexFitter( name="InDetVxFitterToolFullFinder", LinearizedTrackFactory=InDetLinFactory, Extrapolator=InDetExtrapolator) ToolSvc += InDetVxFitterToolFullFinder if (InDetFlags.doPrintConfigurables()): print InDetVxFitterToolFullFinder try: print "JW Found InDetVxFitterToolSequential" except: print "JW no InDetVxFitterToolSequential" from TrkVertexFitters.TrkVertexFittersConf import Trk__SequentialVertexSmoother InDetVertexSmoother = Trk__SequentialVertexSmoother( name="InDetVertexSmoother") ToolSvc += InDetVertexSmoother if (InDetFlags.doPrintConfigurables()): print InDetVertexSmoother from TrkVertexFitters.TrkVertexFittersConf import Trk__SequentialVertexFitter InDetVxFitterToolSequential = Trk__SequentialVertexFitter( name="InDetSequentialVxFitterTool", LinearizedTrackFactory=InDetLinFactory, VertexSmoother=InDetVertexSmoother #VertexUpdator = # no setting required ) ToolSvc += InDetVxFitterToolSequential if (InDetFlags.doPrintConfigurables()): print InDetVxFitterToolSequential from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetDetailedTrackSelectorTool InDetTrackSelectorTool_vx = InDet__InDetDetailedTrackSelectorTool( name="InDetDetailedTrackSelectorTool_" + system + "_" + vxSetup + suffix, pTMin=InDetPrimaryVertexingCuts.minPT(), IPd0Max=InDetPrimaryVertexingCuts.IPd0Max(), IPz0Max=InDetPrimaryVertexingCuts.IPz0Max(), z0Max=InDetPrimaryVertexingCuts.z0Max(), sigIPd0Max=InDetPrimaryVertexingCuts.sigIPd0Max(), sigIPz0Max=InDetPrimaryVertexingCuts.sigIPz0Max(), d0significanceMax=InDetPrimaryVertexingCuts.d0significanceMax(), z0significanceMax=InDetPrimaryVertexingCuts.z0significanceMax(), etaMax=InDetPrimaryVertexingCuts.etaMax(), useTrackSummaryInfo=InDetPrimaryVertexingCuts.useTrackSummaryInfo(), nHitBLayer=nHitBLayer, nHitPix=nHitPix, nHitBLayerPlusPix=nHitBLayerPlusPix, nHitSct=nHitSct, nHitSi=nHitSi, nHitTrt=nHitTrt, nHitTrtHighEFractionMax=InDetPrimaryVertexingCuts. nHitTrtHighEFractionMax(), nHitTrtHighEFractionWithOutliersMax=InDetPrimaryVertexingCuts. nHitTrtHighEFractionWithOutliersMax(), useSharedHitInfo=InDetPrimaryVertexingCuts.useSharedHitInfo(), useTrackQualityInfo=InDetPrimaryVertexingCuts.useTrackQualityInfo(), fitChi2OnNdfMax=InDetPrimaryVertexingCuts.fitChi2OnNdfMax(), TrtMaxEtaAcceptance=InDetPrimaryVertexingCuts.TrtMaxEtaAcceptance(), TrackSummaryTool=InDetTrackSummaryTool, Extrapolator=InDetExtrapolator) ToolSvc += InDetTrackSelectorTool_vx if (InDetFlags.doPrintConfigurables()): print InDetTrackSelectorTool_vx # ----------------------------------------- # # ----- load primary vertex finder tool # # ----------------------------------------- if (not (vxSetup == 'AdaptiveFinding') and not (vxSetup == 'AdaptiveMultiFinding') and not (vxSetup == 'DefaultVKalVrtFinding') and not (vxSetup == 'InDetPriVxFinderFullFinder') and not (vxSetup == 'InDetPriVxFinderFastFinder')): # # --- load primary vertex finder tool # from InDetPriVxFinderTool.InDetPriVxFinderToolConf import InDet__InDetPriVxFinderTool InDetPriVxFinderTool_vx = InDet__InDetPriVxFinderTool( name="InDetPriVxFinderTool_" + system + "_" + vxSetup + suffix, PriVxSeedFinder=InDetMultiSeedFinder, TrackSelector=InDetTrackSelectorTool_vx, VertexFitterTool=InDetVxFitterTool, chi2CutMethod=2, useBeamConstraint=InDetFlags.useBeamConstraint()) if jobproperties.Beam.numberOfCollisions( ) > 2.0: # 900 GeV running at "zero lumi" has 2.0 for this variable InDetPriVxFinderTool_vx.enableMultipleVertices = 1 else: InDetPriVxFinderTool_vx.enableMultipleVertices = 0 if rec.Commissioning(): InDetPriVxFinderTool_vx.maxChi2PerTrack = 15. elif vxSetup == 'AdaptiveFinding': # # --- load adaptive primary vertex finder # from InDetPriVxFinderTool.InDetPriVxFinderToolConf import InDet__InDetIterativePriVxFinderTool InDetPriVxFinderTool_vx = InDet__InDetIterativePriVxFinderTool( name="InDetIterativePriVxFinderTool_" + system + "_" + vxSetup + suffix, VertexFitterTool=InDetVxFitterTool, TrackSelector=InDetTrackSelectorTool_vx, SeedFinder=InDetVtxSeedFinder, ImpactPoint3dEstimator=InDetImpactPoint3dEstimator, LinearizedTrackFactory=InDetLinFactory, useBeamConstraint=InDetFlags.useBeamConstraint(), significanceCutSeeding=12, maximumChi2cutForSeeding=49, maxVertices=25) elif vxSetup == 'AdaptiveMultiFinding': # # --- load adaptive multi primary vertex finder # from InDetPriVxFinderTool.InDetPriVxFinderToolConf import InDet__InDetAdaptiveMultiPriVxFinderTool InDetPriVxFinderTool_vx = InDet__InDetAdaptiveMultiPriVxFinderTool( name="InDetAdaptiveMultiPriVxFinderTool_" + system + "_" + vxSetup + suffix, SeedFinder=InDetVtxSeedFinder, VertexFitterTool=InDetVxFitterTool, TrackSelector=InDetTrackSelectorTool_vx, useBeamConstraint=InDetFlags.useBeamConstraint(), selectiontype=0, do3dSplitting=InDetFlags.doPrimaryVertex3DFinding()) #Add additional finder tools elif vxSetup == 'InDetPriVxFinderFastFinder': # not the official name from InDetPriVxFinderTool.InDetPriVxFinderToolConf import InDet__InDetPriVxFinderTool InDetPriVxFinderTool_vx = InDet__InDetPriVxFinderTool( name="InDetPriVxFinderToolFastFinder_" + system + "_" + vxSetup + suffix, VertexFitterTool=InDetVxFitterToolFastFinder, PriVxSeedFinder=InDetSlidingWindowMultiSeedFinder, TrackSelector=InDetTrackSelectorTool_vx, useBeamConstraint=InDetFlags.useBeamConstraint()) if jobproperties.Beam.zeroLuminosity(): InDetPriVxFinderTool_vx.enableMultipleVertices = 0 else: InDetPriVxFinderTool_vx.enableMultipleVertices = 1 elif vxSetup == 'InDetPriVxFinderFullFinder': from InDetPriVxFinderTool.InDetPriVxFinderToolConf import InDet__InDetPriVxFinderTool InDetPriVxFinderTool_vx = InDet__InDetPriVxFinderTool( name="InDetPriVxFinderToolFullFinder_" + system + "_" + vxSetup + suffix, VertexFitterTool=InDetVxFitterToolFullFinder, PriVxSeedFinder=InDetSlidingWindowMultiSeedFinder, TrackSelector=InDetTrackSelectorTool_vx, useBeamConstraint=InDetFlags.useBeamConstraint()) if jobproperties.Beam.zeroLuminosity(): InDetPriVxFinderTool_vx.enableMultipleVertices = 0 else: InDetPriVxFinderTool_vx.enableMultipleVertices = 1 ToolSvc += InDetPriVxFinderTool_vx if (InDetFlags.doPrintConfigurables()): print InDetPriVxFinderTool_vx from InDetPriVxFinder.InDetPriVxFinderConf import InDet__InDetPriVxFinder InDetPriVxFinder_vx = InDet__InDetPriVxFinder( name="InDetPriVxFinder_" + system + "_" + vxSetup, VertexFinderTool=InDetPriVxFinderTool_vx, TracksName=tracksName, VxCandidatesOutputName=InDetKeys.PrimaryVertices() + "_" + system + "_" + vxSetup + suffix, VertexCollectionSortingTool=VertexCollectionSortingTool, doVertexSorting=doSorting, OutputLevel=DEBUG) from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() topSequence += InDetPriVxFinder_vx pvFinders.append(InDetPriVxFinder_vx) primaryVertices.append(InDetPriVxFinder_vx.VxCandidatesOutputName) if InDetFlags.doPrintConfigurables(): print InDetPriVxFinder_vx Stream.AddItem([ 'VxContainer#' + InDetKeys.PrimaryVertices() + "_" + system + "_" + vxSetup + suffix ]) return (InDetTrackSelectorTool_vx, InDetPriVxFinderTool_vx, InDetPriVxFinder_vx)
def __init__(self, name="TrigVxPrimaryAllTESG_Electron_EF", type="electron"): super(InDet__TrigVxPrimaryAllTE, self).__init__(name) from AthenaCommon.AppMgr import ToolSvc from AthenaCommon.GlobalFlags import GlobalFlags from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags import AthenaCommon.SystemOfUnits as Units from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigExtrapolator, InDetTrigTrackSelectorTool from InDetTrigRecExample.InDetTrigConfigRecLoadToolsPost import InDetTrigLinFactory from InDetMultipleVertexSeedFinderUtils.InDetMultipleVertexSeedFinderUtilsConf import InDet__InDetTrackZ0SortingTool InDetTrackZ0SortingTool = InDet__InDetTrackZ0SortingTool( name="InDetTrigTrackZ0SortingTool_SG") ToolSvc += InDetTrackZ0SortingTool from TrkVertexSeedFinderUtils.TrkVertexSeedFinderUtilsConf import Trk__Trk2dDistanceSeeder Trk2dDistanceSeeder = Trk__Trk2dDistanceSeeder( name="TrigTrk2dDistanceSeederFor2D_SG", SolveAmbiguityUsingZ=False) ToolSvc += Trk2dDistanceSeeder from TrkVertexSeedFinderUtils.TrkVertexSeedFinderUtilsConf import Trk__Trk2DDistanceFinder Trk2DDistanceFinder = Trk__Trk2DDistanceFinder( name="TrigTrk2DDistanceFinder_SG", Trk2dDistanceSeeder=Trk2dDistanceSeeder) ToolSvc += Trk2DDistanceFinder from TrkVertexSeedFinderTools.TrkVertexSeedFinderToolsConf import Trk__CrossDistancesSeedFinder InDet2DVtxSeedFinder = Trk__CrossDistancesSeedFinder( name="InDetTrig2DCrossDistancesSeedFinder_SG", TrkDistanceFinder=Trk2DDistanceFinder, trackdistcutoff=1., trackdistexppower=2, useweights=True #Mode1dFinder = # default, no setting needed ) ToolSvc += InDet2DVtxSeedFinder from TrkVertexBilloirTools.TrkVertexBilloirToolsConf import Trk__FastVertexFitter InDetVxFitterTool = Trk__FastVertexFitter( name="InDetTrigFastVertexFitterTool_SG", LinearizedTrackFactory=InDetTrigLinFactory, Extrapolator=InDetTrigExtrapolator) ToolSvc += InDetVxFitterTool from InDetMultipleVertexSeedFinder.InDetMultipleVertexSeedFinderConf import InDet__SlidingWindowMultiSeedFinder InDetMultiSeedFinder = InDet__SlidingWindowMultiSeedFinder( name="InDetTrigSlidingWindowMultiSeedFinder_SG", clusterLength=5. * Units.mm, TrackSelector=InDetTrigTrackSelectorTool, Extrapolator=InDetTrigExtrapolator, SortingTool=InDetTrackZ0SortingTool, #UseMaxInCluster = True ) ToolSvc += InDetMultiSeedFinder from InDetPriVxFinderTool.InDetPriVxFinderToolConf import InDet__InDetPriVxFinderTool InDetTrigPriVxFinderTool = InDet__InDetPriVxFinderTool( name="InDetTrigPriVxFinderTool_SG", PriVxSeedFinder=InDetMultiSeedFinder, TrackSelector=InDetTrigTrackSelectorTool, VertexFitterTool=InDetVxFitterTool, #maxChi2PerTrack = InDetPrimaryVertexingCuts.MaxChi2PerTrack(), #chi2CutMethod = InDetPrimaryVertexingCuts.chi2CutMethod(), enableMultipleVertices=True, useBeamConstraint=True) ToolSvc += InDetTrigPriVxFinderTool self.VertexFinderTool = InDetTrigPriVxFinderTool self.RunWithoutField = False self.RetrieveTracksFromSG = True self.TrackCollectionFromSG = "FTKConv_Trk_Tracks" #monitoring from InDetTrigPriVxFinder.InDetTrigPriVxFinderMonitoring import InDetTrigPriVxFinderValidationMonitor from InDetTrigPriVxFinder.InDetTrigPriVxFinderMonitoring import InDetTrigPriVxFinderOnlineMonitor from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig vxtime = TrigTimeHistToolConfig("VxTime") vxtime.TimerHistLimits = [0, 100] from InDetTrigRecExample.InDetTrigSliceSettings import InDetTrigSliceSettings if InDetTrigSliceSettings[('doFullScan', type)]: vxtime.TimerHistLimits = [0, 400] self.AthenaMonTools = [ InDetTrigPriVxFinderValidationMonitor( name="InDetTrigPriVxFinderAllTEOnlineMonitor"), InDetTrigPriVxFinderOnlineMonitor( name="InDetTrigPriVxFinderAllTEValidationMonitor"), vxtime ]
InDetTrigVxFitterTool = \ Trk__AdaptiveMultiVertexFitter(name= "InDetTrigAdaptiveMultiVertexFitter", LinearizedTrackFactory = InDetTrigLinFactory, ImpactPoint3dEstimator = InDetTrigImpactPoint3dEstimator, AnnealingMaker = InDetTrigAnnealingMaker, VertexSmoother = InDetTrigSequentialVertexSmoother, DoSmoothing = True) # false is default else: # load fast vertex finding tool and configure it # from TrkVertexBilloirTools.TrkVertexBilloirToolsConf import Trk__FastVertexFitter InDetTrigVxFitterTool = Trk__FastVertexFitter( name="InDetTrigVxFitterTool", LinearizedTrackFactory=InDetTrigLinFactory, Extrapolator=InDetTrigExtrapolator) ToolSvc += InDetTrigVxFitterTool if (InDetTrigFlags.doPrintConfigurables()): print(InDetTrigVxFitterTool) from InDetMultipleVertexSeedFinderUtils.InDetMultipleVertexSeedFinderUtilsConf import InDet__InDetTrackZ0SortingTool InDetTrigTrackZ0SortingTool = InDet__InDetTrackZ0SortingTool( name="InDetTrigTrackZ0SortingTool") ToolSvc += InDetTrigTrackZ0SortingTool if (InDetTrigFlags.doPrintConfigurables()): print(InDetTrigTrackZ0SortingTool) if (not InDetTrigFlags.useBeamConstraint()): from TrkVertexSeedFinderUtils.TrkVertexSeedFinderUtilsConf import Trk__Trk2dDistanceSeeder