/tracking/verbose 0
/run/verbose 1
/control/verbose 1
#/gamos/verbosity RTVerbosity debug 
#/gamos/verbosity GmPhysicsVerbosity test

/gamos/setParam GmReadPhantomGeometry:FileName ../exercise2/linac.geom
/gamos/setParam GmSimplePhantomGeometry:MaterialNames G4_WATER G4_LUNG_ICRP G4_BONE_COMPACT_ICRU
/gamos/setParam GmSimplePhantomGeometry:MaterialZVoxels 10 10 80
/gamos/setParam GmSimplePhantomGeometry:MaterialDensities 1. 0.3 1.85
/gamos/setParam GmSimplePhantomGeometry:NVoxels 10 10 100
/gamos/setParam GmSimplePhantomGeometry:PhantomDims -500 500 -500 500 -500 500
/gamos/setParam GmReadPhantomGeometry:InitialDisplacement 0. 0. 1400.
/gamos/setParam GmReadPhantomGeometry:InitialRotAngles 0*deg 0. 0.
/gamos/geometry GmSimplePhantomGeometry

/gamos/physicsList GmEMPhysics

/gamos/generator GmGenerator

/gamos/geometry/createRegion targetReg target
#/gamos/geometry/createRegion collimatorReg "primary collimator_0"
#/gamos/geometry/createRegion filterReg "flattening filter"
#/gamos/geometry/createRegion monitorReg monitor
#/gamos/geometry/createRegion jawsReg jaws_X jaws_Y   
/gamos/physics/setCuts targetReg 10. 0.1 
/run/setCut 100.

/gamos/userAction GmCountTracksUA
/gamos/userAction GmCountProcessesUA
#/gamos/userAction GmCountProcessesUA GmPrimaryFilter

/run/initialize

/gamos/userAction RTReuseAtZPlaneUA
/gamos/setParam RTReuseAtZPlane:ZReusePlane 900
/gamos/setParam RTReuseAtZPlane:NReuse 10
/gamos/RT/ReuseAtZPlane

/gamos/generator/addSingleParticleSource source e- 6.*MeV
/gamos/generator/directionDist source GmGenerDistDirectionConst 0. 0. 1.

/gamos/scoring/createMFDetector doseDet phantom
/gamos/scoring/addScorer2MFD doseScorer GmG4PSDoseDeposit doseDet
/gamos/scoring/addPrinter2Scorer RTPSPDoseHistos doseScorer
/gamos/scoring/addPrinter2Scorer GmPSPrinterG4cout doseScorer
/gamos/setParam GmPSPrinterSqdose_doseScorer:FileName sqdose.direct.out
/gamos/scoring/addPrinter2Scorer GmPSPrinterSqdose doseScorer

/run/beamOn 100000
