Message: Re: Geant4 BUG???wrong material with G4PhantomParameterisation Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Geant4 BUG???wrong material with G4PhantomParameterisation 

Forum: Medical Applications
Re: Question Geant4 BUG???wrong material with G4PhantomParameterisation (Geng)
Date: 15 Aug, 2013
From: Jonathan Madsen <Jonathan Madsen>

Geng,

///////////////////////////////////////////////////////////////////////////////
  G4TouchableHandle theTouchable = aStep->GetTrack()->GetStep()->GetPreStepPoint()->GetTouchableHandle();
  G4int index=theTouchable->GetCopyNumber();
      G4String materialname=aStep->GetTrack()->GetStep()->GetPreStepPoint()->GetMaterial()->GetName();
       const DicomDetectorConstruction* detector =
     (const DicomDetectorConstruction*)
     (G4RunManager::GetRunManager()->GetUserDetectorConstruction());
if(detector->fMateIDs[index]==0 )
  {if(materialname!="1a") G4cout<<"error"<<materialname<<G4endl;}
/////////////////////////////////////////////////////////////////////////////

I believe the problem with the code above is that the copy numbers are nested -- i.e. you are grabbing the copy number from a line of voxels embedded in a slice or something, not the copy number with respect to all the voxels. If you are building a container volume and filling it with slices, then filling the slices with lines of voxels, etc., each level of filling starts the copyNo back at zero, just like a indices of an entry in matrix. You likely need something along the lines of: (assigning nx and ny at construction to the XY dimensions of parameterization)

G4int ix = theTouchable->GetReplicaNumber(1);

G4int iy = theTouchable->GetReplicaNumber(2);

G4int iz = theTouchable->GetReplicaNumber(3);

G4int index = ix + (nx*iy) + (nx*ny*iz);

Jonathan

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

1 Question: Re: Geant4 BUG???wrong material with G4PhantomParameterisation   (Geng - 15 Aug, 2013)
 Add Message Add Message
to: "Re: Geant4 BUG???wrong material with G4PhantomParameterisation"

 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 ]