Message: Re: multiple field manager problem Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: multiple field manager problem 

Forum: Fields: Magnetic and Otherwise
Re: None multiple field manager problem (Balint Radics)
Date: 28 Jan, 2013
From: Gumplinger Peter <Gumplinger Peter>

Hi Balint,

> I also associate my field manager with separate logical volumes only. I can even see that my class's GetFieldValue(&#65533;) function is being called all the time but still I cannot see the particle trajectories bending!

Your GetFieldValue should be called only when the track is in your G4LogicalVolume.

> 1) I suspect maybe there is some field manager ownership problem, although only local field managers are created.
> Can this be a problem?

No, there should be no limitation on the number of local fields.

> How can I find out in run time which field manager is 'in action' during tracking?

I would turn on stepping/verbose and I would put this code in your SteppingAction:

G4LogicalVolume theLogicalVolume = aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume();

G4FieldManager* theFieldManager=theLogicalVolume->GetFieldManager();

myField* pointer = NULL;

if(theFieldManager)pointer = dynamic_cast <myField*> theFieldManager->GetDetectorField();

if(theLogicalVolume->GetName() == "myName")
  if(pointer)

e.g. see whether the pointer is indeed the one you expect in the logical volume you expect.

> 2) Since I don't have any clue what the problem can be I was wondering if there is any significance that in my original code I used standard volumes (G4Box and G4Tubs), while in the other bigger code there is a lot of G4SubtractionSolids the logical volumes of which I am using to associate them with the field manager of my class.

.... better not!

> 3) Apart from GetFieldValue, is there other any other way to
> -  extract what the field value is at a certain space point ?

No, you define the field and the field value as a function of postion.

> -  debug the charged particle's evolution to find out what field value they 'see' while propagating
> in space?

Since you wrote GetFieldValue, you can put a print statement in it that executes when your method is called. Write out what you return.

In principle, GetFieldValue can be called from your SteppingAction:

if(theFieldManager && theFieldManager->GetDetectorField()){
  pField->theFieldManager->GetDetectorField()

it's a bit tricky, but follow:

http://www-geant4.kek.jp/lxr/source/processes/electromagnetic/xrays/src/G4SynchrotronRadiation.cc#L133

> 4) Could any of you point me to a working example code in which there are multiple field managers involved?

Unfortunately, can't help you here. The only examples we have are with one volume and its FieldManager (Em10) , or a local volume with its FieldManager and a 'global field' everywhere else (F03).

Cheers, Peter

 Add Message Add Message
to: "Re: multiple field manager problem"

 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 ]