--- trunk/src/applications/staticProps/GofRAngle.cpp 2005/02/10 14:15:52 309 +++ trunk/src/applications/staticProps/GofRAngle.cpp 2005/02/10 18:14:03 310 @@ -46,18 +46,17 @@ namespace oopse { namespace oopse { -GofRAngle::GofRAngle(SimInfo* info, const std::string& filename, const std::string& sele1, const std::string& sele2, double len) - : RadialDistrFunc(info, filename, sele1, sele2, len){ +GofRAngle::GofRAngle(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_); } void GofRAngle::preProcess() { - avgGofr_.resize(nbins_); - for (int i = 0; i < avgGofr_.size(); ++i) + + for (int i = 0; i < avgGofr_.size(); ++i) { std::fill(avgGofr_[i].begin(), avgGofr_[i].end(), 0); + } } void GofRAngle::initalizeHistogram() { @@ -99,13 +98,15 @@ void GofRAngle::collectHistogram(StuntDouble* sd1, Stu currentSnapshot_->wrapVector(r12); double distance = r12.length(); - int whichBin = distance / deltaR_; + int whichRBin = distance / deltaR_; double cosAngle = evaluateAngle(sd1, sd2); - histogram_[whichBin] ++; + double halfBin = (nAngleBins_ - 1) * 0.5; + int whichThetaBin = halfBin * (cosAngle + 1.0) + ++histogram_[whichRBin][whichThetaBin]; - npairs_++; + ++npairs_; } void GofRAngle::writeRdf() { @@ -119,7 +120,7 @@ void GofRAngle::writeRdf() { double r = deltaR_ * (i + 0.5); for(int j = 0; j < avgGofr_[i].size(); ++j) { - double cosAngle = ; + double cosAngle = -1.0 + (i + 0.5)*deltaCosAngle_; rdfStream << r << "\t" << cosAngle << "\t" << avgGofr_[i][j]/nProcessed_ << "\n"; } } @@ -132,8 +133,6 @@ void GofRAngle::writeRdf() { rdfStream.close(); } - - double GofRTheta::evaluateAngle(StuntDouble* sd1, StuntDouble* sd2) { Vector3d pos1 = sd1->getPos(); Vector3d pos2 = sd2->getPos(); @@ -147,9 +146,7 @@ double GofROmega::evaluateAngle(StuntDouble* sd1, Stun double GofROmega::evaluateAngle(StuntDouble* sd1, StuntDouble* sd2) { Vector3d v1 = sd1->getElectroFrame().getColumn(2); - Vector3d v2 = sd1->getElectroFrame().getColumn(2); - - + Vector3d v2 = sd1->getElectroFrame().getColumn(2); }