# Uniform Electric Field

Dear Geant4 users,
I’m trying to simulate an uniform electric field of 210^4 V/m in a volume of 14mm x 14mm x 5mm, to create the field I used F05 example. I use Po218 with charge +1 and 25 eV of kinetic energy. My problem is that when I set the field at 210^4 V/m the field doesn’t bend the trajectory. Setting the fied at 2*10^6V/m it works.
What I’m doing wrong? Do you have advice?

Dear Lewis,

A better starting point for a pure electric field is examples/extended/field/field02.
It uses the ‘standard’ equation of motion for particles in a combined electromagnetic field - but can also be used with zero magnetic field.

If all you need is a uniform electric field, you could copy the F02ElectricFieldSetup class and adapt it to attach the field to the volume in question – or else use the key elements as described in the Geant4 Guide for Application Developers, section on " Creating an Electric or Electromagnetic Field"

If this does not work, could you please post a code segment in which you are creating the field and its integration method.

I copied the F02ElectricFieldSetup, it works but now I have two problems:

• The electric field is a global field and I need to attach the field only to a specific volume,
I can use

`G4bool allLocal = true; `
`logicVolumeWithField->SetFieldManager(localFieldManager, allLocal);`

in my DetectorConstruction.cc. Should I attach this field to the volume in question or should I create a second field?

• My field is 0.2 kV/cm along z direction, when I set my field at this value
` fEMfield = new G4UniformElectricField(G4ThreeVector(0.0,0.0,0.2*kilovolt/cm));`
the ions don’t interact with field. If I set
` fEMfield = new G4UniformElectricField(G4ThreeVector(0.0,0.0,20*kilovolt/cm));`
they interact with field. What I’m doing wrong?

Best regards

When you say “the ions don’t interact with field,” what is the symptom you observe? Do they not pick up the energy, or the change in direction, you expect?

The field magnitude is not used to limit track steps; what’s done is that the regular physics processes determine the step length, then G4Transportation uses the field to figure out what effect it has on the track over that predetermined step.

If you’re expecting to see the ions follow a curved path, for instance, you will probably need to use G4StepLimiter to force small steps, over which the field can exert a small influence.

Thank you for your help and I apologize for my late reply, my purpose is to use an electric field to collect ions on my detector’s surface but if I set the field at 0.2 kV/cm I don’t see a curved path.
Please could you explain me how to use G4StepLimiter to force small steps?
Best regards

Take a look at basic example B2 as well as these sections in the App Guide:

https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/TrackingAndPhysics/thresholdVScut.html#special-tracking-cuts

https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/TrackingAndPhysics/userLimits.html

Thank you again for your help, looking at example B2 I write in my DetectorConstruction

``````G4double maxStep = 0.00005*mm;
fStepLimit = new G4UserLimits(maxStep);
logicEnv->SetUserLimits(fStepLimit);
``````

and becouse I use QGSP_BERT_HP PhysicsList in my main() I add

``````physicsList->RegisterPhysics(new G4StepLimiterPhysics());
``````

The problem is that it still doesn’t work, my ions are not collected by the electric field.
Where am I doing wrong?