I have a suggestion concerning TGeoMixture. When one defines a TGeoMixture and then call TGeoMixture::GetZ(), what one gets is a weighted Z, suitable for instance for the calculation of the radiation length. This is perfectly ok and was already the case with GEANT3. But there are cases where one wants to get not this weighted Z, but simply the sum of all the Zi of all elements of the TGeoMixture.
This is the case for me for the calculation of the Compton effect cross-section in my new Litrani. For the Compton effect, it is the sum of the Zi, not the mean Z which is required.
So my suggestion is to add a method “GetZSum()” in the class TGeoMixture. A method “GetASum()” could also be added.
Ok, it is perfectly possible to calculate this sum without a method “GetZSum()”, but it would be nicer and simpler with it.
What do you think?
Hi,
Sure, but what is wrong with:
Int_t zsum = 0;
for (Int_t i=0; i<mixt->GetNelements();i++) zsum += mixt->GetZmixt()[i];
I understand your point, but in some other case a request for the sum of squares or whatever might be as legitimate…
Cheers,