I have access to my data using RDataframe and stored it in a four-momentum vector of class TLoentzvector, Now I wanted to know the pdg code for each event, but I have the function GetPdgCode() in TParticle class. Can you please help me with how to get the pdg code of the events stored in a four-momentum vector using the GetPdgCode() function?
Here I have attached a small part of the code
auto angle(const std::vector<ROOT::Math::PxPyPzMVector>& ang) {
TParticle obj;
int pdg=obj.GetPdgCode();
ROOT::Math::PxPyPzMVector phi, theta, rho;
for(uint i=0; i<ang.size(); i++) {
ROOT::Math::PxPyPzMVector prt=ang[i];
if(fabs(pdg == 11)) {
std::cout<<pdg<<std::endl;
theta +=prt;
}
}
return theta.Theta();
}