TParticle GetMass() problem

Hi,
I’m a beginner and this is my first post here so sorry if I made any mistake.
mycodes:
[color=brown]TParticle mother= new TParticle();
mother->SetPdgCode(111);// pai0’s PDGcode is 111
Double_t mothermass =(TParticle
)mother->GetMass();
cout<<mothermass<<endl;[/color]
you see ,i want to know the value of mothermass,but the rusult is always 0.
Why the value of mothermass is not equal to pai0’s mass?
I don’t know How to use the function “GetMass”??
Who can tell me about that?
Many many thanks.

Hi,

Try like this:Double_t mothermass = mother->GetMass(); (without the cast to TParticle *)

Cheers, Bertrand.

oh yeah,you’re right.
I have solved my problem,
thank you very much.

[quote=“bellenot”]Hi,

Try like this:Double_t mothermass = mother->GetMass(); (without the cast to TParticle *)

Cheers, Bertrand.[/quote]