Message: Adding new fields between runs Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Adding new fields between runs 

Forum: Fields: Magnetic and Otherwise
Date: 09 Feb, 2016
From: Jan Pipek <Jan Pipek>

Hello,

I have one perhaps interesting question.

Let's say that in my detector construction, I create a couple of volumes (Construct) and assign fields to them (ConstructSDandField) in a multi-threaded setting. So far so good.

Now I want to change some parameter of the fields between runs (constant during the whole run). Even this is not so difficult - the field can be implemented in a way that uses a pointer to that parameter that exists in only one copy in the application (shared between threads but safe because not changed).

However... now I want to create a new volume between the runs (initiated from a messenger) and add a new field also to this volume. Unfortunately, no ConstructSDandField is called for me again and I don't see an easy way to do the field initialization in all threads. Where should I put the construction of G4Field objects, G4FieldManager's etc.?

One possible place is the G4UserRunAction::BeginOfRunAction or GenerateRun - but is that safe? Or is there another (better) approach to achieve this?

Thanks for any ideas, Jan

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

1 None: Re: Adding new fields between runs   (Makoto Asai - 09 Feb, 2016)
(_ Sad: Re: Adding new fields between runs   (Jan Pipek - 10 Feb, 2016)
 Add Message Add Message
to: "Adding new fields 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 ]