Skip to content
Snippets Groups Projects
Commit 28f1c47e authored by Wouter Deconinck's avatar Wouter Deconinck Committed by Sylvester Joosten
Browse files

Resolve "Proper digitization for homogenous forward endcap"

parent 5fff288e
No related branches found
No related tags found
1 merge request!297Resolve "Proper digitization for homogenous forward endcap"
...@@ -55,6 +55,12 @@ namespace Jug::Digi { ...@@ -55,6 +55,12 @@ namespace Jug::Digi {
Gaudi::Property<double> m_pedSigmaADC{this, "pedestalSigma", 3.2}; Gaudi::Property<double> m_pedSigmaADC{this, "pedestalSigma", 3.2};
Gaudi::Property<double> m_resolutionTDC{this, "resolutionTDC", 10 * ps}; Gaudi::Property<double> m_resolutionTDC{this, "resolutionTDC", 10 * ps};
Gaudi::Property<double> m_corrMeanScale{this, "scaleResponse", 1.0};
// These are better variable names for the "energyResolutions" array which is a bit
// magic @FIXME
//Gaudi::Property<double> m_corrSigmaCoeffE{this, "responseCorrectionSigmaCoeffE", 0.0};
//Gaudi::Property<double> m_corrSigmaCoeffSqrtE{this, "responseCorrectionSigmaCoeffSqrtE", 0.0};
// signal sums // signal sums
// @TODO: implement signal sums with timing // @TODO: implement signal sums with timing
// field names to generate id mask, the hits will be grouped by masking the field // field names to generate id mask, the hits will be grouped by masking the field
...@@ -165,16 +171,21 @@ namespace Jug::Digi { ...@@ -165,16 +171,21 @@ namespace Jug::Digi {
int nhits = 0; int nhits = 0;
for (const auto& ahit : *simhits) { for (const auto& ahit : *simhits) {
// Note: juggler internal unit of energy is GeV // Note: juggler internal unit of energy is GeV
double eResRel = 0.; // --> optional energy correction to allow for modifying the response for
if (ahit.energyDeposit() > 1e-6) { // effective impelentations, e.g. a homogenous implementation of a fiber
eResRel = m_normDist() * eRes[0] / std::sqrt(ahit.energyDeposit()) + // calorimeter.
m_normDist() * eRes[1] + const double eDep = ahit.energyDeposit() * m_corrMeanScale;
m_normDist() * eRes[2] / ahit.energyDeposit();
} // apply additional calorimeter noise to corrected energy deposit
const double eResRel = (eDep > 1e-6)
? m_normDist() * std::sqrt(std::pow(eRes[0] / std::sqrt(eDep), 2) +
std::pow(eRes[1], 2) + std::pow(eRes[2] / (eDep), 2))
: 0;
const double ped = m_pedMeanADC + m_normDist() * m_pedSigmaADC;
const long long adc = std::llround(ped + eDep * (1. + eResRel) / dyRangeADC * m_capADC);
const long long tdc = std::llround((ahit.truth().time + m_normDist() * tRes) * stepTDC);
double ped = m_pedMeanADC + m_normDist() * m_pedSigmaADC;
long long adc = std::llround(ped + ahit.energyDeposit() * (1. + eResRel) / dyRangeADC * m_capADC);
long long tdc = std::llround((ahit.truth().time + m_normDist() * tRes) * stepTDC);
eic::RawCalorimeterHit rawhit( eic::RawCalorimeterHit rawhit(
{nhits++, algorithmID()}, {nhits++, algorithmID()},
(long long)ahit.cellID(), (long long)ahit.cellID(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment