Message: Re: issue modifying geometry between runs Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: issue modifying geometry between runs 

Forum: Run Management
Re: None issue modifying geometry between runs (A.T.)
Date: 30 Jun, 2015
From: Daren Sawkey <Daren Sawkey>

Reinitializing the geometry is tricky because it's not obvious what you need to do yourself. In particular make sure that you don't create the sensitive detectors again. You can follow example/extended/medical/electronScattering2 where 1) physical and logical volumes stores are explicitly cleaned at the beginning of Construct(), and 2) sensitive detectors are placed in a cache and then carefully reassigned.

If you have parallel worlds or regions this approach becomes difficult.

A better method is to get a pointer to the physical volume you want to move (e.g. make it a class variable), reset the position, and tell the run manager that the geometry has been modified. This keeps the other elements unchanged. e.g. in DetectorConstruction have a method

 void DetectorConstruction::SetPosition(G4double newZPosition) {
  fMyVolume->SetTranslation(G4ThreeVector(0, 0, newZPosition));
  G4RunManager::GetRunManager()->GeometryHasBeenModified();
 }

-- Daren.

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

1 None: Re: issue modifying geometry between runs   (A.T. - 01 Jul, 2015)
 Add Message Add Message
to: "Re: issue modifying geometry between runs"

 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 ]