Calculating new terms from a given root file

I have a file which contains the data regarding event, multiplicity, no. of particle taking part, px,py,pz. From this given data I need to calculate… pt, and phi . How do i do that?