Draft: Radial strip detector models

Radek Privara requested to merge rprivara/allpix-squared:radial into master

This WIP implementation allows simulation of trapezoidal detectors with a radial geometry of strips by introducing a new class of detector models called the RadialStripDetectorModel.

Radial strip detectors

A radial strip detector is defined using four parameters for each given strip row:

  • number_of_strips
  • inner_pitch
  • angular_pitch
  • strip_length

The local coordinate center is placed in the sensor focal point (center of the arcs that form the sensor edges), its position is calculated automatically based on the parameters above. The wrapper of the sensor is trapezoidal (G4Trd object).


  • Detector model ctor (MR !531 (closed)): Currently every detector model configuration file must include the parameters number_of_pixels and pixel_size, otherwise the base DetectorModel ctor throws a MissingKeyError exception. For radial detectors such parameters are not used and their absense should not be a problem. I would propose two ways how this could be solved:
    • The base DetectorModel ctor looks for the parameters using the Configuration::get method and if it doesn't find them in the config file, it initializes the parameters with default values (zeros). The derived models HybridPixel- and MonolithicPixelDetectorModel then in their ctors check these parameters and throw an exception if they are still set to zero (signifying that the user should have supplied these but didn't). The radial detector model doesn't check these parameters in its ctor but later sets their values to something sensible in the context of radial detectors.
    • A new class describing generic pixel detectors, say PixelDetectorModel, inheriting from the base DetectorModel. The base ctor only looks in the config file for truly generic parameters (model_type, sensor_thickness), the PixelDetectorModel ctor looks for pixel-revelant parameters (such as number_of_pixels and pixel_size) and the derived models HybridPixel- and MonolithicPixelDetectorModel (now inheriting from PixelDetectorModel) then handle the rest. The RadialStripDetectorModel would inherit directly from the base DetectorModel and therefore the problem would be avoided.
  • Hit coordinate swap during charge deposition necessary (MR !532 (merged)): Because the sensor wrapper trapezoid is always built in Geant4 with the thickness being the y and not the z dimension (as is expected by Allpix), the y- and z- coordinates of the hits have to be swapped during the SensitiveDetectorActionG4::ProcessHits stage of charge deposition. While this works without issues, it leads to a decreased performance as the detector model type has to be checked in every step to decide whether the coordinate swap is necessary.
Edited by Radek Privara

Merge request reports