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};
372 }
374 vbias,
375 element,
376 fieldCondObj,
378 rndmEngine,
379 ctx);
380 }
381
382 const float StepX{cEta / numberOfSteps};
383 const float StepY{cPhi / numberOfSteps};
384 const float StepZ{cDep / numberOfSteps};
385
386
387
392
393
394
395
397 }
398 }
399
400 float dstep{-0.5};
401 for (int istep{0}; istep < numberOfSteps; ++istep) {
402 dstep += 1.0;
403 float z1{zhit + StepZ * dstep};
404
405
406
407 float zReadout{
static_cast<float>(0.5 * thickness - design->
readoutSide() * z1)};
408 const double spess{zReadout};
409
413 }
414
415 float t_drift{
driftTime(zReadout, element, ctx)};
416 if (t_drift>-2.0000002 and t_drift<-1.9999998) {
417 ATH_MSG_DEBUG(
"Checking for rounding errors in compression");
418 if ((std::abs(z1) - 0.5 * thickness) < 0.000010) {
419 ATH_MSG_DEBUG(
"Rounding error found attempting to correct it. z1 = " << std::fixed << std::setprecision(8) << z1);
420 if (z1 < 0.0) {
421 z1 = 0.0000005 - 0.5 * thickness;
422
423 } else {
424 z1 = 0.5 * thickness - 0.0000005;
425
426 }
427 zReadout = 0.5 * thickness - design->
readoutSide() * z1;
428 t_drift =
driftTime(zReadout, element, ctx);
429 if (t_drift>-2.0000002 and t_drift<-1.9999998) {
431 } else {
432 ATH_MSG_DEBUG(
"Correction Successful! z1 = " << std::fixed << std::setprecision(8) << z1 <<
", zReadout = " << zReadout <<
", t_drift = " << t_drift);
433 }
434 } else {
435 ATH_MSG_DEBUG(
"No rounding error found. Making no correction.");
436 }
437 }
438 if (t_drift > 0.0) {
439 const float x1{xhit + StepX * dstep};
440 float y1{yhit + StepY * dstep};
441
445 y1 += tanLorentz * zReadout;
446 }
447
449 const float rx{CLHEP::RandGaussZiggurat::shoot(rndmEngine)};
451 const float ry{CLHEP::RandGaussZiggurat::shoot(rndmEngine)};
452 const float yd{
y1 +
sigma * ry};
453
454
455 const double stripPitch{0.080};
456 double dstrip{
y1 / stripPitch};
457 if (dstrip > 0.) {
458 dstrip = dstrip - std::trunc(dstrip);
459 } else {
460 dstrip = dstrip - std::trunc(dstrip) + 1;
461 }
462
463
464 double y0{dstrip * stripPitch};
465 double z0{thickness - zReadout};
466
467
471 }
472 double trap_pos{-999999.}, drift_time{-999999.};
475 break;
476 } else {
477 double Q_all[5]={0.0,0.0,0.0,0.0,0.0};
478
479 dstrip =
y1 / stripPitch;
480
481
482
483
484 if (dstrip > 0.) {
485 dstrip -= static_cast<double>(static_cast<int>(dstrip));
486 } else {
487 dstrip -= static_cast<double>(static_cast<int>(dstrip)) + 1;
488 }
489
490
491 double yfin{dstrip * stripPitch};
492 double zfin{thickness - trap_pos};
493
494 m_radDamageTool->holeTransport(y0, z0, yfin, zfin, Q_all[0], Q_all[1], Q_all[2], Q_all[3], Q_all[4]);
496 const double ystrip{yd +
strip * stripPitch};
500 const double time{drift_time};
502 inserter(SiSurfaceCharge(position, SiCharge(q1*
charge, time, hitproc, trklink)));
503 continue;
504 }
505 }
506 }
508 }
509 }
510 }
511
514
520
521 const double mm2cm = 0.1;
522
524 y0*mm2cm, z0*mm2cm,
525 Q_m2, Q_m1, Q_00, Q_p1, Q_p2,
527 ctx);
529 y0*mm2cm, z0*mm2cm,
530 Q_m2, Q_m1, Q_00, Q_p1, Q_p2,
532 ctx);
533
535 if (Q_00[it] == 0.0) continue;
536 double ICM_time{(
it+0.5)*0.5 + timeOfFlight};
538 Q_m2[
it], Q_m1[
it], Q_00[
it], Q_p1[
it], Q_p2[
it]
539 };
541 double ystrip{
y1 +
strip * stripPitch};
544 inserter(SiSurfaceCharge(position,
546 ICM_time, hitproc, trklink)));
547 }
548 }
549 }
550 } else {
554
556 const float totaltime{(
m_tfix > -998.) ?
m_tfix.value() : t_drift + timeOfFlight + t_surf};
557 inserter(SiSurfaceCharge(position, SiCharge(q1, totaltime, hitproc, trklink)));
558 } else {
559 ATH_MSG_VERBOSE(std::fixed << std::setprecision(8) <<
"Local position (phi, eta, depth): ("
560 << position.
xPhi() <<
", " << position.
xEta() <<
", " << position.
xDepth()
561 << ") of the element is out of active area, charge = " << q1);
562 }
563 }
564 }
565 }
566 }
567 }
568 }
float hitTime(const AFP_SIDSimHit &hit)
Scalar mag() const
mag method
#define ATH_MSG_WARNING(x)
double charge(const T &p)
char data[hepevt_bytes_allocation_ATLAS]
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
double xDepth() const
position along depth direction:
double xPhi() const
position along phi direction:
double xEta() const
position along eta direction:
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.
IntegerProperty m_numberOfCharges
FloatProperty m_smallStepLength
bool chargeIsTrapped(double spess, const InDetDD::SiDetectorElement *element, double &trap_pos, double &drift_time)
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)
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling