Message: Atomic number not well defined in G4Material Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Atomic number not well defined in G4Material 

Forum: Geometry
Date: 03 Aug, 2016
From: Paola Ferrario <Paola Ferrario>

Hi all,

I'm trying to build a gas mixture as a material for my detector, so I've tried first to use an example of gas mixture of the Geant4 manual (air), to understand how it works. My code is the following:

 G4double a = 14.01*g/mole;
 G4Element* elN  = new G4Element("Nitrogen", "N", 7, a);

 a = 16.00*g/mole;
  G4Element* elO  = new G4Element("Oxygen", "O", 8, a);

  G4double density = 1.000*g/cm3;
  G4Material* mat = new G4Material("Air", density, 2);
  mat->AddElement(elN, 70*perCent);
  mat->AddElement(elO, 30*perCent);

Running this code gives me the following error:

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : mat036
      issued by : G4Material::GetZ()
the Atomic number is not well defined.
*** Fatal Exception *** core dump ***
-------- EEEE -------- G4Exception-END --------- EEEE -------

Probably there's some silly detail I've not noticed, can anyone help me? Also, why is the code trying to get Z from a material which is a mixture of different materials? Thank you for your help

Paola

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Idea: Re: Atomic number not well defined in G4Material   (Vladimir Ivanchenko - 03 Aug, 2016)
1 None: Re: Atomic number not well defined in G4Material   (Paola Ferrario - 03 Aug, 2016)
2 None: Re: Atomic number not well defined in G4Material   (michel maire - 03 Aug, 2016)
1 None: Re: Atomic number not well defined in G4Material   (Paola Ferrario - 03 Aug, 2016)
(_ None: Re: Atomic number not well defined in G4Material   (michel maire - 03 Aug, 2016)
(_ None: Re: Atomic number not well defined in G4Material   (Paola Ferrario - 04 Aug, 2016)
 Add Message Add Message
to: "Atomic number not well defined in G4Material"

 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 ]