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

Update of Phase2 Tracker Digitizer to fix an issue in Premixing #42938

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