Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ECAL TPG emulator discrepancy for saturated strips #38272

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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