|Message: Re: Relation between physical particles and G4Tracks||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
Hi Peter, thanks for your input.
I do have a G4VTrajectory class derived as in your example, and as you say it is my own code that defines the typedef for points container and creates new points containers as appropriate in the constructors. It also uses the push_back mechanism in AppendStep(), which I have to admit wouldn't appear to tie up with my theory. However, I don't see how this alone could cause my observed behaviour: the constructor does indeed create new points containers, but when a track is found to have user information in the PreUserTrackingAction, no constructor is called - the pointer to the previous trajectory is merely passed on. push_back is then the only function that accesses the points container, and should only ever append to it (which is not the behaviour I'm seeing).
However! Your second link though is very interesting. It looks like the Event Manager is doing some fiddling in the background, presumably to implement the normal step accumulation behaviour in Tracks (as previously discussed in this thread).
From what I can tell, the ProcessOneEvent() method of the G4EventManager:
1) retrieves a pointer to the trajectory for the previously processed track (lines 171-173) (I assume this excludes optical photons)
2) processes the track, calling PreUserTrackingAction and then PostUserTrackingAction in the ProcessOneTrack() method (line 185)
3) Retrieves a pointer to the trajectory used by the Tracking Manager for the processing of the track (line 200) and merges it with the previous trajectory! This would amount to merging with itself if the pointer is passed forward?! (line 204) I'm also not sure how this distinguishes unique tracks, as they would not want to be merged...
4) Deletes the trajectory used by the Tracking Manager! In my case there is only one Trajectory, so this would delete it!
5) Moves the pointer given to the Tracking Manager to point at the previous trajectory (now merged, so in theory containing the new points). In my case, the Trajectory given to the Tracking Manager is the same, so this would just move it to itself (although this has now been deleted in 4... )
So it looks like the event manager is doing a whole lot with trajectories outside of what's visible within my own classes & methods. I'm still not sure this makes sense with my observations, as it would appear to delete the trajectory! This would cause ALL points (and any other information) to vanish at the end of tracking, but that doesn't seem to be the case.
It would also suggest that my implementation in this case may not even be necessary - trajectories are automatically merged for new tracks. But again, this doesn't seem to be the behaviour I observe, and I'm also aware that for some inelastic collisions the Track is NOT preserved, even when I want it to be. So manual pass-over of trajectories would still be necessary.
All in all, very informative, but raises about as many questions as it answers!
|Inline Depth:||Outline Depth:||Add message:|