--- trunk/src/applications/staticProps/GofR.cpp 2005/02/10 14:15:52 309 +++ trunk/src/applications/staticProps/GofR.cpp 2005/02/13 20:36:24 328 @@ -46,16 +46,19 @@ namespace oopse { 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){ +GofR::GofR(SimInfo* info, const std::string& filename, const std::string& sele1, const std::string& sele2) + : RadialDistrFunc(info, filename, sele1, sele2){ - histogram_.resize(nbins_); - avgGofr_.resize(nbins_); + deltaR_ = len_ /nRBins_; + + histogram_.resize(nRBins_); + avgGofr_.resize(nRBins_); + + setOutputName(getPrefix(filename) + ".gr"); } void GofR::preProcess() { - avgGofr_.resize(nbins_); std::fill(avgGofr_.begin(), avgGofr_.end(), 0.0); } @@ -69,7 +72,7 @@ void GofR::processHistogram() { double volume = info_->getSnapshotManager()->getCurrentSnapshot()->getVolume(); double pairDensity = npairs_ /volume; - double pairConstant = ( 4.0 * PI * pairDensity ) / 3.0; + double pairConstant = ( 4.0 * NumericConstant::PI * pairDensity ) / 3.0; for(int i = 0 ; i < histogram_.size(); ++i){ @@ -96,9 +99,11 @@ void GofR::collectHistogram(StuntDouble* sd1, StuntDou double distance = r12.length(); - int whichBin = distance / deltaR_; - histogram_[whichBin] ++; - npairs_++; + if (distance < len_) { + int whichBin = distance / deltaR_; + ++histogram_[whichBin]; + ++npairs_; + } }