Message: ComputeMaterial not changing the material. Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question ComputeMaterial not changing the material. 

Keywords: computematerial compute material G4Material
Forum: Geometry
Date: 04 Jan, 2006
From: James Custer <jcuster@hadron.physics.fsu.edu>

I'm having a problem using ComputeMaterial for one of my parameterisations.

The code I'm using is as follows:

 G4Material* UPVLayerParameterisation::ComputeMaterial
         (const G4int layerNum, G4VPhysicalVolume *physVol)
 {
         if(!(layerNum % 2))
         {
                 physVol->SetName("Scintillator");
                 return material.GetMaterial("Scintillator");
         }
         else
         {
                 physVol->SetName("Lead");
                 return material.GetMaterial("Lead");
         }
 }

For now, I've added:
                 physVol->GetLogicalVolume()->SetMaterial(material.GetMaterial("Scintillator"));
                 physVol->GetLogicalVolume()->SetMaterial(material.GetMaterial("Lead"));
to their respective places to manually set the material in each iteration, and that seems to be working (but obviously, that's not what I'd like to keep doing).

Thanks, James

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

 Add Message Add Message
to: "ComputeMaterial not changing the material."

 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 ]