コード例 #1
0
 def MakeVeloTracks(self,prefilter):
     
     if self.__confdict__["DoVeloDecoding"]:
         from DAQSys.Decoders import DecoderDB
         from DAQSys.DecoderClass import decodersForBank
         decs=[]
         vdec=DecoderDB["DecodeVeloRawBuffer/createBothVeloClusters"]
         vdec.Active=True
         DecoderDB["DecodeVeloRawBuffer/createVeloClusters"].Active=False
         DecoderDB["DecodeVeloRawBuffer/createVeloLiteClusters"].Active=False
         decs=decs+[vdec]
         VeloDecoding = GaudiSequencer("RecoDecodingSeq")
         VeloDecoding.Members += [d.setup() for d in decs ]
     
     MyFastVeloTracking = FastVeloTracking("For%sFastVelo"%self.name,OutputTracksName=self.VeloTrackOutputLocation)
     MyFastVeloTracking.OnlyForward = True
     MyFastVeloTracking.ResetUsedFlags = True
     ### prepare for fitting
     preve = TrackStateInitAlg("For%sInitSeedFit"%self.name,TrackLocation = self.VeloTrackOutputLocation)
     preve.StateInitTool.VeloFitterName = "FastVeloFitLHCbIDs"
     copyVelo = TrackContainerCopy( "For%sCopyVelo"%self.name )
     copyVelo.inputLocations = [self.VeloTrackOutputLocation]
     copyVelo.outputLocation = self.FittedVeloTrackOutputLocation
     
     ### fitting
     if self.__confdict__["VeloFitter"] == "ForwardStraightLine":
         MyVeloFit = ConfiguredForwardStraightLineEventFitter(Name="For%sVeloRefitterAlg"%self.name,
                                                              TracksInContainer=self.FittedVeloTrackOutputLocation)
     elif self.__confdict__["VeloFitter"] == "SimplifiedGeometry":
         MyVeloFit = ConfiguredEventFitter(Name="For%sVeloRefitterAlg"%self.name,
                                           TracksInContainer=self.FittedVeloTrackOutputLocation,
                                           SimplifiedGeometry = True)
     else:
         MyVeloFit = ConfiguredEventFitter(Name="For%sVeloRefitterAlg"%self.name,
                                           TracksInContainer=self.FittedVeloTrackOutputLocation)
         
     #### making the proto particles
     MakeVeloProtos = ChargedProtoParticleMaker('For%sVeloProtoMaker'%self.name)
     MakeVeloProtos.Inputs=[self.FittedVeloTrackOutputLocation]
     MakeVeloProtos.Output = self.VeloProtoOutputLocation
     MakeVeloProtos.addTool( DelegatingTrackSelector, name="TrackSelector" )
     MakeVeloProtos.TrackSelector.TrackTypes = [ "Velo" ]
 
     #### the full sequence
     makeparts = GaudiSequencer('For%sMakeVeloTracksGS'%self.name)
     if self.__confdict__["DoVeloDecoding"]:
         makeparts.Members += [ VeloDecoding ] 
     makeparts.Members += [ MyFastVeloTracking ] 
     makeparts.Members += [ preve ] 
     makeparts.Members += [ copyVelo ] 
     makeparts.Members += [ MyVeloFit ] 
     makeparts.Members += [ MakeVeloProtos ] 
 
     #### some python magic to maek this appear like a "Selection"
     return GSWrapper(name="For%sWrappedVeloTrackingFor"%self.name,
                      sequencer=makeparts,
                      output=self.VeloProtoOutputLocation,
                      requiredSelections =  prefilter)
コード例 #2
0
    def algorithm(self):
        Name = self._name
        inputTrackLocation = self._inputLocation
        from Configurables import GaudiSequencer, HltTrackConverter, TrackContainerCopy, Escher
        from Configurables import TrackContainerCopy, TrackSelector
        trackRefitSeq = GaudiSequencer(
            self.name() + "Seq")  # GaudiSequencer("TrackRefitSeq")

        # create a track list for tracks with velo hits
        velotrackselector = TrackContainerCopy(
            "GoodLongRefittedVeloTracks",
            inputLocations=["Rec/Track/Best"],
            outputLocation="Rec/Track/GoodLongRefittedVeloTracks",
            Selector=TrackSelector())
        velotrackselector.Selector.MinNVeloRHits = 7
        velotrackselector.Selector.MinNVeloPhiHits = 6
        # refit the tracks in that list
        from TrackFitter.ConfiguredFitters import *
        velotrackrefitter = ConfiguredEventFitter(
            Name="TracksWithVeloHitsFitter",
            TracksInContainer="Rec/Track/GoodLongRefittedVeloTracks",
            FieldOff=True)
        velotrackrefitter.Fitter.MeasProvider.IgnoreIT = True
        velotrackrefitter.Fitter.MeasProvider.IgnoreOT = True
        velotrackrefitter.Fitter.MeasProvider.IgnoreTT = True
        velotrackrefitter.Fitter.MeasProvider.IgnoreMuon = True
        velotrackrefitter.Fitter.MakeNodes = True
        velotrackrefitter.Fitter.MakeMeasurements = True

        trackRefitSeq.Members += [velotrackselector, velotrackrefitter]
        return trackRefitSeq
コード例 #3
0
    def algorithm(self):
        from Configurables import GaudiSequencer, HltTrackConverter, TrackContainerCopy, Escher
        from TAlignment.Utils import configuredFitAndHitAdderSequence
        seq = GaudiSequencer(self.name() + "Seq")

        # configure algorithm to revive HLT tracks. it seems that the
        # Hlt2Global decision is the most useful, because it has TT
        # hits on the tracks. adding Hlt1Global does rather
        # little. (if you do, make sure to put it after Hlt2Global,
        # since the clone rejection takes the first track.)
        hltTrackConvAll = HltTrackConverter(
            "HltTrackConvAll", TrackDestination='Rec/Track/NoPIDBest')
        hltTrackConvAll.HltLinesToUse += ['Hlt2Global', 'Hlt1Global']

        if Escher().DataType in ['2015']:
            hltTrackConvAll.SelReportsLocation = 'Hlt1/SelReports'
        seq.Members += [hltTrackConvAll]
        # configure algorithm to run Velo standalone reconstruction
        if self._runVelo:
            # run FastVeloTracks and copy all tracks to NoPIDBest. We
            # need to deal with clones at some point.
            from Configurables import FastVeloTracking
            seq.Members += [
                FastVeloTracking(),
                TrackContainerCopy('CopyVeloTracks',
                                   inputLocations=['Rec/Track/Velo'],
                                   outputLocation='Rec/Track/NoPIDBest')
            ]

        tracksel = FavouriteTrackCocktail(Name='NoPIDForAlignment',
                                          InputLocation='Rec/Track/NoPIDBest',
                                          Fitted=False)
        seq.Members += [
            tracksel.algorithm(),
            TrackContainerCopy('NoPIDForAlignmentCopy',
                               inputLocations=[tracksel.location()],
                               outputLocation=tracksel.location() + 'Owned'),
            configuredFitAndHitAdderSequence(
                'NoPIDFit',
                InputLocation=tracksel.location() + 'Owned',
                OutputLocation=self.location())
        ]
        return seq
コード例 #4
0
def fittedVelo(inputTracks, outputTracks, name='VeloOnlyFitterAlg'):
    from Configurables import TrackEventFitter, TrackInitFit
    from Configurables import TrackStateInitTool, TrackMasterFitter
    if HltRecoConf().getProp("FastFitVelo"):
        # For now use the save option where Velo tracks are copied and the original ones are not changed
        from Configurables import TrackStateInitAlg, TrackStateInitTool,FastVeloFitLHCbIDs
        from Configurables import TrackContainerCopy
        copy = TrackContainerCopy(name+"CopyVelo")
        copy.inputLocations = [ inputTracks ]
        copy.outputLocation = outputTracks
        init = TrackStateInitAlg(name)
        init.TrackLocation = copy.outputLocation
        init.addTool(TrackStateInitTool, name="StateInitTool")
        init.StateInitTool.VeloFitterName = "FastVeloFitLHCbIDs"
        init.StateInitTool.addTool(TrackMasterExtrapolator, "Extrapolator")
        init.StateInitTool.Extrapolator.addTool(SimplifiedMaterialLocator,
                                                name = "MaterialLocator")
        init.StateInitTool.addTool(FastVeloFitLHCbIDs,name="FastVeloFitLHCbIDs")
        init.StateInitTool.FastVeloFitLHCbIDs.UseKalmanFit = True
        return [copy,init]
    else:
        fa = TrackEventFitter(name)
        fa.TracksInContainer = inputTracks
        fa.TracksOutContainer = outputTracks
        fa.Fitter = "TrackInitFit/Fit"
        fa.addTool(TrackInitFit, "Fit")
        fa.Fit.Init = "TrackStateInitTool/VeloOnlyStateInit"
        fa.Fit.addTool(TrackStateInitTool, "VeloOnlyStateInit")
        fa.Fit.VeloOnlyStateInit.VeloFitterName = "FastVeloFitLHCbIDs"
        fa.Fit.VeloOnlyStateInit.addTool(TrackMasterExtrapolator, "Extrapolator")
        fa.Fit.VeloOnlyStateInit.Extrapolator.addTool(SimplifiedMaterialLocator,
                                                      name = "MaterialLocator")
        fa.Fit.Fit = "TrackMasterFitter/Fit"
        fa.Fit.addTool(TrackMasterFitter, name = "Fit")
        from TrackFitter.ConfiguredFitters import ConfiguredForwardFitter
        fitter = ConfiguredForwardFitter(fa.Fit.Fit)
        return [ fa ]
