Skip to content

Commit

Permalink
Fixed emulator discrepancy
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
valsdav committed Jun 7, 2022
1 parent 9c0c506 commit b751607
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down

0 comments on commit b751607

Please sign in to comment.