Message: RE: Modifying the geometry via messenger class Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None RE: Modifying the geometry via messenger class 

Forum: Geometry
Re: Question Modifying the geometry via messenger class (Lukas Schulte)
Date: 23 Dec, 2010
From: Makoto Asai <Makoto Asai>

How did you change your geometry? 
Even if you change the private data member in your
detector construction class via UI command you define,
it does not change the data member in the G4VPhysicalVolume
you have already instantiated.

There are two ways you may modify your geometry.

1) Delete all the geometry you had defined and build everything
from scratch. Novice exampleN03 does this.
 http://www-geant4.kek.jp/lxr/source/examples/novice/N03/src/ExN03DetectorConstruction.cc#L217
If you do this way, please make sure sensitive detector is
also deleted once and then re-instantiated and set to the
new volumes.

2) Remember the physical volume pointers you need to
modify and change their data members in your detector
construction class. Novice exampleN07 does this.
 http://www-geant4.kek.jp/lxr/source/examples/novice/N07/src/ExN07DetectorConstruction.cc#L428

> By the way, this is
> also a question I have: What does exactly happen after
> /run/geometryModified and what doesn't?

By issuing /run/geometryModified, G4RunManager makes sure
all the geometry structure is re-optimized for navigation.
This does not re-invoke Construct() method of your detector
construction.

Hope this helps.
Makoto


> -----Original Message-----
> From: Lukas Schulte [mailto:lschulte@students.uni-mainz.de]
> Sent: Thursday, December 23, 2010 6:03 AM
> To: geometry-g4hn
> Subject: Modifying the geometry via messenger class
> 
> 
> *** Discussion title: Geometry
> 
> Hello there!
> 
> My problem is the following:
> 
> The detector I have defined basically consists of a lot of PMTs placed
> in some grid within an optical medium while the basic parameters of the
> grid (size of grid and spacing of PMTs) are stored as private members
> of
> the detector construction class an accessible via set/get methods. I
> also have a detector messenger class to change those parameters
> interactively.
> 
> This complete thing SEEMS to work as reasonable things happen on the
> first glance, i.e. I get fewer hits when I increase the spacing between
> the PMTs and so on.
> 
> BUT: I also write the hit information to a file where among other
> things
> the positions of the PMTs that were hit are stored, and there it looks
> as the detector geometry wouldn't have been changed at all. The PMT
> positions are always the same as in the default detector setting, even
> if I made all spacings way larger before!
> 
> Also, when I use some visualization the viewer doesn't change the
> displayed geometry either.
> 
> And no, I didn't forget to type /run/geometryModified or
> /vis/viewer/refresh each time I changed something. By the way, this is
> also a question I have: What does exactly happen after
> /run/geometryModified and what doesn't?
> 
> Pooh, that was a long thing but now I'm finished. I hope someone out
> there can help me in some way...
> 
> Thank you and merry Christmas! Lukas
> 
> -------------------------------------------------------------
> Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or
> unsubscribe) at:
> http://hypernews.slac.stanford.edu/HyperNews/geant4/get/geometry/1090.h
> tml

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

1 None: Re: RE: Modifying the geometry via messenger class   (Lukas Schulte - 28 Dec, 2010)
(_ More: Re: RE: Modifying the geometry via messenger class   (Lukas Schulte - 04 Jan, 2011)
(_ None: Re: RE: Modifying the geometry via messenger class   (Michael H. Kelsey - 05 Jan, 2011)
 Add Message Add Message
to: "RE: Modifying the geometry via messenger class"

 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 ]