Skip to content
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
3 changes: 2 additions & 1 deletion CondFormats/SiPixelTransient/interface/SiPixelTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,9 @@ class SiPixelTemplate {
// initialize the rest;
static void postInit(std::vector<SiPixelTemplateStore>& thePixelTemp_);

// Interpolate with y Gaussian Parameter interpolation to be used with goodEdge reconstruction algorithm
// Interpolate input alpha and beta angles to produce a working template for each individual hit.
bool interpolate(int id, float cotalpha, float cotbeta, float locBz, float locBx);
bool interpolate(int id, float cotalpha, float cotbeta, float locBz, float locBx, bool goodEdgeAlgo = false);

// Interpolate input alpha and beta angles to produce a working template for each individual hit.
bool interpolate(int id, float cotalpha, float cotbeta, float locBz);
Expand Down
19 changes: 13 additions & 6 deletions CondFormats/SiPixelTransient/src/SiPixelTemplate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
// V10.21 - Address runtime issues in pushfile() for gcc 7.X due to using tempfile as char string + misc. cleanup [Petar]
// V10.22 - Move templateStore to the heap, fix variable name in pushfile() [Petar]
// V10.24 - Add sideload() + associated gymnastics [Petar and Oz]
// V10.25 - Restore y-residual Gaussian parameters [Morris]

// Created by Morris Swartz on 10/27/06.
//
Expand Down Expand Up @@ -1324,15 +1325,18 @@ void SiPixelTemplate::postInit(std::vector<SiPixelTemplateStore>& thePixelTemp_)
//! \param locBx - (input) the sign of this quantity is used to determine whether to flip cot(alpha/beta)<0 quantities from cot(alpha/beta)>0 (FPix only)
//! for Phase 1 FPix IP-related tracks, locBx/locBz > 0 for cot(alpha) > 0 and locBx/locBz < 0 for cot(alpha) < 0
//! for Phase 1 FPix IP-related tracks, locBx > 0 for cot(beta) > 0 and locBx < 0 for cot(beta) < 0
//! \param goodEdgeAlgo - (input) Flag to turn on the y Gaussian Parameter interpolation to be used with goodEdge reconstruction algorithm
// ************************************************************************************************************
bool SiPixelTemplate::interpolate(int id, float cotalpha, float cotbeta, float locBz, float locBx) {
bool SiPixelTemplate::interpolate(int id, float cotalpha, float cotbeta, float locBz, float locBx, bool goodEdgeAlgo) {
// Interpolate for a new set of track angles

#ifndef SI_PIXEL_TEMPLATE_STANDALONE
//check for nan's
if (!edm::isFinite(cotalpha) || !edm::isFinite(cotbeta)) {
success_ = false;
return success_;
}
#endif

// Local variables
int i, j;
Expand Down Expand Up @@ -1553,16 +1557,19 @@ bool SiPixelTemplate::interpolate(int id, float cotalpha, float cotbeta, float l
}

for (i = 0; i < 4; ++i) {
yavg_[i] = (1.f - yratio_) * thePixelTemp_[index_id_].enty[ilow].yavg[i] +
yratio_ * thePixelTemp_[index_id_].enty[ihigh].yavg[i];
if (flip_y_) {
yavg_[i] = -yavg_[i];
}
yavg_[i] = (1.f - yratio_) * enty0_->yavg[i] + yratio_ * enty1_->yavg[i];
if (flip_y_) {
yavg_[i] = -yavg_[i];
}
yrms_[i] = (1.f - yratio_) * enty0_->yrms[i] + yratio_ * enty1_->yrms[i];

if (goodEdgeAlgo) { // restore y Gaussian Parameter interpolation
ygx0_[i] = (1.f - yratio_) * enty0_->ygx0[i] + yratio_ * enty1_->ygx0[i];
if (flip_y_) {
ygx0_[i] = -ygx0_[i];
}
ygsig_[i] = (1.f - yratio_) * enty0_->ygsig[i] + yratio_ * enty1_->ygsig[i];
} //if(goodEdgeAlgo)
chi2yavg_[i] = (1.f - yratio_) * enty0_->chi2yavg[i] + yratio_ * enty1_->chi2yavg[i];
chi2ymin_[i] = (1.f - yratio_) * enty0_->chi2ymin[i] + yratio_ * enty1_->chi2ymin[i];
chi2xavg[i] = (1.f - yratio_) * enty0_->chi2xavg[i] + yratio_ * enty1_->chi2xavg[i];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

# This modifier enables the good edge algorithm in pixel hit reconstruction that handles broken/truncated pixel cluster caused by radiation damage
siPixelGoodEdgeAlgo = cms.Modifier()
1 change: 1 addition & 0 deletions Configuration/PyReleaseValidation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,4 @@ The offsets currently in use are:
* 0.113: Activate OuterTracker inefficiency (PS-p: bias rails inefficiency; PS-s and SS: 5% bad strips)
* 0.114: Activate OuterTracker inefficiency (PS-p: bias rails inefficiency; PS-s and SS: 10% bad strips)
* 0.141: Activate emulation of the signal shape of the InnerTracker FE chip (CROC)
* 0.186: Run-3 goodEdgeAlgo CPE
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,32 @@ def condition(self, fragment, stepList, key, hasHarvest):
offset = 0.18,
)

# pixel GoodEdgeAlgo CPE workflows
class UpgradeWorkflow_siPixelGoodEdgeAlgo(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
if 'Reco' in step:
stepDict[stepName][k] = merge([{'--procModifiers': 'siPixelGoodEdgeAlgo'}, stepDict[step][k]])
def condition(self, fragment, stepList, key, hasHarvest):
result = (fragment=="QCD_Pt_1800_2400_14" or fragment=="TTbar_14TeV" ) and any(y in key for y in ['2025'])
return result
upgradeWFs['siPixelGoodEdgeAlgo'] = UpgradeWorkflow_siPixelGoodEdgeAlgo(
steps = [
'Reco',
'RecoFakeHLT',
'RecoGlobal',
'RecoNano',
'RecoNanoFakeHLT',
],
PU = [
'Reco',
'RecoFakeHLT',
'RecoGlobal',
'RecoNano',
'RecoNanoFakeHLT',
],
suffix = '_siPixelGoodEdgeAlgo',
offset = 0.186,
)

#Workflow to enable displacedRegionalStep tracking iteration
class UpgradeWorkflow_displacedRegional(UpgradeWorkflowTracking):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class PixelCPEClusterRepair : public PixelCPEBase {
std::vector<SiPixelTemplateStore2D> thePixelTemp2D_;

int speed_;
bool goodEdgeAlgo_;

bool UseClusterSplitter_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class PixelCPETemplateReco : public PixelCPEBase {
const std::vector<SiPixelTemplateStore> *thePixelTemp_;

int speed_;
bool goodEdgeAlgo_;

bool UseClusterSplitter_;

Expand Down
21 changes: 20 additions & 1 deletion RecoLocalTracker/SiPixelRecHits/interface/SiPixelTemplateReco.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,26 @@ namespace SiPixelTemplateReco {
std::vector<std::pair<int, int> >& zeropix,
float& probQ,
int& nypix,
int& nxpix);
int& nxpix,
bool goodEdgeAlgo);

int PixelTempReco1D(int id,
float cotalpha,
float cotbeta,
float locBz,
float locBx,
ClusMatrix& cluster,
SiPixelTemplate& templ,
float& yrec,
float& sigmay,
float& proby,
float& xrec,
float& sigmax,
float& probx,
int& qbin,
int speed,
float& probQ,
bool goodEdgeAlgo);

int PixelTempReco1D(int id,
float cotalpha,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@
ComponentName = "PixelCPEClusterRepairWithoutProbQ",
speed = 0
)

# Enable the good edge algorithm in pixel hit reconstruction that handles broken/truncated pixel cluster caused by radiation damage
from Configuration.ProcessModifiers.siPixelGoodEdgeAlgo_cff import siPixelGoodEdgeAlgo
siPixelGoodEdgeAlgo.toModify(templates2, GoodEdgeAlgo = True)
siPixelGoodEdgeAlgo.toModify(templates2_speed0, GoodEdgeAlgo = True)
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
from RecoLocalTracker.SiPixelRecHits._templates_default_cfi import _templates_default
templates = _templates_default.clone()

# Enable the good edge algorithm in pixel hit reconstruction that handles broken/truncated pixel cluster caused by radiation damage
from Configuration.ProcessModifiers.siPixelGoodEdgeAlgo_cff import siPixelGoodEdgeAlgo
siPixelGoodEdgeAlgo.toModify(templates, GoodEdgeAlgo = True)
9 changes: 7 additions & 2 deletions RecoLocalTracker/SiPixelRecHits/src/PixelCPEClusterRepair.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ PixelCPEClusterRepair::PixelCPEClusterRepair(edm::ParameterSet const& conf,
}

speed_ = conf.getParameter<int>("speed");
goodEdgeAlgo_ = conf.getParameter<bool>("GoodEdgeAlgo");
LogDebug("PixelCPEClusterRepair::PixelCPEClusterRepair:") << "Template speed = " << speed_ << "\n";
LogDebug("PixelCPEClusterRepair::PixelCPEClusterRepair:") << "GoodEdgeAlgo = " << goodEdgeAlgo_ << "\n";

// this returns the magnetic field value in kgauss (1T = 10 kgauss)
int theMagField = mag->nominalValue();
Expand Down Expand Up @@ -355,7 +357,8 @@ void PixelCPEClusterRepair::callTempReco1D(DetParam const& theDetParam,
zeropix,
theClusterParam.probabilityQ_,
nypix,
nxpix);
nxpix,
goodEdgeAlgo_);
// ******************************************************************

//--- Check exit status
Expand Down Expand Up @@ -549,7 +552,8 @@ void PixelCPEClusterRepair::checkRecommend2D(DetParam const& theDetParam,
}
// The 1d pixel template
SiPixelTemplate templ(*thePixelTemp_);
if (!templ.interpolate(ID, theClusterParam.cotalpha, theClusterParam.cotbeta, theDetParam.bz, theDetParam.bx)) {
if (!templ.interpolate(
ID, theClusterParam.cotalpha, theClusterParam.cotbeta, theDetParam.bz, theDetParam.bx, goodEdgeAlgo_)) {
//error setting up template, return false
theClusterParam.recommended2D_ = false;
return;
Expand Down Expand Up @@ -718,6 +722,7 @@ void PixelCPEClusterRepair::fillPSetDescription(edm::ParameterSetDescription& de
desc.add<int>("forwardTemplateID", 0);
desc.add<int>("directoryWithTemplates", 0);
desc.add<int>("speed", -2);
desc.add<bool>("GoodEdgeAlgo", false);
desc.add<bool>("UseClusterSplitter", false);
desc.add<double>("MaxSizeMismatchInY", 0.3);
desc.add<double>("MinChargeRatio", 0.8);
Expand Down
5 changes: 4 additions & 1 deletion RecoLocalTracker/SiPixelRecHits/src/PixelCPETemplateReco.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ PixelCPETemplateReco::PixelCPETemplateReco(edm::ParameterSet const& conf,
<< " not loaded correctly from text file. Reconstruction will fail.\n\n";
}

goodEdgeAlgo_ = conf.getParameter<bool>("GoodEdgeAlgo");
speed_ = conf.getParameter<int>("speed");
LogDebug("PixelCPETemplateReco::PixelCPETemplateReco:") << "Template speed = " << speed_ << "\n";

Expand Down Expand Up @@ -249,7 +250,8 @@ LocalPoint PixelCPETemplateReco::localPosition(DetParam const& theDetParam, Clus
theClusterParam.templProbX_,
theClusterParam.templQbin_,
speed_,
theClusterParam.templProbQ_);
theClusterParam.templProbQ_,
goodEdgeAlgo_);

// ******************************************************************

Expand Down Expand Up @@ -529,4 +531,5 @@ void PixelCPETemplateReco::fillPSetDescription(edm::ParameterSetDescription& des
desc.add<int>("directoryWithTemplates", 0);
desc.add<int>("speed", -2);
desc.add<bool>("UseClusterSplitter", false);
desc.add<bool>("GoodEdgeAlgo", false);
}
Loading