From 559a417f2d0711969437bc6ab6752f2acd2ad5da Mon Sep 17 00:00:00 2001 From: Suchandra Date: Mon, 7 Mar 2022 12:26:38 +0100 Subject: [PATCH 1/4] Adding macropixel inefficiency due to bias rail in PSPDigitizerAlgorithm --- .../plugins/PSPDigitizerAlgorithm.cc | 21 +++++++++++++++++-- .../plugins/PSPDigitizerAlgorithm.h | 2 ++ .../python/phase2TrackerDigitizer_cfi.py | 3 ++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc b/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc index f470211970b2b..2ab4b4f968474 100644 --- a/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc +++ b/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc @@ -24,7 +24,9 @@ PSPDigitizerAlgorithm::PSPDigitizerAlgorithm(const edm::ParameterSet& conf, edm: : Phase2TrackerDigitizerAlgorithm(conf.getParameter("AlgorithmCommon"), conf.getParameter("PSPDigitizerAlgorithm"), iC), - geomToken_(iC.esConsumes()) { + geomToken_(iC.esConsumes()), + addBiasRailInefficiency_(conf.getParameter("PSPDigitizerAlgorithm").getParameter("AddBiasRailInefficiency")) +{ if (use_LorentzAngle_DB_) siPhase2OTLorentzAngleToken_ = iC.esConsumes(); pixelFlag_ = false; @@ -34,13 +36,15 @@ PSPDigitizerAlgorithm::PSPDigitizerAlgorithm(const edm::ParameterSet& conf, edm: << "threshold in electron Endcap = " << theThresholdInE_Endcap_ << "threshold in electron Barrel = " << theThresholdInE_Barrel_ << " " << theElectronPerADC_ << " " << theAdcFullScale_ << " The delta cut-off is set to " - << tMax_ << " pix-inefficiency " << addPixelInefficiency_; + << tMax_ << " pix-inefficiency " << addPixelInefficiency_ + << "Bias Rail Inefficiency " << addBiasRailInefficiency_; } 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)) return false; double toa = hit.tof() - tCorr; return (toa > theTofLowerCut_ && toa < theTofUpperCut_); } @@ -52,3 +56,16 @@ bool PSPDigitizerAlgorithm::isAboveThreshold(const DigitizerUtility::SimHitInfo* float thr) const { return (charge >= thr); } +// +// Check whether the Hit is in the Inefficient Bias Rail Region +// +bool PSPDigitizerAlgorithm::isInBiasRailRegion(const PSimHit& hit) const { + + float implant = 0.1467; + float gRail = 0.0037; + float yin = hit.entryPoint().y() + (16*implant + 15.5*gRail); + float yout = hit.exitPoint().y() + (16*implant + 15.5*gRail); + if (std::fmod(yin, (implant+gRail)) > implant || + std::fmod(yout,(implant+gRail)) > implant ) return true; + else return false; +} diff --git a/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.h b/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.h index d731a69826ebf..80ae13f6e82d7 100644 --- a/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.h +++ b/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.h @@ -16,9 +16,11 @@ class PSPDigitizerAlgorithm : public Phase2TrackerDigitizerAlgorithm { bool select_hit(const PSimHit& hit, double tCorr, double& sigScale) const override; bool isAboveThreshold(const DigitizerUtility::SimHitInfo* hitInfo, float charge, float thr) const override; + bool isInBiasRailRegion(const PSimHit& hit) const; private: edm::ESGetToken siPhase2OTLorentzAngleToken_; const edm::ESGetToken geomToken_; + bool addBiasRailInefficiency_{false}; }; #endif diff --git a/SimTracker/SiPhase2Digitizer/python/phase2TrackerDigitizer_cfi.py b/SimTracker/SiPhase2Digitizer/python/phase2TrackerDigitizer_cfi.py index f516c20eda7e8..282abaaa25c59 100644 --- a/SimTracker/SiPhase2Digitizer/python/phase2TrackerDigitizer_cfi.py +++ b/SimTracker/SiPhase2Digitizer/python/phase2TrackerDigitizer_cfi.py @@ -127,7 +127,8 @@ EfficiencyFactors_Barrel = cms.vdouble(0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999 ), 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() + CellsToKill = cms.VPSet(), + AddBiasRailInefficiency= cms.bool(False) ), #Strip in PS module PSSDigitizerAlgorithm = cms.PSet( From 5103bdcd1fadedd3072e42c5c47a2c433445b74d Mon Sep 17 00:00:00 2001 From: Suchandra Date: Tue, 8 Mar 2022 12:23:30 +0100 Subject: [PATCH 2/4] Adding macropixel inefficiency due to bias rail in PSPDigitizerAlgorithm --- .../plugins/PSPDigitizerAlgorithm.cc | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc b/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc index 2ab4b4f968474..290b5c86f1e1f 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")) -{ + addBiasRailInefficiency_( + conf.getParameter("PSPDigitizerAlgorithm").getParameter("AddBiasRailInefficiency")) { if (use_LorentzAngle_DB_) siPhase2OTLorentzAngleToken_ = iC.esConsumes(); pixelFlag_ = false; @@ -37,14 +37,15 @@ 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 " << addBiasRailInefficiency_; } 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)) return false; + if (addBiasRailInefficiency_ && isInBiasRailRegion(hit)) + return false; double toa = hit.tof() - tCorr; return (toa > theTofLowerCut_ && toa < theTofUpperCut_); } @@ -57,15 +58,16 @@ bool PSPDigitizerAlgorithm::isAboveThreshold(const DigitizerUtility::SimHitInfo* return (charge >= thr); } // -// Check whether the Hit is in the Inefficient Bias Rail Region +// Check whether the Hit is in the Inefficient Bias Rail Region // bool PSPDigitizerAlgorithm::isInBiasRailRegion(const PSimHit& hit) const { - - float implant = 0.1467; - float gRail = 0.0037; - float yin = hit.entryPoint().y() + (16*implant + 15.5*gRail); - float yout = hit.exitPoint().y() + (16*implant + 15.5*gRail); - if (std::fmod(yin, (implant+gRail)) > implant || - std::fmod(yout,(implant+gRail)) > implant ) return true; - else return false; -} + static const float implant = 0.1467; // Implant length (1.467 mm) + static const float bRail = 0.00375; // Bias Rail region which causes inefficiency (37.5micron) + float block_len = 16 * implant + 15.5 * bRail; + float yin = hit.entryPoint().y() + block_len; + float yout = hit.exitPoint().y() + block_len; + if (std::fmod(yin, (implant + bRail)) > implant || std::fmod(yout, (implant + bRail)) > implant) + return true; + else + return false; +} From 8869181d648f897e5adf0c01ca55fdb81cae8e3e Mon Sep 17 00:00:00 2001 From: Suchandra Date: Wed, 9 Mar 2022 09:28:58 +0100 Subject: [PATCH 3/4] adding a few comments and using constexpr --- .../SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc b/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc index 290b5c86f1e1f..7c02c8e985dcc 100644 --- a/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc +++ b/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc @@ -61,12 +61,14 @@ bool PSPDigitizerAlgorithm::isAboveThreshold(const DigitizerUtility::SimHitInfo* // Check whether the Hit is in the Inefficient Bias Rail Region // bool PSPDigitizerAlgorithm::isInBiasRailRegion(const PSimHit& hit) const { - static const float implant = 0.1467; // Implant length (1.467 mm) - static const float bRail = 0.00375; // Bias Rail region which causes inefficiency (37.5micron) - float block_len = 16 * implant + 15.5 * bRail; + constexpr float implant = 0.1467; // Implant length (1.467 mm) + constexpr float bRail = 0.00375; // Bias Rail region which causes inefficiency (37.5micron) + // Do coordinate transformation of the local Y from module middle point considering 32 implants and 31 inter-impant regions with bias rail + constexpr float block_len = 16 * implant + 15.5 * bRail; + constexpr float block_unit = implant + bRail; float yin = hit.entryPoint().y() + block_len; float yout = hit.exitPoint().y() + block_len; - if (std::fmod(yin, (implant + bRail)) > implant || std::fmod(yout, (implant + bRail)) > implant) + if (std::fmod(yin, block_unit) > implant || std::fmod(yout, block_unit) > implant) return true; else return false; From 4b855417cd7e81dd9f0c04a0c3ce6ba8c0af6d3e Mon Sep 17 00:00:00 2001 From: Suchandra Date: Wed, 9 Mar 2022 09:50:05 +0100 Subject: [PATCH 4/4] code-format performed --- .../SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc b/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc index 7c02c8e985dcc..5fa066e5591ee 100644 --- a/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc +++ b/SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc @@ -61,10 +61,10 @@ bool PSPDigitizerAlgorithm::isAboveThreshold(const DigitizerUtility::SimHitInfo* // Check whether the Hit is in the Inefficient Bias Rail Region // bool PSPDigitizerAlgorithm::isInBiasRailRegion(const PSimHit& hit) const { - constexpr float implant = 0.1467; // Implant length (1.467 mm) - constexpr float bRail = 0.00375; // Bias Rail region which causes inefficiency (37.5micron) + constexpr float implant = 0.1467; // Implant length (1.467 mm) + constexpr float bRail = 0.00375; // Bias Rail region which causes inefficiency (37.5micron) // Do coordinate transformation of the local Y from module middle point considering 32 implants and 31 inter-impant regions with bias rail - constexpr float block_len = 16 * implant + 15.5 * bRail; + constexpr float block_len = 16 * implant + 15.5 * bRail; constexpr float block_unit = implant + bRail; float yin = hit.entryPoint().y() + block_len; float yout = hit.exitPoint().y() + block_len;