Message: Re: How to change the copy number of the Replica Volumes (if possible) Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: How to change the copy number of the Replica Volumes (if possible)  

Forum: Geometry
Re: Question How to change the copy number of the Replica Volumes (if possible) (valentina)
Re: None Re: How to change the copy number of the Replica Volumes (if possible) (John Apostolakis)
Date: 13 Mar, 2013
From: valentina <valentina>

Dear John,

thanks for your help. I can get the parent volume ID if I use a sensitive volume, with this code:

     G4bool CXYZSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) {

        G4StepPoint * preStepPoint = aStep->GetPreStepPoint();
        G4TouchableHandle preTouchable  =  preStepPoint->GetTouchableHandle();

        G4int depth=1;        	
	info_volumeID    = preTouchable->GetVolume()->GetCopyNo();
	info_motherID    = theTouchable->GetVolume(depth)->GetCopyNo();

        ...

If I use the SteppingAction:

     void CSteppingAction::UserSteppingAction(const G4Step* step) {

		 G4StepPoint * preStepPoint = step->GetPreStepPoint();
                 G4TouchableHandle theTouchable preStepPoint->GetTouchableHandle();
		 info_volumeID = theTouchable->GetCopyNumber();
                 G4int depth=1;
   	         motherID    = theTouchable->GetVolume(depth)->GetCopyNo();

                 ...

it gives me segmentation fault. If I use depth = 0 the code works fine. Am I doing something wrong?

Thanks! Valentina

On Mon, 11 Mar 2013 17:43:08 GMT, John Apostolakis wrote:

> Dear Valentina,
> 
> Currently it is not possible to change the strip replica number in order to identify a volume uniquely.
> 
> You will need to use information from the parent volume to do this.
> 
> It is easy to get the information about the parent volume from the Touchable History in the Track.
> 
> Regards,
> John
> ===================================================
> John Apostolakis, SFT (SoFTware) Group, PH Department, CERN
> Email:  john.apostolakis@cern.ch       Office Tel:  +41-22-767-7239
> ------------------------------------------------------------------------------------------
> 
> On Mar 6, 2013, at 4:21 PM, valentina wrote:
> 
> > 
> > *** Discussion title: Geometry
> > 
> > Dear all,
> > 
> > I am simulating a detector composed by several layers. Each layer is
> > then divided in thousands of sensitive strips. G4PVReplica allows me to
> > easily create these strips, i.e. to divide the layer in N strips.
> > 
> > However I need a unique copy number to be associated to each strip, in
> > order to know exactly not only the triggered strip, but also the
> > associated layer.
> > 
> > If I use something like:
> > 
> > StripX_phys = new G4PVReplica("lStripX", StripX_log, SiDetector_log,
> > kXAxis, Strip_N, Strip_pitch);
> > 
> > where Strip_N = 3072
> > 
> > I get a copy number ranging from 0 to 3071, for all the layers.
> > 
> > Is there any chance to change the replicated volumes copy number?
> > 
> > Thank you in advance for any reply, Valentina
> > 
> > -------------------------------------------------------------
> > Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or unsubscribe) at: 
> > http://hypernews.slac.stanford.edu/HyperNews/geant4/get/geometry/1260.html 
> 

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

1 None: Re: How to change the copy number of the Replica Volumes (if possible)   (John Apostolakis - 14 Mar, 2013)
 Add Message Add Message
to: "Re: How to change the copy number of the Replica Volumes (if possible) "

 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 ]