Skip to content

Commit

Permalink
updating Bias Rail inefficiency in PSP modules so that the Optimistic…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
Suchandra authored and Suchandra committed Nov 18, 2022
1 parent 5dde5a0 commit 024533d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
22 changes: 14 additions & 8 deletions SimTracker/SiPhase2Digitizer/plugins/PSPDigitizerAlgorithm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ PSPDigitizerAlgorithm::PSPDigitizerAlgorithm(const edm::ParameterSet& conf, edm:
conf.getParameter<ParameterSet>("PSPDigitizerAlgorithm"),
iC),
geomToken_(iC.esConsumes()),
addBiasRailInefficiency_(
conf.getParameter<ParameterSet>("PSPDigitizerAlgorithm").getParameter<bool>("AddBiasRailInefficiency")) {
biasRailInefficiencyFlag_(
conf.getParameter<ParameterSet>("PSPDigitizerAlgorithm").getParameter<int>("BiasRailInefficiencyFlag")) {
if (use_LorentzAngle_DB_)
siPhase2OTLorentzAngleToken_ = iC.esConsumes();
pixelFlag_ = false;
Expand All @@ -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_);
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ class PSPDigitizerAlgorithm : public Phase2TrackerDigitizerAlgorithm {
private:
edm::ESGetToken<SiPhase2OuterTrackerLorentzAngle, SiPhase2OuterTrackerLorentzAngleSimRcd> siPhase2OTLorentzAngleToken_;
const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_;
bool addBiasRailInefficiency_{false};
const int biasRailInefficiencyFlag_{0};
};
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 024533d

Please sign in to comment.