You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I was looking into computing the radiusOfInnerMostHit because I need to use this variable for particle flow reconstruction. Since I have access to events generated with a previous software build that still has access to SiTracks_Refitted/SiTracks_Refitted.radiusOfInnermostHit, I was trying to confirm my piece of code below:
importmathimportuproot# load fileevents=uproot.open("reco_p8_ee_tt_ecm365_100001.root")["events"]
# debug first eventiev=0num_tracks=len(events["SiTracks_Refitted/SiTracks_Refitted.radiusOfInnermostHit"].array()[iev])
foritrackinrange(num_tracks):
val=events["SiTracks_Refitted/SiTracks_Refitted.radiusOfInnermostHit"].array()[iev][itrack]
print(f"reading from branch; radiusOfInnermostHit of track {itrack} is: {val:.4f}")
############# now attempt to compute it using other branches# select the track states corresponding to itrackibegin=events["SiTracks_Refitted/SiTracks_Refitted.trackStates_begin"].array()[iev][itrack]
iend=events["SiTracks_Refitted/SiTracks_Refitted.trackStates_end"].array()[iev][itrack]
num_track_states=iend-ibegincol="_SiTracks_Refitted_trackStates"d0=events[f"{col}/{col}.D0"].array()[iev][ibegin:iend]
phi=events[f"{col}/{col}.phi"].array()[iev][ibegin:iend]
refX=events[f"{col}/{col}.referencePoint.x"].array()[iev][ibegin:iend]
refY=events[f"{col}/{col}.referencePoint.y"].array()[iev][ibegin:iend]
innermost_radius=float('inf')
forihitinrange(num_track_states):
x_closest=refX[ihit] +d0[ihit] *math.cos(phi[ihit])
y_closest=refY[ihit] +d0[ihit] *math.sin(phi[ihit])
radius=math.sqrt(x_closest**2+y_closest**2)
ifradius<innermost_radius:
innermost_radius=radiusprint(f"manually computed radiusOfInnermostHit of track {itrack} is: {innermost_radius:.4f}")
break
which prints out:
reading from branch; radiusOfInnermostHit of track 0 is: 35.6223
manually computed radiusOfInnermostHit of track 0 is: 0.4091
Unfortunately, it seems that my piece of code is not correct because it does not match the value directly obtained from the branch SiTracks_Refitted/SiTracks_Refitted.radiusOfInnermostHit
Could you perhaps share how to build this variable from the other branches? Thanks!
The text was updated successfully, but these errors were encountered:
Hi, I was looking into computing the radiusOfInnerMostHit because I need to use this variable for particle flow reconstruction. Since I have access to events generated with a previous software build that still has access to
SiTracks_Refitted/SiTracks_Refitted.radiusOfInnermostHit
, I was trying to confirm my piece of code below:which prints out:
Unfortunately, it seems that my piece of code is not correct because it does not match the value directly obtained from the branch
SiTracks_Refitted/SiTracks_Refitted.radiusOfInnermostHit
Could you perhaps share how to build this variable from the other branches? Thanks!
The text was updated successfully, but these errors were encountered: