Ejemplo n.º 1
0
def DCMathSegmentMaker(name='DCMathSegmentMaker', extraFlags=None, **kwargs):
    beamType = getattr(extraFlags, "beamType", beamFlags.beamType())
    doSegmentT0Fit = getattr(extraFlags, "doSegmentT0Fit",
                             muonRecFlags.doSegmentT0Fit())
    updateSegmentSecondCoordinate = getattr(
        extraFlags, "updateSegmentSecondCoordinate",
        muonStandaloneFlags.updateSegmentSecondCoordinate())
    enableCurvedSegmentFinding = getattr(
        extraFlags, "enableCurvedSegmentFinding",
        muonStandaloneFlags.enableCurvedSegmentFinding())

    kwargs.setdefault("RefitSegment", True)
    kwargs.setdefault("AssumePointingPhi", beamType != 'cosmics')
    kwargs.setdefault("OutputFittedT0", True)
    kwargs.setdefault("DCFitProvider", "MdtSegmentT0Fitter")
    #kwargs.setdefault("CurvedErrorScaling", False)
    kwargs.setdefault("UsePreciseError", True)
    kwargs.setdefault("SinAngleCut", 0.4)

    #MDT conditions information not available online
    if (athenaCommonFlags.isOnline):
        kwargs.setdefault("MdtCondKey", "")

    # MuonCompetingClustersCreator apparently just takes default
    kwargs.setdefault("MuonClusterCreator",
                      getPrivateTool("MuonClusterOnTrackCreator"))

    if (beamType == 'singlebeam' or beamType == 'cosmics'):
        kwargs.setdefault("SinAngleCut", 0.9)
        kwargs.setdefault("AddUnassociatedPhiHits", True)
        kwargs.setdefault("RecoverBadRpcCabling", True)
        kwargs.setdefault("CurvedErrorScaling", False)
    elif globalflags.DataSource(
    ) == 'data':  # collisions real data or simulation first data
        kwargs.setdefault("AddUnassociatedPhiHits", True)
        kwargs.setdefault("RecoverBadRpcCabling", True)

    if doSegmentT0Fit:
        kwargs.setdefault(
            "MdtCreatorT0",
            getPrivateTool("MdtDriftCircleOnTrackCreatorAdjustableT0"))
        kwargs.setdefault("MdtSegmentFinder",
                          getPrivateTool("MdtMathT0FitSegmentFinder"))
    else:
        kwargs.setdefault("MdtSegmentFinder",
                          getPrivateTool("MdtMathSegmentFinder"))
    kwargs.setdefault("SegmentFitter",
                      getPrivateTool("MuonSegmentFittingTool"))
    kwargs.setdefault("SegmentSelector",
                      getPrivateTool("MuonSegmentSelectionTool"))

    if updateSegmentSecondCoordinate:
        kwargs.setdefault("UpdatePhiUsingPhiHits", True)

    if enableCurvedSegmentFinding:
        kwargs.setdefault("CurvedErrorScaling", False)
        kwargs.setdefault("PreciseErrorScale", 1)
        kwargs.setdefault("UsePreciseError", True)

    return CfgMgr.Muon__DCMathSegmentMaker(name, **kwargs)
Ejemplo n.º 2
0
def MdtMathSegmentFinder(name="MdtMathSegmentFinder",
                         extraFlags=None,
                         **kwargs):
    beamType = getattr(extraFlags, "beamType", beamFlags.beamType())
    doSegmentT0Fit = getattr(extraFlags, "doSegmentT0Fit",
                             muonRecFlags.doSegmentT0Fit())
    enableCurvedSegmentFinding = getattr(
        extraFlags, "enableCurvedSegmentFinding",
        muonStandaloneFlags.enableCurvedSegmentFinding())

    if doSegmentT0Fit:
        kwargs.setdefault("AssociationRoadWidth", 3.)
        kwargs.setdefault("MDTAssocationPullcut", 3.)
        kwargs.setdefault("RecoverMdtOutliers", False)
        kwargs.setdefault("DCFitProvider", "MdtSegmentT0Fitter")

    if beamType == 'singlebeam' or beamType == 'cosmics' or globalflags.DataSource(
    ) == 'data':
        kwargs.setdefault("AssociationRoadWidth", 2.)
        kwargs.setdefault("MDTAssocationPullcut", 4.)
        kwargs.setdefault("RecoverMdtOutliers", True)

    if enableCurvedSegmentFinding:
        kwargs.setdefault("DoCurvedSegmentFinder", True)

    return CfgMgr.Muon__MdtMathSegmentFinder(name, **kwargs)
Ejemplo n.º 3
0
def TMEF_CombinedMuonTrackBuilder(name='TMEF_CombinedMuonTrackBuilder',
                                  **kwargs):
    from MuonRecExample.MuonStandaloneFlags import muonStandaloneFlags
    kwargs.setdefault("CaloEnergyParam", "TMEF_CaloEnergyTool")
    kwargs.setdefault("CaloTSOS", "TMEF_CaloTrackStateOnSurface")
    kwargs.setdefault("CscRotCreator",
                      "")  # enabled with special version in Muid offline
    kwargs.setdefault("Fitter", "TMEF_iPatFitter")
    kwargs.setdefault("SLFitter", "TMEF_iPatSLFitter")
    kwargs.setdefault("MaterialAllocator", "TMEF_MaterialAllocator")
    kwargs.setdefault("MdtRotCreator", "MdtDriftCircleOnTrackCreator")
    kwargs.setdefault("MuonHoleRecovery", "")
    kwargs.setdefault("Propagator", "TMEF_Propagator")
    kwargs.setdefault("SLPropagator", "TMEF_Propagator")
    kwargs.setdefault("CleanCombined", True)
    kwargs.setdefault("CleanStandalone", True)
    kwargs.setdefault("BadFitChi2", 2.5)
    kwargs.setdefault("LargeMomentumError", 0.5)
    #kwargs.setdefault("LineMomentum", muonStandaloneFlags.straightLineFitMomentum())
    kwargs.setdefault("LowMomentum", 10. * GeV)
    kwargs.setdefault("MinEnergy", 0.3 * GeV)
    kwargs.setdefault("PerigeeAtSpectrometerEntrance", True)
    kwargs.setdefault("ReallocateMaterial", False)
    kwargs.setdefault("Vertex2DSigmaRPhi", 100. * mm)
    kwargs.setdefault("Vertex3DSigmaRPhi", 6. * mm)
    kwargs.setdefault("Vertex3DSigmaZ", 60. * mm)
    if not TriggerFlags.run2Config == '2016':
        kwargs.setdefault("MuonErrorOptimizer", '')

    # note - the TrackSummaryTool is done as follows offline:
    # import MuonCombinedRecExample.CombinedMuonTrackSummary
    # combinedMuonTrackBuilder.TrackSummaryTool = ToolSvc.CombinedMuonTrackSummary
    # should check our config is really ok here
    kwargs.setdefault("TrackSummaryTool", 'TMEF_TrackSummaryTool')

    # extra w.r.t. Muid Offline
    kwargs.setdefault("Cleaner", "TMEF_TrackCleaner")
    from MuonRecExample.MuonRecFlags import muonRecFlags
    if muonRecFlags.doSegmentT0Fit():
        kwargs.setdefault("MdtRotCreator", "")

    kwargs.setdefault("UseCaloTG", True)
    kwargs.setdefault("CaloMaterialProvider", "TMEF_TrkMaterialProviderTool")
    if muonRecFlags.enableErrorTuning():
        kwargs.setdefault(
            "MuonErrorOptimizer",
            CfgGetter.getPublicToolClone(
                "TMEF_MuidErrorOptimisationTool",
                "MuonErrorOptimisationTool",
                PrepareForFit=False,
                RecreateStartingParameters=False,
                RefitTool=CfgGetter.getPublicToolClone(
                    "TMEF_MuidRefitTool",
                    "MuonRefitTool",
                    AlignmentErrors=False,
                    Fitter=CfgGetter.getPublicTool("iPatFitter"))))

    return CfgMgr.Rec__CombinedMuonTrackBuilder(name, **kwargs)
