Exemplo n.º 1
0
    def __init__(self,name="MooSegmentFinder",**kwargs):

        kwargs.setdefault( "SegmentCombiner", "MuonCurvedSegmentCombiner" )
        kwargs.setdefault( "SegmentCombinationCleaner", "MuonSegmentCombinationCleanerTool" )
        if( muonStandaloneFlags.reconstructionMode() == 'collisions'): 
            kwargs.setdefault( "HoughPatternFinder", "MuonLayerHoughTool" )
        else:
            kwargs.setdefault( "HoughPatternFinder", "MuonHoughPatternFinderTool" )

        kwargs.setdefault( "MdtSegmentMaker", "MuonPatternSegmentMaker" )
        kwargs.setdefault( "DoSegmentCombinations", False )
        kwargs.setdefault( "DoSegmentCombinationCleaning", False )
        kwargs.setdefault( "DoCscSegments", muonRecFlags.doCSCs() )
        kwargs.setdefault( "DoMdtSegments", muonRecFlags.doMDTs() )
        if muonRecFlags.doCSCs():
            kwargs.setdefault( "Csc2dSegmentMaker","Csc2dSegmentMaker" )
            kwargs.setdefault( "Csc4dSegmentMaker", "Csc4dSegmentMaker" )
        else:
            kwargs.setdefault( "Csc2dSegmentMaker", None )
            kwargs.setdefault( "Csc4dSegmentMaker", None )
        if muonStandaloneFlags.printSummary():
            kwargs.setdefault( "DoSummary", True )

        self.applyUserDefaults(kwargs,name)
        # set some defaults

        # call the base class ctor
        super(MooSegmentCombinationFinder,self).__init__(name,**kwargs)
Exemplo n.º 2
0
def MuonHoughPatternFinderTool(name="MuonHoughPatternFinderTool",**kwargs): 
    getPublicTool("MuonCombinePatternTool") 
    getPublicTool("MuonHoughPatternTool") 
    if muonStandaloneFlags.reconstructionMode() == 'collisions':  
        kwargs.setdefault("MDT_TDC_cut", False)
        kwargs.setdefault("RecordAll",False)
    return CfgMgr.Muon__MuonHoughPatternFinderTool(name,**kwargs) 
Exemplo n.º 3
0
def AdjustableT0Tool(name="AdjustableT0Tool",**kwargs):
    # NB: the following 'ifs' are the same as in the MdtDriftCircleOnTrackCreator, so that the ToF setting is the same
    if muonStandaloneFlags.reconstructionMode() == 'cosmics':
        kwargs.setdefault("DoTof", 0)
    else: # collisions simulation final precise cuts
        kwargs.setdefault("DoTof", 1)
        
    from MdtDriftCircleOnTrackCreator.MdtDriftCircleOnTrackCreatorConf import AdjT0__AdjustableT0Tool
    return AdjT0__AdjustableT0Tool(name,**kwargs)
Exemplo n.º 4
0
    def __init__(self,name="MuonCurvedSegmentCombiner",**kwargs):
        self.applyUserDefaults(kwargs,name)
        
        if (beamFlags.beamType() == 'singlebeam' or beamFlags.beamType() == 'cosmics'):
            kwargs.setdefault( "MissedHitsCut", 100 )
            kwargs.setdefault( "AddUnassociatedMiddleEndcapSegments", False )
        elif globalflags.DataSource() == 'data':  #collisions-data or simulation first data
            kwargs.setdefault( "MissedHitsCut", 100 )
        else:
            kwargs.setdefault( "MissedHitsCut", 4 )
        
        kwargs.setdefault("DoCosmics", muonStandaloneFlags.reconstructionMode() != 'collisions' )
        kwargs.setdefault( "AddAll2DCscs", False )
        kwargs.setdefault( "UseCscSegments", muonRecFlags.doCSCs() )
        kwargs.setdefault( "AddUnassociatedMiddleEndcapSegments", True )

        super(MuonCurvedSegmentCombiner,self).__init__(name,**kwargs)        
Exemplo n.º 5
0
def MooTrackFitter(name="MooTrackFitter", extraFlags=None, **kwargs):

    namePrefix =getattr(extraFlags,"namePrefix","")
    namePostfix=getattr(extraFlags,"namePostfix","")

    kwargs.setdefault("Fitter",          "MCTBFitter")
    kwargs.setdefault("Propagator",      "MuonPropagator")
    kwargs.setdefault("SLFit" ,          not jobproperties.BField.allToroidOn())
    kwargs.setdefault("ReducedChi2Cut",  muonStandaloneFlags.Chi2NDofCut())
    kwargs.setdefault("FitEtaStrips",    True)
    kwargs.setdefault("SegmentMomentum", "MuonSegmentMomentumFromField")
    kwargs.setdefault("CleanPhiHits",              True)
    kwargs.setdefault("UsePreciseHits",            True)
    kwargs.setdefault("UsePrefit",                 False)
    kwargs.setdefault("SeedAtStartOfTrack",        False)

    if muonStandaloneFlags.reconstructionMode() == 'cosmics':
        kwargs.setdefault("SeedWithAvePhi",            True)
        kwargs.setdefault("SeedWithSegmentTheta",      False)
        kwargs.setdefault("Cosmics",                   True)
        kwargs.setdefault("PreCleaningReducedChi2Cut", 5000)
        kwargs.setdefault("SegmentMomentum",           "MuonSegmentMomentum")

    # make instance
    fitter = CfgMgr.Muon__MooTrackFitter(name,**kwargs)

    # make some clones if needed
    if namePrefix or namePostfix:
        oldFitterName = getProperty(fitter,"Fitter").getName()
        newFitterName = namePrefix + oldFitterName + namePostfix
        fitter.Fitter = getPublicToolClone(newFitterName,oldFitterName)

        oldFitterName = getProperty(fitter,"FitterPreFit").getName()
        newFitterName = namePrefix + oldFitterName + namePostfix
        fitter.FitterPreFit = getPublicToolClone(newFitterName,oldFitterName)
 
    return fitter 
Exemplo n.º 6
0
def MooCandidateMatchingTool(name,extraFlags=None,**kwargs):
    namePrefix =getattr(extraFlags,"namePrefix","")
    namePostfix=getattr(extraFlags,"namePostfix","")
    doSegmentPhiMatching = getattr(extraFlags,"doSegmentPhiMatching",None)
    useTrackSegmentMatching = getattr(extraFlags,"useTrackSegmentMatching",muonStandaloneFlags.useTrackSegmentMatching())
    # segment-segment matching
    if doSegmentPhiMatching is not None:
        if not (namePrefix or namePostfix):
            raise RuntimeError("extraFlags ERROR: namePrefix or namePostfix is required if doSegmentPhiMatching is set")

        if "SegmentMatchingTool" not in kwargs:
            kwargs["SegmentMatchingTool"] = getPublicToolClone(namePrefix+"MuonSegmentMatchingTool"+namePostfix,
                                                               "MuonSegmentMatchingTool",
                                                               doPhiMatching=doSegmentPhiMatching)

        if "SegmentMatchingToolTight" not in kwargs:
            kwargs["SegmentMatchingToolTight"] = getPublicToolClone(namePrefix+"MuonSegmentMatchingToolTight"+namePostfix,
                                                                    "MuonSegmentMatchingToolTight",
                                                                    doPhiMatching=doSegmentPhiMatching)
    # track-segment matching
    kwargs.setdefault("DoTrackSegmentMatching", useTrackSegmentMatching)

    kwargs.setdefault("RequireSameSide", muonStandaloneFlags.reconstructionMode() != "collisions")

    if muonRecFlags.useAlignmentCorrections():
        kwargs.setdefault("AlignmentErrorPosX", 5.0)
        kwargs.setdefault("AlignmentErrorPosY", 0.2)
        kwargs.setdefault("AlignmentErrorAngleX", 0.002)
        kwargs.setdefault("AlignmentErrorAngleY", 0.001)

    else: # no alignment corrections
        kwargs.setdefault("AlignmentErrorPosX", 10.0)
        kwargs.setdefault("AlignmentErrorPosY", 5.0)
        kwargs.setdefault("AlignmentErrorAngleX", 0.004)
        kwargs.setdefault("AlignmentErrorAngleY", 0.002)

    return CfgMgr.Muon__MooCandidateMatchingTool(name,**kwargs)
