33 for(set<DTOccupancyPoint>::const_iterator pt =
thePoints.begin(); pt !=
thePoints.end(); ++pt) {
34 theDistances[(*pt).distance(point)] = make_pair(*pt, point);
51 for(set<DTOccupancyPoint>::const_iterator pt =
thePoints.begin(); pt !=
thePoints.end();
59 LogTrace(
"DTDQM|DTMonitorClient|DTOccupancyTest|DTOccupancyClusterBuilder")
60 <<
" # of valid clusters: " <<
theClusters.size() << endl;
69 int colorMap[12] = {632, 600, 800, 400, 820, 416, 432, 880, 616, 860, 900, 920};
74 TCanvas *
canvas =
new TCanvas(canvasName.c_str(),canvasName.c_str());
76 for(vector<DTOccupancyCluster>::const_iterator cluster =
theClusters.begin();
79 stream << canvasName <<
"_" << cluster-
theClusters.begin();
80 string histoName = stream.str();
86 histo->Draw(
"box,same");
97 for(set<DTOccupancyPoint>::const_iterator pt_i =
thePoints.begin(); pt_i !=
thePoints.end();
99 for(set<DTOccupancyPoint>::const_iterator pt_j =
thePoints.begin(); pt_j !=
thePoints.end();
102 theDistances[pt_i->distance(*pt_j)] = make_pair(*pt_i, *pt_j);
112 for(set<DTOccupancyPoint>::const_iterator pt =
thePoints.begin(); pt !=
thePoints.end(); ++pt) {
119 LogTrace(
"DTDQM|DTMonitorClient|DTOccupancyTest|DTOccupancyClusterBuilder")
120 <<
"--------- New Cluster Candidate ----------------------" << endl;
121 pair<DTOccupancyPoint, DTOccupancyPoint> initialPair =
getInitialPair();
122 LogTrace(
"DTDQM|DTMonitorClient|DTOccupancyTest|DTOccupancyClusterBuilder")
123 <<
" Initial Pair: " << endl
124 <<
" point1: mean " << initialPair.first.mean()
125 <<
" rms " << initialPair.first.rms() << endl
126 <<
" point2: mean " << initialPair.second.mean()
127 <<
" rms " << initialPair.second.rms() << endl;
129 if(clusterCandidate.
isValid()) {
145 LogTrace(
"DTDQM|DTMonitorClient|DTOccupancyTest|DTOccupancyClusterBuilder")
146 <<
" # of layers: " << clusterCandidate.
nPoints()
147 <<
" avrg. mean: " << clusterCandidate.
averageMean() <<
" avrg. rms: " << clusterCandidate.
averageRMS() << endl;
159 LogTrace(
"DTDQM|DTMonitorClient|DTOccupancyTest|DTOccupancyClusterBuilder") <<
" sorting" << endl;
162 for(vector<DTOccupancyCluster>::const_iterator cluster = ++(
theClusters.begin());
164 set<DTLayerId> clusterLayers = (*cluster).getLayerIDs();
165 LogTrace(
"DTDQM|DTMonitorClient|DTOccupancyTest|DTOccupancyClusterBuilder")
166 <<
" # layers in the cluster: " << clusterLayers.size() << endl;
169 LogTrace(
"DTDQM|DTMonitorClient|DTOccupancyTest|DTOccupancyClusterBuilder")
bool isValid() const
Check if the cluster candidate satisfies the quality requirements.
DTOccupancyCluster getBestCluster() const
get the cluster correspondig to "normal" cell occupancy.
std::set< DTLayerId > theProblematicLayers
std::map< double, std::pair< DTOccupancyPoint, DTOccupancyPoint > > theDistances
std::map< double, DTOccupancyPoint > theDistancesFromTheCluster
double maxMean() const
max average cell occupancy of the layers in the cluster
double averageRMS() const
average RMS of the cell occpuancy distributions of the layers in the cluster
double maxRMS() const
max RMS of the cell occpuancy distributions of the layers in the cluster
std::set< DTOccupancyPoint > thePoints
bool addPoint(const DTOccupancyPoint &anotherPoint)
void drawClusters(std::string canvasName)
draw a TH2F histograms showing the clusters
virtual ~DTOccupancyClusterBuilder()
Destructor.
double averageMean() const
average cell occupancy of the layers in the cluster
void computeDistancesToCluster(const DTOccupancyCluster &cluster)
void addPoint(const DTOccupancyPoint &point)
Add an occupancy point for a given layer.
void buildClusters()
build the clusters
DTOccupancyClusterBuilder()
Constructor.
void computePointToPointDistances()
std::pair< DTOccupancyPoint, DTOccupancyPoint > getInitialPair()
int nPoints() const
of layers belonging to the cluster
std::vector< DTOccupancyCluster > theClusters
bool isProblematic(DTLayerId layerId) const
bool clusterIsLessThan(const DTOccupancyCluster &clusterOne, const DTOccupancyCluster &clusterTwo)
for DTOccupancyCluster sorting
double distance(const DTOccupancyPoint &point) const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point