Dose analysis in voxelization

Hi guys,
I am trying to plot depth dose profile for different (primary and secondary) particles. I define the volume in detector construction to calculate dose and …
in stepping action:
if ( volume == fDetConstruction->GetphantomPV() ) {
analysisManager->FillH1(4, zz/mm, doseStep/gray); …
in runaction.cc:
analysisManager->CreateH1(“Dosevsz”,“”, 1000, 0, 1000);

but my results are different from my reference paper. they used gate code and Doses were recorded by using the GATE dose-actor. They were tallied in bins of 0.1mm, 2mm, and 1mm in the lateral, vertical, and beam directions, respectively.

As specified in my code for depth dose profile (CreateH1) I just divided my beam direction in 1mm(bin).
Is the method I’m running wrong?

please help me out I spent so much time trying.

Best regards,
Mohaddeseh

Try to compare your simulation with G4 examples: electromagnetic/TestEm11 or hadronic/Hadr07.
See Readme. Pay attention to step limitation.
Here, a macro for TestEm11 and the corresponding plot.

mohad.mac.txt (550 Bytes)

Thanks for your advice. Actually, I tested it with scoring mesh in macro and when I divided my depth(z) in enough bins and my bins are 1 for x and y direction in macro file, and plot dose versus depth I get the same results as the condition which I use in steppingaction.
I guess that may be because they recorded the dose by using the GATE dose-actor and bins of 0.1mm, 2mm, and 1mm in the lateral, vertical, and beam directions. they said that “Depth dose profiles (PDD) were assessed over the tally bin size along the beam transversal axis.”
but I don’t know how to do that in geant4 and analyze this and whether voxelization is important in dose discrepancy or not. because for the depth dose profile, we plot dose versus one dimension.