Member function error of two different classes

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)) {
	theta +=prt;
return theta.Theta();

Welcome to the ROOT Forum!

This cannot work. You can search for GetPdgCode on this forum, or look at the ${ROOTSYS}/tutorials/pythia/pythia8.C tutorial for an example woth the TParticle class.