Skip to content

Commit

Permalink
Merge pull request #38353 from CMS-ECAL-Trigger-Group/peak_finder_sat…
Browse files Browse the repository at this point in the history
…uration_bugfix

[backport] Fix ECAL TPG emulator discrepancy for saturated strips
  • Loading branch information
cmsbuild committed Jun 15, 2022
2 parents ab02da8 + b751607 commit 9901112
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 9901112

Please sign in to comment.