From 024533dc13e5a8eaa6f2e20cc29659f053e0a9ba Mon Sep 17 00:00:00 2001 From: Suchandra Date: Fri, 18 Nov 2022 15:05:50 +0100 Subject: [PATCH] updating Bias Rail inefficiency in PSP modules so that the Optimistic or Pessimistic (rejection of SimHits when the trajectory is fully inside the inefficient region or any part of the trajectory inside the inefficient region) scenarios through the configuration parameter --- .../plugins/PSPDigitizerAlgorithm.cc | 22 ++++++++++++------- .../plugins/PSPDigitizerAlgorithm.h | 2 +- .../python/phase2TrackerDigitizer_cfi.py | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc b/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc index 48ab241bd7b6d..269a72f4a681a 100644 --- a/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc +++ b/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc @@ -25,8 +25,8 @@ PSPDigitizerAlgorithm::PSPDigitizerAlgorithm(const edm::ParameterSet& conf, edm: conf.getParameter("PSPDigitizerAlgorithm"), iC), geomToken_(iC.esConsumes()), - addBiasRailInefficiency_( - conf.getParameter("PSPDigitizerAlgorithm").getParameter("AddBiasRailInefficiency")) { + biasRailInefficiencyFlag_( + conf.getParameter("PSPDigitizerAlgorithm").getParameter("BiasRailInefficiencyFlag")) { if (use_LorentzAngle_DB_) siPhase2OTLorentzAngleToken_ = iC.esConsumes(); pixelFlag_ = false; @@ -37,14 +37,14 @@ PSPDigitizerAlgorithm::PSPDigitizerAlgorithm(const edm::ParameterSet& conf, edm: << "threshold in electron Barrel = " << theThresholdInE_Barrel_ << " " << theElectronPerADC_ << " " << theAdcFullScale_ << " The delta cut-off is set to " << tMax_ << " pix-inefficiency " << addPixelInefficiency_ - << "Bias Rail Inefficiency " << addBiasRailInefficiency_; + << "Bias Rail Inefficiency " << biasRailInefficiencyFlag_; } PSPDigitizerAlgorithm::~PSPDigitizerAlgorithm() { LogDebug("PSPDigitizerAlgorithm") << "Algorithm deleted"; } // // -- Select the Hit for Digitization (sigScale will be implemented in future) // bool PSPDigitizerAlgorithm::select_hit(const PSimHit& hit, double tCorr, double& sigScale) const { - if (addBiasRailInefficiency_ && isInBiasRailRegion(hit)) + if (biasRailInefficiencyFlag_ > 0 && isInBiasRailRegion(hit)) return false; double toa = hit.tof() - tCorr; return (toa > theTofLowerCut_ && toa < theTofUpperCut_); @@ -68,10 +68,16 @@ bool PSPDigitizerAlgorithm::isInBiasRailRegion(const PSimHit& hit) const { constexpr float block_unit = implant + bRail; float yin = hit.entryPoint().y() + block_len; float yout = hit.exitPoint().y() + block_len; - if (std::fmod(yin, block_unit) > implant && std::fmod(yout, block_unit) > implant) - return true; - else - return false; + bool result = false; + + // Flag= 1 corresponds to optimistic case when the entire trajectory is withon the bias rail region the SimHit will be rejected + if (biasRailInefficiencyFlag_ == 1 && (std::fmod(yin, block_unit) > implant && std::fmod(yout, block_unit) > implant)) + result = true; + // Flag= 2 corresponds to pessimistic case i.e iven in a small part of the trajectory is inside the bias rain region the SimHit is rejected + else if (biasRailInefficiencyFlag_ == 2 && + (std::fmod(yin, block_unit) > implant || std::fmod(yout, block_unit) > implant)) + result = true; + return result; } // // -- Read Bad Channels from the Condidion DB and kill channels/module accordingly diff --git a/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.h b/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.h index 5c3a596e2b3e4..fb97b060b616c 100644 --- a/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.h +++ b/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.h @@ -22,6 +22,6 @@ class PSPDigitizerAlgorithm : public Phase2TrackerDigitizerAlgorithm { private: edm::ESGetToken siPhase2OTLorentzAngleToken_; const edm::ESGetToken geomToken_; - bool addBiasRailInefficiency_{false}; + const int biasRailInefficiencyFlag_{0}; }; #endif diff --git a/SimTracker/SiPhase2Digitizer/python/phase2TrackerDigitizer_cfi.py b/SimTracker/SiPhase2Digitizer/python/phase2TrackerDigitizer_cfi.py index 81f3b440a057c..569d0d46ab3f2 100644 --- a/SimTracker/SiPhase2Digitizer/python/phase2TrackerDigitizer_cfi.py +++ b/SimTracker/SiPhase2Digitizer/python/phase2TrackerDigitizer_cfi.py @@ -127,7 +127,7 @@ EfficiencyFactors_Endcap = cms.vdouble(0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999 ),#Efficiencies kept as Side2Disk1,Side1Disk1 and so on CellsToKill = cms.VPSet(), - AddBiasRailInefficiency= cms.bool(True) + BiasRailInefficiencyFlag = cms.int32(1) # Flag to decide BiasRail inefficiency : no inefficency(0) : inefficiency with optimistic(AND) scenario(1) : inefficiency with pessimistic(OR) scenario(2) ), #Strip in PS module PSSDigitizerAlgorithm = cms.PSet(