Dear Sylvia,
It is our fault that we could not document well about the limitation
of this new G4PhantomParameterisation class. To get the best
navigation performance, a step is NOT limited by a voxel boundary
if the materials of both sides of the boundaries are same. On the
other hand, our scorers naively believe that a step should be fully
contained by a voxel. That is the reason why you saw strange
dose deposition.
For the time being, please use the ordinary G4NestedParameterisation.
We are sorry for this problem.
Kind regards,
Makoto Asai
> -----Original Message-----
> From: Sylvia Studeny [mailto:sylvia.studeny@helmholtz-muenchen.de]
> Sent: Wednesday, February 27, 2008 8:44 AM
> To: publichypernews
> Subject: Mistake in DoseDeposit-scorer with G4PhantomParameterisation
>
> *** Discussion title: Hits, Digitization and Pileup
> Email replies to PublicHyperNews@slac.stanford.edu must include:
> In-Reply-To: <"/hitsdigits/196"@geant4-hn.slac.stanford.edu>
> Subject: ...change this to be about your reply.
>
> Hello,
> To test how the new G4PhantomParameterisation is working
> I want to calculate a neutron depth dose in a waterphantom.
> I have done this in a waterbox and a "normaly" parametriesed
> detector before and the depth dose curve from this seems
> to be good.
> I defined the G4PhantomParameterisation the way it is given
> in the manual:
> G4PhantomParameterisation* wpParam = new G4PhantomParameterisation();
> wpParam->
> SetVoxelDimensions(voxelSize.x()/2.,voxelSize.y()/2.,voxelSize
> .z()/2.);
> wpParam-> SetNoVoxel(xNo,yNo,zNo);
>
> std::vector <G4Material*> theMaterials;
> for(G4int i=0;i<1;i++){theMaterials.push_back(H2O);};
> wpParam->SetMaterials( theMaterials );
>
> size_t* mateIDs = new size_t[xNo*yNo*zNo];
> G4int Zahler =0;
> for(G4int i=0;i<zNo;i++){
> for(G4int j=0;j<yNo;j++){
> for(G4int k=0;k<xNo;k++){
> mateIDs[Zahler] = 0;
> Zahler++;
> }}}
> wpParam->SetMaterialIndices( mateIDs );
>
> G4ThreeVector positionPhantom(0.,0.,0.);
> solidPhantom = new
> G4Box("phantom",fphantomSize.x()/2.,fphantomSize.y()/2.,
> fphantomSize.z()/2.);
> logicPhantom = new G4LogicalVolume(solidPhantom, Air,
> "phantom", 0, 0, 0);
> physiPhantom = new G4PVPlacement(0,positionPhantom,logicPhantom,
> "phantom",logicWorld, false,0);
> //here also with copynumber=1
>
> wpParam->BuildContainerSolid(physiPhantom);
> wpParam->SetSkipEqualMaterials(1);
>
> solidVoxel = new
> G4Box("voxel",voxelSize.x()/2.,voxelSize.y()/2.,voxelSize.z()/2.);
> logicVoxel = new G4LogicalVolume(solidVoxel, H2O, "voxel", 0,0,0);
> patient_phys = new G4PVParameterised("Voxel",logicVoxel,
> logicPhantom, kYAxis, xNo*yNo*zNo, wpParam);
>
> patient_phys->SetRegularStructureId(1);
>
> I then set a DoseDeposit-scorer to the logicVoxel:
>
> G4MultiFunctionalDetector* MFDet = new
> G4MultiFunctionalDetector(phantomSDname);
> SDman->AddNewDetector( MFDet );
> logicVoxel->SetSensitiveDetector(MFDet);
>
> G4PSDoseDeposit* scorer0 = new G4PSDoseDeposit(psName="totalDose");
> MFDet->RegisterPrimitive(scorer0);
>
> In RunAction I want to readout the dose and print it in an ascii-file:
> void RE02RunAction::EndOfRunAction(const G4Run* aRun)
> {
> RE02Run* re02Run = (RE02Run*)aRun;
> G4THitsMap<G4double>* totalDose;
> totalDose = re02Run->GetHitsMap("PhantomSD/totalDose");
> ...
> xNo = detector->GetxNo(); //number of voxels in x-direction
> yNo = detector->GetyNo();
> zNo = detector->GetzNo();
> xyNo = xNo*yNo;
> ...
> ofstream wpDose;
> wpDose.open("wpDoseMatrix.dat");
> ...
> for(G4int nz=0;nz<zNo;nz++){
> for(G4int nx=0;nx<xNo;nx++){
> for(G4int ny=0;ny<yNo;ny++){
> copyNo= nz*xyNo + ny*xNo + nx;
> //I copied this from the G4PhantomParameterisation-class!
> wpDose << copyNo << " "<< nx << " "<< ny << " "<< nz;
> Dose = (*totalDose)[copyNo];
> if(Dose){
> dose = *Dose/NoOfEvents;
> wpDose << " " << dose/gray << " " ;
> }else{
> wpDose <<" " << 0.000 << " " ;
> }
> Dose=0;
> ...
>
> But when I plot this with gnuplot:
> reset
> set title 'Dosis ueber xy'
> set logscale z
> set xlabel 'x'
> set ylabel 'y'
> splot 'wpDoseMatrix.dat' u 2:3:(($4) == 0 ? $5 : 1/0) pt 1 ti 'z = 0'\
> , 'wpDoseMatrix.dat' u 2:3:(($4) == 1 ? $5 : 1/0) pt 2 ti
> 'z = 1' \
> , 'wpDoseMatrix.dat' u 2:3:(($4) == 2 ? $5 : 1/0) pt 3 ti
> 'z = 2' \
> , 'wpDoseMatrix.dat' u 2:3:(($4) == 3 ? $5 : 1/0) pt 4 ti
> 'z = 2' \
> , 'wpDoseMatrix.dat' u 2:3:(($4) == 4 ? $5 : 1/0) pt 5 ti
> 'z = 4' \
> , 'wpDoseMatrix.dat' u 2:3:(($4) == 5 ? $5 : 1/0) pt 6 ti
> 'z = 5' \
> , 'wpDoseMatrix.dat' u 2:3:(($4) == 6 ? $5 : 1/0) pt 7 ti
> 'z = 6' \
> , 'wpDoseMatrix.dat' u 2:3:(($4) == 7 ? $5 : 1/0) pt 8 ti
> 'z = 7' \
> , 'wpDoseMatrix.dat' u 2:3:(($4) == 8 ? $5 : 1/0) pt 9 ti
> 'z = 8' \
> , 'wpDoseMatrix.dat' u 2:3:(($4) == 9 ? $5 : 1/0) pt 10
> ti 'z = 9' \
> , 'wpDoseMatrix.dat' u 2:3:(($4) == 10 ? $5 : 1/0) pt 11
> ti 'z = 10' \
> , 'wpDoseMatrix.dat' u 2:3:(($4) == 11 ? $5 : 1/0) pt 12
> ti 'z = 11' \
>
> I see that there is only dose at the borders of the water qube, not in
> the middle. When I look at the visualisation, I do see tracks
> there and
> I tested the material definition (all voxels are set to water).
>
> What did I do wrong? I have also tested G4PSDoseDeposit3D (though
> I rather think this was desinged for Nestedparameterisation),
> with no change.
>
> How can I use a scorer with the G4PhantomParameterisation???
> (maybe you
> can but this in the DICOM example, because many people will be
> interested in dose in this case)
>
> Thanks a lot for your help Sylvia
>
|