LDMX Software
SiStripDigitizer.h
1#pragma once
2
3#include <map>
4#include <random>
5#include <utility>
6
7#include "Acts/Definitions/Algebra.hpp"
9#include "Tracking/Digitization/SiStripConstants.h"
10
11namespace tracking::digitization {
12
61 public:
63 struct SensorParams {
65 double thickness{0.0};
67 double sense_pitch{SENSE_PITCH_MM};
69 double readout_pitch{READOUT_PITCH_MM};
71 double bias_voltage{BIAS_VOLTAGE_V};
73 double depletion_voltage{DEPLETION_VOLTAGE_V};
75 double temperature{TEMPERATURE_K};
77 double noise_electrons{NOISE_ELECTRONS};
79 double threshold_electrons{THRESHOLD_ELECTRONS};
81 bool is_n_type{true};
86 /***** lorentz angles should be calculated from sensor geometry and
87 * bfield *********/
95 double trapping{0.0};
105 int n_readout_strips{N_READOUT_STRIPS};
109 double readout_transfer_efficiency{READOUT_TRANSFER_EFFICIENCY};
113 double sense_transfer_efficiency{SENSE_TRANSFER_EFFICIENCY};
114 };
115
116 SiStripDigitizer() = default;
117
118 explicit SiStripDigitizer(const SensorParams& params) : params_(params) {}
119
122 void seed(uint64_t s) { generator_.seed(s); }
123
140 std::map<int, double> computeStripCharges(double edep,
141 const Acts::Vector3& local_pos,
142 const Acts::Vector3& local_dir,
143 double path_length) const;
144
151 void applyNoiseAndThreshold(std::map<int, double>& strip_charges);
152
153 const SensorParams& params() const { return params_; }
154 SensorParams& mutableParams() { return params_; }
155
157 void setThickness(double thickness) { params_.thickness = thickness; }
158
159 private:
165 int adaptiveNSegments(const Acts::Vector3& local_dir,
166 double path_length) const;
167
175 double diffusionSigma(double d, bool is_minority) const;
176
182 double stripFraction(double u0, double sigma, double strip_center,
183 double pitch) const;
184
197 std::map<int, double> computeCarrierCharges(
198 double q_per_seg, int n_seg, const Acts::Vector3& local_pos,
199 const Acts::Vector3& local_dir, double path_length, double w_collect,
200 double lorentz_tan, bool is_minority) const;
201
207 std::map<int, double> senseToReadout(
208 const std::map<int, double>& sense_charges) const;
209
210 SensorParams params_;
211 std::default_random_engine generator_;
212 std::normal_distribution<double> normal_{0.0, 1.0};
213};
214
215} // namespace tracking::digitization
Class which encapsulates information from a hit in a simulated tracking detector.
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.