Problem 1940

Summary: Electric Field units mismatch
Product: Geant4 Reporter: Dan Ciubotaru <dan.andrei.ciubotaru>
Component: geometry/magneticfieldAssignee: John Apostolakis <John.Apostolakis>
Status: RESOLVED WORKSFORME    
Severity: major    
Priority: P4    
Version: 10.2   
Hardware: All   
OS: All   
Attachments: A small example with the problem

Description Dan Ciubotaru 2017-02-17 15:48:30 CET
Created attachment 440 [details]
A small example with the problem

Hello everybody,

I'm trying to simulate a detector in which I study the interaction of the generated electrons in a gas detector with an electric field (electrons generated by a high energetic muon). In my simulation due to the high electric field applied, electrons generated by primary particle must be carried to the anode. This thing is not happening because it seems there is an error with the user units (I suppose).

To demonstrate the issue encountered I build a small example in Geant4. In this example, I considered a very simple geometry with a box placed in the world volume.
The box is filled with gas and an electric field can be applied to this volume (not to the world).

By default, there is no electric field applied and the particle travel in direction -z.

If we set an 100kV/m electric field in direction +x with the command:

/field/setVector 100000 0 0 volt/m
/run/beamOn 20

We notice that the generated electrons due to muon interaction move freely in the gas without feeling the electric field. With our calculation, we realized that 100 kV/m should be enough to deflect the electrons to +X side. But in our simulations, it seems to don't be so.

I did some debugging and I noticed something strange with units conversion. I tried to use a much bigger field (1GigaV/m) and indeed it seems to have the correct drift (but wrong in sign)

/field/setVector 1000000000 0 0 volt/m
/run/beamOn 5

Can you please verify if there is not an obvious mistake in my code or if it is really a bug of Geant4?

I tested with 10.02.p02, p03 and 10.03 with the same results.

Best regards
Comment 1 John Apostolakis 2017-03-07 14:19:45 CET
Thank you for your problem report.

I was looking to find an existing Geant4 example in which there was a user interface that allows to set an electric field, but I could not find one. 

Could you please explain what example you based your application code on, if any, or else how you register an electric field and a corresponding equation of motion ? 

From your description it sounds to me that the appropriate equation of motion is not registered to deflect the particle.

I suggest to look at the following Geant4 example, which demonstrates the equation of motion required for an Electric Field: geant4/examples/extended/field/field02

You will see in the file F02ElecticFieldSetup that an instance of the class G4EqMagElectricField is created and used as the equation of motion:
  fEquation = new G4EqMagElectricField(fEMfield);

If you are already using this equation, could you please provide more information about your field setup?  What stepper you are using, how you connect the messenger with your field class ? 

Best regards,
John