Exemplo n.º 7
0
def MuonSegmentMomentum(name="MuonSegmentMomentum",**kwargs):
    kwargs.setdefault("DoCosmics", muonStandaloneFlags.reconstructionMode() != 'collisions')
    return CfgMgr.MuonSegmentMomentum(name,**kwargs)
Exemplo n.º 8
0
def MuonPhiHitSelector(name="MuonPhiHitSelector",**kwargs):
    kwargs.setdefault("MakeClusters", True)
    kwargs.setdefault("CompetingRios", True)
    kwargs.setdefault("DoCosmics", muonStandaloneFlags.reconstructionMode() != 'collisions')

    return CfgMgr.MuonPhiHitSelector(name,**kwargs)
Exemplo n.º 9
0
def MuonHoughPatternTool(name="MuonHoughPatternTool",**kwargs):
    if muonStandaloneFlags.reconstructionMode() == 'collisions': 
        kwargs.setdefault("UseCosmics", True)
        kwargs.setdefault("NumberOfMaximaPerIterations", 1)
    return CfgMgr.MuonHoughPatternTool(name,**kwargs)
Exemplo n.º 10
0
def MuonCombinePatternTool(name="MuonCombinePatternTool",**kwargs):
    kwargs.setdefault("UseTightAssociation", muonStandaloneFlags.reconstructionMode() == 'collisions')
    kwargs.setdefault("UseCosmics", muonStandaloneFlags.reconstructionMode() != 'collisions' )
    return CfgMgr.MuonCombinePatternTool(name,**kwargs)
Exemplo n.º 11
0
def MooTrackBuilder(name="MooTrackBuilderTemplate",
                    extraFlags=None,
                    **kwargs):

    namePrefix =getattr(extraFlags,"namePrefix","")
    namePostfix=getattr(extraFlags,"namePostfix","")
    optimiseMomentumResolutionUsingChi2=getattr(extraFlags,"optimiseMomentumResolutionUsingChi2",False)
    
    kwargs.setdefault("Fitter",   "MooTrackFitter")
    kwargs.setdefault("SLFitter", "MooSLTrackFitter")
    kwargs.setdefault("RecalibrateMDTHitsOnTrack", ( (not muonRecFlags.doSegmentT0Fit()) and muonStandaloneFlags.reconstructionMode() == 'collisions') )

    # hardcode some properties before passing on to base class constructors
    if optimiseMomentumResolutionUsingChi2:
        if "ErrorOptimisationTool" not in kwargs:
            if namePrefix or namePostfix:
                tool = getPublicToolClone(namePrefix+"MuonErrorOptimisationTool"+namePostfix,
                                          "MuonErrorOptimisationTool",
                                          extraFlags=extraFlags)
            else:
                tool = getPublicTool("MuonErrorOptimisationTool")
            kwargs["ErrorOptimisationTool"] = tool
        
    builder = CfgMgr.Muon__MooTrackBuilder(name,**kwargs)

    # make clones of some tools if namePrefix (e.g. for TrigMuonEF) or namePostfix (e.g. for FinalFit) is given
    if namePrefix or namePostfix:
        oldFitterName = getProperty(builder,"Fitter").getName()
        newFitterName = namePrefix+oldFitterName+namePostfix
        builder.Fitter = getPublicToolClone(newFitterName,oldFitterName,extraFlags=extraFlags)
        oldFitterName = getProperty(builder,"SLFitter").getName()
        newFitterName = namePrefix+oldFitterName+namePostfix
        builder.SLFitter = getPublicToolClone(newFitterName,oldFitterName,extraFlags=extraFlags)
        oldMatchingToolName = getProperty(builder,"CandidateMatchingTool").getName()
        newMatchingToolName = namePrefix+oldMatchingToolName+namePostfix
        builder.CandidateMatchingTool = getPublicToolClone(newMatchingToolName,oldMatchingToolName,extraFlags=extraFlags)
    
    return builder