--- trunk/src/applications/staticProps/GofRAngle.cpp 2005/02/10 18:14:03 310 +++ trunk/src/applications/staticProps/GofRAngle.cpp 2005/02/15 17:24:12 348 @@ -67,10 +67,10 @@ void GofRAngle::processHistogram() { void GofRAngle::processHistogram() { - + int nRealPairs = getNRealPairs(); double volume = info_->getSnapshotManager()->getCurrentSnapshot()->getVolume(); - double pairDensity = npairs_ /volume; - double pairConstant = ( 4.0 * PI * pairDensity ) / 3.0; + double pairDensity = nRealPairs /volume; + double pairConstant = ( 4.0 * NumericConstant::PI * pairDensity ) / 3.0; for(int i = 0 ; i < histogram_.size(); ++i){ @@ -100,13 +100,14 @@ void GofRAngle::collectHistogram(StuntDouble* sd1, Stu double distance = r12.length(); int whichRBin = distance / deltaR_; - - double cosAngle = evaluateAngle(sd1, sd2); - double halfBin = (nAngleBins_ - 1) * 0.5; - int whichThetaBin = halfBin * (cosAngle + 1.0) - ++histogram_[whichRBin][whichThetaBin]; - - ++npairs_; + if (distance <= len_) { + double cosAngle = evaluateAngle(sd1, sd2); + double halfBin = (nAngleBins_ - 1) * 0.5; + int whichThetaBin = halfBin * (cosAngle + 1.0); + ++histogram_[whichRBin][whichThetaBin]; + + ++npairs_; + } } void GofRAngle::writeRdf() { @@ -139,14 +140,17 @@ double GofRTheta::evaluateAngle(StuntDouble* sd1, Stun Vector3d r12 = pos1 - pos2; currentSnapshot_->wrapVector(r12); r12.normalize(); - Vector3d dipole = sd1->getElectroFrame().getColumn(2)£» + Vector3d dipole = sd1->getElectroFrame().getColumn(2); dipole.normalize(); - return dot(); + return dot(r12, dipole); } double GofROmega::evaluateAngle(StuntDouble* sd1, StuntDouble* sd2) { Vector3d v1 = sd1->getElectroFrame().getColumn(2); Vector3d v2 = sd1->getElectroFrame().getColumn(2); + v1.normalize(); + v2.normalize(); + return dot(v1, v2); }