| Message: Re: Local Electric Field: GetFieldValue() problem | Not Logged In (login) |
|
Hi Mario, My guess is that none of us will speculate what happens when you have overlapping volumes because it is a NO NO in Geant4, precisely because what the G4Navigator will do is unpredictable. You have to use special (G4) tools to test your geometry for overlaps. Please, see the documentation about that.
> The main concern is point[4] which comes in at the GetFieldValue() > function. point[3] is 'time' - ergo, you can have a time dependent field.
> I have displayed point[0], point[1], point[2] and calculated the > magnitude of this vector and in some instances it is larger than my > entire world volume You can also turn on step-wise debugging (/tracking/verbose 1) to follow where your tracks go and since you seem to have a debugging print statement in your SetFieldValue method you can find out when it's called - should only be called when in your 'logicalVolume' - and at what global coordinate points. If you print Point[0,1,2] you should be able to verify whether Point is local or global. I think it is global - but I am not 100% sure. So, if you want to return a value easier calculated from the local system, you need to use a GlobalToLocal transform: G4StepPoint* p = aStep->GetPreStepPoint(); G4ThreeVector globalPoint(Point[0],Point[1],Point[2]); const G4AffineTransform global2local = p->GetTouchable()->GetHistory()->GetTopTransform(); G4ThreeVector localPoint= global2local.TransformPoint(globalPoint); Except I am at a loss how you get a handle to G4Step aStep in your SetFieldValue method. One lengthy way might be: G4Step aStep = G4EventManager::GetEventManager()->GetTrackingManager()->GetSteppingManager()->GetStep();
> I guess I am curious about the coordinate system that point[4] is > using... does it use the logicalVolume in which the fieldManager of > the field belongs to as the coordinate system, or is it with respect > to the global volume?? I am afraid it's the global coordinate system.
> is there something special about a volume that is made of Vacuum and > holds a field manager?? Not that I know off. |
| Inline Depth: | Outline Depth: | Add message: |
|
to: |