コード例 #5
0
def configuredFitAndHitAdderSequence(Name, InputLocation, OutputLocation):
    from TrackFitter.ConfiguredFitters import ConfiguredEventFitter
    from Configurables import (TrackHitAdder, TrackContainerCopy,
                               TrackSelector, GaudiSequencer,
                               TrackStateInitAlg)
    # create the sequence
    if isinstance(Name, GaudiSequencer):
        seq = Sequence
        Name = seq.name()
        Name.replace('Sequence', '')
        Name.replace('Seq', '')
    else:
        seq = GaudiSequencer(Name + 'Seq')

    # I am lazy: use the DOD to get the decoded clusters
    #importOption( "$STDOPTS/DecodeRawEvent.py" )
    # now setup the fitters
    seq.Members += [
        TrackStateInitAlg(Name + 'FitInit', TrackLocation=InputLocation),
        ConfiguredEventFitter(Name + 'FitBeforeHitAdder',
                              TracksInContainer=InputLocation),
        TrackHitAdder(Name + 'HitAdder', TrackLocation=InputLocation),
        ConfiguredEventFitter(Name + 'FitAfterHitAdder',
                              TracksInContainer=InputLocation)
    ]
    tracksel = TrackContainerCopy(Name + 'CopyAndSelect',
                                  inputLocations=[InputLocation],
                                  outputLocation=OutputLocation,
                                  Selector=TrackSelector())
    # also apply a selection
    tracksel.Selector.MaxChi2Cut = 5
    tracksel.Selector.MaxChi2PerDoFMatch = 5
    tracksel.Selector.MaxChi2PerDoFVelo = 5
    tracksel.Selector.MaxChi2PerDoFDownstream = 5
    seq.Members.append(tracksel)
    return seq
コード例 #6
0
    tmuonfit.Fitter.MaxNumberOutliers = 0
    tmuonfit.Fitter.addTool(MeasurementProvider(), name='MeasProvider')
    tmuonfit.Fitter.MeasProvider.MuonProvider.clusterize = True
    tmuonfit.Fitter.MeasProvider.MuonProvider.OutputLevel = outputlevel
    tmuonfit.Fitter.MeasProvider.IgnoreMuon = False

    if OTMuonMatching:
        trackFilterSeq.Members.append(matching)
        trackFilterSeq.Members.append(tmuonfit)
    # ------------------------------------------------------------------
from Configurables import TrackMonitor
trackFilterSeq.Members.append(
    TrackMonitor("MyTMuonMonitor", TracksInContainer='Rec/Track/Best/TMuon'))

from Configurables import (TrackSelector, TrackContainerCopy)
tmuonselectoralg = TrackContainerCopy("TmuonSelection")
tmuonselectoralg.addTool(TrackSelector, name="Selector")
tmuonselectoralg.Selector.MaxChi2Cut = 10
tmuonselectoralg.Selector.OutputLevel = outputlevel
tmuonselectoralg.inputLocation = 'Rec/Track/Best/TMuon'
tmuonselectoralg.outputLocation = 'Rec/Track/AlignTracks'

trackFilterSeq.Members.append(tmuonselectoralg)
##==============================================================

#-- Use latest database tags for real data

from Configurables import LHCbApp
#LHCbApp().Monitors = ["MemoryAuditor"]
Escher().DataType = "2010"
LHCbApp().DDDBtag = "default"
コード例 #7
0
    def algorithm(self):
        from Configurables import TrackSys
        TrackSys().GlobalCuts = {
            'Velo': 4000,
            'OT': 8000
        }  #### to remove busy events
        Name = self._name
        inputTrackLocation = self._inputLocation
        from Configurables import GaudiSequencer, HltTrackConverter, TrackContainerCopy, Escher
        from TAlignment.Utils import configuredFitAndHitAdderSequence
        seq = GaudiSequencer(self.name() + "Seq")
        ## Here starts Stefania's code ========================
        from Configurables import MuonNNetRec, MuonPadRec, MuonClusterRec

        muonTrackTool = MuonNNetRec(
            name="MuonNNetRec",
            AssumeCosmics=False,
            PhysicsTiming=False,
            AssumePhysics=
            True,  ## assume that tracks come from IP (only forward)
            AddXTalk=True,
            XtalkRadius=1.5,
            SkipStation=0,
            #DecodingTool = "MuonMonHitDecode", # default is "MuonHitDecode"
            ClusterTool="MuonClusterRec"  # default is "MuonFakeClustering"
            #OutputLevel   = 2
        )

        clusterTool = MuonClusterRec(name="MuonClusterRec",
                                     OutputLevel=5,
                                     MaxPadsPerStation=500)  #default 1500
        padRecTool = MuonPadRec(name="PadRecTool", OutputLevel=5)

        from Configurables import MakeMuonTracks
        copy = MakeMuonTracks(name='MakeMuonTracks',
                              OutputLevel=5,
                              SkipBigClusters=True)
        copy.addTool(muonTrackTool, name='MuonRecTool')
        # ------------------------------------------------------------------
        seq.Members += [copy]  # Copy MuonTracks to LHCb tracks
        # ------------------------------------------------------------------
        from TrackFitter.ConfiguredFitters import ConfiguredForwardStraightLineEventFitter  #, ConfiguredStraightLineFitter
        from Configurables import MeasurementProvider, TrackKalmanFilter

        muonTrackFit = ConfiguredForwardStraightLineEventFitter(
            "MuonTrackFit", TracksInContainer="Rec/Track/Muon")
        #muonTrackFit =  ConfiguredStraightLineFitter( 'MuonTrackFit' , TracksInContainer = 'Rec/Track/Muon' )

        muonTrackFit.Fitter.OutputLevel = 5
        muonTrackFit.Fitter.addTool(TrackKalmanFilter, 'NodeFitter')
        muonTrackFit.Fitter.addTool(MeasurementProvider, name='MeasProvider')

        muonTrackFit.Fitter.MeasProvider.MuonProvider.clusterize = True  #default False
        muonTrackFit.Fitter.MeasProvider.MuonProvider.OutputLevel = 5
        muonTrackFit.Fitter.ErrorX = 1000
        muonTrackFit.Fitter.ErrorY = 10000
        muonTrackFit.Fitter.MaxNumberOutliers = 0
        # ------------------------------------------------------------------
        seq.Members += [muonTrackFit]
        # ------------------------------------------------------------------
        from Configurables import TAlignment, GetElementsToBeAligned
        from Configurables import TrackFilterAlg
        trackFilterAlg = TrackFilterAlg(
            name="FilterTracks",
            OutputLevel=5,
            TracksInputContainer="Rec/Track/Muon",  # MuonTrackRec
            TracksOutputContainer="Rec/Track/SelectedMuon",  # Filtered tracks
            MuonFilter=True,  ###------------------------------ MUONTRACKSELECTOR
            MuonPcut=6000.,  ## 6 GeV
            MuonChisquareCut=5,
            inCaloAcceptance=True,
            noOverlap=False,
            #TheRegion       = 10
            minHitStation=3)  # >3

        ####???????
        trackFilterAlg.addTool(GetElementsToBeAligned(
            OutputLevel=5, Elements=TAlignment().ElementsToAlign),
                               name="GetElementsToBeAligned")
        # ------------------------------------------------------------------
        seq.Members += [trackFilterAlg]
        # ------------------------------------------------------------------
        from Configurables import TrackMuonMatching, TrackMasterExtrapolator, TrackChi2Calculator
        #, TrajOTCosmicsProjector, TrajOTProjector, TrackProjectorSelector
        matching = TrackMuonMatching(
            name="TrackMuonMatching",
            AllCombinations=False,  # default true
            MatchAtFirstMuonHit=True,  # default false
            FullDetail=True,  #????
            OutputLevel=5,
            TTracksLocation=inputTrackLocation,  # Best container + chisquare < 5
            MuonTracksLocation='Rec/Track/SelectedMuon',  # MuonNNet
            TracksOutputLocation='Rec/Track/Best/TMuon',
            MatchChi2Cut=20.0,
            WriteNtuple=False)
        matching.addTool(TrackMasterExtrapolator, name='Extrapolator')
        matching.Extrapolator.ApplyMultScattCorr = True
        matching.Extrapolator.ApplyEnergyLossCorr = False
        matching.Extrapolator.ApplyElectronEnergyLossCorr = False
        matching.addTool(TrackChi2Calculator, name='Chi2Calculator')
        # ------------------------------------------------------------------
        seq.Members += [matching]  # Track-Muon  Matching
        # ------------------------------------------------------------------

        from TrackFitter.ConfiguredFitters import ConfiguredEventFitter
        #tmuonfit = ConfiguredFastEventFitter( 'TMuonFit', TracksInContainer = 'Rec/Track/Best/TMuon') # contains Best+Muon
        tmuonfit = ConfiguredEventFitter(
            "TMuonFit",
            TracksInContainer='Rec/Track/Best/TMuon')  # contains Best+Muon

        tmuonfit.Fitter.MakeNodes = True
        tmuonfit.Fitter.MakeMeasurements = True
        tmuonfit.Fitter.addTool(TrackKalmanFilter, 'NodeFitter')
        tmuonfit.Fitter.ErrorX = 1000
        tmuonfit.Fitter.ErrorY = 10000
        tmuonfit.Fitter.NumberFitIterations = 5
        tmuonfit.Fitter.MaxDeltaChiSqConverged = 0.1
        tmuonfit.Fitter.MaxNumberOutliers = 0
        tmuonfit.Fitter.addTool(MeasurementProvider(), name='MeasProvider')
        tmuonfit.Fitter.MeasProvider.MuonProvider.clusterize = True
        #tmuonfit.Fitter.MeasProvider.MuonProvider.OutputLevel   = 2
        tmuonfit.Fitter.MeasProvider.IgnoreMuon = False
        # ------------------------------------------------------------------
        seq.Members += [tmuonfit]  # Fit TMuon tracks
        # ------------------------------------------------------------------
        from Configurables import TrackSelector, TrackContainerCopy
        tmuonselectoralg = TrackContainerCopy(
            name="TmuonSelection",
            inputLocations=['Rec/Track/Best/TMuon'],
            outputLocation=self.location())
        tmuonselectoralg.addTool(TrackSelector, name="Selector")
        tmuonselectoralg.Selector.MaxChi2Cut = 10
        #tmuonselectoralg.Selector.OutputLevel = 2
        # ------------------------------------------------------------------
        seq.Members += [tmuonselectoralg]  # selects good TMuon tracks
        # ------------------------------------------------------------------

        return seq
