You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

Event:

  • eventID

True Track:

  • charge (gChanrge)
  • momentum (gpx, gpy, gpz)
  • vertex (gvx, gvy, gvz)
  • station1 (gx_st1, gy_st1, gz_st1, gpx_st1, gpy_st1, gpz_st1)
  • station3 (gx_st3, gy_st3, gz_st3, gpx_st3, gpy_st3, gpz_st3)

Hit:

  • hitID
  • hit_trackID
  • processID
  • detectorID
  • elementID
  • driftDistance
  • tdcTime

Reco Variables:

  • charge (rec_charge)
  • momentum (rec_px, rec_py, rec_pz)
  • vertex (rec_vx, rec_vy, rec_vz)
  • station1 (rec_x_st1, rec_y_st1, rec_z_st1, rec_px_st1, rec_py_st1, rec_pz_st1)
  • station3 (rec_x_st3, rec_y_st3, rec_z_st3, rec_px_st3, rec_py_st3, rec_pz_st3)
  • dimuon vertex (rec_dimu_vx, rec_dimu_vy, rec_dimu_vz)
  • dimuon momentum (rec_dimu_px, rec_dimu_py, rec_dimu_pz)
  • dimuon mass (rec_dimu_mass)
  • dimuon xF, x1, x2 (rec_dimu_xf, rec_dimu_x1, rec_dimu_x2)
Source FlagDescription
1Target
2Dump
3Gap
ProcessDescription
11DY (mu⁺)
12J/ψ (mu⁺)
13ψ' (mu⁺)
14Single (mu⁺)
21DY (mu⁻)
22J/ψ (mu⁻)
23ψ' (mu⁻)
24Single (mu⁻)


An example of how to access the event, track, and hit level information, as well as how to decode the processID to obtain the processID and sourceFlag.


import ROOT

def decode_source_flag(encoded):
    return (encoded >> 5) & 0x3  # Extract bits 5-6

def decode_process_id(encoded):
    return encoded & 0x1F  # Extract lower 5 bits

file = ROOT.TFile("RUS.root") 
tree = file.Get("tree")

for event in tree:

    print("EventID:", event.eventID)

    for i in range(len(event.gpz)):

        #print track level information
        print("true pz of the track: ", event.gpz[i] )
        print("charge of the track: ", event.gCharge[i] )

        for j in range(len(event.hit_trackID)):

            #check for the track id. When the track id matches with the track id at the hit level, we access the hit information.
            if event.hit_trackID[j] != trackID:
                continue
            hit_id = event.hitID[j]
            hit_trackid = event.hit_trackID[j]
            encoded_value = event.processID[j] 
            process_id = decode_process_id(encoded_value) #decoding the process_id
            source_flag = decode_source_flag(encoded_value) #decoding the source_flag
            print("hitID:", hit_id)
            print("hit_trackID:", hit_trackid)
            print("Encoded value:", encoded_value)
            print("Decoded Process ID:", process_id)
            print("Decoded Source Flag:", source_flag)




  • No labels