File indexing completed on 2024-04-06 12:07:05
0001 #ifndef DTOccupancyClusterBuilder_H
0002 #define DTOccupancyClusterBuilder_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include "DTOccupancyPoint.h"
0012 #include "DTOccupancyCluster.h"
0013
0014 #include <set>
0015 #include <map>
0016 #include <vector>
0017 #include <string>
0018
0019 class DTOccupancyClusterBuilder {
0020 public:
0021
0022 DTOccupancyClusterBuilder();
0023
0024
0025 virtual ~DTOccupancyClusterBuilder();
0026
0027
0028
0029 void addPoint(const DTOccupancyPoint& point);
0030
0031
0032 void buildClusters();
0033
0034
0035 void drawClusters(std::string canvasName);
0036
0037
0038 DTOccupancyCluster getBestCluster() const;
0039
0040 bool isProblematic(DTLayerId layerId) const;
0041
0042 protected:
0043 private:
0044 std::pair<DTOccupancyPoint, DTOccupancyPoint> getInitialPair();
0045
0046 void computePointToPointDistances();
0047
0048 void computeDistancesToCluster(const DTOccupancyCluster& cluster);
0049
0050 bool buildNewCluster();
0051
0052 void sortClusters();
0053
0054 std::set<DTOccupancyPoint> thePoints;
0055 std::map<double, std::pair<DTOccupancyPoint, DTOccupancyPoint> > theDistances;
0056 std::map<double, DTOccupancyPoint> theDistancesFromTheCluster;
0057 std::vector<DTOccupancyCluster> theClusters;
0058 std::set<DTLayerId> theProblematicLayers;
0059
0060 double maxMean;
0061 double maxRMS;
0062 };
0063
0064 #endif