コード例 #8
0
def RecoTrackingHLT1(exclude=[],
                     simplifiedGeometryFit=True,
                     liteClustersFit=True):
    '''Function that defines the pattern recognition algorithms for the HLT1 sequence of the Run 2 offline tracking'''
    ## Start TransportSvc, needed by track fit
    ApplicationMgr().ExtSvc.append("TransportSvc")

    ## --------------------------------------------------------------------
    ## Pattern Recognition and Fitting
    ## --------------------------------------------------------------------

    # Which algs to run ?
    trackAlgs = TrackSys().getProp("TrackPatRecAlgorithms")

    # Which data type is it?
    dataType = TrackSys().getProp("DataType")

    # Decode the RAW banks
    ExcludedLayers = TrackSys().getProp("ExcludedLayers")
    DecodeTracking(trackAlgs, ExcludedLayers)

    from Configurables import STOfflinePosition
    IT = STOfflinePosition('ITClusterPosition')
    IT.DetType = "IT"
    TT = STOfflinePosition('TTClusterPosition')
    TT.DetType = "TT"

    from STTools import STOfflineConf
    STOfflineConf.DefaultConf().configureTools()

    ## Make sure the default extrapolator and interpolator use simplified material
    from Configurables import TrackMasterExtrapolator, TrackInterpolator, SimplifiedMaterialLocator, DetailedMaterialLocator
    if TrackSys().simplifiedGeometry() and ('SimpleGeom' not in exclude):
        TrackMasterExtrapolator().MaterialLocator = 'SimplifiedMaterialLocator'
        TrackInterpolator().addTool(TrackMasterExtrapolator(
            MaterialLocator='SimplifiedMaterialLocator'),
                                    name='Extrapolator')

    ### This configures public tools to use the new multiple scattering description without the log term
    from Configurables import StateThickMSCorrectionTool
    me = TrackMasterExtrapolator()
    me.addTool(DetailedMaterialLocator(), name="MaterialLocator")
    me.MaterialLocator.addTool(StateThickMSCorrectionTool,
                               name="StateMSCorrectionTool")
    me.MaterialLocator.StateMSCorrectionTool.UseRossiAndGreisen = True

    ti = TrackInterpolator()
    ti.addTool(me)

    from Configurables import TrackStateProvider
    tsp = TrackStateProvider()
    tsp.addTool(TrackInterpolator, name="Interpolator")
    tsp.addTool(TrackMasterExtrapolator, name="Extrapolator")
    tsp.Interpolator.addTool(TrackMasterExtrapolator, name='Extrapolator')
    if simplifiedGeometryFit or (TrackSys().simplifiedGeometry() and
                                 ('SimpleGeom' not in exclude)):
        tsp.Extrapolator.addTool(SimplifiedMaterialLocator,
                                 name="MaterialLocator")
        tsp.Interpolator.Extrapolator.addTool(SimplifiedMaterialLocator,
                                              name="MaterialLocator")
    else:
        tsp.Extrapolator.addTool(DetailedMaterialLocator,
                                 name="MaterialLocator")
        tsp.Interpolator.Extrapolator.addTool(DetailedMaterialLocator,
                                              name="MaterialLocator")
    tsp.Extrapolator.MaterialLocator.addTool(StateThickMSCorrectionTool,
                                             name="StateMSCorrectionTool")
    tsp.Extrapolator.MaterialLocator.StateMSCorrectionTool.UseRossiAndGreisen = True
    tsp.Interpolator.Extrapolator.MaterialLocator.addTool(
        StateThickMSCorrectionTool, name="StateMSCorrectionTool")
    tsp.Interpolator.Extrapolator.MaterialLocator.StateMSCorrectionTool.UseRossiAndGreisen = True
    ###

    ## Velo tracking
    ## Why is Velo not in the tracking sequence?
    if "FastVelo" in trackAlgs:
        from Configurables import FastVeloTracking
        GaudiSequencer("RecoVELOSeq").Members += [
            FastVeloTracking("FastVeloTracking")
        ]
        if TrackSys().timing():
            FastVeloTracking().TimingMeasurement = True

    ## Tracking sequence
    from Configurables import ProcessPhase
    track = ProcessPhase("TrackHLT1")
    GaudiSequencer("RecoTrHLT1Seq").Members += [track]

    from Configurables import MagneticFieldSvc
    if TrackSys().fieldOff():
        MagneticFieldSvc().ForcedSignedCurrentScaling = 0.

    if "noDrifttimes" in TrackSys().getProp("ExpertTracking"):
        from Configurables import (Tf__OTHitCreator)
        Tf__OTHitCreator("OTHitCreator").NoDriftTimes = True

    # Get the fitters
    from TrackFitter.ConfiguredFitters import ConfiguredFit, ConfiguredFitSeed, ConfiguredMasterFitter

    # Clone killer
    tracklists = []

    # Is this standard sequence?
    stdSeq = "fastSequence" not in TrackSys().getProp("ExpertTracking")

    ## Velo-TT pattern
    if "VeloTT" in trackAlgs:
        track.DetectorList += ["VeloTTPat"]
        from Configurables import PatVeloTTHybrid
        GaudiSequencer("TrackHLT1VeloTTPatSeq").Members += [
            PatVeloTTHybrid("PatVeloTTHybrid")
        ]
        from PatVeloTT import PatVeloTTAlgConf
        PatVeloTTAlgConf.PatVeloTTConf().configureAlgRun2HLT1()
        if TrackSys().timing():
            PatVeloTTHybrid("PatVeloTTHybrid").TimingMeasurement = True
        tracklists += ["Rec/Track/VeloTT"]

    ## Forward pattern
    if "ForwardHLT1" in trackAlgs:
        if "VeloTT" not in trackAlgs:
            raise RuntimeError("Cannot run HLT1 forward without VeloTT")

        track.DetectorList += ["ForwardPatHLT1"]
        from Configurables import PatForward, PatForwardTool
        GaudiSequencer("TrackHLT1ForwardPatHLT1Seq").Members += [
            PatForward("PatForwardHLT1")
        ]

        # should be replaced by more 'global' tracking configuration
        from PatAlgorithms import PatAlgConf
        PatAlgConf.ForwardConf().configureAlgRun2HLT1()
        if TrackSys().timing():
            PatForward("PatForwardHLT1").TimingMeasurement = True
        tracklists += ["Rec/Track/ForwardHLT1"]

    ## Fitting all HLT1 tracks
    track.DetectorList += ["FitHLT1"]

    from Configurables import TrackEventFitter, TrackInitFit, TrackStateInitTool, TrackStateInitAlg, TrackMasterExtrapolator, TrackMasterFitter
    from Configurables import SimplifiedMaterialLocator, DetailedMaterialLocator
    from Configurables import TrackContainerCopy

    ######
    ### Fitter for Velo tracks
    ######
    if "FastVelo" in trackAlgs:
        if "VeloForwardKalmanHLT1" in TrackSys().getProp("ExpertTracking"):
            # This is the option for the 2015 early measurements
            veloFitter = TrackEventFitter('VeloOnlyFitterAlg')
            veloFitter.TracksInContainer = "Rec/Track/Velo"
            veloFitter.TracksOutContainer = "Rec/Track/FittedHLT1VeloTracks"
            veloFitter.Fitter = "TrackInitFit/Fit"
            veloFitter.addTool(TrackInitFit, "Fit")
            veloFitter.Fit.Init = "TrackStateInitTool/VeloOnlyStateInit"
            veloFitter.Fit.addTool(TrackStateInitTool, "VeloOnlyStateInit")
            veloFitter.Fit.VeloOnlyStateInit.VeloFitterName = "FastVeloFitLHCbIDs"
            veloFitter.Fit.VeloOnlyStateInit.addTool(TrackMasterExtrapolator,
                                                     "Extrapolator")
            if (simplifiedGeometryFit):
                veloFitter.Fit.VeloOnlyStateInit.Extrapolator.addTool(
                    SimplifiedMaterialLocator, name="MaterialLocator")
            else:
                veloFitter.Fit.VeloOnlyStateInit.Extrapolator.addTool(
                    DetailedMaterialLocator, name="MaterialLocator")

            veloFitter.Fit.Fit = "TrackMasterFitter/Fit"
            veloFitter.Fit.addTool(TrackMasterFitter, name="Fit")

            from TrackFitter.ConfiguredFitters import ConfiguredForwardFitter
            ConfiguredForwardFitter(veloFitter.Fit.Fit,
                                    LiteClusters=liteClustersFit)

            GaudiSequencer("TrackHLT1FitHLT1Seq").Members += [veloFitter]

        else:
            # and this is the option for after the early measurements
            # copy tracks from pat reco output container to a new one
            copyVeloTracks = TrackContainerCopy("CopyVeloTracks")
            copyVeloTracks.inputLocations = ["Rec/Track/Velo"]
            copyVeloTracks.outputLocation = "Rec/Track/FittedHLT1VeloTracks"

            from FastVelo import FastVeloAlgConf
            stateInit = TrackStateInitAlg('VeloOnlyInitAlg')
            FastVeloAlgConf.FastVeloKalmanConf().configureFastKalmanFit(
                init=stateInit)
            GaudiSequencer("TrackHLT1FitHLT1Seq").Members += [
                copyVeloTracks, stateInit
            ]

    ######
    ### Fitter for Forward tracks
    ### Need to be careful: This is all a little fragile, so if you plan to change something, check that everything configures the way you expect
    ### The Extrapolator for the StateInitTool does not use material corrections, so don't need to explicitely add the StateThickMSCorrectionTool
    ######
    if "ForwardHLT1" in trackAlgs:
        fwdFitter = TrackEventFitter('ForwardHLT1FitterAlg')
        fwdFitter.TracksInContainer = "Rec/Track/ForwardHLT1"
        fwdFitter.TracksOutContainer = "Rec/Track/FittedHLT1ForwardTracks"
        # Keep only good tracks, this cut should be aligned with the one in the TrackBestTrackCreator
        fwdFitter.MaxChi2DoF = 4.0
        fwdFitter.Fitter = "TrackInitFit/Fit"
        fwdFitter.addTool(TrackInitFit, "Fit")
        fwdFitter.Fit.Init = "TrackStateInitTool/FwdStateInit"
        fwdFitter.Fit.addTool(TrackStateInitTool, "FwdStateInit")
        fwdFitter.Fit.FwdStateInit.addTool(TrackMasterExtrapolator,
                                           "Extrapolator")
        fwdFitter.Fit.FwdStateInit.UseFastMomentumEstimate = True
        fwdFitter.Fit.FwdStateInit.VeloFitterName = "FastVeloFitLHCbIDs"
        if (simplifiedGeometryFit):
            fwdFitter.Fit.FwdStateInit.Extrapolator.addTool(
                SimplifiedMaterialLocator, name="MaterialLocator")
        else:
            fwdFitter.Fit.FwdStateInit.Extrapolator.addTool(
                DetailedMaterialLocator, name="MaterialLocator")

        fwdFitter.Fit.Fit = "TrackMasterFitter/Fit"
        fwdFitter.Fit.addTool(TrackMasterFitter, name="Fit")

        from TrackFitter.ConfiguredFitters import ConfiguredMasterFitter
        ConfiguredMasterFitter(fwdFitter.Fit.Fit,
                               SimplifiedGeometry=simplifiedGeometryFit,
                               LiteClusters=liteClustersFit,
                               MSRossiAndGreisen=True)

        GaudiSequencer("TrackHLT1FitHLT1Seq").Members += [fwdFitter]
