Message: Re: Problem with local magnetic field Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Problem with local magnetic field 

Forum: Fields: Magnetic and Otherwise
Re: Question Problem with local magnetic field (Lukasz Fulek)
Date: 15 Dec, 2011
From: Gumplinger Peter <Gumplinger Peter>

I cannot sport anything wrong with your code snippet as far as G4 is concerned. If the trajectory is not where it should be then perhaps your field(value) is not accurate/correct for your particle's momentum.

The formula is:

B = P / (0.299792458 * q *R)

Where:

P = ... GeV (/c where c = 1) R = ... m q = 1, 2, 3 etc (in units of electronic charge)

I suspect you want:

B = (100*GeV/ (0.299792458 * 1 * 0.13*m) ) * tesla

I suggest that you define variables in G4 that have units, with their units immediately. So, for example:

G4double dxlength = 3.700219*m; etc.

but this is just a 'good coding' convention.

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Problem with local magnetic field   (Lukasz Fulek - 15 Dec, 2011)
(_ Feedback: Re: Problem with local magnetic field   (Gumplinger Peter - 15 Dec, 2011)
(_ None: Re: Problem with local magnetic field   (Lukasz Fulek - 15 Dec, 2011)
 Add Message Add Message
to: "Re: Problem with local magnetic field"

 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 ]