How to define complex material using TGeo?

I want to define some medium like Gd-loaded liquid scintillator which is composed with C, H, and a small part of Gd. But I am confused by the classes in ROOT: TGeoMaterial, TMaterial, TGeoManager::Material(). Which is the best way to define such a material?
In python:

import ROOT as RT
gm = RT.TGeoManager("gm","Geo Manager")
gm.Material("LS", array('d',[a_C, a_H, a_Gd]), array('d', [z_C, z_H, z_Gd]), density, 3,
             array('d', [w_C, w_H, w_Gd]), id)

How to calculate the “w_C”, “w_H”, “w_Gd”? Is it used by mass ratio or element ratio?

Hi,

You should use TGeoManager::Mixture. These are fractional weights. Or use one of the constructors of TGeoMixture, as there is one using number of atoms per element (if you have a chemical formula.

Cheers,

Thanks a lot! Does “fractional weight” mean “mass weight”?

Yes, mass weights.