Skip to content

Commit

Permalink
Fix sim digi links in 3D pixels
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordi Duarte Campderros authored and Jordi Duarte Campderros committed Jun 8, 2020
1 parent d032aea commit d5b1078
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void Pixel3DDigitizerAlgorithm::accumulateSimHits(std::vector<PSimHit>::const_it
LogDebug("Pixel3DDigitizerAlgorithm:: Geant4 hit info: ")
<< (*it).particleType() << " " << (*it).pabs() << " " << (*it).energyLoss() << " " << (*it).tof() << " "
<< (*it).trackId() << " " << (*it).processType() << " " << (*it).detUnitId() << (*it).entryPoint() << " "
<< (*it).exitPoint();
<< (*it).exitPoint() << " Global index for PSimHit:" << simHitGlobalIndex;

// Convert the simhit position into global to check if the simhit was
// produced within a given time-window
Expand Down Expand Up @@ -409,14 +409,16 @@ void Pixel3DDigitizerAlgorithm::induce_signal(const PSimHit& hit,
MeasurementPoint rowcol(pt.position().x(), pt.position().y());
const int channel = topo.channel(topo.localPosition(rowcol));

float corr_time = hit.tof() - pixdet->surface().toGlobal(hit.localPosition()).mag() * c_inv;
if (makeDigiSimLinks_) {
the_signal[channel] += DigitizerUtility::Amplitude(pt.amplitude(), &hit, pt.amplitude(), hitIndex, tofBin);
the_signal[channel] += DigitizerUtility::Amplitude(pt.amplitude(), &hit, pt.amplitude(), corr_time, hitIndex, tofBin);
} else {
the_signal[channel] += DigitizerUtility::Amplitude(pt.amplitude(), nullptr, pt.amplitude());
}

LogDebug("Pixel3DDigitizerAlgorithm::induce_signal")
<< " Induce charge at row,col:" << rowcol << " N_electrons:" << pt.amplitude() << " [Channel:" << channel
<< "]\n [Accumulated signal in this channel:" << the_signal[channel].ampl() << "]";
<< "]\n [Accumulated signal in this channel:" << the_signal[channel].ampl() << "] "
<< " Global index linked PSimHit:" << hitIndex;;
}
}

0 comments on commit d5b1078

Please sign in to comment.