--- trunk/src/applications/staticProps/GofR.cpp 2005/02/09 18:12:47 307 +++ trunk/src/applications/staticProps/GofR.cpp 2005/02/10 18:14:03 310 @@ -47,15 +47,16 @@ GofR::GofR(SimInfo* info, const std::string& filename, namespace oopse { GofR::GofR(SimInfo* info, const std::string& filename, const std::string& sele1, const std::string& sele2, double len) - : RadialDistrFunc(info, filename, sele1, sele2, len){ + : RadialDistrFunc(info, filename, sele1, sele2){ - histogram_.resize(nbins_); - avgGofr_.resize(nbins_); + deltaR_ = len_ /nRBins_; + + histogram_.resize(nRBins_); + avgGofr_.resize(nRBins_); } void GofR::preProcess() { - avgGofr_.resize(nbins_); std::fill(avgGofr_.begin(), avgGofr_.end(), 0.0); } @@ -73,8 +74,8 @@ void GofR::processHistogram() { for(int i = 0 ; i < histogram_.size(); ++i){ - double rLower = i * delta_; - double rUpper = rLower + delta_; + double rLower = i * deltaR_; + double rUpper = rLower + deltaR_; double volSlice = ( rUpper * rUpper * rUpper ) - ( rLower * rLower * rLower ); double nIdeal = volSlice * pairConstant; @@ -96,9 +97,9 @@ void GofR::collectHistogram(StuntDouble* sd1, StuntDou double distance = r12.length(); - int whichBin = distance / delta_; - histogram_[whichBin] ++; - npairs_++; + int whichBin = distance / deltaR_; + ++histogram_[whichBin]; + ++npairs_; } @@ -110,7 +111,7 @@ void GofR::writeRdf() { rdfStream << "selection2: (" << selectionScript2_ << ")\n"; rdfStream << "#r\tcorrValue\n"; for (int i = 0; i < avgGofr_.size(); ++i) { - double r = delta_ * (i + 0.5); + double r = deltaR_ * (i + 0.5); rdfStream << r << "\t" << avgGofr_[i]/nProcessed_ << "\n"; }