Message: Re: local vs. global field manager Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: local vs. global field manager 

Forum: Fields: Magnetic and Otherwise
Re: Question local vs. global field manager (Neil Fazel)
Re: Feedback Re: local vs. global field manager (Gumplinger Peter)
Re: Question Re: local vs. global field manager (Neil Fazel)
Date: 13 Jan, 2012
From: John Apostolakis <John Apostolakis>

--_000_87E0873D08604BBABBF40DE3FCB78124cernch_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi Neil,

I wanted to expand on Peter's clear and precise recommendation.  I note tha=
t I am the original author of the majority of the field propagation module.

Having a field which is restricted to the geometrical region (volume) where=
 the magnetic field matters (i.e. is significant for your application) is a=
n improvement for the following reason(s):
- if you have a global magnetic field, then all the steps of a charged part=
icle will need to interrogate the value of the field at their start and at =
a few other points (typically 3-8).  These extra calls and the additional c=
ode which integrates the zero force are useless extra work if the field is =
zero in most of the geometry.
- the steps in which the track passes from a zero field to a finite field a=
re handled much more easily if an extra volume is used.  A step inside this=
 volume will almost certainly see that the field exists.  On the other hand=
 if there is a global field it is possible that a track could skip over a r=
egion in which the field exists.  The integrator inside Geant4 will sample =
the field value only at a few points: the start, end and a few intermediate=
 points (typically at the 25, 50 and 75% points of the projected step.)  If=
 a step starts outside the field region, and crosses it in a way that these=
 sampling points have zero field, it will be as though the field is zero al=
l along the track.

I hope this clarifies some of the key differences between using a global an=
d a local field for this type of setup.

By the way, I expect that changing the 'largest step size' will slow down y=
our simulation much more than using a global field manager.

Please note that all fields (including a field restricted to a volume - i.e=
. local field) have the values of the position input and field value output=
 in the global reference frame.

Best regards,

John Apostolakis

On Jan 13, 2012, at 8:37 AM, Neil Fazel wrote:


*** Discussion title: Fields: Magnetic and Otherwise

On Fri, 13 Jan 2012 01:03:25 GMT, Gumplinger Peter wrote:

Hi Neil, the local field approach will give you better performance.
Peter


Thanks Peter. Is the difference in performance because in the global
case a common 'largest step size' has to be used inside and outside the
magnetic field, one which is too small for propagation of a particle in
vacuum with no magnetic field?

If that's the case, I may have gotten around that by using a global
field manager but changing the 'largest step size' to something small
(0.1mm) when approaching the magnet and while inside the field and then
changing the 'largest step size' to something relatively large (10m) as
soon as the particle exits the magnetic field into vacuum with no field.

Neil

-------------------------------------------------------------
Visit this GEANT4 at hypernews.slac.stanford.edu<http://hypernews.slac.stan=
ford.edu> message (to reply or unsubscribe) at:
http://hypernews.slac.stanford.edu/HyperNews/geant4/get/emfields/190/1/1.ht=
ml


--_000_87E0873D08604BBABBF40DE3FCB78124cernch_
Content-Type: text/html; charset="iso-8859-1"
Content-ID: <E41EAC3AE38CCC4DA7234BB2BF5042B3@cernxchg.cern.ch>
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
</head>
<body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-lin=
e-break: after-white-space; ">
<div>Hi Neil,</div>
<div><br>
</div>
<div>I wanted to expand on Peter's clear and precise recommendation. &nbsp;=
I note that I am the original author of the majority of the field propagati=
on module.&nbsp;</div>
<div><br>
</div>
<div>Having a field which is restricted to the geometrical region (volume) =
where the magnetic field matters (i.e. is significant for your application)=
 is an improvement for the following reason(s):</div>
<div>- if you have a global magnetic field, then all the steps of a charged=
 particle will need to interrogate the value of the field at their start an=
d at a few other points (typically 3-8). &nbsp;These extra calls and the ad=
ditional code which integrates the zero
 force are useless extra work if the field is zero in most of the geometry.=
 &nbsp;</div>
