Commit 0fbae969 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

ROI: check every pixel of a cluster for being inside the ROI. This fixes #32

parent 3004510a
......@@ -297,7 +297,16 @@ bool Detector::isWithinROI(const Track* track) {
}
// Check if cluster is within ROI and/or touches ROI border:
bool Detector::isWithinROI(const Cluster* cluster) {}
bool Detector::isWithinROI(Cluster* cluster) {
// Loop over all pixels of the cluster
for(auto& pixel : (*cluster->pixels())) {
if(winding_number(pixel->coordinates(), m_roi) == 0) {
return false;
}
}
return true;
}
/* isLeft(): tests if a point is Left|On|Right of an infinite line.
* via: http://geomalgorithms.com/a03-_inclusion.html
......
......@@ -105,7 +105,7 @@ namespace corryvreckan {
ROOT::Math::XYZPoint globalToLocal(ROOT::Math::XYZPoint global) { return m_globalToLocal * global; };
bool isWithinROI(const Track* track);
bool isWithinROI(const Cluster* cluster);
bool isWithinROI(Cluster* cluster);
private:
// Member variables
......
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