Ejemplo n.º 4
0
def CombinedMuonTrackBuilder( name='CombinedMuonTrackBuilder', **kwargs ):
    import MuonCombinedRecExample.CombinedMuonTrackSummary
    from AthenaCommon.AppMgr    import ToolSvc
    kwargs.setdefault("CaloEnergyParam"               , getPublicTool("MuidCaloEnergyToolParam") )
    kwargs.setdefault("CaloTSOS"                      , getPublicTool("MuidCaloTrackStateOnSurface") )
    kwargs.setdefault("CscRotCreator"                 , getPublicTool("CscClusterOnTrackCreator") )
    kwargs.setdefault("Fitter"                        , getPublicTool("iPatFitter") )
    kwargs.setdefault("SLFitter"                      , getPublicTool("iPatSLFitter") )
    kwargs.setdefault("MaterialAllocator"             , getPublicTool("MuidMaterialAllocator") )
    kwargs.setdefault("MdtRotCreator"                 , getPublicTool("MdtDriftCircleOnTrackCreator") )
    kwargs.setdefault("MuonHoleRecovery"              , getPublicTool("MuidSegmentRegionRecoveryTool") )
    kwargs.setdefault("Propagator"                    , getPublicTool("MuonCombinedPropagator") )
    kwargs.setdefault("SLPropagator"                  , getPublicTool("MuonCombinedPropagator") )
    kwargs.setdefault("CleanCombined"                 , True )
    kwargs.setdefault("CleanStandalone"               , True )
    kwargs.setdefault("BadFitChi2"                    , 2.5 )
    kwargs.setdefault("LargeMomentumError"            , 0.5 )
    kwargs.setdefault("LineMomentum"                  , muonStandaloneFlags.straightLineFitMomentum() )
    kwargs.setdefault("LowMomentum"                   , 10.*GeV )
    kwargs.setdefault("MinEnergy"                     , 0.3*GeV )
    kwargs.setdefault("PerigeeAtSpectrometerEntrance" , False )
    kwargs.setdefault("ReallocateMaterial"            , False )
    kwargs.setdefault("Vertex2DSigmaRPhi"             , 100.*mm )
    kwargs.setdefault("Vertex3DSigmaRPhi"             , 6.*mm )
    kwargs.setdefault("Vertex3DSigmaZ"                , 60.*mm)
    kwargs.setdefault("TrackSummaryTool"              , ToolSvc.CombinedMuonTrackSummary )
    kwargs.setdefault("UseCaloTG"                     , True ) #
    
    if beamFlags.beamType() == 'cosmics':
        kwargs.setdefault("MdtRotCreator" ,  "" )
        kwargs.setdefault("LowMomentum"   ,  1.5*GeV )
        kwargs.setdefault("ReallocateMaterial", False )
        kwargs.setdefault("Vertex2DSigmaRPhi" , 100.*mm )
        kwargs.setdefault("Vertex3DSigmaRPhi" , 100.*mm )
        kwargs.setdefault("Vertex3DSigmaZ"    ,  1.*meter )

    # configure tools for data reprocessing 
    if muonRecFlags.enableErrorTuning():
       # use alignment effects on track for all algorithms

       useAlignErrs = True
       if conddb.dbdata == 'COMP200' or conddb.dbmc == 'COMP200' or 'HLT' in globalflags.ConditionsTag() or conddb.isOnline :
            useAlignErrs = False

       kwargs.setdefault("MuonErrorOptimizer", getPublicToolClone("MuidErrorOptimisationTool",
                                                                  "MuonErrorOptimisationTool",
                                                                  PrepareForFit              = False,
                                                                  RecreateStartingParameters = False,
                                                                  RefitTool = getPublicToolClone("MuidRefitTool",
                                                                                                 "MuonRefitTool",
                                                                  				 AlignmentErrors = useAlignErrs,
                                                                                                 Fitter = getPublicTool("iPatFitter"))))


    if muonRecFlags.doSegmentT0Fit():
        kwargs.setdefault("MdtRotCreator"                 , "" )
    getPublicTool("MuonCaloParticleCreator")
    return CfgMgr.Rec__CombinedMuonTrackBuilder(name,**kwargs)
Ejemplo n.º 5
0
def TMEF_TrackCleaner(name='TMEF_TrackCleaner', **kwargs):
    if TriggerFlags.run2Config == '2016':
        kwargs.setdefault('PullCut', 3.0)
        kwargs.setdefault('PullCutPhi', 3.0)
    else:
        kwargs.setdefault('PullCut', 4.0)
        kwargs.setdefault('PullCutPhi', 4.0)
    kwargs.setdefault("Fitter", "TMEF_iPatFitter")
    kwargs.setdefault("SLFitter", "TMEF_iPatSLFitter")
    if not TriggerFlags.run2Config == '2016':
        kwargs.setdefault("Iterate", False)
        kwargs.setdefault("RecoverOutliers", False)
    if muonRecFlags.doSegmentT0Fit():
        kwargs.setdefault("RecoverOutliers", False)
    return CfgMgr.Muon__MuonTrackCleaner(name, **kwargs)
