Skip to content

Commit

Permalink
Merge pull request cms-sw#339 from slava77/from-devel-pr334/dr-deadRe…
Browse files Browse the repository at this point in the history
…strict-qv-p256

update dead module treatment to a more restrictive
  • Loading branch information
osschar committed Aug 11, 2021
2 parents baafc5a + bc09d1e commit 9a96f65
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Config.h
Expand Up @@ -165,7 +165,7 @@ namespace Config
extern float XigridME[Config::nBinsZME][Config::nBinsRME];

// This will become layer dependent (in bits). To be consistent with min_dphi.
static constexpr int m_nphi = 128;
static constexpr int m_nphi = 256;

// config on Event
/*MM: chi2Cut is now set in IterationsParams*/
Expand Down
4 changes: 2 additions & 2 deletions mkFit/HitStructures.h
Expand Up @@ -150,8 +150,8 @@ class LayerOfHits

// Testing bin filling
static constexpr float m_fphi = Config::m_nphi / Config::TwoPI;
static constexpr int m_phi_mask = 0x7f;
static constexpr int m_phi_bits = 7;
static constexpr int m_phi_mask = 0xff;
static constexpr int m_phi_bits = 8;
static constexpr float m_fphi_fine = 1024 / Config::TwoPI;
static constexpr int m_phi_mask_fine = 0x3ff;
static constexpr int m_phi_bits_fine = 10; //can't be more than 16
Expand Down
15 changes: 11 additions & 4 deletions mkFit/MkFinder.cc
Expand Up @@ -212,7 +212,7 @@ void MkFinder::SelectHitIndices(const LayerOfHits &layer_of_hits,
L.is_barrel() ? "barrel" : "endcap", L.layer_id(), N_proc);

float dqv[NN], dphiv[NN], qv[NN], phiv[NN];
int qb1v[NN], qb2v[NN], pb1v[NN], pb2v[NN];
int qb1v[NN], qb2v[NN], qbv[NN], pb1v[NN], pb2v[NN];

const auto assignbins = [&](int itrack, float q, float dq, float phi, float dphi, float min_dq, float max_dq, float min_dphi, float max_dphi){
dphi = clamp(std::abs(dphi), min_dphi, max_dphi);
Expand All @@ -223,6 +223,7 @@ void MkFinder::SelectHitIndices(const LayerOfHits &layer_of_hits,
dphiv[itrack] = dphi;
dqv[itrack] = dq;
//
qbv [itrack] = L.GetQBinChecked(q);
qb1v[itrack] = L.GetQBinChecked(q - dq);
qb2v[itrack] = L.GetQBinChecked(q + dq) + 1;
pb1v[itrack] = L.GetPhiBin(phi - dphi);
Expand Down Expand Up @@ -361,6 +362,7 @@ void MkFinder::SelectHitIndices(const LayerOfHits &layer_of_hits,
continue;
}

const int qb = qbv [itrack];
const int qb1 = qb1v[itrack];
const int qb2 = qb2v[itrack];
const int pb1 = pb1v[itrack];
Expand Down Expand Up @@ -411,7 +413,8 @@ void MkFinder::SelectHitIndices(const LayerOfHits &layer_of_hits,
{
const int pb = pi & L.m_phi_mask;

if (L.m_phi_bin_deads[qi][pb] == true)
// Limit to central Q-bin
if (qi == qb && L.m_phi_bin_deads[qi][pb] == true)
{
//std::cout << "dead module for track in layer=" << L.layer_id() << " qb=" << qi << " pb=" << pb << " q=" << q << " phi=" << phi<< std::endl;
XWsrResult[itrack].m_in_gap = true;
Expand Down Expand Up @@ -813,6 +816,7 @@ void MkFinder::FindCandidates(const LayerOfHits &layer_of_hits
}

dprintf("FindCandidates max hits to process=%d\n", maxSize);
int nHitsAdded[NN] {};

for (int hit_cnt = 0; hit_cnt < maxSize; ++hit_cnt)
{
Expand Down Expand Up @@ -876,6 +880,7 @@ void MkFinder::FindCandidates(const LayerOfHits &layer_of_hits
dprint("chi2=" << chi2);
if (chi2 < m_iteration_params->chi2Cut)
{
nHitsAdded[itrack]++;
dprint("chi2 cut passed, creating new candidate");
// Create a new candidate and fill the tmp_candidates output vector.
// QQQ only instantiate if it will pass, be better than N_best
Expand Down Expand Up @@ -925,7 +930,7 @@ void MkFinder::FindCandidates(const LayerOfHits &layer_of_hits
fake_hit_idx = -3;
}
//now add fake hit for tracks that passsed through inactive modules
else if (XWsrResult[itrack].m_in_gap == true)
else if (XWsrResult[itrack].m_in_gap == true && nHitsAdded[itrack] == 0)
{
fake_hit_idx = -7;
}
Expand Down Expand Up @@ -972,6 +977,7 @@ void MkFinder::FindCandidatesCloneEngine(const LayerOfHits &layer_of_hits, CandC
}

dprintf("FindCandidatesCloneEngine max hits to process=%d\n", maxSize);
int nHitsAdded[NN] {};

for (int hit_cnt = 0; hit_cnt < maxSize; ++hit_cnt)
{
Expand Down Expand Up @@ -1005,6 +1011,7 @@ void MkFinder::FindCandidatesCloneEngine(const LayerOfHits &layer_of_hits, CandC
dprint("chi2=" << chi2 << " for trkIdx=" << itrack << " hitIdx=" << XHitArr.At(itrack, hit_cnt, 0));
if (chi2 < m_iteration_params->chi2Cut)
{
nHitsAdded[itrack]++;
const int hit_idx = XHitArr.At(itrack, hit_cnt, 0);

// Register hit for overlap consideration, here we apply chi2 cut
Expand Down Expand Up @@ -1055,7 +1062,7 @@ void MkFinder::FindCandidatesCloneEngine(const LayerOfHits &layer_of_hits, CandC
fake_hit_idx = -3;
}
//now add fake hit for tracks that passsed through inactive modules
else if (XWsrResult[itrack].m_in_gap == true)
else if (XWsrResult[itrack].m_in_gap == true && nHitsAdded[itrack] == 0)
{
fake_hit_idx = -7;
}
Expand Down

0 comments on commit 9a96f65

Please sign in to comment.