Hi everyone!
Currently I’m trying to get more information about the decay of Rn-222, especially at which time how much of Rn-222 or its “daughters” is left. Therefore I modified this tutorial: root.cern.ch/doc/master/RadioNu … ource.html
The problem is, that it seems like my code woudn’t be able to get all daughters of the decay scheme of Rn-222:

And it should be:

Do you know what the problem is?
Thank you in advance for your answer,
Alina
My code is:
[code]void Rn222()
{
//-----------------------------------------------------------------------------
TGeoManager *geom = new TGeoManager("", “”);
TGeoElementTable *table = gGeoManager->GetElementTable();
TGeoElementRN *rn22 = table->GetElementRN(222, 86);
rn22->Print();
TGeoElementRN *el1 = table->GetElementRN(222, 86);
//TGeoElementRN *el2 = table->GetElementRN(12,6);
//-------------------------------------------------------------------------------
//Radioactive material
TGeoMaterial *mat = new TGeoMaterial(“RN22”, rn22, 9.73);
printf("___________________________________________________________\n");
printf(“Radioactive material:\n”);
mat->Print();
//Calculate seconds
Double_t time = 1.5e11; // seconds
Double_t precision = 1e-20;
TGeoMaterial *decaymat = mat->DecayMaterial(time, precision);//Define Calculate
printf("___________________________________________________________\n");
printf(“Radioactive material evolution after %g years:\n”, time / 3.1536e7);
decaymat->Print();
//Calculate years
time = 100000000.;
decaymat = mat->DecayMaterial(time, precision);
printf("___________________________________________________________\n");
printf(“Radioactive material evolution after %g seconds:\n”, time);
decaymat->Print();
//---------------------------------------------------------------------------------
//Fill Vector
TObjArray *vect = new TObjArray();
vect->Clear();
TCanvas *c2 = new TCanvas(“c2”, “Mixture decay”, 1000, 800);
c2->SetGrid();
mat->FillMaterialEvolution(vect);
DrawPopulation(vect, c2, 0.01, 100000000., kTRUE);
}
//Draw
void DrawPopulation(TObjArray *vect, TCanvas *c2, Double_t tmin = 0.,
Double_t tmax = 0., Bool_t logx = kFALSE)
{
Int_t n = vect->GetEntriesFast();//set n to amount of entries
TGeoElementRN *elem;
TGeoBatemanSol *sol;
c2->SetLogy(); //set axes scale logarithm
if (logx) c2->SetLogx();
for (Int_t i = 0; i<n; i++)
{
TGeoElement *el = (TGeoElement*)vect->At(i);
if (!el->IsRadioNuclide()) continue;
TGeoElementRN *elem = (TGeoElementRN *)el;
TGeoBatemanSol *sol = elem->Ratio();
if (sol)
{
sol->SetLineColor(1 + (i % 9));
sol->SetLineWidth(2);
if (tmax>0.) sol->SetRange(tmin, tmax);
if (i == 0) //Titel is set at the beginning of the array
{
sol->Draw();
TF1 *func = (TF1*)c2->FindObject(
Form("conc%s", sol->GetElement()->GetName())); //Get Name of the first element in the array
func->SetTitle(
"Concentration of elements derived from Rn22;\
time[s];Rn222 and Daughters");
}
else sol->Draw("SAME");//do not overwrite
}
}
}[/code]