Problem 1492

Summary: Problem to import IAEA phase space data to medical linac example.
Product: Examples/Advanced Reporter: Yue Yan <yanyue0730>
Component: medical_linacAssignee: Luciano Pandola <luciano.pandola>
Status: RESOLVED INVALID    
Severity: major CC: pandola
Priority: P5    
Version: 9.5   
Hardware: PC   
OS: Linux   
Attachments: Error reported by the software when I revised the ml2.mac file to run the project.
Error information when I try to build the project using make -j2
revised ML2PrimaryGenerationAction.hh file
revised ML2PrimaryGenerationAction.cc file

Description Yue Yan 2013-07-11 22:33:25 CEST
Created attachment 225 [details]
Error reported by the software when I revised the ml2.mac file to run the project.

Dear Sir/Madam:

I have installed the Geant4.9.5.p02 on my Ubuntu 12.04 64-bit system. 
I am trying to import a IAEA phase space data(TrueBeam_v2_6FFF_00.IAEAphsp) to advanced medical linac example. In the build ml2.mac file, I made revision like this:

### Primary generator 

....
#/primaryParticleData/sourceTypeName randomTarget       # type of particle generator source
/primaryParticleData/sourceTypeName phaseSpace
#/primaryParticleData/calculatedPhaseSpaceFileIN PhSp_Acc1_1.txt # full path and file name of the phase space file to be used as particle generator
/primaryParticleData/calculatedPhaseSpaceFileIN TrueBeam_v2_6FFF_00.IAEAphsp

.....

When I try to run the build ml2 file (./ml2), the software complain the following errors:

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : TRACK003
      issued by : G4ParticleChange::CheckIt
momentum, energy, and/or time was illegal
*** Event Must Be Aborted ***
-------- EEEE -------- G4Exception-END --------- EEEE -------

Could you give me some suggestions about how to use the phase space data as the particle rather than random target?

I find online that IAEA provide an interface to read the IAEA space phase files (http://www-nds.iaea.org/phsp/phsp.htmlx).  I tried to copy the needed function and headers to linac /include and /src folder and modified the source code (ML2PhantomConstruction.cc and ML2PhantomConstruction.hh) files based on the IAEA document but it still does not work. I just wonder should I use the IAEA interface to import the IAEA phase space data?

Thank you for your help and have a nice day. 

Sincerely Yours
   Yue
Comment 1 Yue Yan 2013-07-12 00:45:27 CEST
Created attachment 226 [details]
Error information when I try to build the project using make -j2
Comment 2 Yue Yan 2013-07-12 00:46:27 CEST
Dear Sir/Madam:

Hope you have a nice day. I just add some revision to my reported problem. I tried to use the interface developed by IAEA to make some revisions to the source code in linac example. I revised the following two files located in /src and /include folders in the medical linac project: ML2PrimaryGenerationAction.cc and ML2PrimaryGenerationAction.hh. You can see the attachments for the detail information for my revision. 

When I try to build the project, there are some problems. I use command 

cmake -DGeant4_DIR=/home/yunzhongfan107/Program/Geant4/geant4.9.5-install/lib/Geant4-9.5.2/ /media/7b6affeb-931d-46f5-ab55-dca1255b2204/yunzhongfan107/work/Geant4/TrueBeam/medical_linac/

Success

then I use

make -j2

The software complains about some problems (you can see the screen-shot for details. 

Could you give me some suggestions please? Thank you for your help.

Best 
Yue
Comment 3 Yue Yan 2013-07-12 00:47:57 CEST
Created attachment 227 [details]
revised ML2PrimaryGenerationAction.hh file
Comment 4 Yue Yan 2013-07-12 00:48:41 CEST
Created attachment 228 [details]
revised ML2PrimaryGenerationAction.cc file
Comment 5 Luciano Pandola 2013-12-16 11:34:58 CET
The medical_linac example is not meant to import directly the phase space data from the IAEA format. It is able to re-read only phase-space files that are generated by the program itself.