18 #include "GaudiKernel/PhysicalConstants.h"
19 #include "GaudiKernel/SystemOfUnits.h"
21 #include "CLHEP/Random/RandFlat.h"
36 return StatusCode::FAILURE;
55 for (
int ix{0}; ix<81; ix++) {
56 for (
int iy{0}; iy<115; iy++) {
61 return StatusCode::SUCCESS;
66 return StatusCode::SUCCESS;
76 const EventContext& ctx{Gaudi::Hive::currentContext()};
82 holeTransport(x0, y0, xfin, yfin, Q_m2, Q_m1, Q_00, Q_p1, Q_p2);
87 const EventContext& ctx{Gaudi::Hive::currentContext()};
99 ATH_MSG_WARNING(
"Conditions Summary Tool is not used. Will use temperature and voltages from job options. "
100 <<
"Effects of radiation damage may be wrong!");
107 double temperature{0.};
108 double deplVoltage{0.};
109 double biasVoltage{0.};
131 double depletionDepth{element->thickness()};
132 if (std::abs(biasVoltage) < std::abs(deplVoltage)) {
133 depletionDepth *= sqrt(std::abs(biasVoltage / deplVoltage));
140 element->thickness(),
141 std::abs(biasVoltage))};
152 double electronDriftMobility{0.};
153 double holeDriftMobility{0.};
154 double electronDriftVelocity{0.};
155 double holeDriftVelocity{0.};
164 holeDriftVelocity = holeDriftMobility*electricField;
172 double trappingHoles{0.};
179 const double meanFreePathElectrons{electronDriftVelocity*trappingElectrons};
182 double meanFreePathHoles{0.};
184 meanFreePathHoles = holeDriftVelocity*trappingHoles;
189 double trappingProbability_electron{0.0};
190 double trappingProbability_hole{0.0};
191 double trappingProbability{0.0};
193 trappingProbability = 1.0 -
std::exp(-std::abs(
pos/meanFreePathElectrons));
194 trappingProbability_electron = trappingProbability;
197 trappingProbability = 1.0 -
std::exp(-std::abs(
pos/meanFreePathHoles));
198 trappingProbability_hole = trappingProbability;
200 trappingProbability = 0.0;
206 const double u{CLHEP::RandFlat::shoot(0., 1.)};
207 const double drift_time{-
std::log(
u)*trappingHoles};
211 const double t_electrode_hole{
pos/holeDriftVelocity};
215 const double trappingPosition_hole{holeDriftVelocity*drift_time};
227 ATH_MSG_VERBOSE(
"Electron drift velocity (cm/s): " << electronDriftVelocity);
229 ATH_MSG_VERBOSE(
"Electron trapping probability: " << trappingProbability_electron);
235 ATH_MSG_VERBOSE(
"Hole trapping probability: " << trappingProbability_hole);
254 static const double deltax{0.0005};
255 static const double deltay{0.00025};
257 static const double bulk_depth{0.0285};
258 static const double strip_pitch{0.0080};
261 if ((
y < 0.) or (
y > bulk_depth))
return 0.;
262 const double xc{strip_pitch * (istrip + 0.5)};
263 const double dx{std::abs(
x-xc)};
264 const int ix{
static_cast<int>(
dx/deltax)};
265 if (ix > 79)
return 0.;
266 const int iy{
static_cast<int>(
y/deltay)};
267 const double fx{(
dx - ix*deltax) / deltax};
268 const double fy{(
y - iy*deltay) / deltay};
269 const int ix1{ix + 1};
270 const int iy1{iy + 1};
275 ATH_MSG_DEBUG(
"induced: x,y,iy="<<
x<<
" "<<
y<<
" "<<iy<<
" istrip,xc,dx,ix="
276 <<istrip<<
" "<<xc<<
" " <<
dx<<
" "<<ix<<
" fx,fy="<<fx <<
" " <<fy<<
", P="<<
P);
303 for (
int istrip{-2}; istrip < 3 ; istrip++) {
304 qstrip[istrip+2] =
induced(istrip,
x,
y);
306 ATH_MSG_DEBUG(
"h:qstrip=" << qstrip[0] <<
" " << qstrip[1] <<
" " << qstrip[2] <<
" " << qstrip[3] <<
" " << qstrip[4]);
309 for (
int istrip{-2}; istrip < 3 ; istrip++) {
312 const double qnew{
induced(istrip,
x,
y)};
314 const double dq{qnew - qstrip[jj]};
318 case -2: Q_m2 +=
dq ;
break;
319 case -1: Q_m1 +=
dq ;
break;
320 case 0: Q_00 +=
dq ;
break;
321 case +1: Q_p1 +=
dq ;
break;
322 case +2: Q_p2 +=
dq ;
break;
326 ATH_MSG_DEBUG(
"h:qstrip=" << qstrip[0] <<
" " << qstrip[1] <<
" " << qstrip[2] <<
" " << qstrip[3] <<
" " << qstrip[4]);
336 if (not condData.isValid())
return nullptr;
337 return condData->getDetectorElement(waferHash);