Skip to content

Commit

Permalink
Merge pull request #42938 from suchandradutta/Phase2Digitizer_PreMixi…
Browse files Browse the repository at this point in the history
…ngBugFix_133X

Update of Phase2 Tracker Digitizer to fix an issue in Premixing
  • Loading branch information
cmsbuild authored Oct 9, 2023
2 parents fe52f9b + 8f397b7 commit 6403d0e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -997,15 +997,16 @@ int Phase2TrackerDigitizerAlgorithm::convertSignalToAdc(uint32_t detID, float si
signal_in_adc = theAdcFullScale_;
} else {
if (thePhase2ReadoutMode_ == -1) {
temp_signal = std::min(static_cast<int>(signal_in_elec / theElectronPerADC_), theAdcFullScale_);
temp_signal = std::min(static_cast<int>(std::round(signal_in_elec / theElectronPerADC_)), theAdcFullScale_);
} else {
// calculate the kink point and the slope
int dualslope_param = std::min(std::abs(thePhase2ReadoutMode_), max_limit);
int kink_point = static_cast<int>(theAdcFullScale_ / 2) + 1;
// C-ROC: first valid ToT code above threshold is 0b0000
temp_signal = std::floor((signal_in_elec - threshold) / theElectronPerADC_);
if (temp_signal > kink_point)
temp_signal = std::floor((temp_signal - kink_point) / (pow(2, dualslope_param - 1))) + kink_point;
temp_signal =
static_cast<int>(std::floor((temp_signal - kink_point) / (pow(2, dualslope_param - 1)))) + kink_point;
}
signal_in_adc = std::min(temp_signal, theAdcFullScale_);
LogTrace("Phase2TrackerDigitizerAlgorithm")
Expand Down
22 changes: 19 additions & 3 deletions SimTracker/SiPhase2Digitizer/python/phase2TrackerDigitizer_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,15 @@
# - do not add noisy pixels (to be done in stage2)
# - do not apply inefficiency (to be done in stage2)
# - disable threshold smearing
# - disable x-talk simulatiom
#
# For outer tracker
# - force analog readout to get the ADCs
#
# For both Inner and Outer tracker
# - force analog readout to get Full Charge ADCs
# - for Inner Tracker Dual Slope signal scaling NOT used here to avoid any singal loss.
# At step 2 Dual Slope signal scaling is used as default. To keep the full precision
# ADCFull scaling is also changed to 255 for Inner Tracker
#
# -
# NOTE: It is currently assumed that all sub-digitizers have the same ElectronPerAdc.
from Configuration.ProcessModifiers.premix_stage1_cff import premix_stage1
_premixStage1ModifyDict = dict(
Expand All @@ -233,27 +238,38 @@
AddNoisyPixels = False,
AddInefficiency = False,
AddThresholdSmearing = False,
AddXTalk = False,
Phase2ReadoutMode = -1,
AdcFullScale = 255,
),
Pixel3DDigitizerAlgorithm = dict(
AddNoisyPixels = False,
AddInefficiency = False,
AddThresholdSmearing = False,
AddXTalk = False,
Phase2ReadoutMode = -1,
AdcFullScale = 255,
),
PSPDigitizerAlgorithm = dict(
AddNoisyPixels = False,
AddInefficiency = False,
AddThresholdSmearing = False,
AddXTalk = False,
Phase2ReadoutMode = -1,
),
PSSDigitizerAlgorithm = dict(
AddNoisyPixels = False,
AddInefficiency = False,
AddThresholdSmearing = False,
AddXTalk = False,
Phase2ReadoutMode = -1,
),
SSDigitizerAlgorithm = dict(
AddNoisyPixels = False,
AddInefficiency = False,
AddThresholdSmearing = False,
AddXTalk = False,
Phase2ReadoutMode = -1,
),
)

Expand Down

0 comments on commit 6403d0e

Please sign in to comment.