Problems with TGeoManager GetMother

Hello everyone,
I am experiencing some issues when I’m trying to get the mother’s volume number of a certain volume.
In particular I don’t know why the method “gGeoManager->GetMother(0)->GetNumber()” gives different outputs when it is applying to different volumes with similar paths. I am attaching part of the code to help you understand my problem. Thanks!

gMC->CurrentVolID(detID);
cout<< "detID = " << detID << endl;
cout << gMC->CurrentVolPath()<< endl;
Int_t motherID = gGeoManager->GetMother(0)->GetNumber();
const char *mumname = gMC->CurrentVolOffName(1);
cout<<mumname<<"   "<< motherID<<endl;
detID = motherID;
cout<< "detID = " << detID << endl;

In the image you can see the path of my “volRpc”, the mother’s number is 10007 for the first and 10008 for the latter, but the method mentioned before keeps giving me 1 for the first RPC volume
36

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.