File indexing completed on 2024-04-06 12:30:59
0001 #include "SiLinearChargeCollectionDrifter.h"
0002 #include "vdt/log.h"
0003
0004 SiLinearChargeCollectionDrifter::SiLinearChargeCollectionDrifter(double dc, double cdr, double dv, double av)
0005 :
0006 diffusionConstant(dc),
0007 chargeDistributionRMS(cdr),
0008 depletionVoltage(dv),
0009 appliedVoltage(av) {}
0010
0011 SiChargeCollectionDrifter::collection_type SiLinearChargeCollectionDrifter::drift(
0012 const SiChargeCollectionDrifter::ionization_type& ion, const LocalVector& driftDir, double mt, double tn) {
0013
0014 collection_type _temp;
0015 _temp.resize(ion.size());
0016
0017 for (size_t i = 0; i < ion.size(); i++) {
0018 _temp[i] = drift(ion[i], driftDir, mt, tn);
0019 }
0020 return _temp;
0021 }
0022
0023 SignalPoint SiLinearChargeCollectionDrifter::drift(const EnergyDepositUnit& edu,
0024 const LocalVector& drift,
0025 double moduleThickness,
0026 double timeNormalisation) {
0027
0028
0029 double depth = (moduleThickness / 2. - edu.z());
0030 double thicknessFraction = depth / moduleThickness;
0031 thicknessFraction = thicknessFraction > 0. ? thicknessFraction : 0.;
0032 thicknessFraction = thicknessFraction < 1. ? thicknessFraction : 1.;
0033
0034
0035 double driftTime = -timeNormalisation * vdt::fast_log(1. - 2 * depletionVoltage * thicknessFraction /
0036 (depletionVoltage + appliedVoltage)) +
0037 chargeDistributionRMS;
0038
0039
0040 return SignalPoint(edu.x() + depth * drift.x() / drift.z(),
0041 edu.y() + depth * drift.y() / drift.z(),
0042 sqrt(2. * diffusionConstant * driftTime),
0043 edu.energy());
0044 }