public void findPeaks(DataSetXY dataSet){
        
        DataSetXY rieman = dataSet.getDataSetRieman(this.nSamples);
        clustersData.clear();
        double delta = this.averageDelta(rieman);
        System.err.println("=====> AVERAGE DELTA = " + delta);
        for(int loop = 0; loop < rieman.getDataX().getSize(); loop++){
            double  xvalue = rieman.getDataX().getValue(loop);
            double  yvalue = dataSet.evaluate(xvalue);
            boolean  addNewDataset = true;
            for(DataSetXY d : clustersData){
                if(this.isInCluster(d, xvalue,peakClusteringWidth*delta)){
                    d.add(xvalue, yvalue);
                    addNewDataset = false;
                }
            }
            if(addNewDataset==true){
                DataSetXY set = new DataSetXY();
                set.add(xvalue, yvalue);
                clustersData.add(set);
            }            
        }
        
        ArrayList<DataSetXY>  clustersFiltered = new ArrayList<DataSetXY>();
        
        for(DataSetXY vec : clustersData){
            if(vec.getDataX().getSize()>=this.maxHitsInCluster){
                clustersFiltered.add(vec);
            }
        }
        
        this.clustersData = clustersFiltered;
        for(DataSetXY vec : clustersData){
            System.err.println("DATA SIZE = " + vec.getDataX().getSize() + "  mean = "
            + vec.getMean() + "  rms = " + vec.getRMS());
            //vec.show();
        }
        
        for(DataSetXY vec : clustersData){
            System.err.println("DATA SIZE = " + vec.getDataX().getSize() + "  mean = "
            + vec.getMean() + "  rms = " + vec.getRMS());
            //vec.show();
        }
    }