4from ctypes
import c_double
11 p = ROOT.TDatabasePDG.Instance().GetParticle(x.PdgCode())
15 txt = f
'("{x.Class_Name()}") X:{x.GetX():6.3F}cm Y:{x.GetY():6.3F}cm Z:{x.GetZ():6.3F}cm dE/dx:{x.GetEnergyLoss() / u.MeV:6.2F}MeV {n}'
21 p = ROOT.TDatabasePDG.Instance().GetParticle(c)
26 txt =
'("ShipMCTrack") pdgCode: %7i(%10s) Z=%6.1F m P=%6.3F GeV/c mother=%i %s' % (
38 txt =
'("vetoHit") detID:%7i ADC:%5.2F TDC:%5.2F' % (x.GetDetectorID(), x.GetADC(), x.GetTDC())
43 t = x.GetMeasurements()
44 txt =
'("TimeDetHit") detID:%7i TDC1:%5.2F TDC2:%5.2F isValid:%r' % (x.GetDetectorID(), t[0], t[1], x.isValid())
50 if st.isFitConverged():
51 chi2DoF = st.getChi2() / st.getNdf()
52 sta = x.getFittedState()
54 txt =
'("FitTrack") chi2/dof:%3.1F P:%5.2FGeV/c pdg:%i' % (chi2DoF, P, sta.getPDG())
56 txt =
'("FitTrack") fit not converged'
61 txt = f
'("TParticle") {x.GetName()} P:{x.P():5.2F}GeV/c VxZ:{x.Vz() / u.m:5.2F}m'
66 txt = f
'("ShipParticle") {x.GetName()} M:{x.GetMass():5.2F}GeV/c2 P:{x.P():5.2F}GeV/c VxZ:{x.Vz() / u.m:5.2F}m'
73 print(k, obj.__repr__())
78 txt = f
"{x.X():9.5F},{x.Y():9.5F},{x.Z():9.5F}"
83 txt = f
"{x.Px():9.5F},{x.Py():9.5F},{x.Pz():9.5F},{x.E():9.5F},{x.Mag():9.5F}"
88 x, y, z = c_double(), c_double(), c_double()
91 txt =
"<ROOT.TEvePointSet object>"
92 for n
in range(P.GetN()):
93 P.GetPoint(n, x, y, z)
94 txt += f
"{n:6d} {x.value:7.1f}, {y.value:7.1f}, {z.value:9.1f} x, y, z cm\n"
100 """Apply custom __repr__ methods to ROOT classes.
102 Call this function after ROOT libraries are fully loaded to enable
103 enhanced string representations for ROOT objects.
105 ROOT.FairMCPoint.__repr__ = MCPointPrintOut
106 ROOT.ShipMCTrack.__repr__ = MCTrackPrintOut
107 ROOT.genfit.Track.__repr__ = FitTrackPrintOut
108 ROOT.TClonesArray.Dump = Dump
109 ROOT.TVector3.__repr__ = TVector3PrintOut
110 ROOT.TParticle.__repr__ = TParticlePrintOut
111 ROOT.ShipParticle.__repr__ = ShipParticlePrintOut
112 ROOT.TEvePointSet.__repr__ = TEvePointSetPrintOut
113 ROOT.vetoHit.__repr__ = vetoHitPrintOut
114 ROOT.TimeDetHit.__repr__ = TimeDetHitPrintOut
115 ROOT.TLorentzVector.__repr__ = TLorentzVectorPrintOut
str TLorentzVectorPrintOut(x)
str TEvePointSetPrintOut(P)
def ShipParticlePrintOut(x)
def TimeDetHitPrintOut(x)