9 return (a > b) - (a < b)
13parallelToZ = ROOT.TVector3(0.0, 0.0, 1.0)
14top = ROOT.gGeoManager.GetTopVolume()
15if top.GetNode(
"SplitCalDetector_1"):
16 z_ecal = top.GetNode(
"SplitCalDetector_1").GetMatrix().GetTranslation()[2]
18 print(
"TrackExtraploate tool: Error, no calo present")
24 rc, pos, mom =
False,
None,
None
25 fst = fT.getFitStatus()
26 if fst.isFitConverged()
and fst.getNdf() > minNdf:
28 if fT.getPoint(0).getFitterInfo()
and fT.getPoint(1).getFitterInfo():
29 fstate0, fstate1 = fT.getFittedState(0), fT.getFittedState(1)
30 fPos0, fPos1 = fstate0.getPos(), fstate1.getPos()
31 if abs(z - fPos0.z()) < abs(z - fPos1.z()):
36 NewPosition = ROOT.TVector3(0.0, 0.0, zs)
37 rep = ROOT.genfit.RKTrackRep(13 *
cmp(fstate.getPDG(), 0))
38 state = ROOT.genfit.StateOnPlane(rep)
39 pos, mom = fstate.getPos(), fstate.getMom()
40 rep.setPosMom(state, pos, mom)
42 rep.extrapolateToPlane(state, NewPosition, parallelToZ)
43 pos, mom = state.getPos(), state.getMom()
48 if not rc
or z > z_ecal:
50 px, py, pz = mom.X(), mom.Y(), mom.Z()
51 lam = (z - pos.Z()) / pz
52 pos = ROOT.TVector3(pos.X() + lam * px, pos.Y() + lam * py, z)