From b7516073546e3413271528e4806b66cd9a4e0e52 Mon Sep 17 00:00:00 2001 From: Davide Valsecchi Date: Tue, 7 Jun 2022 00:58:02 +0200 Subject: [PATCH] Fixed emulator discrepancy In the frontend hardware after the sliding window applied in the peak-finder block the output of each filter is saturated at 12bits. Then, the even and odd outputs are compared. In the emulator the saturation was not checked and the odd and even amplitudes were compared at 18bits. This PR fixes the problem. --- .../EcalTrigPrimAlgos/src/EcalFenixStripFormatEB.cc | 7 +++++++ .../EcalTrigPrimAlgos/src/EcalFenixStripFormatEE.cc | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/SimCalorimetry/EcalTrigPrimAlgos/src/EcalFenixStripFormatEB.cc b/SimCalorimetry/EcalTrigPrimAlgos/src/EcalFenixStripFormatEB.cc index 15c541dcea5a7..9afef26dd81a0 100644 --- a/SimCalorimetry/EcalTrigPrimAlgos/src/EcalFenixStripFormatEB.cc +++ b/SimCalorimetry/EcalTrigPrimAlgos/src/EcalFenixStripFormatEB.cc @@ -21,6 +21,7 @@ int EcalFenixStripFormatEB::process() { int even_output = 0; int odd_output = 0; + // Applying sliding window on the strip output after the peak finder if (ecaltpgTPMode_->DisableEBEvenPeakFinder) { even_output = input_even_ >> shift_; } else { @@ -35,6 +36,12 @@ int EcalFenixStripFormatEB::process() { odd_output = input_odd_ >> shift_; } + // Truncating the signals to 12 bit after peak finder sliding window + if (odd_output > 0XFFF) + odd_output = 0XFFF; + if (even_output > 0XFFF) + even_output = 0XFFF; + // Prepare the amplitude output for the strip looking at the TPmode options int output = 0; bool is_odd_larger = false; diff --git a/SimCalorimetry/EcalTrigPrimAlgos/src/EcalFenixStripFormatEE.cc b/SimCalorimetry/EcalTrigPrimAlgos/src/EcalFenixStripFormatEE.cc index 4aa9ba95a14f8..73b6ab75d5b63 100644 --- a/SimCalorimetry/EcalTrigPrimAlgos/src/EcalFenixStripFormatEE.cc +++ b/SimCalorimetry/EcalTrigPrimAlgos/src/EcalFenixStripFormatEE.cc @@ -32,6 +32,7 @@ int EcalFenixStripFormatEE::process() { int even_output = 0; int odd_output = 0; + // Applying sliding window on the strip output after the peak finder if (ecaltpgTPMode_->DisableEEEvenPeakFinder) { even_output = input_even_ >> shift_; } else { @@ -46,6 +47,12 @@ int EcalFenixStripFormatEE::process() { odd_output = input_odd_ >> shift_; } + // Truncating the signals to to 12 bit after peak finder sliding window + if (odd_output > 0XFFF) + odd_output = 0XFFF; + if (even_output > 0XFFF) + even_output = 0XFFF; + // Prepare the amplitude output for the strip looking at the TPmode options int output = 0; bool is_odd_larger = false;