Example #1
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
#from Configurables import L0Conf
#L0Conf().EnsureKnownTCK=False

from Configurables import TrajOTProjector
Projector = TrajOTProjector("OTProjector", UseDrift=True)

from TrackFitter.ConfiguredFitters import *
Fitter = ConfiguredMasterFitter("TrackMonFitter")
Fitter.Projector.OT = Projector
Fitter.MaxNumberOutliers = 0

#OT t0 calibration
from Configurables import (GaudiSequencer, TrackHitAdder, TrackEventFitter,
                           OTModuleClbrMon, TrackMon)
GaudiSequencer("MoniOTSeq").Members = [
    TrackHitAdder(TrackLocation="Rec/Track/Best"),
    TrackEventFitter(TracksInContainer="Rec/Track/Best", Fitter=Fitter),
    OTModuleClbrMon(
        TrackType=
        3,  # Long tracks                                                                  
        MinP=3.2,  # GeV
        MaxTrackChi2=100,
        MaxTrackUbChi2=2,
        ReadXMLs=False,
        TrackLocation="Rec/Track/Best",
        Fitter=Fitter,
        Projector=Projector)
]

NTupleSvc().Output = ["FILE1 DATAFILE='clbr.root' TYP='ROOT' OPT='NEW'"]
HistogramPersistencySvc().OutputFile = "clbr_hists.root"
TAlignment().WriteCondSubDetList = ['Velo', 'TT', 'IT', 'OT', 'MUON']
TAlignment().MinNumberOfHits = 6
#TAlignment().SolvTool = "gslSVDsolver"
TAlignment().DimuonLocation = "Rec/Vertex/DiMuon"

# still set up a track selection
from Configurables import (GaudiSequencer, TrackListRefiner, TrackListMerger,
                           TrackSelector, TrackMonitor, ITTrackSelector,
                           ITTrackMonitor, TrackHitAdder, TrackDoubleHitPruner,
                           TrackOTClusterPruner)
from TrackFitter.ConfiguredFitters import *

GaudiSequencer("TrackAddExtraInfoSeq").Members += [
    TrackHitAdder("TrackHitAdder",
                  TrackLocation="Rec/Track/Best",
                  MaxDistVelo=-1,
                  MaxDistOT=-1,
                  MaxDistTT=0.3,
                  MaxDistIT=0.3),
    #TrackOTClusterPruner(),
    ConfiguredEventFitter("TrackRefitter", TracksInContainer="Rec/Track/Best")
    #,TrackDoubleHitPruner("TrackDoubleHitPruner",TrackLocation = "Rec/Track/Best")
]

alignSelectorAlgs = []
alignSelectorA = TrackListRefiner("AlignSelectorA",
                                  inputLocation="Rec/Track/Best",
                                  outputLocation="Rec/Track/AlignTracksA",
                                  Selector=TrackSelector())
alignSelectorA.Selector.MaxChi2Cut = 5
alignSelectorA.Selector.MaxChi2PerDoFMatch = 5
alignSelectorA.Selector.MaxChi2PerDoFVelo = 5
Example #4
0
TAlignment().VertexLocation = "Rec/Vertex/AlignPrimaryVertices"
#TAlignment().VertexLocation       = "Rec/Vertex/Primary"
TAlignment().Constraints = constraints
TAlignment().WriteCondSubDetList = ['Velo', 'TT', 'IT', 'OT', 'MUON']
TAlignment().MinNumberOfHits = 6
#TAlignment().SolvTool = "gslSVDsolver"

# still set up a track selection
from Configurables import (GaudiSequencer, TrackListRefiner, TrackListMerger,
                           TrackSelector, TrackMonitor, ITTrackSelector,
                           TrackHitAdder, TrackDoubleHitPruner)
from TrackFitter.ConfiguredFitters import *

GaudiSequencer("TrackAddExtraInfoSeq").Members += [
    TrackHitAdder("TrackHitAdder",
                  TrackLocation="Rec/Track/Best",
                  MaxDistTT=0.5,
                  MaxDistIT=2),
    ConfiguredEventFitter("TrackRefitter", TracksInContainer="Rec/Track/Best")
    #,TrackDoubleHitPruner("TrackDoubleHitPruner",TrackLocation = "Rec/Track/Best")
]

trackFilterSeq = GaudiSequencer("TrackFilterSeq")
alignSelectorA = TrackListRefiner("AlignSelectorA",
                                  inputLocation="Rec/Track/Best",
                                  outputLocation="Rec/Track/AlignTracksA",
                                  Selector=TrackSelector())
alignSelectorA.Selector.MaxChi2Cut = 10
alignSelectorA.Selector.MaxChi2PerDoFMatch = 10
alignSelectorA.Selector.MaxChi2PerDoFVelo = 5
alignSelectorA.Selector.MaxChi2PerDoFDownstream = 5
alignSelectorA.Selector.MinPCut = 5000