LDMX Software
SiStripDigitizer.h
1#pragma once
2
3#include <map>
4#include <random>
5
6#include "Acts/Definitions/Algebra.hpp"
7#include "Tracking/Digitization/SiStripConstants.h"
8
9namespace tracking::digitization {
10
59 public:
60 // I like not having underscores for struct members,
61 // but that's not settable until a later version of clang-tidy
62 // NOLINTBEGIN(readability-identifier-naming)
64 struct SensorParams {
66 double thickness{0.0};
68 double sense_pitch{SENSE_PITCH_MM};
70 double readout_pitch{READOUT_PITCH_MM};
72 double bias_voltage{BIAS_VOLTAGE_V};
74 double depletion_voltage{DEPLETION_VOLTAGE_V};
76 double temperature{TEMPERATURE_K};
78 double noise_electrons{NOISE_ELECTRONS};
80 double threshold_electrons{THRESHOLD_ELECTRONS};
82 bool is_n_type{true};
87 /***** lorentz angles should be calculated from sensor geometry and
88 * bfield *********/
96 double trapping{0.0};
106 int n_readout_strips{N_READOUT_STRIPS};
110 double readout_transfer_efficiency{READOUT_TRANSFER_EFFICIENCY};
114 double sense_transfer_efficiency{SENSE_TRANSFER_EFFICIENCY};
115 };
116 // NOLINTEND(readability-identifier-naming)
117
118 SiStripDigitizer() = default;
119
120 explicit SiStripDigitizer(const SensorParams& params) : params_(params) {}
121
124 void seed(uint64_t s) { generator_.seed(s); }
125
142 std::map<int, double> computeStripCharges(double edep,
143 const Acts::Vector3& local_pos,
144 const Acts::Vector3& local_dir,
145 double path_length) const;
146
153 void applyNoiseAndThreshold(std::map<int, double>& strip_charges);
154
155 const SensorParams& params() const { return params_; }
156 SensorParams& mutableParams() { return params_; }
157
159 void setThickness(double thickness) { params_.thickness = thickness; }
160
161 private:
167 int adaptiveNSegments(const Acts::Vector3& local_dir,
168 double path_length) const;
169
177 double diffusionSigma(double d, bool is_minority) const;
178
184 double stripFraction(double u0, double sigma, double strip_center,
185 double pitch) const;
186
199 std::map<int, double> computeCarrierCharges(
200 double q_per_seg, int n_seg, const Acts::Vector3& local_pos,
201 const Acts::Vector3& local_dir, double path_length, double w_collect,
202 double lorentz_tan, bool is_minority) const;
203
209 std::map<int, double> senseToReadout(
210 const std::map<int, double>& sense_charges) const;
211
212 SensorParams params_;
213 std::default_random_engine generator_;
214 std::normal_distribution<double> normal_{0.0, 1.0};
215};
216
217} // namespace tracking::digitization
Realistic digitization of silicon strip sensor hits.
std::map< int, double > computeStripCharges(double edep, const Acts::Vector3 &local_pos, const Acts::Vector3 &local_dir, double path_length) const
Simulate charge collection for a single hit.
int adaptiveNSegments(const Acts::Vector3 &local_dir, double path_length) const
Number of track sub-segments, chosen adaptively so that the U displacement per segment does not excee...
double diffusionSigma(double d, bool is_minority) const
Diffusion sigma [mm] for carriers drifting distance d [mm].
void setThickness(double thickness)
Set the sensor thickness [mm] from the geometry before processing hits.
void seed(uint64_t s)
Seed the internal random-number engine.
double stripFraction(double u0, double sigma, double strip_center, double pitch) const
Fraction of a Gaussian charge cloud (centred at u0 with sigma sigma) collected by a strip of width pi...
void applyNoiseAndThreshold(std::map< int, double > &strip_charges)
Add Gaussian electronic noise to signal strips and their immediate neighbours, then remove strips bel...
std::map< int, double > senseToReadout(const std::map< int, double > &sense_charges) const
Sum sense-strip charges into readout-strip charges according to the AC-coupling ratio ratio = round(r...
std::map< int, double > computeCarrierCharges(double q_per_seg, int n_seg, const Acts::Vector3 &local_pos, const Acts::Vector3 &local_dir, double path_length, double w_collect, double lorentz_tan, bool is_minority) const
Simulate one carrier type and return the sense-strip charge map.
All parameters describing one silicon strip sensor layer.
double electron_lorentz_tangent
tan(θ_Lorentz) for electrons. Sign encodes U-shift direction.
double threshold_electrons
Readout threshold [electrons]. Strips below this are suppressed.
double readout_pitch
Readout strip pitch [mm]. Must be an integer multiple of sense_pitch.
double sense_pitch
Sense (inner) electrode pitch [mm].
double noise_electrons
Electronic noise sigma [electrons ENC].
double thickness
Sensor thickness [mm]. Must be set from the geometry before use.
double bias_voltage
Applied reverse-bias voltage [V].
double deposition_granularity
Adaptive segmentation granularity: max U-step as fraction of sense_pitch.
double trapping
Charge-trapping fraction lost per 100 µm of drift.
bool hole_side_readout
Simulate and read out the hole-collection side (p-strips / backplane).
double readout_transfer_efficiency
AC-coupling transfer efficiency from a paired sense strip (physically under a readout strip,...
int n_segments_min
Minimum number of track sub-segments (used when the track is close to normal incidence so the adaptiv...
double sense_transfer_efficiency
AC-coupling transfer efficiency from an unpaired sense strip (between two readout strips,...
bool electron_side_readout
Simulate and read out the electron-collection side (n-strips).
bool is_n_type
true = n-type bulk; false = p-type bulk. LDMX (and HPS) use n-type bulk.