1. A computer implemented method for optimizing the number of conditioning data to use in multiple point statistics simulation, the method comprising: inputting, into the computer, a training image representative of subsurface geological heterogeneity; inputting, into the computer, an initial conservative number of conditioning data; selecting, by the computer, a geometry of a template wherein a size of the template is defined by the initial conservative number of conditioning data; building, using the computer, a search tree by scanning the training image with the template and storing data patterns present in the training image in the search tree to obtain a plurality of patterns; and determining, by the computer, a threshold number of conditioning data, smaller than the initial conservative number of conditioning data, beyond which estimated facies probabilities are not significantly modified by additional conditioning data.