Contradictory Errors when using a TCAD Weighting Potential

Hi All,

I’ve recently begun to put more effort into debugging my allpix simulation, and I’ve had a recurring error/warning/bug that I’d like to ask about.

I’m using TCAD meshes for my electric field and weighting potential. When I run the converter over the weighting potential, I usually tell it that the potential has units of voltage:

#log_level: Define verbosity for output
log_level = "STATUS"
#log_level = "DEBUG"

#model: Choose to create a .apf or .init file
model = init

#region: Define the region to be analysed. Right now only the "Substrate" is possible
region = "Substrate"

#observable: Take the observable to be analysed from the .dat file
observable = "ElectrostaticPotential"

#xyz: Define the coordinate system
xyz = x y -z

#divisions: Define the granularity of the outgoing mesh
divisions = 100 100

#observable_units: Define the units used for the observable defined above
observable_units = V
#observable_units = 1

#workers: The number of threads the program should use
workers = 10

However, when I try to run allpix using the output of this conversion, it complains that the field should have no units:

[damir@lxplus774 Prototype]$ allpix -c main.conf
|07:09:32.665|  (STATUS) Welcome to Allpix^2 v3.0.0
|07:09:32.665|  (STATUS) Initialized PRNG with configured seed 0
|07:09:33.751| (WARNING) Main ROOT file "/eos/home-d/damir/ALLPIX2_Remote/Prototype/output/histos_prototype_5strip_SimonNoTrap.root" exists and will be overwritten.
|07:09:34.229|  (STATUS) Loading module DepositionPointCharge
|07:09:34.245| (WARNING) Model file "/eos/home-d/damir/ALLPIX2_Remote/Prototype/Configurations/prototype_strip.conf" does not provide a geometry parameter, using default
|07:09:34.245|  (STATUS) Loading module TransientPropagation     
|07:09:34.246| (WARNING) [C:TransientPropagation:detector1] Per-event line graphs or animations requested, disabling parallel event processing
|07:09:34.246| (WARNING) Module instance TransientPropagation:detector1 prevents multithreading
|07:09:34.256|  (STATUS) Loaded 10 modules                   
|07:09:34.256|   (ERROR) Multithreading disabled since the current module configuration does not support it
|07:09:34.256|  (STATUS) Initializing 10 module instantiations
|07:09:35.224| (WARNING) [I:WeightingPotentialReader:detector1] No field units provided, interpreting field data in internal units, this might lead to unexpected results.
|07:09:35.225|   (ERROR) [I:WeightingPotentialReader:detector1] Requesting to interpret INIT field as units "" while file header states "V"
|07:09:35.228| (WARNING) [I:WeightingPotentialReader:detector1] Weighting potential with 2 dimensions detected, requiring three-dimensional scalar field - this might lead to unexpected behavior.
Warning in <TH1::TH1>: nbins is <=0 - set to nbins = 1
Warning in <TH2::TH2>: nbinsy is <=0 - set to nbinsy = 1
|07:09:35.287| (WARNING) [I:ROOTObjectWriter] File "/eos/home-d/damir/ALLPIX2_Remote/Prototype/output/trees_prototype_5strip_SimonNoTrap.root" exists and will be overwritten.
|07:09:35.890|  (STATUS) Initialized 10 module instantiations
|07:09:35.891|  (STATUS) Starting event loop
|07:09:38.013|  (STATUS) Finished run of 100 events             
|07:09:38.498|  (STATUS) [F:ROOTObjectWriter] Wrote 21060 objects to 7 branches in file:
                                              /eos/home-d/damir/ALLPIX2_Remote/Prototype/output/trees_prototype_5strip_SimonNoTrap.root
|07:09:38.795|  (STATUS) Finalization completed
|07:09:38.795| (WARNING) Unused configuration keys in section DepositionPointCharge:detector1:
                         output_plots
|07:09:38.795|  (STATUS) Executed 10 instantiations in 4 seconds, spending 44% of time in slowest instantiation TransientPropagation:detector1
|07:09:38.795|  (STATUS) Average processing time is 21.225ms/event, event generation at 47 Hz

If I try to change the configuration file so that it has observable_units = 1 then the converter simply crashes:

|07:32:30.772|  (STATUS) Welcome to the Mesh Converter Tool of Allpix^2 v3.0.0
|07:32:30.772|  (STATUS) Using ConvertWeightingPotential.conf configuration file
|07:32:30.772|   (FATAL) Error in the configuration:
                         Value 1 of key 'observable_units' in global section is not valid: unit 1 not found
                         The configuration needs to be updated. Cannot continue.

This seems contradictory, no? The weighting potential seems to need to change units between being output by the converter and being input into the allpix binary?

Also, I’ve noticed that I’ve been getting errors that aren’t allpix’ standard:

Warning in TH1::TH1: nbins is <=0 - set to nbins = 1
Warning in TH2::TH2: nbinsy is <=0 - set to nbinsy = 1

I’m not sure what I did here, but I’m getting root errors that don’t have the regular allpix nomenclature around them.

Any ideas what could be causing these issues?

Cheers,
Damir

Hi @damir

you are experiencing a small inconsistency here that we haven’t had time to iron out. The error

|07:09:35.225|   (ERROR) [I:WeightingPotentialReader:detector1] Requesting to 
                 interpret INIT field as units "" while file header states "V"

essentially is there because the checking method we use for the fields has not been taught that “unit potential” is a thing. You can safely ignore this for now and we hopefully find a smart way of avoiding this in the future. If you really don’t want to have the message there, you can set the unit to anything that evaluated to 1 in the reference units, for example mm (see table here: Configuration Files | Allpix Squared)

The other errors are coming from ROOT when the number of bins booked for a histogram are odd. I’ll have a look where this is coming from - but also here, nothing dramatic :slight_smile:

Cheers,
Simon