Message: Re: What is the correct way to create a G4Element consisting of a single G4Isotope? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: What is the correct way to create a G4Element consisting of a single G4Isotope? 

Forum: Geometry
Re: Question What is the correct way to create a G4Element consisting of a single G4Isotope? (Sergio Losilla)
Re: None Re: What is the correct way to create a G4Element consisting of a single G4Isotope? (michel maire)
Date: 06 Nov, 2018
From: Sergio Losilla <Sergio Losilla>

Hi Michel,

When the G4Element is printed into the stream, Neff is converted to an integer:

File source/materials/src/G4Element.cc lines 442 onwards:

   << " Element: " << element->fName   << " (" << element->fSymbol << ")"
    << "   Z = " << std::setw(4) << std::setprecision(1) <<  element->fZeff 
    << "   N = " << std::setw(5) << std::setprecision(1) 
    <<  G4lrint(element->fNeff)
    << "   A = " << std::setw(6) << std::setprecision(3)
                 << (element->fAeff)/(g/mole) << " g/mole";

I run the example you mentioned adding some additional prints, removing the call to G4lrint and changing the precision from 1 to 6 and the output becomes:

   --->  Element: B10 (B10)   Z = 5.000000   N = 10.012900   Z =  5.0   N =    10   A = 10.013 g/mole
         --->  Isotope:   B10   Z =  5   N =  10   A =  10.01 g/mole   abundance: 100.000 %
          ElmMassFraction: 100.00 %  ElmAbundance 100.00 % 

Best regards,

Sergio

 Add Message Add Message
to: "Re: What is the correct way to create a G4Element consisting of a single G4Isotope?"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]