Using custom electric field

Hi,

the way this is handled in Allpix Squared is the following: when we read in parameters from the configuration file, they’re automatically converted to Allpix Squared internal units, which is MV and mm. In addition, we store the field function as a TF3 and later on evaluate it based on internal units again. This means, that if you use a field function field_function = [0]*exp(-x/3.13), the number 3.13, the value for x will be provided in mm and the calculation will be wrong. The latter configuration is you showed will work, as then internally the 3.13cm will be converted to mm.

Allpix Squared does not check on correct units. If you are interested in implementing such a check, we would of course be thrilled :slight_smile:

Cheers
Paul