Commit 2acda3c5 authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

Xtal cal digi fix.

Because of bad c-style cast the block energies being truncated at 1 keV, they were being
truncated at 1 GeV!!!

This was updated using a nice round function with explicit return type: https://en.cppreference.com/w/cpp/numeric/math/round

	modified:   CrystalEndcapsDigi.cpp
parent 09f8d18f
#include <algorithm>
#include <cmath>
#include "GaudiAlg/Transformer.h"
#include "GaudiAlg/GaudiTool.h"
......@@ -58,7 +59,7 @@ namespace Jug {
double res = m_gaussDist()/sqrt(ahit.energyDeposit());
eic::RawCalorimeterHit rawhit(
(long long) ahit.cellID(),
(long long) ahit.energyDeposit() * (1. + res)*1.0e6, // convert to keV integer
std::llround(ahit.energyDeposit() * (1. + res)*1.0e6), // convert to keV integer
(double) ahit.truth().time);
rawhits->push_back(rawhit);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment