Message: How to add optical properties to an external defined material ? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question How to add optical properties to an external defined material ? 

Forum: Processes Involving Optical Photons
Date: 13 May, 2012
From: sylvian kahane <sylvian kahane>

Hi all

I have an external geometry text file which defines a BC501 detector:

// BC501

:MIXT BC501 0.87 2 G4_C 0.45 G4_H 0.55

// 3x3" Detector

:VOLU DET TUBE 0 3.81*cm 3.81*cm BC501

Now I want to attach to this material some optical properties. In DetectorConstruction, after reading the external geometry text file, I define a temporary

              G4MaterialPropertiesTable* MPT

and I put in MPT what I know about the BC501. The problem is to connect this MPT with the "real" material.

I tried the following

         G4Material* Scint->GetMaterial("BC501");
         Scint->SetMaterialProperiesTable(MPT);

but I got ab error on the first line saying tha I can not use -> operator on the undefined material Scint.

I tried also

         G4Material* Scint;
         Scint->GetMaterial("BC501");
         Scint->SetMaterialProperiesTable(MPT);

This time I got only a warning on the 3rd line but I got a segmentation fault in the run.

It seems that I cannot get a connection to the BC501 material defined in the external file. Any ideas ?

Sylvian

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

1 Feedback: Re: How to add optical properties to an external defined material ?   (Gumplinger Peter - 14 May, 2012)
 Add Message Add Message
to: "How to add optical properties to an external defined material ?"

 Subscribe Subscribe

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