Skip to content
Snippets Groups Projects

Digi speed up

Merged Carl Gwilliam requested to merge gwilliam/calypso:digi_speed_up into master
3 files
+ 66
28
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -99,12 +99,24 @@ CaloWaveformDigiAlg::execute(const EventContext& ctx) const {
// Create structure to store pulse for each channel
std::map<Identifier, std::vector<uint16_t>> waveforms = m_digiTool->create_waveform_map(m_ecalID);
// Sum energy for each channel (i.e. identifier)
std::map<unsigned int, float> esum;
for (const auto& hit : *caloHitHandle) {
esum[hit.identify()] += hit.energyLoss();
}
// Loop over time samples
for (const auto& tk : m_timekernel) {
std::map<unsigned int, float> counts;
// Convolve hit energy with evaluated kernel and sum for each hit id (i.e. channel)
for (const auto& hit : *caloHitHandle) {
counts[hit.identify()] += tk * hit.energyLoss();
//for (const auto& hit : *caloHitHandle) {
// counts[hit.identify()] += tk * hit.energyLoss();
//}
// Convolve summed energy with evaluated kernel for each hit id (i.e. channel)
for (const auto& e : esum) {
counts[e.first] = tk * e.second;
}
// Subtract count from basleine and add result to correct waveform vector
Loading