Message: Re: Modifying Geometry using Messenger Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Modifying Geometry using Messenger 

Forum: Geometry
Re: None Modifying Geometry using Messenger (Alan James Bell)
Re: None Re: Modifying Geometry using Messenger (Roger Hälg)
Re: None Re: Modifying Geometry using Messenger (Alan James Bell)
Date: 03 Dec, 2014
From: Roger Hälg <Roger Hälg>

Hi Alan,

I am glad you were able to figure out your problem! Could you quickly tell me, what steps are needed for multifunctional detectors?

If you have different materials with different refractive indices, it should be easy to change them from a messenger as well. You could do something like this:

void DetectorConstruction::SetMaterial(G4String materialChoice) {
  // search the material by its name
  G4Material* newMaterial = G4Material::GetMaterial(materialChoice);
  if (newMaterial != fMat) {
    fMat = newMaterial;
    if (fLogicVolume) fLogicVolume->SetMaterial(fMat);
    G4RunManager::GetRunManager()->GeometryHasBeenModified();
  } else {
    G4cerr << materialChoice << " is not defined. - Command is ignored." << G4endl;
  }
}

If you need to change the refractive index of an existing material, I have no experience how to do that. But I think for that you should look into G4MaterialPropertiesTable.

Good luck and kind regards,

Roger

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

1 None: Re: Modifying Geometry using Messenger   (Alan James Bell - 04 Dec, 2014)
(_ None: Re: Modifying Geometry using Messenger   (Roger Hälg - 04 Dec, 2014)
1 None: Re: Modifying Geometry using Messenger   (Makoto Asai - 04 Dec, 2014)
2 None: Re: Modifying Geometry using Messenger   (Alan James Bell - 05 Dec, 2014)
 Add Message Add Message
to: "Re: Modifying Geometry using Messenger"

 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 ]