TruthTransfer module - bypass "realistic" deposition, propagation, transfer and instead produce PixelCharge objects directly from MCTrack truth
Motivation:
This module allows one to simulate "unrealistic" scenarios such as detectors made of exotic materials (in my case, turning the telescope to vacuum to isolate scattering from the DUT from other scattering effects in the setup), and also provides a faster pipeline from G4Deposition
to DefaultDigitizer
if deposition/propagation/transfer don't need to be properly simulated and can the processes can be idealised for the purposes of the simulation
TL;DR: True MC Tracks -> "true" pixel hit locations without detours
TODO (before merge):
-
Update README.md (I think it's still just the SimpleTransfer one)✅ -
Add/fix the tests✅ Checked charge-sharing reconstruction for a few test points
Changes:
- Added TruthTransfer module to simulate perfect truth deposits at implant
- Deposits a given amount of charge per track length in sensor (config:
charge_per_length
, units: charge/length) for each true primary track, propagates directly to PixelCharge messages. - Produces (generally unused)
DepositedCharge
andPropagatedCharge
messages to propagate the MCParticle and MCTrack to output in case this is used in Corry or similar - Can be set to either share charge perfectly based on distance to closest 4 pixels, or to deposit all charge in nearest pixel, using
share_charge
(bool) config value.
- Deposits a given amount of charge per track length in sensor (config:
- Allowed vacuum as sensor material
- Added
is_true_primary
slot to MCParticle to track whether it was part of the original Geant4-simulated beam, or is a secondary. This differs toisPrimary
as the latter only considers secondaries within a given sensor, and considers secondaries produced outside the sensor to be "primary"
Open points:
- Add selection of which types of tracks to allow deposition from (e.g. only true primary tracks, or only sensor-level primary tracks, or all tracks?)
- this becomes tricky - only deposit from charged particles? We're not considering e.g. gamma pair production in "vacuum" sensors since Geant4 isn't simulating this. Do we need to allow different deposition rates per particle type? This feels like it would be slowly approaching what Geant4 is meant to do.
Example configs (5-plane MALTA telescope, 4 planes vacuum + 1 plane silicon):
allpix.conf
[AllPix]
log_level = "WARNING"
log_format = "DEFAULT"
detectors_file = "monstar.conf"
model_paths = "../models"
# ... [readacted for brevity]
[GeometryBuilderGeant4]
world_material = "vacuum"
[DepositionGeant4]
physics_list = "FTFP_BERT_EMZ"
particle_type = "e+"
number_of_particles = 1
source_energy = 1.2GeV
source_position = 0um 0um -100mm
source_type = "beam"
beam_shape = "rectangle"
beam_size = 10mm 10mm
flat_beam = true
beam_direction = 0 0 1
max_step_length = 1.0um
output_plots = true
[TruthTransfer]
charge_per_length = 107e/um
share_charge = true
[DefaultDigitizer]
type = "nomalta"
electronics_noise = 0e
threshold = 1e
threshold_smearing = 0e
qdc_smearing = 0e
output_plots = 1
qdc_resolution = 8
qdc_slope = 300e
[CorryvreckanWriter]
file_name = "corryvreckan"
output_mctruth = true
dut = "MALTA2"
reference = "MALTA2"
[DetectorHistogrammer]
granularity = 100, 100
monstar.conf
[MALTA0]
type = "nomalta"
sensor_thickness = 295um
chip_thickness = 5um
position = 0mm 0mm 0mm
# ... [readacted for brevity]
[MALTA1]
type = "nomalta"
sensor_thickness = 45um
chip_thickness = 5um
position = 0mm 0mm 900mm
# ... [readacted for brevity]
[MALTA2]
type = "malta"
sensor_thickness = 45um
chip_thickness = 5um
position = 0mm 0mm 1000mm
# ... [readacted for brevity]
[MALTA3]
type = "nomalta"
sensor_thickness = 95um
chip_thickness = 5um
position = 0mm 0mm 1100mm
# ... [readacted for brevity]
[MALTA4]
type = "nomalta"
sensor_thickness = 295um
chip_thickness = 5um
position = 0mm 0mm 2000mm
# ... [readacted for brevity]
../models/nomalta.conf
type = "monolithic"
geometry = "pixel"
number_of_pixels = 512 512
pixel_size = 36.4um 36.4um
sensor_thickness = 300um
# ... [readacted for brevity]
sensor_material = "VACUUM"
../models/malta.conf
type = "monolithic"
geometry = "pixel"
number_of_pixels = 512 512
pixel_size = 36.4um 36.4um
sensor_thickness = 300um
# ... [readacted for brevity]
sensor_material = "SILICON"
# support structures [readacted for brevity]
# ...