I have a MC generated root file which contains a TTree object containing collision events. One of the variables provided for the analysis of events is the (pdgid) of particles. Now I am supposed to get the value of charge of a particle using its (pdgid).
What root library should I include in my analysis program so as to get the charge of a particle as a function of particle’s PDG ID?
You can read ROOT files in a number of ways, see e.g. this post.
The simplest is probably to use RDataFrame (docs, tutorials).
About getting the charge of a particle from its PDG ID: doesn’t that tell you what particle it is? So e.g. if you know it’s an electron, you know what charge it has. I’m not a HEP analyst though