Properly treat Polarity of Charge
Current situation
Up till now the framework has been quite ignorant to the sign of charges arriving at a pixel. The main reason for this was that the only module available to process the information was the DefaultDigitizer which simply takes the absolute charge value and applies a threshold.
Changes in this MR
Now with the CSADigitizer recently having landed this changed and we have become aware of our (my) ignorance implementing the current PixelCharge object. This MR rectifies the situation and now allows to properly treat charges (or currents) left by charge carriers. Also, the polarity of pulses recorded by the TransientPropagation module have been inverted and are corrected now. The following changes have been implemented:
Objects
-
SensorCharge (base class of DepositedCharge, PropagatedCharge) now has a new mehtod
getSign()
which returns either+1
or-1
depending on the charge carrier type. ThegetCharge()
function remains unchanged and still returns the number of carriers in the object. -
PixelCharge will now store the charge as
long
instead ofunsigned int
to allow for negative polarity. This means, thegetCharge()
function will return negative values for collected electrons. -
PixelCharge now has a new method
getAbsoluteCharge()
which returns the absolute value of the charge, emulating the previous behavior.
Modules
- CapacitiveTransfer now takes polarity of charge carriers into account when calculating the charge coupled into pixels.
-
DefaultDigitizer uses
PixelCharge::getAbsoluteCharge()
instead ofPixelCharge::getCharge()
to retain the same functionality. - InducedTransfer now correctly calculates the sign of the induced charge, charges were inverted before.
- TransientPropagation now correctly calculates the sign of the induced charge, charges were inverted before.
Backwards Compatibility
This approach is mostly transparent for current simulations, apart from the following changes:
- When collecting electrons at the implants and writing PixelCharge objects out, these objects will now return a negative charge on
getCharge()
and the absolute value ongetAbsoluteCharge()
. PreviouslygetCharge()
was always positive. - When simulating transient sensor behavior, pulses generated by electrons now have negative polarity.
All test cases still work without changes.
Other Changes
The PulseTransfer module has been slightly modified to separate plotting code for pulse graphs from the actual transfer code. A new plot has been added to provide the absolute pulse in addition to the signed pulse.
Open Tasks
-
CSADigitizer needs to be able to process pulses of both polarities