コード例 #9
0
#trackselectortool = TrackSelector( MaxChi2Cut="20", TrackTypes = [ "Long","Upstream","Velo" ] )

elements = TAlignment().getProp("ElementsToAlign")
print "Elements = ", elements

trackselectortool = TrackSelector(
    "AlignTrackSelectorTool",
    MaxChi2Cut="20",
    MinNDoF=2,
    MinNVeloPhiHits=5,
    MinNVeloRHits=5,
    #TrackTypes = [ "Long","Velo","Upstream" ]
    TrackTypes=["Velo", "Long"])

trackselectoralg = TrackContainerCopy(
    "AlignTrackSelector",
    inputLocation="Rec/Track/Best",
    outputLocation="Alignment/AlignmentTracks")
trackselectoralg.addTool(GetElementsToBeAligned(
    OutputLevel=TAlignment().getProp("OutputLevel"), Elements=elements),
                         name="GetElementsToBeAligned")

trackselectoralg.addTool(trackselectortool, "Selector")

trkselector = TrackSelector("VertexTrackSelector", TrackTypes=["Long"])
vertexresidualtool = Al__VertexResidualTool("Al::VertexResidualTool")
#vertexresidualtool.addTool(TrackSelector("TrackSelector",TrackTypes = [ "Long" ] ) )
vertexresidualtool.addTool(trkselector, name="MyTrackSelector")
vertexresidualtool.MyTrackSelector.TrackTypes = ["Long"]
#vertexresidualtool.MyTrackSelectorHandle = trkselector
#vertexresidualtool.UseCorrelations = computeVertexCorrelations
コード例 #10
0
TAlignment().TrackLocation = "Rec/Track/AlignTracks"
TAlignment().Constraints = constraints
TAlignment().WriteCondSubDetList = ['OT']

from Configurables import (PatSeeding, PatSeedingTool)
PatSeeding = PatSeeding("PatSeeding")
PatSeeding.addTool(PatSeedingTool("PatSeedingTool"))
PatSeeding.PatSeedingTool.MaxOTOccupancy = 0.02
PatSeeding.PatSeedingTool.MaxITOccupancy = 0.02
#PatSeeding.PatSeedingTool.CommonXFraction        = 0.
#PatSeeding.PatSeedingTool.MaxUsedFractPerRegion  = 0.
#PatSeeding.PatSeedingTool.MaxUsedFractITOT       = 0.
#PatSeeding.PatSeedingTool.MaxUsedFractLowQual    = 0.

# set up a track selection
from Configurables import (GaudiSequencer, TrackContainerCopy, TrackSelector,
                           TrackMonitor)
trackFilterSeq = GaudiSequencer("TrackFilterSeq")
alignSelector = TrackContainerCopy("AlignSelector",
                                   inputLocation="Rec/Track/Best",
                                   outputLocation="Rec/Track/AlignTracks")
alignSelector.addTool(TrackSelector("Selector", MaxChi2Cut=5))
trackFilterSeq.Members.append(alignSelector)
trackFilterSeq.Members.append(
    TrackMonitor("AlignTrackMonitor",
                 TracksInContainer="Rec/Track/AlignTracks"))

##############################################################################
# I/O datasets are defined in a separate file, see examples in 2008-TED_Data.py
##############################################################################
コード例 #11
0
def STPerformanceStudy(Name_Prefix="STPerf_",
                       Efficiency=True,
                       Residuals=True,
                       ActivateFullClusters=True,
                       TrackContainter=False):
    #Define tracks for ST Performance
    if not TrackContainter:
        from Configurables import TrackSelector, TrackContainerCopy
        goodtracksselector = TrackContainerCopy(
            name=Name_Prefix + "Selection",
            inputLocation='/Event/Rec/Track/Best',
            outputLocation='/Event/Rec/Track/PerformanceTracks')
        goodtracksselector.addTool(TrackSelector, name="Selector")
        goodtracksselector.Selector.MinPCut = 10000.
        goodtracksselector.Selector.MaxChi2Cut = 2.
        goodtracksselector.Selector.MaxChi2PerDoFMatch = 2.
        goodtracksselector.Selector.MaxChi2PerDoFDownstream = 2.
        goodtracksselector.Selector.MaxChi2PerDoFVelo = 2.
        goodtracksselector.Selector.TrackTypes = ["Long"]
        TrackLocation = '/Event/Rec/Track/PerformanceTracks'
    else:
        TrackLocation = TrackContainter

    #Define clusters used for ST Efficiency studies
    from Configurables import STClusterCollector
    # Search window (residual) for STEfficiency and STClusterCollector
    window = 0.4
    # Tolerance for X an Y in the first estimate of the track crossing the silicion position
    # and central position of the cluster
    xTol = 1.
    yTol = 0.

    # Collecting the ST clusters
    itClusterCollector = STClusterCollector("ToolSvc.ITClusterCollector")
    itClusterCollector.DetType = "IT"
    itClusterCollector.ignoreHitsOnTrack = False
    itClusterCollector.xTol = xTol
    itClusterCollector.yTol = yTol
    itClusterCollector.window = window
    itClusterCollector.MagFieldOn = True
    itClusterCollector.dataLocation = "/Event/Raw/IT/Clusters"

    ttClusterCollector = STClusterCollector("ToolSvc.TTClusterCollector")
    ttClusterCollector.DetType = "TT"
    ttClusterCollector.ignoreHitsOnTrack = False
    ttClusterCollector.xTol = xTol
    ttClusterCollector.yTol = yTol
    ttClusterCollector.window = window
    ttClusterCollector.MagFieldOn = True
    ttClusterCollector.dataLocation = "/Event/Raw/TT/Clusters"

    #Configuring ST Efficiency algorithms
    from Configurables import STEfficiency
    ttEff = STEfficiency(Name_Prefix + "TTHitEfficiency")
    ttEff.TracksInContainer = TrackLocation
    ttEff.DetType = "TT"
    ttEff.Cuts = [window]
    ttEff.XLayerCut = window  #0.4
    ttEff.StereoLayerCut = window  #0.4
    ttEff.MinExpectedSectors = 2  #2
    ttEff.MaxNbResSectors = 10  #10
    ttEff.MinStationPassed = 1  #1
    # Edge size excluded of the computation
    ttEff.MinDistToEdgeX = 2  #2
    ttEff.MinDistToEdgeY = 2  #2
    ttEff.ResidualsPlot = False
    ttEff.FullDetail = False
    ttEff.TH1DSummaryHist = True
    ttEff.EfficiencyPlot = False
    ttEff.SingleHitPerSector = True  #True
    ttEff.TakeEveryHit = True  #True
    ttEff.OutputLevel = 3

    itEff = STEfficiency(Name_Prefix + "ITHitEfficiency")
    itEff.TracksInContainer = TrackLocation
    itEff.DetType = "IT"
    itEff.Cuts = [window]
    itEff.XLayerCut = window  #0.4
    itEff.StereoLayerCut = window  #0.4
    itEff.MinExpectedSectors = 6  #6
    itEff.MaxNbResSectors = 10
    itEff.MinStationPassed = 3  #3
    # Edge size excluded of the computation
    itEff.MinDistToEdgeX = 2  #2
    itEff.MinDistToEdgeY = 2  #2
    itEff.ResidualsPlot = False
    itEff.FullDetail = False
    itEff.TH1DSummaryHist = True
    ttEff.EfficiencyPlot = False
    itEff.SingleHitPerSector = True
    itEff.TakeEveryHit = True
    itEff.OutputLevel = 3

    #Configuring Track Monitors to work in performance mode
    from Configurables import ITTrackMonitor, TTTrackMonitor
    itMon = ITTrackMonitor(Name_Prefix + 'ITTrackMonitor')
    itMon.TracksInContainer = TrackLocation
    itMon.FullDetail = False
    itMon.plotsByLayer = False
    itMon.plotsBySector = False
    itMon.ProfileSummaryHist = False
    itMon.TH2DSummaryHist = True
    itMon.minNumITHits = 6

    ttMon = TTTrackMonitor(Name_Prefix + 'TTTrackMonitor')
    ttMon.TracksInContainer = TrackLocation
    ttMon.FullDetail = False
    ttMon.plotsBySector = False
    ttMon.ProfileSummaryHist = False
    ttMon.TH2DSummaryHist = True
    ttMon.minNumTTHits = 2

    #These lines activates Full clusters. For .raw data only!
    #Access to the full clusters
    if ActivateFullClusters:
        from Configurables import TrackSys
        TrackSys().ExpertTracking = ["fullClustersHLT1", "fullClustersHLT2"]

    # Post configuration actions
    def PostConfigurationActions():
        from Configurables import GaudiSequencer
        if not TrackContainter:
            GaudiSequencer('MoniTrSeq').Members += [goodtracksselector]
        if Efficiency:
            GaudiSequencer('MoniTrSeq').Members += [itEff, ttEff]
        if Residuals:
            GaudiSequencer('MoniTrSeq').Members += [ttMon, itMon]

    from GaudiKernel.Configurable import appendPostConfigAction
    appendPostConfigAction(PostConfigurationActions)

    return True
コード例 #12
0
# trackFitAlg                           = TrackEventFitter("FitTracks",
#                                                          OutputLevel        = INFO,
#                                                          TracksInContainer  = "Alignment/FilterTracks1",
#                                                          TracksOutContainer = "Alignment/FittedTracks")
# trackFitAlg.addTool(TrackMasterFitter("Fitter"))
# trackMasterFitter = allConfigurables["FitTracks.Fitter"]
# trackMasterFitter.addTool(TrackMasterExtrapolator("Extrapolator"))
# trackMasterExtrapolator = allConfigurables["FitTracks.Fitter.Extrapolator"]
# trackMasterFitter.addTool(TrackKalmanFilter("NodeFitter"))
# trackMasterNodeFitter = allConfigurables["FitTracks.Fitter.NodeFitter"]
# trackMasterNodeFitter.addTool(TrackMasterExtrapolator("Extrapolator"))
# trackMasterNodeFitterExtrapolator = allConfigurables["FitTracks.Fitter.NodeFitter.Extrapolator"]
# importOptions("$TALIGNMENTROOT/options/BFieldOff.opts")

