Skip to content

Commit 7bf9010

Browse files
committed
ITS3: fix topologydict generation
1 parent c7074f6 commit 7bf9010

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

Detectors/Upgrades/ITS3/macros/test/CreateDictionariesITS3.C

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,16 @@ void CreateDictionariesITS3(bool saveDeltas = true,
280280
mMosaixSegmentations[layer].curvedToFlat(locC.X(), locC.Y(), xFlat, yFlat);
281281
locC.SetCoordinates(xFlat, yFlat, locC.Z());
282282
}
283+
284+
auto pitchX = (ib) ? o2::its3::SegmentationMosaix::PitchRow : o2::itsmft::SegmentationAlpide::PitchRow;
285+
auto pitchZ = (ib) ? o2::its3::SegmentationMosaix::PitchCol : o2::itsmft::SegmentationAlpide::PitchCol;
283286
dX = xyzLocM.X() - locC.X();
284287
dZ = xyzLocM.Z() - locC.Z();
285-
dX /= (ib) ? o2::its3::SegmentationMosaix::PitchRow : o2::itsmft::SegmentationAlpide::PitchRow;
286-
dZ /= (ib) ? o2::its3::SegmentationMosaix::PitchCol : o2::itsmft::SegmentationAlpide::PitchCol;
287288

288289
float outLimitDx{-1}, outLimitDz{-1};
289290
if (checkOutliers > 0.) {
290-
outLimitDx = topology.getRowSpan() * checkOutliers;
291-
outLimitDz = topology.getColumnSpan() * checkOutliers;
291+
outLimitDx = topology.getRowSpan() * checkOutliers * pitchX;
292+
outLimitDz = topology.getColumnSpan() * checkOutliers * pitchZ;
292293
bool isOutDx = std::abs(dX) > outLimitDx;
293294
bool isOutDz = std::abs(dZ) > outLimitDz;
294295
if (isOutDx || isOutDz) { // ignore outlier

Detectors/Upgrades/ITS3/reconstruction/src/BuildTopologyDictionary.cxx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ void BuildTopologyDictionary::accountTopologyImpl(const itsmft::ClusterTopology&
4040
++tot;
4141
bool useDf = dX < IgnoreVal / 2; // we may need to account the frequency but to not update the centroid
4242

43-
// std::pair<unordered_map<unsigned long, itsmft::TopoStat>::iterator,bool> ret;
44-
// auto ret = mTopologyMap.insert(std::make_pair(cluster.getHash(), std::make_pair(cluster, 1)));
4543
auto& topoStat = tstat[cluster.getHash()];
4644
topoStat.countsTotal++;
4745
if (topoStat.countsTotal == 1) { // a new topology is inserted
@@ -59,7 +57,7 @@ void BuildTopologyDictionary::accountTopologyImpl(const itsmft::ClusterTopology&
5957
topoStat.countsWithBias = 1;
6058
} else { // assign expected sigmas from the pixel X, Z sizes
6159
topInf.mXsigma2 = sigmaX * sigmaX / 12.f / (float)std::min(10, topInf.mSizeX);
62-
topInf.mZsigma2 = sigmaZ * sigmaZ / (float)std::min(10, topInf.mSizeZ);
60+
topInf.mZsigma2 = sigmaZ * sigmaZ / 12.f / (float)std::min(10, topInf.mSizeZ);
6361
}
6462
tinfo.emplace(cluster.getHash(), topInf);
6563
} else {
@@ -128,7 +126,7 @@ void BuildTopologyDictionary::setThresholdImpl(double thr, TopoFreq& tfreq, Topo
128126
{
129127
setNCommonImpl(0, tfreq, tstat, ncommon, ntot);
130128
freqthres = thr;
131-
for (auto& q : tfreq) {
129+
for (const auto& q : tfreq) {
132130
if (((double)q.first) / ntot > thr) {
133131
++ncommon;
134132
} else {
@@ -205,7 +203,7 @@ void BuildTopologyDictionary::groupRareTopologiesImpl(TopoFreq& tfreq, TopoInfo&
205203
gr.mHash = tfreq[j].second;
206204
gr.mFrequency = ((double)(tfreq[j].first)) / ntot;
207205
totFreq += gr.mFrequency;
208-
// rough estimation for the error considering a8 uniform distribution
206+
// rough estimation for the error considering a uniform distribution
209207
const auto& topo = tinfo.find(gr.mHash)->second;
210208
gr.mErrX = std::sqrt(topo.mXsigma2);
211209
gr.mErrZ = std::sqrt(topo.mZsigma2);

0 commit comments

Comments
 (0)