Post on 06-Mar-2016
description
transcript
7/21/2019 Gamos.g4ws07
1/32
P d A GAMOS G4WS07 13th S t b 2007 1
GAMOS(GEANT4-based Architecture forMedical-Oriented Simulations)
Status and plans
Pedro Arce uboisPedro !ato Mendes
"#EMAT$ Madrid
%&th GEANT4 'orshopebden *rid+e (,)$ %.-%/ September &001
7/21/2019 Gamos.g4ws07
2/32
Pedro Arce GAMOS G4WS07 13th September 2007 1
P d A c GAMOS G4WS07 13th S pt mb 2007 2
Introduction GAMOS objective p!u"#in
GAMOS component Geometr$ Movement Gener%tor Ph$ic &er %ction Senitive detector %nd hit
'econtructed hit Scorin" (ito"r%m )iu%!i*%tion
#nde2
&ti!itie P%r%meter m%n%"ement
)erboit$ m%n%"ement Input +i!e m%n%"ement
,-%mp!e
P,. /O'A doimetr$
'%diother%p$
&e o+ GAMOS
Summ%r$
7/21/2019 Gamos.g4ws07
3/32
P d A GAMOS G4WS07 13th S pt mb 2007 3
Easy to use
Simulate a medical project with a minimal knowledge of GEANT4
and no need of C++
Base it on ascripting langauge
Complete
Provide all the functionality+or omeone 5ho 5%nt to imu!%te %
medical physics project
At least as complete as possible
Ob3ecties
7/21/2019 Gamos.g4ws07
4/32
P d A GAMOS G4WS07 13th S t b 2007 4
Flexible
Users always need to do something or to extract some info in a
way you hae not foreseen
!ain users are research groups
GEANT4 has a lot of possi"ilities# eer increasing
$f your framework is too rigid# you will end hiding some of these
possi"ilities to the users
C++ cannot "e aoided if you want to "e flexi"le# "ut you hae to
make it easy%
&ase it on the plug'in mechanism
(roide templates and easy instructions for each plug'in type
Ob3ecties
7/21/2019 Gamos.g4ws07
5/32
P d A GAMOS G4WS07 13th S t b 2007 5
The main GAMOS program has no predefined componentsno fixed !ay to build geometry" no fixed physics list" no fixed sensiti#e
detector type"$% At run&time user selects !hich components to load through user commands They are selected !ith a user command and loaded through the plug&in
mechanism
User has full freedomin choosing components
User can define a component not foreseenby GAMOS
)rite C++and use it through an user command
Mix it with any other component
6or the p!u"#in imp!ement%tion in GAMOS it h% been choen the
/,' !ibr%r$ S,A8 On!$ % +e5 ubp%c9%"e %nd :m%9e compi!in" inte%d o+ :S/'AM compi!in"
GAMOS plu+-in5s
7/21/2019 Gamos.g4ws07
6/32
P d A GAMOS G4WS07 13th S t b 2007 6
C'' code( .he uu%! G,A.4 5%$
Add one !ine to transform your class in a plug&inDEFINE_GAMOS_GEOMETRY (MyGeometry);
o th%t $ou c%n e!ect it in $our input m%cro/gamos/geometry MyGeometry
)efine it in ASC** files
.he e%iet 5%$ to de+ine % "eometr$ ;%ed on imp!e t%"
+sing one of the GAMOS examples Simp!e P,. c%n be de+ined throu"h %n
cr$t%!=-?$?*> r%diu> @
,eading )*COM files /M.B too!9it AS/II ,GS +orm%t GAMOS &e G4'e"u!%r%vi"%tion +or +%t n%vi"%tion ee .hurd%$ t%!9
Geometr6
7/21/2019 Gamos.g4ws07
7/32
P d A GAMOS G4WS07 13th S t b 2007 7
;%ed on imp!e t%"> 5ith %me order o+ p%r%meter % correpondin" G,A.4c!%e
:ELEM Hyroge! H "# "#
:$OL% yo&e :T%'S Iro! *#+,m -*.# "#*+m
:0LA1E yo&e " e23Ha44 R. .#. .#. .#+,m
MA.,'IA8S Iotope ,!ement Simp!e m%teri%! M%teri%! mi-ture b$ 5ei"ht> vo!ume or number o+ %tom
SO8IS A!! C/SGD %nd Cpeci+icD o!id ;oo!e%n o!id
'O.A.IO MA.'I/,S 3 rot%tion %n"!e %round E>F> H thet% %nd phi %n"!e o+ E>F> %-i m%tri- v%!ue
Geometr6 from AS"## files
7/21/2019 Gamos.g4ws07
8/32
P d A GAMOS G4WS07 13th S t b 2007 8
P8A/,M,.S
Simp!e p!%cement
iviion
'ep!ic%
P%r%meteri%tion 8ine%r> circu!%r or Ju%re
6or comp!ic%ted p%r%meteri%tion e-%mp!e o+ ho5 to mi- the /KK p%r%meteri%tion5ith the AS/II "eometr$ +i!e
/O8O&'S
)IS&A8ISA.IO O?O66
Geometr6 from AS"## files
7/21/2019 Gamos.g4ws07
9/32
P d A GAMOS G4WS07 13th S t b 2007 9
PA'AM,.,'S
/%n be de+ined to ue them !%ter
:0 I!!erR "*#
:$OL% yo&e :T%'S Iro! $InnerR-*.# "*.#
A'I.(M,.I/ ,EP',SSIOS
,!%bor%ted e-preion c%n be ued
:$OL% yo&e :T%'S Iro! s5!(6ANG7)+*89+,os(e23("#)) -*.# "*.#
&I.S
e+%u!t unit +or e%ch v%!ue
,%ch v%!u!e c%n be overridden b$ uer
:0 1o!e05 "#+ra
Geometr6 from AS"## files
7/21/2019 Gamos.g4ws07
10/32
P d A GAMOS G4WS07 13th S t b 2007 10
Inc!ude other +i!e
5!,4
7/21/2019 Gamos.g4ws07
11/32
P d A GAMOS G4WS07 13th S t b 2007 11
&ti!itie th%t c%n be ued throu"h % comm%nd or +rom %n$ p%rt o+ the uer code
Material factory GAMOS reads material list from a text file
A G$Material can be built at user re%uest
G4Material* bgo = GmMaterialMgr::GetInstance() -
>GetG4Material(BGO);
&rinting list of Materials S'lids (ogical )olumes &hysical )olumes Toucha"les
*ind a )olume by name +(,- &, or touchable.
/elete a )olume +and daugthers. by name
Some +eometr6 utilities
7/21/2019 Gamos.g4ws07
12/32
P d A GAMOS G4WS07 13th S t b 2007 12
Fou c%n move % vo!ume b$ uin" comm%nd
,ver$ event or ever$ interv%! o+ time
time or +orever
Fou c%n de+ine %n o++et
ip!%ce or rot%te it Fou c%n decribe any -ind of mo#ementb$ uin" %n AS/II +i!e
5here $ou de+ine the poition %nd rot%tion o+ the vo!ume %t e%ch
tep
Sever%! movement o+ di++erent or the %me vo!ume c%n be et
Moements
7/21/2019 Gamos.g4ws07
13/32
P d A GAMOS G4WS07 13th S t b 2007 13
Generator
C'' code
.he uu%! G,A.4 5%$
Add one !ine to transform your class in a plug&inDEFINE_GAMOS_GENERATOR(MyGe!erator);
o th%t $ou c%n e!ect it in $our input m%cro
/gamos/ge!erator MyGe!erator
GA!* generator
01ombine any number of single particlesor decaying isotopes
0,or each particle or isotopeuser may select by user commands a combination
of time# energy# position and directiondistributions
Or create its own and select it by a user command +transforming it into a plug2in.
DEFINE_GAMOS_DIST_0OSITION(My0osO!05ram5a44);
/gamos/ge!erator/3os5t5o!D5st MYSO%R1E" My0osO!05ram5a44 "#+,m
Also your class may deri)e from se)eral of these +for introducing correlations.
7/21/2019 Gamos.g4ws07
14/32
P d A GAMOS G4WS07 13th S t b 2007 14
Ph6sics
C'' code
.he uu%! G,A.4 5%$
Add one !ine to transform your class in a plug&in
DEFINE_GAMOS_0HYSI1S_LIST (My0ys5,sL5st);
o th%t $ou c%n e!ect it in $our input m%cro
/gamos/3ys5,sL5st My0ys5,sL5st
An$ o++ici%! G,A.4 ph$ic !it c%n be e%i!$ ued throu"h % uer comm%nd
0GA!* physics list
0&ased on GEANT4 hadrotherapy adanced example
0User can com"ine different physics lists for photons# electrons#
positrons# muons# protons and ions
0-ummy one for isualisation
7/21/2019 Gamos.g4ws07
15/32
P d A GAMOS G4WS07 13 h S b 2007 15
,ser actions
User can ha)e as many user actions of any type as he3she wants
User can acti)ate a user action by a user command
0GAMOS user actions or her3his own
04ust adding a line after the user action to transform it into a plug2in
DEFINE_GAMOS_%SER_A1TION(My%serA,t5o!);so that you can select it in your input macro
/gasos/
7/21/2019 Gamos.g4ws07
16/32
P d A GAMOS G4WS07 13 h S b 2007 16
Sensitie etectors
.o produce hit in G,A.4 % uer h% to
e+ine % c!% inheritin" +rom G4)SenitiveetectorAoci%te it to % G48o"ic%!)o!ume
/re%te hit in the Proce(it method
/!e%n the hit %t ,ndO+,vent
0$n GA!* you can do all this with a user command
/gamos/assocSD2LogVol SD_CLASS SD_TYPE LOGVOL_NAME
S=/8ASS the G4)Senitiveetector c!%
S=.FP, %n identi+ier trin"> o th%t di++erent S?hit c%n h%ve di++erent
tre%tment
Fou c%n cre%te $our o5n S c!% %nd m%9e it % p!u"in
DEFINE_GAMOS_SENSDET(MySD);
o th%t $ou c%n e!ect it on $our input m%cro
7/21/2019 Gamos.g4ws07
17/32
P d A GAMO G4W 07 13 h b 2007 17
its
0A GA!* hit has the following information
0 G4int theet!nitI; I o+ the enitive vo!ume cop$
G4int the"#entI;$G4%o&ble the"nerg';
$G4%o&ble theimeMin; time o+ the +irt , depoit
$G4%o&ble theimeMa; time o+ the !%t , depoit
$G4hreeector the+osition;
$st%::set,,G4int,>, therac.Is; !it o+ %!! tr%c9 th%t contributed
$st%::set,,G4int,>, the+rimar'rac.Is; !it o+ %!! :prim%r$Ntr%c9 th%t
contributed
$st%::#ector,,Gamos"e/o*,>, the"e/os; !it o+ %!! depoited ener"ie
$G40tring the0'/e;
&er c%n cre%te hi?her o5n hit c!%
7/21/2019 Gamos.g4ws07
18/32
P d G MO G4W 07 13 h b 2007 18
i+iti7er
i"iti*%tion i ver$ detector peci+ic it i not poib!e to provide %
"ener%! o!ution
GAMOS jut provide % imp!e di"iti*er05 hit 5digit
0Merge hits close enough
0ame set of sensitie olumes
0Closer than a gien distance@ %nd % b%ic tructure
06its compatible in time +spanning )arious e)ents.
0#rigger
0&ulse simulation
0Sampling0"oise
7/21/2019 Gamos.g4ws07
19/32
P d G M G4 0 1 h b 20019
!econstructed hits
.he di"it%! i"n%! bui!d b$ % di"iti*er c%n be converted to
recontructed hit poition> time> ener"$ throu"h % 'ec(it;ui!der
%!o % p!u"#in
Fou c%n %!o ue it %ctin" direct!$ on hit
e" +or mer"in" hit
7/21/2019 Gamos.g4ws07
20/32Pedro Arce GAMOS G4WS07 13th September2007 20
etector effects
!easuring time
# A detector i not %b!e to ep%r%te i"n%! +rom di++erent event i+
the$ come c!oe in time
-ead time
# When % detector i tri""ered> thi detector or even the 5ho!e
"roup it be!on" to i not %b!e to t%9e d%t% durin" ome time
;oth c%n be et b$ the uer in the input m%croA di++erent time +or e%ch S=.FP,
1gamos1set+aram 0:2its:Meas&ringime:3alor 56 ns
S
7/21/2019 Gamos.g4ws07
21/32Pedro Arce GAMOS G4WS07 13th September2007 21
Scorin+
GAMOS scoring is based on GEA.T/ scoring
#Fou c%n ue it throu"h uer comm%nd
G,A.4 primitive corer %re p!u"#inNFou c%n e%i!$ %dd $our o5n one
G,A.4 corer +i!ter %re p!u"#inNFou c%n e%i!$ %dd $our o5n one
A third t$pe o+ p!u"#in GmScorer6orm%tter
.o de+ine the +orm%t o+ $our corin" b$ ener"$ bin> b$vo!ume I> @.o de+ine $our output +orm%t
i
7/21/2019 Gamos.g4ws07
22/32Pedro Arce GAMOS G4WS07 13th September2007 22
isto+rams
Same code to create and fill histograms independent of the formatGAMOS t%9e c%re o+ 5ritin" the +i!e in the choen +orm%t %t the end o+ job
Ori"in%!!$ b%ed on /,' p%c9%"e PI;ut PI i not upported %n$ more
/urrent!$ o5n +orm%t> output in ,OOTor CS0/omm% Sep%r%ted
)%!ue te-t +i!e
GmAnalysisMgr9eep % !it o+ histograms o th%t the$can be accessedfrom any part of the code" by number or name
Gm2its"#entMgr::GetInstance(/et)->Get2isto(784)->9ill(ener);
Gm2its"#entMgr::GetInstance(/et)->Get2isto(3alor0: hitsenerg')->9ill(ener);
There can be se#eral files" each one !ith its o!n histograms
When creating an histogram, user chooses file name
P t t
7/21/2019 Gamos.g4ws07
23/32Pedro Arce GAMOS G4WS07 13th September2007 23
Parameter mana+ement
Gm(arameter!grhe!p the uer to de+ine %nd ue % p%r%meter
A p%r%meter i de+ined in the input macro1gamos1set+aram 0:2its:"nerg'esol&tion 56
&er c%n get it v%!ue in any part of the codeloat eneresol = Gm+arameterMgr::GetInstance()
->Get
7/21/2019 Gamos.g4ws07
24/32Pedro Arce GAMOS G4WS07 13th September2007 24
8erbosit6 mana+ement
&er c%n contro! the verboit$ o+ the di++erent GAMOS
component independent!$1gamos1#erbosit' GamosGenererb 8
1gamos1#erbosit' Gamos0erb 7
/%n be ued in ne5 code trivi%!!$ G4co&t AnaVerb(2) creating m' histograms G4en%l;
G4co&t AnaVerb(DebgVerb) energ' is ener G4en%l;
&er c%n e%i!$ de+ine it o5n verboit$ t$pe contro!!ed b$ % uer
comm%nd
K 1 !eve! o+ verboit$0Silent,erb 7 25
0!rror,erb 7 8 +default.
09arning,erb 7 5
0nfo,erb 7 :
0/ebug,erb 7 ;
0#est,erb 7 $
8 b it t (##)
7/21/2019 Gamos.g4ws07
25/32Pedro Arce GAMOS G4WS07 13th September2007 25
8erbosit6 mana+ement (##)
Trac-ing0erbose by e#ent and trac- number(It c%n be e!ected +or 5hich event %nd tr%c9 number the
C?tr%c9in"?verboeD comm%nd become %ctive
1gamos1&serction rac.ingerbose!
1gamos1set+aram rac.ingerbose:"#entMin 555
1gamos1set+aram rac.ingerbose:"#entMa 55
1gamos1set+aram rac.ingerbose:rac.Min 5
1gamos1set+aram rac.ingerbose:rac.Ma 75
Also your o!n #erbosity can be s!itched on2off by e#ent
,undamental for de"ugging strange eents.
# t fil t
7/21/2019 Gamos.g4ws07
26/32Pedro Arce GAMOS G4WS07 13th September2007 26
#nput file mana+ement
Some %!"orithm need to re%d in % d%t% +i!e
In GAMOS the file does not ha#e to be on the current directory ,%ier to ue the %me +i!e in ever%! %pp!ic%tion
GAMOS3SEA,C431AT4v%ri%b!e cont%in the !it o+ directorie
5here the +i!e i !oo9ed +or&er c%n %dd more directorie
A li ti PET
7/21/2019 Gamos.g4ws07
27/32
Pedro Arce GAMOS G4WS07 13th September2007 27
Applications9 PET
A +u!! P,. %pp!ic%tion i %v%i!%b!eModu!e +or bui!din" % imp!e P,. 5it % +e5 p%r%meter
Sever%! contro! hito"r%m,vent c!%i+ic%tion
/.I ,/A. ,-%ct 22 G, icover$ S. P,.?/. detector
h%ve been imu!%ted'eu!t %"ree 5ith d%t%
/!e%rP,. detector i bein" imu!%ted 5ith GAMOS
;r%inP,. ree%rch project i bein" imu!%ted 5ith GAMOS
A li ti "ON!A 'P4
7/21/2019 Gamos.g4ws07
28/32
Pedro Arce GAMOS G4WS07 13th September2007 28
Applications9 "ON!A 'P4
1O"
7/21/2019 Gamos.g4ws07
29/32
Pedro Arce GAMOS G4WS07 13th September2007 29
Applications9 !adiotherap6
M*,AS Medical *maging ,adiotherapy and Simulation%&roject aimed to facilitate all =ind of %nd % e%i!$P,,8OP, peop!e ho5ed interet meetin" %t ;%rce!on% ne-t 5ee9
;,AMnrc ,GSnrc to GAMOS tr%n!%torGeometr$Gener%torPh$ic cut)%ri%nce reduction optino@On pro"re@
A li ti ! di th
7/21/2019 Gamos.g4ws07
30/32
Pedro Arce GAMOS G4WS07 13th September2007 30
Applications9 !adiotherap6
M*,AS Medical *maging ,adiotherapy and Simulation%
I/OM re%der
OSEF ,GS te-t +orm%t
GAMOS;%ed on /M.B tooo!9it > the de#+%cto t%nd%rd +or re%din" I/OM +i!e
%n$ I/OM c%n e%i!$ be re%d
MI'AS i "oin" to be preented %t
10th ,6OMP ,urope%n 6eder%tion o+ Or"%ni%tion +or Medic%! Ph$ic/on"re> Pi%> It%!$> 20#22 September 2007Im%"in" .echno!o"ie in ;iomedic%! Science 2007 con+erence> Mi!o> Greece>
22#2< September 2007
MI'AS coure %t M%drid in ovember 2007
,se of GAMOS
7/21/2019 Gamos.g4ws07
31/32
Pedro Arce GAMOS G4WS07 13th September2007 31
,se of GAMOS
A set of scripts to download it and install it automatically$ncluded compilation of GEANT4# C/0E(# EA/ 1 2**T
Tested on cientific /inux 3 1 4# ,edora Core 4# # 5 1 6 and-e"ian
&ase GEANT4 software at the medical physics and electronics
departments of C$E!AT'!adrid
GA!* course at /a 0a"ana# Cu"a# 7uly 8995
GA!* course at /ima# (erou# *cto"er 8995
&eta'testers in &russels# &elgium and Tennessee# UA :Townsend
;s group< uniersities
Course at !adrid for pain medical simulation users community in
Summar6
7/21/2019 Gamos.g4ws07
32/32
Summar6
GA!* is a user'friendly and flexi"le GEANT4'"ased framework
for medical simulations
allows the user to do G!A"#$ simulation through user commandsplug'in=sallow to easily extend its functionalityby writing C++
classes that can then be used through user commands
Software engineering techni%ues ha)e been applied with the aim ofbuilding a framewor=
Easy to use# complete and flexi"le
GA!* core is application independent
Se)eral medical applicationsare being built on top of GAMOS
core +&!#- /osimetry-