Problem 1209 - G4PhantomParameterisation SetSkipEqualMaterials(false) broken in 4.9.4
Summary: G4PhantomParameterisation SetSkipEqualMaterials(false) broken in 4.9.4
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/navigation (show other problems)
Version: 9.4
Hardware: All All
: P2 major
Assignee: Pedro.Arce
URL:
Depends on:
Blocks:
 
Reported: 2011-04-28 23:49 CEST by Derek Dolney
Modified: 2011-06-06 11:34 CEST (History)
1 user (show)

See Also:


Attachments
correct the name of SD (5.33 KB, patch)
2011-04-29 12:00 CEST, Pedro.Arce
Details | Diff
Output with SetSkipEqualMaterials(true) (26.84 KB, application/octet-stream)
2011-05-04 00:23 CEST, Derek Dolney
Details
Output with SetSkipEqualMaterials(false) (112.57 KB, application/octet-stream)
2011-05-04 00:24 CEST, Derek Dolney
Details
Output with SetSkipEqualMaterials(true) (26.84 KB, text/plain)
2011-05-04 00:25 CEST, Derek Dolney
Details
Output with SetSkipEqualMaterials(false) (112.57 KB, text/plain)
2011-05-04 00:25 CEST, Derek Dolney
Details

Note You need to log in before you can comment on or make changes to this problem.
Description Derek Dolney 2011-04-28 23:49:30 CEST
I construct a G4PhantomParameterisation and register my own scorer class (that derives from G4VPrimitiveScorer) containing a ProcessHits method. If I call SetSkipEqualMaterials(false) in my geometry construct chain, I get no hits in the sensitive detector associated with the G4PhantomParameterisation. If I use SetSkipEqualMaterials(true), it is fine and I get calls to my ProcessHits method as expected.

I tried to reproduce with examples/extended/medical/DICOM, but that doesn't score dose with either setting for SetSkipEqualMaterials. The output file dicom.out is empty with either setting. This is also a regression in 4.9.4; the example works for 4.9.3. I will open a separate bug for the example.

This is a new issue in 4.9.4 and 4.9.4.p01. Version 4.9.3.p02 works fine.
Comment 1 Derek Dolney 2011-04-28 23:54:38 CEST
Filed Problem 1210 about the DICOM example problem that may be related.
Comment 2 Pedro.Arce 2011-04-29 12:00:03 CEST
Created attachment 108 [details]
correct the name of SD

There is a bug int the DICOM example: the name of the SD starts with a capital in one place and not in the other. Could you check if it happens the same in your case? It should read:

./src/DicomRunAction.cc:  theSDName.push_back(G4String("phantomSD"));
./src/DicomDetectorConstruction.cc:  G4String concreteSDname = "phantomSD";

Pedro
Comment 3 Derek Dolney 2011-04-29 20:28:16 CEST
This fixed Problem 1210, but not this one.

But now you can use this dicom example to reproduce the problem. Run the example as

     dicom run.mac

It will write dose to the file dicom.out. If you add the line

     param->SetSkipEqualMaterials(true);

at, say, line 95 of RegularDicomDetectorConstruction.cc, you will find that no dose is scored. You can change true to false and see that it works again.
Comment 4 Pedro.Arce 2011-05-02 11:18:55 CEST
I did what you say, using geant4.9.4.p01, and I do get a dose: 

  Number of events processed : 100
  User=1.81s Real=1.83s Sys=0.01s
 ###### EndOfRunAction  
=============================================================
 Number of event processed : 100
=============================================================
 opened file dicom.out for dose output
     Voxel |   DoseDeposit  |
    8127     6.45217e-20 Gy
    8128     7.14331e-20 Gy
    8255     5.7546e-20 Gy
    8256     6.20639e-20 Gy
    8383     2.38152e-21 Gy
    8384     2.39943e-20 Gy
    24511     8.84293e-20 Gy
    24512     6.2932e-20 Gy
    24639     4.94702e-20 Gy
    24640     5.99939e-20 Gy
    40895     8.8007e-20 Gy
    40896     5.57992e-20 Gy
    41023     5.07102e-20 Gy
    41024     6.33292e-20 Gy
    41151     1.75917e-21 Gy
=============================================
Comment 5 Derek Dolney 2011-05-02 20:32:39 CEST
My apologies. I meant to say add the line

     param->SetSkipEqualMaterials(false);

There is a bug when you do *not* skip boundaries between equal materials.
Comment 6 Derek Dolney 2011-05-04 00:23:44 CEST
Created attachment 109 [details]
Output with SetSkipEqualMaterials(true)
Comment 7 Derek Dolney 2011-05-04 00:24:09 CEST
Created attachment 110 [details]
Output with SetSkipEqualMaterials(false)
Comment 8 Derek Dolney 2011-05-04 00:24:37 CEST
Without skipping I get no dose at all, even running 10000 events. I've attached the output of my simulation runs with SetSkipEqualMaterials(true) and SetSkipEqualMaterials(false). You can see that there is no dose reported in false.out.
Comment 9 Derek Dolney 2011-05-04 00:25:19 CEST
Created attachment 111 [details]
Output with SetSkipEqualMaterials(true)
Comment 10 Derek Dolney 2011-05-04 00:25:44 CEST
Created attachment 112 [details]
Output with SetSkipEqualMaterials(false)
Comment 11 Pedro.Arce 2011-06-06 11:31:51 CEST
 fix will be included in the next patch and releases
Comment 12 John Apostolakis 2011-06-06 11:34:52 CEST
(The fix has been provided to the person reporting the issue.)