#AlConfigurable().filterSeq().Members.append( trackFitAlg )

from Configurables import (TrackContainerCopy, TrackSelector)

trackContCopy = TrackContainerCopy(
    "FilterTracks2",
    OutputLevel=INFO,
    inputLocations=["Alignment/FilterTracks1"],  #"Alignment/FittedTracks",
    outputLocation="Alignment/AlignmentTracks",
    copyFailures=False)

trackContCopy.addTool(TrackSelector(), name="Selector")
trackContCopy.Selector.TrackTypes = ["Long", "Ttrack"]
trackContCopy.Selector.MaxChi2Cut = 40.0

TAlignment().filterSeq().Members.append(trackContCopy)
コード例 #13
0
ファイル: AlignVelo.py プロジェクト: marromlam/lhcb-software
## Here we configure the track fitting/selection and what else?
## importOptions( trackingOpts )
from Configurables import (TrackContainerCopy, TrackSelector)
#trackselectortool = TrackSelector( MinPCut = "3000", MaxChi2Cut="20", TrackTypes = [ "Long","Upstream","Velo" ] )
#trackselectortool = TrackSelector( MaxChi2Cut="20", TrackTypes = [ "Long","Upstream","Velo" ] )
trackselectortool = TrackSelector(
    "AlignTrackSelectorTool",
    MaxChi2Cut="20",
    MinNDoF=2,
    MinNVeloPhiHits=5,
    MinNVeloRHits=5,
    #TrackTypes = [ "Long","Velo","Upstream" ]
    TrackTypes=["Velo"])

trackselectoralg = TrackContainerCopy(
    "AlignTrackSelector",
    inputLocations=["Rec/Track/Best"],
    outputLocation="Alignment/AlignmentTracks")
trackselectoralg.addTool(trackselectortool, "Selector")
AlConfigurable().filterSeq().Members.append(trackselectoralg)

from Configurables import (Al__VertexResidualTool, Al__AlignConstraintTool)

trkselector = TrackSelector("VertexTrackSelector", TrackTypes=["Long"])
vertexresidualtool = Al__VertexResidualTool("Al::VertexResidualTool")
#vertexresidualtool.addTool(TrackSelector("TrackSelector",TrackTypes = [ "Long" ] ) )
vertexresidualtool.addTool(trkselector, name="MyTrackSelector")
vertexresidualtool.MyTrackSelector.TrackTypes = ["Long"]
#vertexresidualtool.MyTrackSelectorHandle = trkselector
vertexresidualtool.ComputeCorrelations = computeVertexCorrelations

