Coordinate system shifted for half pixel in DepositionPointCharge scan
Summary
When running the DepositionPointCharge module with the scan option the initial distribution of the charge is not positioned inside the bounds of a pixel. The scan options assumes that the reference point is lower left corner of one pixel volume, whereas the Pixel
object or allpix in general assumes that the reference point the center of the pixel volume. This results in the situation that the deposited charge is not directly under a pixel, but rather equally shared between 4 pixels.
Steps to reproduce
To run use these two files basic.confplacement.cpnf and then look at the difference
depositedCharge->getLocalPosition().X() vs depositedCharge->getLocalPosition().Y()
vs.
pixelCharge->getPixel().getLocalCenter().X() vs pixelCharge->getPixel().getLocalCenter().Y()
and you get this two plots pixel.pdf deposited.pdf
Example Configuration
All described in previous step
What is the current bug behavior?
The coordinate system in which the deposited charge is placed is shifted for 1/2 pixel in x and y
What is the expected correct behavior?
That the scan module places the charge directly under the pixel
Relevant event logs and/or screenshots
the problem is here https://gitlab.cern.ch/allpix-squared/allpix-squared/blob/master/src/modules/DepositionPointCharge/DepositionPointChargeModule.cpp#L132
Build environment information
cvmfs 1.4.3.
Request
When you fix this please enable that the position option of the DepositionPointCharge also works with the scan option. At present it's not possible to move the initial position (the entire cube) of the charge in the scan.