Commit e1d7d51c authored by Simon Spannagel's avatar Simon Spannagel
Browse files

ROI: if no ROI given, always return true when checking

parent 27b10c3c
Pipeline #434444 passed with stages
in 3 minutes and 31 seconds
......@@ -285,6 +285,11 @@ double Detector::inPixelY(const PositionVector3D<Cartesian3D<double>> localPosit
// Check if track position is within ROI:
bool Detector::isWithinROI(const Track* track) {
// Empty region of interest:
if(m_roi.empty()) {
return true;
}
// Check that track is within region of interest using winding number algorithm
auto localIntercept = this->getLocalIntercept(track);
auto coordinates = std::make_pair(this->getColumn(localIntercept), this->getRow(localIntercept));
......@@ -299,6 +304,11 @@ bool Detector::isWithinROI(const Track* track) {
// Check if cluster is within ROI and/or touches ROI border:
bool Detector::isWithinROI(Cluster* cluster) {
// Empty region of interest:
if(m_roi.empty()) {
return true;
}
// Loop over all pixels of the cluster
for(auto& pixel : (*cluster->pixels())) {
if(winding_number(pixel->coordinates(), m_roi) == 0) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment