<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Dear Gate users,
    <div class="moz-forward-container">
      <div class="moz-forward-container">
        <p>I am having difficulties obtaining an output from my
          simulation. The simulation run as it should be (long enough),
          smoothly and there is no error messages. <b>However, after my
            simulation my root file is empty.<br>
          </b>I checked the forum and followed the few inputs I found
          but I really don't understand the reason of my problem.<b> </b>Hereafter
          are a few details.<b><br>
          </b></p>
        <p>I hope one of you already faced this issue and will remember
          what needs to be changed/added.<b><br>
          </b></p>
        <p><b><br>
          </b></p>
        <p>I am using:<br>
          Gate 9.0<br>
          geant4-10-06-patch-02<br>
          root 6.22/02<br>
          Ubuntu 20.04.4<br>
        </p>
        <p>I am simulating a brain scan from real CT/PT data and
          centered in a ring PET scanner. Both my source and my phantom
          are voxelized. I am using back-to-back gamma radiations with
          the emstandard_opt3 physics list and the RadioactiveDecay
          process.<br>
          I would like to save only the singles in the output file.<br>
        </p>
        <p>The sourceMap below shows that the simulation is running
          correctly. Furthermore, below the image is a part of the
          verbose from source. It also proves that particles are
          generated.<br>
        </p>
        <p><img src="cid:part1.yQ7lZu5f.d0rcCj23@phys.ethz.ch" alt=""
            class="" width="835" height="308"></p>
        <p>Source verbose:<br>
        </p>
        <p>[GateSourceVoxellized::GeneratePrimaries] Centre: 4.87951
          4.50845 7.91909 cm <br>
           NumberOfParticlesToBeGenerated: 2<br>
          Particle name: gamma<br>
                 Energy: 0.511<br>
               Position: (48.9512,25.5379,79.5088)<br>
              Direction: (-0.619851,0.684191,0.384275)<br>
          Particle name: gamma<br>
                 Energy: 0.511<br>
               Position: (48.9512,25.5379,79.5088)<br>
              Direction: (-0.495773,-0.863156,-0.0957614)<br>
           Primary Vertex generated !<br>
          GetNumberOfPrimaryVertex : 1<br>
          GetNumberOfParticle      : 2<br>
          GateVSource::GetNextTime : Initial activity (becq) : 589.609<br>
                                      At time (s) 0.657133 activity
          (becq) 589.568<br>
          GateVSource::GetNextTime : next time (s) 0.00132811<br>
          GateSourceVoxellized::GetNextTime : firstTime (s) 0.00132811<br>
        </p>
        <p><br>
        </p>
        <p><b>A few settings:</b><br>
          <b>* The digitizer is set like that:</b><br>
          /gate/digitizer/Singles/insert                     adder<br>
          /gate/digitizer/Singles/insert                     readout<br>
          /gate/digitizer/Singles/readout/setDepth  4</p>
        <p><b>* The physic list is set like that:</b><br>
          /gate/physics/addPhysicsList           emstandard_opt3<br>
          /gate/physics/addProcess                RadioactiveDecay<br>
          /gate/physics/addProcess                Decay<br>
        </p>
        <p><b>* For the output file the settings are these:</b><br>
          /gate/output/root/enable<br>
          /gate/output/root/setFileName                        
          refFullBrain_root<br>
          /gate/output/root/setRootHitFlag                     0<br>
          /gate/output/root/setRootSinglesFlag              1<br>
          /gate/output/root/setRootCoincidencesFlag    0<br>
          /gate/output/ascii/setSingleMask                    1 1 1 0 0
          0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0  <br>
        </p>
        <p><b>* the voxelized phantom is set as followed:</b><br>
          /gate/patientVolume/daughters/name                         
          phantom_brain<br>
          /gate/patientVolume/daughters/insert                         
          ImageNestedParametrisedVolume<br>
          <br>
          /gate/geometry/setMaterialDatabase                          
          gate_stuff/HUmaterials.db<br>
          /gate/phantom_brain/geometry/setHUToMaterialFile   
          gate_stuff/HU2mat.mac<br>
          /gate/phantom_brain/geometry/setImage                   
          data/rawData.mhd<br>
          <br>
/gate/phantom_brain/vis/setVisible                              1<br>
          /gate/phantom_brain/vis/forceWireframe<br>
          /gate/phantom_brain/placement/setTranslation         
          {phantom_x} {phantom_y} {phantom_z} mm<br>
          /gate/phantom_brain/attachPhantomSD<br>
        </p>
        <p><b>*the voxelized source is set as followed:</b><br>
          /gate/source/addSource                                      
                    voxel_brain voxel<br>
/gate/source/voxel_brain/attachTo                                
          phantom_brain<br>
          /gate/source/voxel_brain/reader/insert                      
             image<br>
          <br>
/gate/source/voxel_brain/imageReader/translator/insert                   
          linear<br>
/gate/source/voxel_brain/imageReader/linearTranslator/setScale     
          60000000 Bq<br>
/gate/source/voxel_brain/imageReader/readFile                          
               data/rawPT.mhd<br>
          /gate/source/voxel_brain/setPosition                       
                                   {source_x} {source_y} {source_z} mm<br>
          <br>
          /gate/source/voxel_brain/setType                              
          backtoback<br>
          /gate/source/voxel_brain/gps/particle                       
          gamma<br>
          /gate/source/voxel_brain/gps/ene/type                     
          Mono<br>
          /gate/source/voxel_brain/setForcedUnstableFlag       true<br>
          /gate/source/voxel_brain/setForcedHalfLife              
          6586.2 s<br>
          /gate/source/voxel_brain/gps/ene/mono                    511.
          keV<br>
          /gate/source/voxel_brain/gps/ang/type                      iso<br>
          <br>
          /gate/source/voxel_brain/dump         1<br>
          /gate/source/list<br>
        </p>
        <p><br>
        </p>
        <p>Conclusions of what I tried for debugging:<br>
        </p>
        <p> </p>
        <p>- If I use the exact same code with a sphere phantom (not
          voxelized), the simulation runs and the singles are  correctly
          saved in the output root file.</p>
        <p>- If I save the Hits, Singles and Coincidences in an ascii
          output file but nothing is saved.</p>
        <p><br>
        </p>
        <p>Any insight would be greatly appreciated.<br>
          Don't hesitate if something is not clear or if you need more
          details. Thanks you very much in advance.<br>
        </p>
        <p>Best regards,</p>
        <p>Marina<br>
        </p>
        <p><br>
        </p>
      </div>
    </div>
  </body>
</html>