## run some monitoring code
コード例 #14
0
def RecoTracking(exclude=[]):
    '''What used to be in the options file, moved here'''
    ## Start TransportSvc, needed by track fit
    ApplicationMgr().ExtSvc.append("TransportSvc")

    ## --------------------------------------------------------------------
    ## Pattern Recognition and Fitting
    ## --------------------------------------------------------------------

    # Which algs to run ?
    trackAlgs = TrackSys().getProp("TrackPatRecAlgorithms")

    # Which data type is it?
    dataType = TrackSys().getProp("DataType")

    # Decode the RAW banks
    DecodeTracking(trackAlgs)

    from Configurables import STOfflinePosition
    IT = STOfflinePosition('ITClusterPosition')
    IT.DetType = "IT"
    TT = STOfflinePosition('TTClusterPosition')
    TT.DetType = "TT"

    from STTools import STOfflineConf
    STOfflineConf.DefaultConf().configureTools()

    #importOptions( "$STTOOLSROOT/options/Brunel.opts" )

    ## Velo tracking
    if "FastVelo" in trackAlgs:
        from Configurables import FastVeloTracking
        GaudiSequencer("RecoVELOSeq").Members += [FastVeloTracking()]
        if TrackSys().timing():
            FastVeloTracking().TimingMeasurement = True

    if "Velo" in trackAlgs:
        from Configurables import Tf__PatVeloGeneralTracking
        if TrackSys().veloOpen():
            if TrackSys().beamGas():
                from Configurables import Tf__PatVeloGeneric
                GaudiSequencer("RecoVELOSeq").Members += [
                    Tf__PatVeloGeneric("PatVeloGeneric"),
                    Tf__PatVeloGeneralTracking("PatVeloGeneralTracking")
                ]
            else:
                from Configurables import Tf__PatVeloTrackTool
                GaudiSequencer("RecoVELOSeq").Members += [
                    Tf__PatVeloGeneralTracking("PatVeloGeneralTracking")
                ]
                Tf__PatVeloGeneralTracking(
                    "PatVeloGeneralTracking").PointErrorMin = 2 * mm
                Tf__PatVeloGeneralTracking("PatVeloGeneralTracking").addTool(
                    Tf__PatVeloTrackTool("PatVeloTrackTool"))
                Tf__PatVeloTrackTool("PatVeloTrackTool").highChargeFract = 0.5
                if TrackSys().timing():
                    Tf__PatVeloGeneralTracking(
                        "PatVeloGeneralTracking").TimingMeasurement = True
        else:
            from Configurables import (Tf__PatVeloRTracking,
                                       Tf__PatVeloSpaceTool,
                                       Tf__PatVeloSpaceTracking)
            GaudiSequencer("RecoVELOSeq").Members += [
                Tf__PatVeloRTracking("PatVeloRTracking"),
                Tf__PatVeloSpaceTracking("PatVeloSpaceTracking"),
                Tf__PatVeloGeneralTracking("PatVeloGeneralTracking")
            ]
            Tf__PatVeloSpaceTracking("PatVeloSpaceTracking").addTool(
                Tf__PatVeloSpaceTool(), name="PatVeloSpaceTool")
            Tf__PatVeloSpaceTracking("PatVeloSpaceTracking"
                                     ).PatVeloSpaceTool.MarkClustersUsed = True
            if TrackSys().timing():
                Tf__PatVeloSpaceTracking(
                    "PatVeloSpaceTracking").TimingMeasurement = True
                Tf__PatVeloRTracking(
                    "PatVeloRTracking").TimingMeasurement = True
                Tf__PatVeloGeneralTracking(
                    "PatVeloGeneralTracking").TimingMeasurement = True

    ## Make sure the default extrapolator and interpolator use simplified material
    if TrackSys().simplifiedGeometry() and ('SimpleGeom' not in exclude):
        from Configurables import TrackMasterExtrapolator, TrackInterpolator
        TrackMasterExtrapolator().MaterialLocator = 'SimplifiedMaterialLocator'
        TrackInterpolator().addTool(TrackMasterExtrapolator(
            MaterialLocator='SimplifiedMaterialLocator'),
                                    name='Extrapolator')

    ## Tracking sequence
    from Configurables import ProcessPhase
    track = ProcessPhase("Track")
    GaudiSequencer("RecoTrSeq").Members += [track]

    from Configurables import MagneticFieldSvc
    if TrackSys().fieldOff():
        MagneticFieldSvc().ForcedSignedCurrentScaling = 0.

    if "noDrifttimes" in TrackSys().getProp("ExpertTracking"):
        from Configurables import (Tf__OTHitCreator)
        Tf__OTHitCreator("OTHitCreator").NoDriftTimes = True

    # Get the fitters
    from TrackFitter.ConfiguredFitters import ConfiguredFit, ConfiguredFitSeed, ConfiguredMasterFitter

    # Clone killer
    tracklists = []

    # Is this standard sequence?
    stdSeq = "fastSequence" not in TrackSys().getProp("ExpertTracking")

    # TrackMatching not supported anymore, raise error
    if "Match" in trackAlgs:
        raise RuntimeError(
            "TrackMatching not supported anymore. If you think this is wrong, report to [email protected]"
        )

    ## Forward pattern
    if "Forward" in trackAlgs:
        track.DetectorList += ["ForwardPat"]
        from Configurables import PatForward
        GaudiSequencer("TrackForwardPatSeq").Members += [
            PatForward("PatForward")
        ]
        from PatAlgorithms import PatAlgConf
        PatAlgConf.ForwardConf().configureAlg()
        if TrackSys().timing():
            PatForward("PatForward").TimingMeasurement = True
        tracklists += ["Rec/Track/Forward"]

    ## Seed pattern
    if "TsaSeed" in trackAlgs and "PatSeed" in trackAlgs:
        raise RuntimeError("Cannot run both Tsa and Pat Seeding at once")

    if "TsaSeed" in trackAlgs:
        track.DetectorList += ["SeedPat"]
        from Configurables import Tf__Tsa__Seed, Tf__Tsa__SeedTrackCnv
        GaudiSequencer("TrackSeedPatSeq").Members += [
            Tf__Tsa__Seed("TsaSeed"),
            Tf__Tsa__SeedTrackCnv("TsaSeedTrackCnv")
        ]
        from TsaAlgorithms import TsaAlgConf
        TsaAlgConf.TsaSeedConf().configureAlg()
        if TrackSys().timing():
            Tf__Tsa__Seed("TsaSeed").TimingMeasurement = True

    if "PatSeed" in trackAlgs:
        track.DetectorList += ["SeedPat"]
        from Configurables import PatSeeding
        GaudiSequencer("TrackSeedPatSeq").Members += [PatSeeding("PatSeeding")]
        from PatAlgorithms import PatAlgConf
        PatAlgConf.SeedingConf().configureAlg()

        if TrackSys().timing():
            PatSeeding("PatSeeding").TimingMeasurement = True

        if TrackSys().cosmics():
            from PatAlgorithms import PatAlgConf
            PatAlgConf.CosmicConf().configureAlg()

    if "TsaSeed" in trackAlgs or "PatSeed" in trackAlgs:
        tracklists += ["Rec/Track/Seed"]
        # TrackMatching not supported anymore, comment for the moment in case anything breaks
        #if "Match" in trackAlgs :
        # Fit now
        #track.DetectorList += [ "SeedFit" ]
        ## Seed fit initialization
        #from Configurables import TrackStateInitAlg, TrackStateInitTool
        #initSeedFit = TrackStateInitAlg("InitSeedFit",
        #                                TrackLocation = "Rec/Track/Seed")
        #GaudiSequencer("TrackSeedFitSeq").Members += [initSeedFit]
        #if "FastVelo" in trackAlgs :
        #   initSeedFit.StateInitTool.VeloFitterName = "FastVeloFitLHCbIDs"
        # Use small ErrorQoP fitter, needed for Match
        #GaudiSequencer("TrackSeedFitSeq").Members += [ConfiguredFitSeed()]

    # TrackMatching not supported anymore, comment for the moment in case anything breaks
    ## Match
    #if "Match" in trackAlgs and "PatMatch" in trackAlgs :
    #   raise RuntimeError("Cannot run both TrackMatching and PatMatch at once")
    #if "Match" in trackAlgs :
    #   track.DetectorList += [ "MatchPat" ]
    #   from Configurables import TrackMatchVeloSeed
    #   GaudiSequencer("TrackMatchPatSeq").Members += [ TrackMatchVeloSeed("TrackMatch") ]
    #   from TrackMatching import TrackMatchConf
    #   TrackMatchConf.MatchingConf().configureAlg()
    #   TrackMatchVeloSeed("TrackMatch").LikCut = -99999.
    #   if TrackSys().timing() :
    #      TrackMatchVeloSeed("TrackMatch").TimingMeasurement = True;

    if "PatMatch" in trackAlgs:
        track.DetectorList += ["MatchPat"]
        from Configurables import PatMatch
        GaudiSequencer("TrackMatchPatSeq").Members += [PatMatch("PatMatch")]
    if "Match" in trackAlgs or "PatMatch" in trackAlgs:
        tracklists += ["Rec/Track/Match"]

    ## Downstream
    if "Downstream" in trackAlgs:
        track.DetectorList += ["DownstreamPat"]
        from Configurables import PatDownstream
        GaudiSequencer("TrackDownstreamPatSeq").Members += [PatDownstream()]
        tracklists += ["Rec/Track/Downstream"]
        from PatAlgorithms import PatAlgConf
        #PatAlgConf.DownstreamConf().configureAlg()
        if TrackSys().timing():
            PatDownstream("PatDownstream").TimingMeasurement = True

    ## Velo-TT pattern
    if "VeloTT" in trackAlgs:
        track.DetectorList += ["VeloTTPat"]
        # from 2015 on, 'VeloTTHybrid' is used (as in the HLT)
        # on python configuration is used
        if dataType is "2015":
            from Configurables import PatVeloTTHybrid
            GaudiSequencer("TrackVeloTTPatSeq").Members += [
                PatVeloTTHybrid("PatVeloTTHybrid")
            ]
            if TrackSys().timing():
                PatVeloTTHybrid("PatVeloTTHybrid").TimingMeasurement = True
        # for everything older, the old 'PatVeloTT' is run
        else:
            from Configurables import PatVeloTT
            GaudiSequencer("TrackVeloTTPatSeq").Members += [
                PatVeloTT("PatVeloTT")
            ]
            from PatVeloTT.PatVeloTTAlgConf import PatVeloTTConf
            PatVeloTTConf().configureAlg()
            if TrackSys().timing():
                PatVeloTT("PatVeloTT").TimingMeasurement = True
        tracklists += ["Rec/Track/VeloTT"]

    ### Clean clone and fit
    track.DetectorList += ["Fit"]
    if TrackSys().getProp("OldCloneKiller"):
        from Configurables import TrackEventCloneKiller, TrackStateInitAlg, TrackContainerCopy
        cloneKiller = TrackEventCloneKiller()
        cloneKiller.TracksInContainers = tracklists
        cloneKiller.TracksOutContainer = "Rec/Track/AllBest"
        GaudiSequencer("TrackFitSeq").Members += [cloneKiller]
        stateInitAlg = TrackStateInitAlg("InitBestFit")
        stateInitAlg.TrackLocation = "Rec/Track/AllBest"
        if "FastVelo" in trackAlgs:
            stateInitAlg.StateInitTool.VeloFitterName = "FastVeloFitLHCbIDs"
        GaudiSequencer("TrackFitSeq").Members += [stateInitAlg]

        GaudiSequencer("TrackFitSeq").Members += [
            ConfiguredFit("FitBest", "Rec/Track/AllBest")
        ]
        copyBest = TrackContainerCopy("CopyBest")
        copyBest.inputLocations = ["Rec/Track/AllBest"]
        GaudiSequencer("TrackFitSeq").Members += [copyBest]

        ## Velo fitting
        if "Velo" in trackAlgs or "FastVelo" in trackAlgs:
            ## Prepare the velo tracks for the fit
            track.DetectorList += ["VeloFit"]
            from Configurables import TrackPrepareVelo
            GaudiSequencer("TrackVeloFitSeq").Members += [TrackPrepareVelo()]
            ## Fit the velo tracks
            GaudiSequencer("TrackVeloFitSeq").Members += [
                ConfiguredFit("FitVelo", "Rec/Track/PreparedVelo")
            ]
            ## copy the velo tracks to the "best" container
            copyVelo = TrackContainerCopy("CopyVelo")
            copyVelo.inputLocations = ["Rec/Track/PreparedVelo"]
            GaudiSequencer("TrackVeloFitSeq").Members += [copyVelo]
    else:
        # complete the list of track lists
        if "Velo" in trackAlgs or "FastVelo" in trackAlgs:
            tracklists += ["Rec/Track/Velo"]
        # create the best track creator
        from Configurables import TrackBestTrackCreator
        bestTrackCreator = TrackBestTrackCreator(TracksInContainers=tracklists)
        # configure its fitter and stateinittool
        ConfiguredMasterFitter(bestTrackCreator.Fitter)
        if "FastVelo" in trackAlgs:
            bestTrackCreator.StateInitTool.VeloFitterName = "FastVeloFitLHCbIDs"
        # add to the sequence
        GaudiSequencer("TrackFitSeq").Members.append(bestTrackCreator)

    ### Change dEdx correction for simulated data
    if TrackSys().getProp("Simulation"):
        from Configurables import StateDetailedBetheBlochEnergyCorrectionTool, DetailedMaterialLocator
        if TrackSys().getProp("OldCloneKiller"):
            from Configurables import TrackEventFitter, TrackMasterFitter
            fitBest = TrackEventFitter("FitBest")
            fitBest.Fitter.MaterialLocator.addTool(
                StateDetailedBetheBlochEnergyCorrectionTool("GeneralDedxTool"))
            fitBest.Fitter.MaterialLocator.GeneralDedxTool.EnergyLossFactor = 0.76
        else:
            from Configurables import TrackBestTrackCreator
            fitter = TrackBestTrackCreator().Fitter
            fitter.MaterialLocator.addTool(
                StateDetailedBetheBlochEnergyCorrectionTool("GeneralDedxTool"))
            fitter.MaterialLocator.GeneralDedxTool.EnergyLossFactor = 0.76

    ## Extra track information sequence
    extraInfos = TrackSys().getProp("TrackExtraInfoAlgorithms")
    if len(extraInfos) > 0:

        track.DetectorList += ["AddExtraInfo"]

        ## Clone finding and flagging
        if "CloneFlagging" in extraInfos:
            from Configurables import TrackBuildCloneTable, TrackCloneCleaner
            trackClones = GaudiSequencer("TrackClonesSeq")
            GaudiSequencer("TrackAddExtraInfoSeq").Members += [trackClones]
            if TrackSys().timing():
                trackClones.MeasureTime = True
            cloneTable = TrackBuildCloneTable("FindTrackClones")
            cloneTable.maxDz = 500 * mm
            cloneTable.zStates = [0 * mm, 990 * mm, 9450 * mm]
            cloneTable.klCut = 5e3
            cloneCleaner = TrackCloneCleaner("FlagTrackClones")
            cloneCleaner.CloneCut = 5e3
            trackClones.Members += [cloneTable, cloneCleaner]

        ## Add expected hit information
        #if "ExpectedHits" in extraInfos :
        #   GaudiSequencer("TrackAddExtraInfoSeq").Members += [ TrackComputeExpectedHits() ]

        ## Add the likelihood information
        if "TrackLikelihood" in extraInfos and ('TrackLikelihood'
                                                not in exclude):
            from Configurables import TrackAddLikelihood, TrackLikelihood
            trackAddLikelihood = TrackAddLikelihood()
            trackAddLikelihood.addTool(TrackLikelihood,
                                       name="TrackMatching_likTool")
            trackAddLikelihood.TrackMatching_likTool.otEff = 0.9
            GaudiSequencer("TrackAddExtraInfoSeq").Members += [
                trackAddLikelihood
            ]

        ## ghost probability using a Neural Net
        if "GhostProbability" in extraInfos:
            from Configurables import TrackAddNNGhostId, TrackNNGhostId
            nn = TrackAddNNGhostId()
            GaudiSequencer("TrackAddExtraInfoSeq").Members += [nn]

    track.DetectorList += ["EraseExtraInformation"]
    from Configurables import TrackEraseExtraInfo
    GaudiSequencer("TrackEraseExtraInformationSeq").Members += [
        TrackEraseExtraInfo()
    ]

    ## Muon alignment tracks
    if "MuonAlign" in trackAlgs:
        from Configurables import TrackEventFitter, AlignMuonRec
        track.DetectorList += ["MuonRec"]
        GaudiSequencer("TrackMuonRecSeq").Members += [
            AlignMuonRec("AlignMuonRec"),
            TrackEventFitter("MuonTrackFitter")
        ]
        importOptions("$TRACKSYSROOT/options/AlignMuonRec.opts")
        if TrackSys().fieldOff():
            AlignMuonRec("AlignMuonRec").BField = False
            importOptions("$STDOPTS/DstContentMuonAlign.opts")