<div>- the steps in which the track passes from a zero field to a finite fi=
eld are handled much more easily if an extra volume is used. &nbsp;A step i=
nside this volume will almost certainly see that the field exists. &nbsp;On=
 the other hand if there is a global field
 it is possible that a track could skip over a region in which the field ex=
ists. &nbsp;The integrator inside Geant4 will sample the field value only a=
t a few points: the start, end and a few intermediate points (typically at =
the 25, 50 and 75% points of the projected
 step.) &nbsp;If a step starts outside the field region, and crosses it in =
a way that these sampling points have zero field, it will be as though the =
field is zero all along the track.</div>
<div><br>
</div>
<div>I hope this clarifies some of the key differences between using a glob=
al and a local field for this type of setup.</div>
<div><br>
</div>
<div>By the way,&nbsp;I expect that changing the 'largest step size' will s=
low down your simulation much more than using a global field manager.</div>
<div><br>
</div>
<div>Please note that all fields (including a field restricted to a volume =
- i.e. local field) have the values of the position input and field value o=
utput in the global reference frame.</div>
<br>
<div apple-content-edited=3D"true"><span class=3D"Apple-style-span" style=
=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;=
 font-style: normal; font-variant: normal; font-weight: normal; letter-spac=
ing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; tex=
t-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-s=
pacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertica=
l-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size=
-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span c=
lass=3D"Apple-style-span" style=3D"border-collapse: separate; color: rgb(0,=
 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; f=
ont-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2=
; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-s=
pace: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spaci=
ng: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-=
effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0p=
x; font-size: medium; ">
<div style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line=
-break: after-white-space; ">
<div>
<div>Best regards,</div>
<div><br>
</div>
<div>
<div apple-content-edited=3D"true"><span class=3D"Apple-style-span" style=
=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;=
 font-style: normal; font-variant: normal; font-weight: normal; letter-spac=
ing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; tex=
t-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-s=
pacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertica=
l-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size=
-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">
<div>John Apostolakis</div>
<div><br>
</div>
</span></div>
</div>
</div>
</div>
</span></span></div>
<div>
<div>On Jan 13, 2012, at 8:37 AM, Neil Fazel wrote:</div>
<br class=3D"Apple-interchange-newline">
<blockquote type=3D"cite">
<div><br>
*** Discussion title: Fields: Magnetic and Otherwise<br>
<br>
On Fri, 13 Jan 2012 01:03:25 GMT, Gumplinger Peter wrote:<br>
<br>
<blockquote type=3D"cite">Hi Neil, the local field approach will give you b=
etter performance.<br>
</blockquote>
<blockquote type=3D"cite">Peter<br>
</blockquote>
<blockquote type=3D"cite"><br>
</blockquote>
<br>
Thanks Peter. Is the difference in performance because in the global<br>
case a common 'largest step size' has to be used inside and outside the<br>
magnetic field, one which is too small for propagation of a particle in<br>
vacuum with no magnetic field?<br>
<br>
If that's the case, I may have gotten around that by using a global<br>
field manager but changing the 'largest step size' to something small<br>
(0.1mm) when approaching the magnet and while inside the field and then<br>
changing the 'largest step size' to something relatively large (10m) as<br>
soon as the particle exits the magnetic field into vacuum with no field.<br=
>
<br>
Neil<br>
<br>
-------------------------------------------------------------<br>
Visit this GEANT4 at <a href=3D"http://hypernews.slac.stanford.edu">hyperne=
ws.slac.stanford.edu</a> message (to reply or unsubscribe) at:
<br>
<a href=3D"http://hypernews.slac.stanford.edu/HyperNews/geant4/get/emfields=
/190/1/1.html">http://hypernews.slac.stanford.edu/HyperNews/geant4/get/emfi=
elds/190/1/1.html</a>
<br>
</div>
</blockquote>
</div>
<br>
</body>
</html>

--_000_87E0873D08604BBABBF40DE3FCB78124cernch_--

 Add Message Add Message
to: "Re: local vs. global field manager"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]