Skip to content

Commit 6fc0585

Browse files
committed
Reject outliers when building ITS/MFT clusters dictionary
1 parent 8c6dda0 commit 6fc0585

2 files changed

Lines changed: 27 additions & 9 deletions

File tree

Detectors/ITSMFT/ITS/macros/test/CheckTopologies.C

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
void CheckTopologies(std::string clusfile = "o2clus_its.root",
3636
std::string hitfile = "o2sim_HitsITS.root",
3737
std::string collContextfile = "collisioncontext.root",
38-
std::string inputGeom = "")
38+
std::string inputGeom = "",
39+
float checkOutliers = 2., // reject outliers (MC dX or dZ exceeds row/col span by a factor above the threshold)
40+
float minPtMC = 0.01) // account only MC hits with pT above threshold
3941
{
4042
const int QEDSourceID = 99; // Clusters from this MC source correspond to QED electrons
4143

@@ -57,7 +59,7 @@ void CheckTopologies(std::string clusfile = "o2clus_its.root",
5759
const o2::steer::DigitizationContext* digContext = nullptr;
5860
TStopwatch sw;
5961
sw.Start();
60-
62+
float minPtMC2 = minPtMC > 0 ? minPtMC * minPtMC : -1;
6163
// Geometry
6264
o2::base::GeometryManager::loadGeometry(inputGeom);
6365
auto gman = o2::its::GeometryTGeo::Instance();
@@ -205,12 +207,20 @@ void CheckTopologies(std::string clusfile = "o2clus_its.root",
205207
auto hitEntry = mc2hit.find(key);
206208
if (hitEntry != mc2hit.end()) {
207209
const auto& hit = (*hitArray)[hitEntry->second];
208-
auto locH = gman->getMatrixL2G(chipID) ^ (hit.GetPos()); // inverse conversion from global to local
209-
auto locHsta = gman->getMatrixL2G(chipID) ^ (hit.GetPosStart());
210-
locH.SetXYZ(0.5 * (locH.X() + locHsta.X()), 0.5 * (locH.Y() + locHsta.Y()), 0.5 * (locH.Z() + locHsta.Z()));
211-
const auto locC = o2::itsmft::TopologyDictionary::getClusterCoordinates(cluster, pattern, false);
212-
dX = locH.X() - locC.X();
213-
dZ = locH.Z() - locC.Z();
210+
if (minPtMC < 0.f || hit.GetMomentum().Perp2() > minPtMC2) {
211+
auto locH = gman->getMatrixL2G(chipID) ^ (hit.GetPos()); // inverse conversion from global to local
212+
auto locHsta = gman->getMatrixL2G(chipID) ^ (hit.GetPosStart());
213+
locH.SetXYZ(0.5 * (locH.X() + locHsta.X()), 0.5 * (locH.Y() + locHsta.Y()), 0.5 * (locH.Z() + locHsta.Z()));
214+
const auto locC = o2::itsmft::TopologyDictionary::getClusterCoordinates(cluster, pattern, false);
215+
dX = locH.X() - locC.X();
216+
dZ = locH.Z() - locC.Z();
217+
if (checkOutliers > 0.) {
218+
if (std::abs(dX) > topology.getRowSpan() * o2::itsmft::SegmentationAlpide::PitchRow * checkOutliers ||
219+
std::abs(dZ) > topology.getColumnSpan() * o2::itsmft::SegmentationAlpide::PitchCol * checkOutliers) { // ignore outlier
220+
dX = dZ = BuildTopologyDictionary::IgnoreVal;
221+
}
222+
}
223+
}
214224
} else {
215225
printf("Failed to find MC hit entry for Tr:%d chipID:%d\n", trID, chipID);
216226
lab.print();

Detectors/ITSMFT/MFT/macros/test/CheckTopologies.C

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
void CheckTopologies(std::string clusfile = "mftclusters.root",
3636
std::string hitfile = "o2sim_HitsMFT.root",
3737
std::string collContextfile = "collisioncontext.root",
38-
std::string inputGeom = "")
38+
std::string inputGeom = "",
39+
float checkOutliers = 2. // reject outliers (MC dX or dZ exceeds row/col span by a factor above the threshold)
40+
)
3941
{
4042
const int QEDSourceID = 99; // Clusters from this MC source correspond to QED electrons
4143

@@ -211,6 +213,12 @@ void CheckTopologies(std::string clusfile = "mftclusters.root",
211213
const auto locC = o2::itsmft::TopologyDictionary::getClusterCoordinates(cluster, pattern);
212214
dX = locH.X() - locC.X();
213215
dZ = locH.Z() - locC.Z();
216+
if (checkOutliers > 0.) {
217+
if (std::abs(dX) > topology.getRowSpan() * o2::itsmft::SegmentationAlpide::PitchRow * checkOutliers ||
218+
std::abs(dZ) > topology.getColumnSpan() * o2::itsmft::SegmentationAlpide::PitchCol * checkOutliers) { // ignore outlier
219+
dX = dZ = BuildTopologyDictionary::IgnoreVal;
220+
}
221+
}
214222
} else {
215223
printf("Failed to find MC hit entry for Tr:%d chipID:%d\n", trID, chipID);
216224
lab.print();

0 commit comments

Comments
 (0)