Message: Precision of geometry definition and tracking in replicas Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Precision of geometry definition and tracking in replicas 

Keywords: replicas, tracking, precision, histogram, boundary,
Forum: Event and Track Management
Date: 04 Feb, 2005
From: Matthias BŲhm <>

Hello all

I ran into a problem with G4 and filling histograms using ROOT. 
The problem is the calculated position of a step during tracking 
and the corresponding volume the particle is in as defined by the

In detail:
I have a detector block, which I divided into smaller voxels by 
replicating in all three directions (with G4PVReplica). I want 
to sum the energy deposit in each voxel. Iím doing this in two 
different way and getting different result.

1-way) Iím checking though the G4TouchableHistory which voxel was 
hit and add the energy into a 3dim array. 

	// get info which detector box was hit
  G4Step aStep;
  G4int repDepth = aStep->GetPreStepPoint()->GetTouchable()->GetHistory()->GetDepth()
  G4int repNrX   = aStep->GetPreStepPoint()->GetTouchable()->GetHistory()->GetReplicaNo(repDepth-1);
  G4int repNrY   = aStep->GetPreStepPoint()->GetTouchable()->GetHistory()->GetReplicaNo(repDepth);
  G4int repNrZ   = aStep->GetPreStepPoint()->GetTouchable()->GetHistory()->GetReplicaNo(repDepth-2);

2-way) Iím getting the position info at the G4PreStepPoint and use 
this position to fill a ROOT histogram with the energy. I thought 
this is a much more elegant way and avoids the subdivision of the 

       // store the energy deposit in the depEHist-Histogram
  G4ThreeVector pos = aStep->GetPreStepPoint()->GetPosition();
  analysis->FillDepEHist(pos.getX()/cm, pos.getY()/cm, pos.getZ()/cm, eDep);

The problem now shows up at the boundaries. Therefore two examples:

Ex1) My detector voxel (2/2/0) should have a z dimension from 
0cm to 10cm. The position of the G4PreStepPoint is -1.4e-15. 
G4 defines this point to be inside the volume so it increments 
the deposited energy of this voxel. The ROOT filling routine 
clearly sees this position as negative and does not collect it, 
since it is outside the histogram range. 

   Position: (463.38536,252.86935,-1.4210855e-014), depE = 1.3747972
   Pos: 46.338536, 25.286935, -1.4210855e-015
   DetBox: 2, 2, 0

Ex2) At the boundary between voxel (2,2,0) and (2,2,1) two hits 
with the same position are put into two different voxels. ROOT 
again will put both energies into the same bin:

   Position: (435.55771,277.03582,100), depE = 7.0426665e-011
   Pos: 43.555771, 27.703582, 10
   DetBox: 2, 2, 0

   Position: (435.55771,277.03582,100), depE = 0.040809802
   Pos: 43.555771, 27.703582, 10
   DetBox: 2, 2, 1

Sure this wrong energy is probably neglectable, but I guess it 
still shows the kind of problem.

So my question now is, how can I decrease the precision during 
tracking, that these type of mismatches donít show up anymore? 
Also if I donít subdivide my detector by replicas anymore how 
can I make sure that G4 takes enough steps to get the precision 
of my histograming grid? The replicas have the nice feature to 
make a step at each boundary (even through this feature you 
sometimes get two steps at the same position in different volumes!)

Help would be appreciated. Thanks.

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

1 None: Re: Precision of geometry definition and tracking in replicas   (Vladimir IVANTCHENKO - 04 Feb, 2005)
(_ None: Re: Precision of geometry definition and tracking in replicas   (Peter Gumplinger - 04 Feb, 2005)
 Add Message Add Message
to: "Precision of geometry definition and tracking in replicas"

 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 ]