コード例 #15
0
def doMyAlignChanges():
    from Configurables import TrackEventFitter, VeloTrackSelector
    from TrackFitter.ConfiguredFitters import ConfiguredStraightLineFitter
    TweakFitter(TrackEventFitter('FitMatch'))
    TweakFitter(TrackEventFitter('FitForward'))
    TweakFitter(TrackEventFitter('FitSeed'))
    TweakFitter(TrackEventFitter('FitVelo'))
    TweakFitter(TrackEventFitter('FitVeloTT'))
    TweakFitter(TrackEventFitter('RefitSeed'))
    TweakFitter(TrackEventFitter('TrackRefitter'))

    # add a filter on Velo tracks
    from Configurables import TrackListFilter
    GaudiSequencer("RecoVELOSeq").Members += [
        TrackListFilter("VeloFilter", inputLocation="Rec/Track/Velo")
    ]

    GaudiSequencer("RecoVELOSeq").Members += [
        TrackContainerCopy('VeloOnlyContainerCopy',
                           inputLocation="Rec/Track/Velo",
                           outputLocation="Rec/Track/VeloOnly",
                           copyFailures=True,
                           Selector=None),
        ConfiguredStraightLineFitter('VeloOnlyFitter',
                                     TracksInContainer="Rec/Track/VeloOnly")
    ]

    veloOnlyRefiner = TrackListRefiner(
        "VeloOnlySelector",
        inputLocation="Rec/Track/VeloOnly",
        outputLocation="Rec/Track/SelectedVeloOnly",
        Selector=TrackSelector())
    veloOnlyRefiner.Selector.MaxChi2Cut = 5
    #veloOnlyRefiner.OutputLevel = 1

    GaudiSequencer("RecoVELOSeq").Members.append(veloOnlyRefiner)

    GaudiSequencer("RecoVELOSeq").Members += [
        TrackListRefiner('VeloASideSelector',
                         inputLocation="Rec/Track/SelectedVeloOnly",
                         outputLocation="Rec/Track/VeloASide",
                         Selector=VeloTrackSelector()),
        TrackCaloMatchMonitor("VeloAEcalMatchMonitor",
                              TrackLocation='Rec/Track/VeloASide',
                              CaloSystem='Ecal',
                              RequireTHits=False)
    ]
    TrackListRefiner('VeloASideSelector').Selector.MinHitsASide = 6

    GaudiSequencer("RecoVELOSeq").Members += [
        TrackListRefiner('VeloCSideSelector',
                         inputLocation="Rec/Track/SelectedVeloOnly",
                         outputLocation="Rec/Track/VeloCSide",
                         Selector=VeloTrackSelector()),
        TrackCaloMatchMonitor("VeloCEcalMatchMonitor",
                              TrackLocation='Rec/Track/VeloCSide',
                              CaloSystem='Ecal',
                              RequireTHits=False)
    ]
    TrackListRefiner('VeloCSideSelector').Selector.MinHitsCSide = 6

    from Configurables import AlRobustAlignAlg
    GaudiSequencer("AlignMonitorSeq").Members += [
        AlRobustAlignAlg('VeloARobustAlign',
                         TrackLocation="Rec/Track/VeloASide"),
        AlRobustAlignAlg('VeloCRobustAlign',
                         TrackLocation="Rec/Track/VeloCSide")
    ]
    GaudiSequencer("AlignPostMonitorSeq").Members += [
        AlRobustAlignAlg('VeloARobustAlignPost',
                         TrackLocation="Rec/Track/VeloASide"),
        AlRobustAlignAlg('VeloCRobustAlignPost',
                         TrackLocation="Rec/Track/VeloCSide")
    ]

    from Configurables import Tf__Tsa__Seed, Tf__Tsa__SeedAddHits
    tsaSeed = Tf__Tsa__Seed("TsaSeed")
    tsaSeed.addTool(Tf__Tsa__SeedAddHits(), name="SeedAddHits")
    # tolerance if inside box mm
    tsaSeed.SeedAddHits.tol = 5
    # tolerance window make bigger mmm
    tsaSeed.SeedAddHits.dCut = 2
    # chi-sq cut
    tsaSeed.SeedAddHits.outlierCutParabola = 5

    from Configurables import STOfflinePosition
    itClusterPosition = STOfflinePosition('ToolSvc.ITClusterPosition')
    itClusterPosition.ErrorVec = [0.28, 0.22, 0.35, 0.35]
    itClusterPosition.APE = 0.1

    from Configurables import TrackFieldOffMatchMonitor

    seedRefiner = TrackListRefiner("SeedSelector",
                                   inputLocation="Rec/Track/Seed",
                                   outputLocation="Rec/Track/SelectedSeed",
                                   Selector=TrackSelector())
    seedRefiner.Selector.MaxChi2Cut = 5

    GaudiSequencer('MoniTrSeq').Members += [
        seedRefiner,
        TrackFieldOffMatchMonitor(
            VeloTrackLocation='Rec/Track/SelectedVeloOnly',
            SeedTrackLocation='Rec/Track/SelectedSeed')
    ]

    from Configurables import TrackMatchVeloSeed
    TrackMatchVeloSeed("TrackMatch").Chi2MatchingCut = 500
コード例 #16
0
constraints.append(
    "VPFixModule40 : VP/VPLeft/Module40WithSupport: Tx Ty Tz Rx Ry Rz")
constraints.append(
    "VPFixModule41 : VP/VPRight/Module41WithSupport: Tx Ty Tz Rx Ry Rz")
constraints.append(
    "VPFixModule50 : VP/VPLeft/Module50WithSupport: Tx Ty Tz Rx Ry Rz")
constraints.append(
    "VPFixModule51 : VP/VPRight/Module51WithSupport: Tx Ty Tz Rx Ry Rz")
# constraints = []
print "aligning elements ", elements
trackRefitSeq = GaudiSequencer("TrackRefitSeq")

# create a track list for tracks with velo hits
velotrackselector = TrackContainerCopy(
    "TracksWithVeloHits",
    inputLocation="Rec/Track/Best",
    outputLocation="Rec/Track/TracksWithVeloHits",
    Selector=TrackSelector())

# refit the tracks in that list
velotrackrefitter = ConfiguredEventFitter(
    Name="TracksWithVeloHitsFitter",
    TracksInContainer="Rec/Track/TracksWithVeloHits",
    FieldOff=True)
