Hello,
I am trying to build a liquid xenon (LXe) TPC in Geant4, but when I add a uniform electric field to the logical volume connected to the LXe, it has no effect on charged particles unless the magnitude of the field is of order ~10^10 V/cm. The field works perfectly fine in other materials in my simulation, but has this problem in the liquid xenon. I have tried implementing a magnetic field instead of an electric field and come across the same exact problem. Any advice or potential solutions would be much appreciated!
I have some snippets of my code below. You can access my full code in the following GitHub repository in the “uclatpc” directory: GitHub - NFar20/GEANT4sims: Library of GEANT-4 simulations I have created and instructions on how to use them in GEANT-4.
Electric field setup:
#include "electricField.hh"
ElectricField::ElectricField() {}
ElectricField::~ElectricField() {}
void ElectricField::GetFieldValue(const G4double Point[4], G4double *field) const
{
G4double x = Point[0];
G4double y = Point[1];
G4double z = Point[2];
field[0] = 0.;
field[1] = 0.;
field[2] = 0.;
field[3] = 0.;
field[4] = 0.;
field[5] = -10000*kilovolt/cm;
}
G4bool ElectricField::DoesFieldChangeEnergy() const
{
return true;
}
Electric field implementation in my Construct() method:
electricField = new ElectricField();
//electricField = new G4UniformElectricField(electricFieldVector);
equation = new G4EqMagElectricField(electricField);
G4int nvar = 8;
auto pStepper = new G4DormandPrince745(equation, nvar);
auto globalFieldManager = G4TransportationManager::GetTransportationManager()->GetFieldManager();
auto localFieldManager = new G4FieldManager(electricField);
localFieldManager->SetDetectorField(electricField);
G4double minStep = 0.001*mm;
auto pIntegrationDriver = new G4IntegrationDriver<G4DormandPrince745>(minStep, pStepper, nvar);
chordFinder = new G4ChordFinder(pIntegrationDriver);
globalFieldManager->SetChordFinder(chordFinder);
localFieldManager->SetChordFinder(chordFinder);
logicLXe->SetFieldManager(localFieldManager, true);
Any suggestions would be extremely helpful. Thank you so much!
Geant4 Version: 11.3.2
Operating System: Linux Ubuntu 24.04.2
Compiler/Version: g++ 13.3.0
CMake Version: 4.0.3