314 {
315 const SCT_ModuleSideDesign* design{
dynamic_cast<const SCT_ModuleSideDesign*
>(&(element->
design()))};
316 if (design==nullptr) {
317 ATH_MSG_ERROR(
"SCT_SurfaceChargesGenerator::process can not get " << design);
318 return;
319 }
320
321 const double thickness{design->
thickness()};
324
325
326
327
328
329 float timeOfFlight{p_eventTime +
hitTime(phit)};
330
331
332 timeOfFlight -= (element->
center().
mag()) / CLHEP::c_light;
333
334
335
338 }
339
340
345
347 const float cEta{
static_cast<float>(endPos[
SiHit::xEta]) - xEta};
348 const float cPhi{
static_cast<float>(endPos[
SiHit::xPhi]) - xPhi};
349 const float cDep{
static_cast<float>(endPos[
SiHit::xDep]) - xDep};
350
351 const float LargeStep{std::sqrt(cEta*cEta + cPhi*cPhi + cDep*cDep)};
354 const float e1{
static_cast<float>(phit.
energyLoss() / steps)};
355 const float q1{
static_cast<float>(
e1 *
m_siPropertiesTool->getSiProperties(hashId, ctx).electronHolePairsPerEnergy())};
356
357
358
359 float xhit{xEta};
360 float yhit{xPhi};
361 float zhit{xDep};
362
363 InducedChargeModel::SCT_InducedChargeModelData*
data{
nullptr};
366 const AtlasFieldCacheCondObj* fieldCondObj{*readHandle};
368 ATH_MSG_ERROR(
"SCT_SurfaceChargesGenerator::process has fieldCondObj=nullptr");
369 return;
370 }
376 }
378 vbias,
379 element,
380 fieldCondObj,
382 rndmEngine,
383 ctx);
384 }
385
386 const float StepX{cEta / numberOfSteps};
387 const float StepY{cPhi / numberOfSteps};
388 const float StepZ{cDep / numberOfSteps};
389
390
391
396
397
398
399
401 }
402 }
403
404 float dstep{-0.5};
405 for (int istep{0}; istep < numberOfSteps; ++istep) {
406 dstep += 1.0;
407 float z1{zhit + StepZ * dstep};
408
409
410
411 float zReadout{
static_cast<float>(0.5 * thickness - design->
readoutSide() * z1)};
412 const double spess{zReadout};
413
417 }
418
419 float t_drift{
driftTime(zReadout, element, ctx)};
420 if (t_drift>-2.0000002 and t_drift<-1.9999998) {
421 ATH_MSG_DEBUG(
"Checking for rounding errors in compression");
422 if ((std::abs(z1) - 0.5 * thickness) < 0.000010) {
423 ATH_MSG_DEBUG(
"Rounding error found attempting to correct it. z1 = " << std::fixed << std::setprecision(8) << z1);
424 if (z1 < 0.0) {
425 z1 = 0.0000005 - 0.5 * thickness;
426
427 } else {
428 z1 = 0.5 * thickness - 0.0000005;
429
430 }
431 zReadout = 0.5 * thickness - design->
readoutSide() * z1;
432 t_drift =
driftTime(zReadout, element, ctx);
433 if (t_drift>-2.0000002 and t_drift<-1.9999998) {
435 } else {
436 ATH_MSG_DEBUG(
"Correction Successful! z1 = " << std::fixed << std::setprecision(8) << z1 <<
", zReadout = " << zReadout <<
", t_drift = " << t_drift);
437 }
438 } else {
439 ATH_MSG_DEBUG(
"No rounding error found. Making no correction.");
440 }
441 }
442 if (t_drift > 0.0) {
443 const float x1{xhit + StepX * dstep};
444 float y1{yhit + StepY * dstep};
445
449 y1 += tanLorentz * zReadout;
450 }
451
453 const float rx{CLHEP::RandGaussZiggurat::shoot(rndmEngine)};
455 const float ry{CLHEP::RandGaussZiggurat::shoot(rndmEngine)};
456 const float yd{
y1 +
sigma * ry};
457
458
459 const double stripPitch{0.080};
460 double dstrip{
y1 / stripPitch};
461 if (dstrip > 0.) {
462 dstrip = dstrip - std::trunc(dstrip);
463 } else {
464 dstrip = dstrip - std::trunc(dstrip) + 1;
465 }
466
467
468 double y0{dstrip * stripPitch};
469 double z0{thickness - zReadout};
470
471
475 }
476 double trap_pos{-999999.}, drift_time{-999999.};
479 break;
480 } else {
481 double Q_all[5]={0.0,0.0,0.0,0.0,0.0};
482
483 dstrip =
y1 / stripPitch;
484
485
486
487
488 if (dstrip > 0.) {
489 dstrip -= static_cast<double>(static_cast<int>(dstrip));
490 } else {
491 dstrip -= static_cast<double>(static_cast<int>(dstrip)) + 1;
492 }
493
494
495 double yfin{dstrip * stripPitch};
496 double zfin{thickness - trap_pos};
497
498 m_radDamageTool->holeTransport(y0, z0, yfin, zfin, Q_all[0], Q_all[1], Q_all[2], Q_all[3], Q_all[4], ctx);
500 const double ystrip{yd +
strip * stripPitch};
504 const double time{drift_time};
506 inserter(SiSurfaceCharge(position, SiCharge(q1*
charge, time, hitproc, trklink)));
507 continue;
508 }
509 }
510 }
512 }
513 }
514 }
515
518
524
525 const double mm2cm = 0.1;
526
528 y0*mm2cm, z0*mm2cm,
529 Q_m2, Q_m1, Q_00, Q_p1, Q_p2,
531 ctx);
533 y0*mm2cm, z0*mm2cm,
534 Q_m2, Q_m1, Q_00, Q_p1, Q_p2,
536 ctx);
537
539 if (Q_00[it] == 0.0) continue;
540 double ICM_time{(
it+0.5)*0.5 + timeOfFlight};
542 Q_m2[
it], Q_m1[
it], Q_00[
it], Q_p1[
it], Q_p2[
it]
543 };
545 double ystrip{
y1 +
strip * stripPitch};
548 inserter(SiSurfaceCharge(position,
550 ICM_time, hitproc, trklink)));
551 }
552 }
553 }
554 } else {
558
560 const float totaltime{(
m_tfix > -998.) ?
m_tfix.value() : t_drift + timeOfFlight + t_surf};
561 inserter(SiSurfaceCharge(position, SiCharge(q1, totaltime, hitproc, trklink)));
562 } else {
563 ATH_MSG_VERBOSE(std::fixed << std::setprecision(8) <<
"Local position (phi, eta, depth): ("
565 << ") of the element is out of active area, charge = " << q1);
566 }
567 }
568 }
569 }
570 }
571 }
572 }
float hitTime(const AFP_SIDSimHit &hit)
Scalar mag() const
mag method
#define ATH_MSG_WARNING(x)
double charge(const T &p)
bool isValid() const
Validity check.
static HepMcParticleLink getRedirectedLink(const HepMcParticleLink &particleLink, uint32_t eventIndex, const EventContext &ctx)
Return a HepMcParticleLink pointing at the same particle, but in a different GenEvent.
int readoutSide() const
ReadoutSide.
virtual double scaledDistanceToNearestDiode(const SiLocalPosition &chargePos) const =0
give distance to the nearest diode in units of pitch, from 0.0 to 0.5, this method should be fast as ...
virtual bool inActiveArea(const SiLocalPosition &chargePos, bool checkBondGap=true) const =0
check if the position is in active area
virtual const Amg::Vector3D & center() const override final
Center in global coordinates.
Amg::Vector2D hitLocalToLocal(double xEta, double xPhi) const
Simulation/Hit local frame to reconstruction local frame.
bool chargeIsTrapped(double spess, const InDetDD::SiDetectorElement *element, double &trap_pos, double &drift_time, const EventContext &ctx)
IntegerProperty m_numberOfCharges
FloatProperty m_smallStepLength
float surfaceDriftTime(float ysurf) const
Calculate of the surface drift time.
double energyLoss() const
HepGeom::Point3D< double > localStartPosition() const
const HepMcParticleLink & particleLink() const
HepGeom::Point3D< double > localEndPosition() const
time(flags, cells_name, *args, **kw)
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling