24def AddJPsiVertexingFitterCfg(flags, prefix='', IdTrkContainer = "InDetTrackParticles", MuonContainer = "Muons"):
25 result = ComponentAccumulator()
26 from JpsiUpsilonTools.JpsiUpsilonToolsConfig import JpsiFinderCfg
27 jpsi_finder_tool = result.popToolsAndMerge(JpsiFinderCfg(flags,
28 muAndMu = False,
29 muAndTrack = False,
30 TrackAndTrack = True,
31 assumeDiMuons = True,
32 invMassUpper = 3500.0,
33 invMassLower = 2700.0,
34 Chi2Cut = 2000.,
35 allChargeCombinations = True,
36 oppChargesOnly = False,
37 sameChargesOnly= False,
38 trackThresholdPt = 2500,
39 muonThresholdPt= 4000,
40 atLeastOneComb = False,
41 useCombinedMeasurement = False,
42 muonCollectionKey = MuonContainer,
43 TrackParticleCollection = IdTrkContainer,
44 useMCPCuts = True))
45
46
47
48 MuonTP_Reco_mumu = result.getPrimaryAndMerge(AddRecoMumuToolCfg(flags,
49 name = prefix+"MuonTP_Reco_mumu",
50 JpsiFinder = jpsi_finder_tool,
51 OutputVtxContainerName = prefix+"JpsiCandidates",
52 PVContainerName = "PrimaryVertices",
53 RefPVContainerName = prefix+"RefittedPrimaryVertices",
54 RefitPV = True,
55 MaxPVrefit = 100000,
56 DoVertexType = 7))
57 result.addPublicTool(MuonTP_Reco_mumu)
58 the_alg = CompFactory.DerivationFramework.DerivationKernel(prefix +"JPsiVertexFitKernel",
59 AugmentationTools = [MuonTP_Reco_mumu])
60 result.addEventAlgo(the_alg, primary = True)
61 return result
62