velotrackrefitter.Fitter.MeasProvider.IgnoreIT = True
velotrackrefitter.Fitter.MeasProvider.IgnoreOT = True
velotrackrefitter.Fitter.MeasProvider.IgnoreTT = True
velotrackrefitter.Fitter.MeasProvider.IgnoreMuon = True
velotrackrefitter.Fitter.MeasProvider.IgnoreUT = True
velotrackrefitter.Fitter.MakeNodes = True
velotrackrefitter.Fitter.MakeMeasurements = True
コード例 #17
0
def RecoTrackingHLT2(exclude=[],
                     simplifiedGeometryFit=True,
                     liteClustersFit=True):
    '''Function that defines the pattern recognition algorithms for the HLT2 sequence of the Run 2 offline tracking'''

    ## Tracking sequence
    from Configurables import ProcessPhase
    track = ProcessPhase("TrackHLT2")
    GaudiSequencer("RecoTrHLT2Seq").Members += [track]

    tracklists = []

    # Which algs to run ?
    trackAlgs = TrackSys().getProp("TrackPatRecAlgorithms")

    # Which data type is it?
    dataType = TrackSys().getProp("DataType")

    ## Forward pattern
    if "ForwardHLT2" in trackAlgs:
        track.DetectorList += ["ForwardPatHLT2"]
        # Need to filter out the Velo tracks of the fitted HLT1 tracks
        #from Configurables import TrackListRefiner, TrackSelector
        #refiner = TrackListRefiner("FilterForwardHLT1Tracks")
        #refiner.inputLocation = "Rec/Track/FittedHLT1Tracks"
        #refiner.outputLocation = "Rec/Track/FittedHLT1ForwardTracks"
        #refiner.Selector = "TrackSelector"
        #refiner.addTool(TrackSelector("TrackSelector"))
        #refiner.TrackSelector.TrackTypes = [ "Long" ]
        #GaudiSequencer("TrackHLT2ForwardPatHLT2Seq").Members +=  [ refiner ]

        from Configurables import PatForward
        GaudiSequencer("TrackHLT2ForwardPatHLT2Seq").Members += [
            PatForward("PatForwardHLT2")
        ]
        from PatAlgorithms import PatAlgConf
        PatAlgConf.ForwardConf().configureAlgRun2HLT2()
        if TrackSys().timing():
            PatForward("PatForwardHLT2").TimingMeasurement = True
            #tracklists += ["Rec/Track/ForwardHLT2"]

        #merge forward from HLT1 and HLT2
        from Configurables import TrackContainerCopy
        merger = TrackContainerCopy("MergeForwardHLT1HLT2")
        merger.inputLocations = [
            "Rec/Track/FittedHLT1ForwardTracks", "Rec/Track/ForwardHLT2"
        ]
        merger.outputLocation = "Rec/Track/Forward"
        merger.copyFailures = True
        GaudiSequencer("TrackHLT2ForwardPatHLT2Seq").Members += [merger]
        tracklists += ["Rec/Track/Forward"]

    ## Seed pattern
    if "PatSeed" in trackAlgs:
        track.DetectorList += ["SeedPat"]
        from Configurables import PatSeeding
        GaudiSequencer("TrackHLT2SeedPatSeq").Members += [
            PatSeeding("PatSeeding")
        ]
        # should be replaced by more 'global' tracking configuration
        from PatAlgorithms import PatAlgConf
        PatAlgConf.SeedingConf().configureAlg()

        if TrackSys().timing():
            PatSeeding("PatSeeding").TimingMeasurement = True

        if TrackSys().cosmics():
            from PatAlgorithms import PatAlgConf
            PatAlgConf.CosmicConf().configureAlg()

        tracklists += ["Rec/Track/Seed"]

    ## Matching
    if "PatMatch" in trackAlgs:
        track.DetectorList += ["MatchPat"]
        from Configurables import PatMatch
        GaudiSequencer("TrackHLT2MatchPatSeq").Members += [
            PatMatch("PatMatch")
        ]
        # timing?
        # global conf?
        tracklists += ["Rec/Track/Match"]

    ## avoid running both downstream algos
    if "Downstream" in trackAlgs and "PatLongLivedTracking" in trackAlgs:
        raise RuntimeError(
            "Cannot run both PatDownstream and PatLongLivedTracking at once")

    ## Downstream
    if "Downstream" in trackAlgs:
        track.DetectorList += ["DownstreamPat"]
        from Configurables import PatDownstream
        GaudiSequencer("TrackHLT2DownstreamPatSeq").Members += [
            PatDownstream("PatDownstream")
        ]
        from PatAlgorithms import PatAlgConf
        # global conf?
        #PatAlgConf.DownstreamConf().configureAlg()
        if TrackSys().timing():
            PatDownstream("PatDownstream").TimingMeasurement = True
        tracklists += ["Rec/Track/Downstream"]

    ## PatLongLivedTracking (aka improved Downstream)
    if "PatLongLivedTracking" in trackAlgs:
        track.DetectorList += ["DownstreamPat"]
        from Configurables import PatLongLivedTracking
        GaudiSequencer("TrackHLT2DownstreamPatSeq").Members += [
            PatLongLivedTracking("PatLongLivedTracking")
        ]
        if TrackSys().timing():
            PatLongLivedTracking(
                "PatLongLivedTracking").TimingMeasurement = True
        tracklists += ["Rec/Track/Downstream"]

    fit = ProcessPhase("FitHLT2")
    GaudiSequencer("RecoTrHLT2Seq").Members += [fit]
    ### Clean clone and fit
    fit.DetectorList += ["Best"]

    # complete the list of track lists
    if "FastVelo" in trackAlgs:
        tracklists += ["Rec/Track/Velo"]

    if "VeloTT" in trackAlgs:
        tracklists += ["Rec/Track/VeloTT"]

    # create the best track creator
    # note the comment for the HLT1 forward fitter about configurations
    from TrackFitter.ConfiguredFitters import ConfiguredMasterFitter
    from Configurables import TrackBestTrackCreator, TrackMasterFitter, TrackStateInitTool

    # add and cut on the GP in the TrackBestTrackCreator
    # the variable is needed later
    addGhostProbTBTC = True

    bestTrackCreator = TrackBestTrackCreator(TracksInContainers=tracklists)
    bestTrackCreator.MaxChi2DoF = 4.0
    bestTrackCreator.addTool(TrackMasterFitter, name="Fitter")
    bestTrackCreator.DoNotRefit = True
    bestTrackCreator.addTool(TrackStateInitTool, name="StateInitTool")
    bestTrackCreator.StateInitTool.UseFastMomentumEstimate = True
    # cut on ghost prob
    bestTrackCreator.AddGhostProb = addGhostProbTBTC
    bestTrackCreator.GhostIdTool = "Run2GhostId"
    bestTrackCreator.MaxGhostProb = 0.4
    # configure its fitter and stateinittool
    ConfiguredMasterFitter(getattr(bestTrackCreator, "Fitter"),
                           SimplifiedGeometry=simplifiedGeometryFit,
                           LiteClusters=liteClustersFit,
                           MSRossiAndGreisen=True)
    if "FastVelo" in trackAlgs:
        bestTrackCreator.StateInitTool.VeloFitterName = "FastVeloFitLHCbIDs"
    # add to the sequence
    GaudiSequencer("FitHLT2BestSeq").Members += [bestTrackCreator]

    ### Change dEdx correction for simulated data
    #if TrackSys().getProp("Simulation"):
    #   from Configurables import StateDetailedBetheBlochEnergyCorrectionTool,DetailedMaterialLocator
    #   from Configurables import TrackBestTrackCreator
    #   fitter = TrackBestTrackCreator().Fitter
    #   fitter.MaterialLocator.addTool(StateDetailedBetheBlochEnergyCorrectionTool("GeneralDedxTool"))
    #   fitter.MaterialLocator.GeneralDedxTool.EnergyLossFactor = 0.76

    # Make V0
    # needs to be done after fitting, but before the extra infos
    from Configurables import TrackV0Finder
    V0 = ProcessPhase("RecV0")
    GaudiSequencer("RecoTrHLT2Seq").Members += [V0]
    V0.DetectorList += ["MakeV0"]
    ### Clean clone and fit
    trackV0Finder = TrackV0Finder("TrackV0Finder")
    GaudiSequencer("RecV0MakeV0Seq").Members += [trackV0Finder]

    #########################################################
    ##########################################################

    addExtraInfo = ProcessPhase("AddExtraInfo")
    GaudiSequencer("RecoTrHLT2Seq").Members += [addExtraInfo]

    ## Extra track information sequence
    extraInfos = TrackSys().getProp("TrackExtraInfoAlgorithms")
    if len(extraInfos) > 0:

        ## Clone finding and flagging
        if "CloneFlagging" in extraInfos:

            addExtraInfo.DetectorList += ["Clones"]

            from Configurables import TrackBuildCloneTable, TrackCloneCleaner
            #trackClones = GaudiSequencer("TrackClonesSeq")
            if TrackSys().timing():
                trackClones.MeasureTime = True
            cloneTable = TrackBuildCloneTable("FindTrackClones")
            cloneTable.maxDz = 500 * mm
            cloneTable.zStates = [0 * mm, 990 * mm, 9450 * mm]
            cloneTable.klCut = 5e3
            cloneCleaner = TrackCloneCleaner("FlagTrackClones")
            cloneCleaner.CloneCut = 5e3
            #trackClones.Members += [ cloneTable, cloneCleaner ]
            GaudiSequencer("AddExtraInfoClonesSeq").Members += [
                cloneTable, cloneCleaner
            ]

        ## Add the likelihood information
        if "TrackLikelihood" in extraInfos and ('TrackLikelihood'
                                                not in exclude):

            addExtraInfo.DetectorList += ["TrackLikelihood"]

            from Configurables import TrackAddLikelihood, TrackLikelihood
            trackAddLikelihood = TrackAddLikelihood()
            trackAddLikelihood.addTool(TrackLikelihood,
                                       name="TrackMatching_likTool")
            trackAddLikelihood.TrackMatching_likTool.otEff = 0.9
            GaudiSequencer("AddExtraInfoTrackLikelihoodSeq").Members += [
                trackAddLikelihood
            ]

        ## ghost probability using a Neural Net
        if "GhostProbability" in extraInfos and addGhostProbTBTC is False:

            addExtraInfo.DetectorList += ["GhostProb"]

            from Configurables import TrackAddNNGhostId
            nn = TrackAddNNGhostId("TrackAddNNGhostdId")
            nn.GhostIdTool = "Run2GhostId"  # to be decided
            GaudiSequencer("AddExtraInfoGhostProbSeq").Members += [nn]

    # this is very misleading (naming wise), but it will erase extra info that is put on the track by some algorithms
    # (not of the ones beforehand).
    addExtraInfo.DetectorList += ["EraseExtraInfo"]
    from Configurables import TrackEraseExtraInfo

    # erase extra info on Best tracks and on fitted Velo tracks (i.e. on everything that is saved on a DST)
    eraseExtraInfoBest = TrackEraseExtraInfo("TrackEraseExtraInfoBest")
    eraseExtraInfoFittedVelo = TrackEraseExtraInfo(
        "TrackEraseExtraInfoFittedVelo")
    eraseExtraInfoFittedVelo.InputLocation = "Rec/Track/FittedHLT1VeloTracks"

    GaudiSequencer("AddExtraInfoEraseExtraInfoSeq").Members += [
        eraseExtraInfoBest, eraseExtraInfoFittedVelo
    ]

    ## Muon alignment tracks
    ## is this still needed? Looks rather old
    if "MuonAlign" in trackAlgs:
        from Configurables import TrackEventFitter, AlignMuonRec
        track.DetectorList += ["MuonRec"]
        GaudiSequencer("TrackMuonRecSeq").Members += [
            AlignMuonRec("AlignMuonRec"),
            TrackEventFitter("MuonTrackFitter")
        ]
        importOptions("$TRACKSYSROOT/options/AlignMuonRec.opts")
        if TrackSys().fieldOff():
            AlignMuonRec("AlignMuonRec").BField = False
            importOptions("$STDOPTS/DstContentMuonAlign.opts")
コード例 #18
0
    print sample
else:
    #CondDB().addLayer( MUONAlignmentCondition )
    CondDB().addLayer(OTAlignmentCondition)

# ================================================================================================
# add all 'private' reconstruction to this sequence which is automatically added to the alignment sequence.
# ================================================================================================
from Configurables import GaudiSequencer
trackFilterSeq = GaudiSequencer("TrackFilterSeq")

# ----------------------------------------------------------------------------------
# make a selection of the Best-tracks based on the chisquare
# ----------------------------------------------------------------------------------
from Configurables import (TrackSelector, TrackContainerCopy)
seedselectoralg = TrackContainerCopy("SeedSelection")
seedselectoralg.addTool(TrackSelector("SeedSelector"), name="Selector")
seedselectoralg.inputLocation = 'Rec/Track/Best'
seedselectoralg.outputLocation = 'Rec/Track/SelectedBest'
seedselectoralg.Selector.MaxChi2Cut = 5
#seedselectoralg.Selector.MinNOTHits = 12
trackFilterSeq.Members.append(seedselectoralg)

## # ----------------------------------------------------------------------------------
## from Configurables import TrackListRefiner
## # ----------------------------------------------------------------------------------

## longTrackSelector = TrackListRefiner("LongTrackSelector",
##                                      inputLocation = "Rec/Track/SelectedBest",
##                                      outputLocation = "Rec/Track/SeectedLong",
##                                      Selector = TrackSelector())
コード例 #19
0
print "aligning elements ", elements

TAlignment().ElementsToAlign = list(elements)
TAlignment().TrackLocation = "Rec/Track/AlignTracks"
TAlignment().VertexLocation = "Rec/Vertex/Primary"
TAlignment().Constraints = constraints
TAlignment().WriteCondSubDetList = ['Velo']
#TAlignment().UpdateInFinalize = False

# still set up a track selection
from Configurables import (GaudiSequencer, TrackContainerCopy, TrackSelector,
                           TrackMonitor)
trackFilterSeq = GaudiSequencer("TrackFilterSeq")
alignSelector = TrackContainerCopy("AlignSelector",
                                   inputLocation="Rec/Track/Best",
                                   outputLocation="Rec/Track/AlignTracks")
alignSelector.addTool(
    TrackSelector("Selector",
                  MaxChi2Cut=10,
                  MinNVeloRHits=3,
                  MinNVeloPhiHits=3))
trackFilterSeq.Members.append(alignSelector)
trackFilterSeq.Members.append(
    TrackMonitor("AlignTrackMonitor",
                 TracksInContainer="Rec/Track/AlignTracks"))

# Load the velo alignment slce
#from Configurables import ( CondDB, CondDBAccessSvc )
#veloCond = CondDBAccessSvc( 'VeloAlignCond' )
#veloCond.ConnectionString = 'sqlite_file:/afs/cern.ch/lhcb/group/tracking/vol7/wouter/DB/VeloSliceFestNothing.db/LHCBCOND'