|Message: Charge, momentum and mass are not enough to compute the force||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
(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.
|Inline Depth:||Outline Depth:||Add message:|