Problem 453 - aStep->GetPreStepPoint()->GetPhysicalVolume()
Summary: aStep->GetPreStepPoint()->GetPhysicalVolume()
Status: RESOLVED INVALID
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/volumes (show other problems)
Version: 4.1
Hardware: PC Linux
: P2 normal
Assignee: John Apostolakis
URL:
Depends on:
Blocks:
 
Reported: 2003-02-06 05:47 CET by schiefer
Modified: 2003-02-14 16:09 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description schiefer 2003-02-06 05:47:31 CET
I have realized that in my SeensDet class, whenever I ask (the aStep object) for
the G4VPhysicalVolume I am in, I get the same pointer! Still, the aStep object
knows the correct position, while seemingly pointing to the last
G4PhysicalVolume created. Moreover, each time I ask this (same!!) pointer for
its mother, it always gives the correct (different!!) answer!

It seems as if some 'Optimisation' might cause this, but this sure does not take
into account that all these G4VPhysicalVolumes, though sharing the same logical
volume relative transformation, might have different copyNo!!

I think I can anyway expect that if I ask for a G4VPhysicalVolume, I get the
exact thing I have created at that point in space. If the tracking engine is
smarter and translates my definition into something else, where all these
physical volumes are shared, then it should not pretend to be able to hand me
the old object (type).
Comment 1 Makoto.Asai 2003-02-14 16:09:59 CET
This behabior is correct and as designed.
For getting volume information from the preStepPoint,
you have to get it through the touchable object.
 G4TouchableHistory* aTH =
  (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
For example, if you want to get the copy numbers of the volume and
its mother volume,
 copyNo = aTH->GetReplicaNumber();
 motherCopyNo = aTH->GetReplicaNumber(1);
These features are documented in both user's guide and examples.