Ejemplo n.º 6
0
def CombinedMuonTrackBuilderFit( name='CombinedMuonTrackBuilderFit', **kwargs ):
    import MuonCombinedRecExample.CombinedMuonTrackSummary
    from AthenaCommon.AppMgr    import ToolSvc
    kwargs.setdefault("CaloEnergyParam"               , getPublicTool("MuidCaloEnergyToolParam") )
    kwargs.setdefault("CaloTSOS"                      , getPublicTool("MuidCaloTrackStateOnSurface") )
    kwargs.setdefault("CscRotCreator"                 , getPublicTool("CscClusterOnTrackCreator") )
    kwargs.setdefault("Fitter"                        , getPublicTool("iPatFitter") )
    kwargs.setdefault("SLFitter"                      , getPublicTool("iPatSLFitter") )
    kwargs.setdefault("MaterialAllocator"             , getPublicTool("MuidMaterialAllocator") )
    kwargs.setdefault("MdtRotCreator"                 , getPublicTool("MdtDriftCircleOnTrackCreator") )
    kwargs.setdefault("Propagator"                    , getPublicTool("MuonCombinedPropagator") )
    kwargs.setdefault("SLPropagator"                  , getPublicTool("MuonCombinedPropagator") )
    kwargs.setdefault("CleanCombined"                 , True )
    kwargs.setdefault("CleanStandalone"               , True )
    kwargs.setdefault("BadFitChi2"                    , 2.5 )
    kwargs.setdefault("LargeMomentumError"            , 0.5 )
    kwargs.setdefault("LineMomentum"                  , muonStandaloneFlags.straightLineFitMomentum() )
    kwargs.setdefault("LowMomentum"                   , 10.*GeV )
    kwargs.setdefault("MinEnergy"                     , 0.3*GeV )
    kwargs.setdefault("PerigeeAtSpectrometerEntrance" , True )
    kwargs.setdefault("ReallocateMaterial"            , False )
    kwargs.setdefault("Vertex2DSigmaRPhi"             , 100.*mm )
    kwargs.setdefault("Vertex3DSigmaRPhi"             , 6.*mm )
    kwargs.setdefault("Vertex3DSigmaZ"                , 60.*mm)
    kwargs.setdefault("TrackSummaryTool"              , ToolSvc.CombinedMuonTrackSummary )
    kwargs.setdefault("UseCaloTG"                     , False )

    if beamFlags.beamType() == 'cosmics':
        kwargs.setdefault("MdtRotCreator" ,  "" )
        kwargs.setdefault("LowMomentum"   ,  1.5*GeV )
        kwargs.setdefault("ReallocateMaterial", False )
        kwargs.setdefault("Vertex2DSigmaRPhi" , 100.*mm )
        kwargs.setdefault("Vertex3DSigmaRPhi" , 100.*mm )
        kwargs.setdefault("Vertex3DSigmaZ"    ,  1.*meter )

    if muonRecFlags.doSegmentT0Fit():
        kwargs.setdefault("MdtRotCreator"                 , "" )

    getPublicTool("MuonCaloParticleCreator")
    return CfgMgr.Rec__CombinedMuonTrackBuilder(name,**kwargs)
