def inputSeq(self, outputLevel=INFO): if not allConfigurables.get("AlignInputSeq"): if outputLevel == VERBOSE: print "VERBOSE: Filter Sequencer not defined! Defining!" inputSequencer = GaudiSequencer("AlignInputSeq") inputSequencer.MeasureTime = True trackselections = self.getProp("TrackSelections") if len(trackselections) > 0: trackInputSeq = GaudiSequencer("AlignTrackSelSeq", IgnoreFilterPassed=True) inputSequencer.Members.append(trackInputSeq) # add the algorithms for the track selections to the sequence. # also merge the tracks lists into one list from Configurables import TrackListMerger trackmerger = TrackListMerger( "AlignTracks", outputLocation="Rec/Track/AlignTracks") self.setProp("TrackLocation", trackmerger.outputLocation) for i in trackselections: alg = i.algorithm() if alg: trackInputSeq.Members.append(alg) trackmerger.inputLocations.append(i.location()) trackInputSeq.Members.append(trackmerger) # add all particle selections if len(self.getProp("ParticleSelections")) > 0: particleInputSeq = GaudiSequencer("AlignParticleSelSeq", IgnoreFilterPassed=True) inputSequencer.Members.append(particleInputSeq) from Configurables import FilterDesktop particlemerger = FilterDesktop("AlignParticles", Code="ALL") particlemerger.Code = "ALL" particlemerger.CloneFilteredParticles = False for i in self.getProp("ParticleSelections"): alg = i.algorithm() if alg: particleInputSeq.Members.append(alg) print "adding particleinputsel to sequence: ", i.name( ), i.algorithm(), i.location() particlemerger.Inputs.append(i.location()) particleInputSeq.Members.append(particlemerger) self.setProp("ParticleLocation", '/Event/Phys/AlignParticles/Particles') # add the PV selection if hasattr(self, "PVSelection"): inputSequencer.Members.append( self.getProp("PVSelection").algorithm()) self.setProp("VertexLocation", self.getProp("PVSelection").location()) return inputSequencer else: if outputLevel == VERBOSE: print "VERBOSE: AlignInputSeq already defined!" return allConfigurables.get("AlignInputSeq")
def algorithm(self): from Configurables import GaudiSequencer, TrackListMerger Name = self._name loc = self._inputLocation b = self._fitted seq = GaudiSequencer(Name + "SelectionSeq") selections = [ VeloOverlapTracks(Name=Name + "VeloOverlap", InputLocation=loc, Fitted=b), VeloBackwardTracks(Name=Name + "VeloBackward", InputLocation=loc, Fitted=b), ITBoxOverlapTracks(Name=Name + "ITBoxOverlap", InputLocation=loc, Fitted=b), GoodLongTracks(Name=Name + "GoodLong", InputLocation=loc, Fitted=b) ] seq.Members += [i.algorithm() for i in selections] merger = TrackListMerger(Name + "Merger") merger.inputLocations = [i.location() for i in selections] merger.outputLocation = self.location() seq.Members.append(merger) return seq
outputLocation="Rec/Track/AlignTracksDiMuons", Selector=TrackSelector()) alignSelectorDiMuons.Selector.MaxChi2PerDoFVelo = 5 alignSelectorDiMuons.Selector.MaxChi2Cut = 5 alignSelectorDiMuons.Selector.MinPCut = 5000 alignSelectorAlgs.append(alignSelectorDiMuons) trackFilterSeq = GaudiSequencer("TrackFilterSeq") trackFilterSeq.Members += alignSelectorAlgs trackFilterSeq.Members.append( TrackListMerger( "AlignTrackMerger", #inputLocations= [ "Rec/Track/AlignTracksA", "Rec/Track/AlignTracksB", # "Rec/Track/AlignTracksC", "Rec/Track/AlignTracksD", # "Rec/Track/AlignTracksT"], inputLocations=[ "Rec/Track/AlignTracksA", "Rec/Track/AlignTracksB", "Rec/Track/AlignTracksITMod", "Rec/Track/AlignTracksDiMuons" ], outputLocation="Rec/Track/AlignTracks")) for selalg in alignSelectorAlgs: trackFilterSeq.Members.append( TrackMonitor(selalg.name() + "Monitor", TracksInContainer=selalg.outputLocation)) trackFilterSeq.Members.append( ITTrackMonitor(selalg.name() + "ITMonitor", TracksInContainer=selalg.outputLocation)) # #from Configurables import TrackListPrinter #trackFilterSeq.Members.append(TrackListPrinter("BackwardPrinter",InputLocation="Rec/Track/AlignTracksC"))
alignSelectorD.Selector.MinHitsASide = 1 alignSelectorD.Selector.MinHitsCSide = 1 alignSelectorD.Selector.MinNVeloRHits = 4 alignSelectorD.Selector.MinNVeloPhiHits = 4 alignSelectorD.Selector.MaxNVeloHoles = 0 trackFilterSeq.Members += [ alignSelectorA, alignSelectorB, alignSelectorC, alignSelectorD, alignSelectorT ] trackFilterSeq.Members.append( TrackListMerger("AlignTrackMerger", inputLocations=[ "Rec/Track/AlignTracksA", "Rec/Track/AlignTracksB", "Rec/Track/AlignTracksC", "Rec/Track/AlignTracksD", "Rec/Track/AlignTracksT" ], outputLocation="Rec/Track/AlignTracks")) #from Configurables import TrackListPrinter #trackFilterSeq.Members.append(TrackListPrinter("BackwardPrinter",InputLocation="Rec/Track/AlignTracksC")) # now select the primary vertices from Configurables import VertexListRefiner pvSelector = VertexListRefiner( "AlignPVSelector", InputLocation="Rec/Vertex/Primary", OutputLocation="Rec/Vertex/AlignPrimaryVertices", MaxChi2PerDoF=10, MinNumTracks=5,
inputLocation = "Rec/Track/Best", outputLocation = "Rec/Track/AlignTracksD", Selector = VeloTrackSelector()) alignSelectorD.Selector.MaxChi2PerDoFVelo = 10 alignSelectorD.Selector.MaxChi2Cut = 10 alignSelectorD.Selector.MinHitsASide = 1 alignSelectorD.Selector.MinHitsCSide = 1 alignSelectorD.Selector.MinNVeloRHits = 4 alignSelectorD.Selector.MinNVeloPhiHits = 4 alignSelectorD.Selector.MaxNVeloHoles = 0 trackFilterSeq.Members += [ alignSelectorA, alignSelectorB, alignSelectorC, alignSelectorD ] trackFilterSeq.Members.append( TrackListMerger("AlignTrackMerger", inputLocations= [ "Rec/Track/AlignTracksA", "Rec/Track/AlignTracksB", "Rec/Track/AlignTracksC", "Rec/Track/AlignTracksD" ], outputLocation = "Rec/Track/AlignTracks") ) #from Configurables import TrackListPrinter #trackFilterSeq.Members.append(TrackListPrinter("BackwardPrinter",InputLocation="Rec/Track/AlignTracksC")) # now select the primary vertices from Configurables import VertexListRefiner pvSelector = VertexListRefiner("AlignPVSelector", InputLocation = "Rec/Vertex/Primary", OutputLocation = "Rec/Vertex/AlignPrimaryVertices", MaxChi2PerDoF = 10, MinNumTracks = 5, MinNumLongTracks = 2 ) trackFilterSeq.Members.append( pvSelector )