Message: Charge, momentum and mass are not enough to compute the force Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Warning Charge, momentum and mass are not enough to compute the force 

Forum: Fields: Magnetic and Otherwise
Date: 03 Mar, 2005
From: Bertalan Juhasz <Bertalan.Juhasz@cern.ch>

Dear GEANTers,

(Maybe I should sent this to the bug report system, but since strictly speaking this is not a bug but a limitation, I send it here. Hopefully the developers will read it.)

The problem is the following: when one wants to calculate the force acting on a particle in an electomagnetic field, one has only the charge, momentum and mass of the particle to use (through the SetChargeMomentumMass(G4double charge, G4double momentum, G4double mass) method of G4EquationOfMotion). However, in case of a neutral particle (in my case on antihydrogen atom) in an inhomogenous magnetic field, there is a force acting on the particle's magnetic moment (which in turn sometimes depends on the magnitude of the field). But since the equation of motion calculation method doesn't know about the magnetic moment, it cannot calculate the force.

I solved this problem the following quick-and-dirty way: I modified the SetChargeMomentumMass(G4double charge, G4double momentum, G4double mass) methods of all classes to SetChargeMomentumMass(G4double charge, G4double momentum, G4double mass, G4ParticleDefinition *pDef) i.e. now my equation of motion calculator knows the particle type and thus can access all properties of the particle including its magnetic moment. This way everything works fine. However, I made the modifications in the GEANT classes themselves i.e. I did not derive my own classes (I tried it but failed), so now I should do the modifications every time a new GEANT version comes out.

Of course, there could be other workarounds like encrypting the magnetic moment in e.g. the charge (e.g. q = 1.000001 would mean mu = 1 Bohr magneton), but this is not the way it should be.

It would be very useful not only for me but for future users as well if SetChargeMomentumMass() would also pass the particle type as a G4ParticleDefinition* pointer (see above) or some other, more elegant way. Maybe this could be implemented in a future release.

Thanks,

Bertalan

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

1 Feedback: Re: Charge, momentum and mass are not enough to compute the force   (Peter Gumplinger - 03 Mar, 2005)
(_ None: Re: Charge, momentum and mass are not enough to compute the force   (Bertalan Juhasz - 04 Mar, 2005)
(_ Feedback: Re: Charge, momentum and mass are not enough to compute the force   (Peter Gumplinger - 04 Mar, 2005)
 Add Message Add Message
to: "Charge, momentum and mass are not enough to compute the force"

 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 ]