Ejemplo n.º 7
0
def CombinedMuonTrackBuilder( name='CombinedMuonTrackBuilder', **kwargs ):
    from AthenaCommon.AppMgr import ToolSvc
    kwargs.setdefault("CaloEnergyParam"               , getPublicTool("MuidCaloEnergyToolParam") )
    kwargs.setdefault("CaloTSOS"                      , getPublicTool("MuidCaloTrackStateOnSurface") )
    kwargs.setdefault("MaterialAllocator"             , getPublicTool("MuidMaterialAllocator") )
    kwargs.setdefault("MdtRotCreator"                 , getPublicTool("MdtDriftCircleOnTrackCreator") )
    kwargs.setdefault("CleanCombined"                 , True )
    kwargs.setdefault("CleanStandalone"               , True )
    kwargs.setdefault("BadFitChi2"                    , 2.5 )
    kwargs.setdefault("LargeMomentumError"            , 0.5 )
    kwargs.setdefault("LineMomentum"                  , muonStandaloneFlags.straightLineFitMomentum() )
    kwargs.setdefault("LowMomentum"                   , 10.*GeV )
    kwargs.setdefault("MinEnergy"                     , 0.3*GeV )
    kwargs.setdefault("PerigeeAtSpectrometerEntrance" , False )
    kwargs.setdefault("ReallocateMaterial"            , False )
    kwargs.setdefault("Vertex2DSigmaRPhi"             , 100.*mm )
    kwargs.setdefault("Vertex3DSigmaRPhi"             , 6.*mm )
    kwargs.setdefault("Vertex3DSigmaZ"                , 60.*mm)
    kwargs.setdefault("UseCaloTG"                     , True ) #
    kwargs.setdefault("CaloMaterialProvider"          , getPublicTool("MuonMaterialProviderTool"))
    kwargs.setdefault("TrackQuery"                    , getPrivateTool("MuonTrackQuery") )

    if TriggerFlags.MuonSlice.doTrigMuonConfig:
        kwargs.setdefault("MuonHoleRecovery"              , "" )
        trigTrackSummary = getPublicToolClone("TrigMuonTrackSummary", "MuonTrackSummaryTool")
        if DetFlags.detdescr.ID_on():
            from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackSummaryHelperTool
            trigTrackSummary.InDetSummaryHelperTool = InDetTrigTrackSummaryHelperTool
            trigTrackSummary.doHolesInDet = True
        kwargs.setdefault("TrackSummaryTool"              , trigTrackSummary )

        kwargs.setdefault("Propagator"                    , ToolSvc.AtlasRungeKuttaPropagator)
        kwargs.setdefault("SLPropagator"                  , ToolSvc.AtlasRungeKuttaPropagator)

        #The trigger uses the iPatFitter in different sequences that do and do not include ID tracking
        #so using the same track summary tool as is used here to get it correct
        trackSummary = kwargs["TrackSummaryTool"]
        suffix = "MS"
        if "Trig" in trackSummary.name():
            suffix = "CB"
        kwargs.setdefault("Fitter"                        , getPublicToolClone("TrigiPatFitter_"+suffix, "iPatFitter", TrackSummaryTool=trackSummary) )
        kwargs.setdefault("SLFitter"                      , getPublicToolClone("TrigiPatSLFitter_"+suffix, "iPatSLFitter", TrackSummaryTool=trackSummary) )
        kwargs.setdefault("MuonErrorOptimizer", "")
        kwargs.setdefault("CscRotCreator"                 , "" )
        kwargs.setdefault("Cleaner"                       , getPrivateToolClone("TrigMuidTrackCleaner_"+suffix, "MuidTrackCleaner", Fitter=kwargs["Fitter"]) )
    else:
        import MuonCombinedRecExample.CombinedMuonTrackSummary
        kwargs.setdefault("MuonHoleRecovery"              , getPublicTool("MuidSegmentRegionRecoveryTool") )
        kwargs.setdefault("TrackSummaryTool"              , ToolSvc.CombinedMuonTrackSummary )
        kwargs.setdefault("Propagator"                    , getPublicTool("MuonCombinedPropagator") )
        kwargs.setdefault("SLPropagator"                  , getPublicTool("MuonCombinedPropagator") )
        kwargs.setdefault("Fitter"                        , getPublicTool("iPatFitter") )
        kwargs.setdefault("SLFitter"                      , getPublicTool("iPatSLFitter") )
        kwargs.setdefault("CscRotCreator"                 , (getPublicTool("CscClusterOnTrackCreator") if MuonGeometryFlags.hasCSC() else "") )
        kwargs.setdefault("Cleaner"                       , getPrivateTool("MuidTrackCleaner") )


    if beamFlags.beamType() == 'cosmics':
        kwargs.setdefault("MdtRotCreator" ,  "" )
        kwargs.setdefault("LowMomentum"   ,  1.5*GeV )
        kwargs.setdefault("ReallocateMaterial", False )
        kwargs.setdefault("Vertex2DSigmaRPhi" , 100.*mm )
        kwargs.setdefault("Vertex3DSigmaRPhi" , 100.*mm )
        kwargs.setdefault("Vertex3DSigmaZ"    ,  1.*meter )

    # configure tools for data reprocessing 
    if muonRecFlags.enableErrorTuning():
       # use alignment effects on track for all algorithms

       useAlignErrs = True
       if conddb.dbdata == 'COMP200' or conddb.dbmc == 'COMP200' or 'HLT' in globalflags.ConditionsTag() or conddb.isOnline or TriggerFlags.MuonSlice.doTrigMuonConfig:
            useAlignErrs = False

       kwargs.setdefault("MuonErrorOptimizer", getPublicToolClone("MuidErrorOptimisationTool",
                                                                  "MuonErrorOptimisationTool",
                                                                  PrepareForFit              = False,
                                                                  RecreateStartingParameters = False,
                                                                  RefitTool = getPublicToolClone("MuidRefitTool", "MuonRefitTool", AlignmentErrors = useAlignErrs, Fitter = getPublicTool("iPatFitter"))
                                                                  ))


    if muonRecFlags.doSegmentT0Fit():
        kwargs.setdefault("MdtRotCreator"                 , "" )
    getPublicTool("MuonCaloParticleCreator")
    return CfgMgr.Rec__CombinedMuonTrackBuilder(name,**kwargs)
Ejemplo n.º 8
0
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,