Message: Extracting materials information Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Extracting materials information 

Forum: Persistency
Date: 03 Jul, 2015
From: Christopher Walker <Christopher Walker>

Hello,
   I am using the latest Geant4 release on Linux (Ubuntu)
   I am trying to modify the G04 example so that I can read in the information about the materials contained within the auxiliary.gdml file in the example.

Hence I added this code:
   G4cout << "Declare G4ProductionCutsTable" << G4endl;
   const G4ProductionCutsTable* theCoupleTable=
      G4ProductionCutsTable::GetProductionCutsTable();
   size_t numOfCouples = theCoupleTable->GetTableSize();
   G4cout << "Start Loop numOfCouples = " << numOfCouples << G4endl;
   for (size_t i=0;i<numOfCouples;i++)// Loop for each material in the table
   {
      const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
      const G4Material* material = couple->GetMaterial();
      G4String mname = material->GetName();
      G4String mformula = material->GetChemicalFormula();
      G4bool isgas = (material->GetState()==kStateGas);
      G4cout << "Material " << mname << G4endl;
   }

after the comments 
   //
   // End of Auxiliary Information block
   //
   ////////////////////////////////////////////////////////////////////////

in the gdml_det.cc file.

What I see is that the numOfCouples is zero, but I was expecting 3 as that is the number of materials declared within the <materials><materials/> block.

Can someone suggest what I need to do to obtain the materials data?

Thankyou Chris Walker

 Add Message Add Message
to: "Extracting materials information"

 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 ]