Message: Access density of material inside Detector Construction Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Access density of material inside Detector Construction 

Forum: Geometry
Date: 30 Jul, 2015
From: Steven Walton <Steven Walton>

So I'd like to be able to access the density of a material defined within the define materials section from the detector construction section. For example I have

void DetectorConstruction::DefineMaterials() {

.... code ....

G4double eNovCFDensity;

eNovCFDensity = ((80.*perCent)+(cFiberDensity))+((20.*perCent)*(eNovDensity));

G4Material* eNovCF = new G4Material("eNovCF", eNovCFDensity, 2);

eNovCF -> AddMaterial(cFiber, fracMass = 80.*perCent);

eNovCF -> AddMaterial(eNovolic, fracMass = 20.*perCent);

... more code ...

}

And I would like to access it in the construction section, eg:

G4VPhysicalVolume* DetectorConstruction::Construct() {

G4NistManager* nist = G4NistManager::Instance();

G4Material* abs_mat = nist -> FindOrBuildMaterial("eNovCF");

G4double density = eNovCFDensity;

... code ...

}

Is there a simple way I can access this variable? I'm sorry, my c++ skills are lacking and I may be missing something quite obvious.

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

1 None: Re: Access density of material inside Detector Construction   (Makoto Asai - 30 Jul, 2015)
(_ None: Re: Access density of material inside Detector Construction   (Steven Walton - 03 Aug, 2015)
 Add Message Add Message
to: "Access density of material inside Detector Construction"

 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 ]