| 50 | 
  | 
                       const std::string& sele2, RealType len, int nrbins, int nangleBins) | 
| 51 | 
  | 
    : RadialDistrFunc(info, filename, sele1, sele2), len_(len), nRBins_(nrbins), nAngleBins_(nangleBins){ | 
| 52 | 
  | 
 | 
| 53 | 
< | 
      deltaR_ = len_ /nRBins_;              | 
| 54 | 
< | 
      deltaCosAngle_ = 2.0 / nAngleBins_;     | 
| 55 | 
< | 
 | 
| 53 | 
> | 
      deltaR_ = len_ /(double) nRBins_; | 
| 54 | 
> | 
      deltaCosAngle_ = 2.0 / (double)nAngleBins_;     | 
| 55 | 
  | 
      histogram_.resize(nRBins_); | 
| 56 | 
  | 
      avgGofr_.resize(nRBins_); | 
| 57 | 
  | 
      for (int i = 0 ; i < nRBins_; ++i) { | 
| 62 | 
  | 
 | 
| 63 | 
  | 
 | 
| 64 | 
  | 
  void GofRAngle::preProcess() { | 
| 66 | 
– | 
 | 
| 65 | 
  | 
    for (int i = 0; i < avgGofr_.size(); ++i) { | 
| 66 | 
  | 
      std::fill(avgGofr_[i].begin(), avgGofr_[i].end(), 0); | 
| 67 | 
  | 
    } | 
| 69 | 
  | 
 | 
| 70 | 
  | 
  void GofRAngle::initalizeHistogram() { | 
| 71 | 
  | 
    npairs_ = 0; | 
| 72 | 
< | 
    for (int i = 0; i < histogram_.size(); ++i) | 
| 72 | 
> | 
    for (int i = 0; i < histogram_.size(); ++i){ | 
| 73 | 
  | 
      std::fill(histogram_[i].begin(), histogram_[i].end(), 0); | 
| 74 | 
+ | 
    } | 
| 75 | 
  | 
  } | 
| 76 | 
  | 
 | 
| 78 | 
– | 
 | 
| 77 | 
  | 
  void GofRAngle::processHistogram() { | 
| 80 | 
– | 
 | 
| 78 | 
  | 
    int nPairs = getNPairs(); | 
| 79 | 
  | 
    RealType volume = info_->getSnapshotManager()->getCurrentSnapshot()->getVolume(); | 
| 80 | 
  | 
    RealType pairDensity = nPairs /volume; | 
| 99 | 
  | 
    if (sd1 == sd2) { | 
| 100 | 
  | 
      return; | 
| 101 | 
  | 
    } | 
| 105 | 
– | 
     | 
| 102 | 
  | 
    Vector3d pos1 = sd1->getPos(); | 
| 103 | 
  | 
    Vector3d pos2 = sd2->getPos(); | 
| 104 | 
  | 
    Vector3d r12 = pos2 - pos1; | 
| 105 | 
< | 
    currentSnapshot_->wrapVector(r12); | 
| 105 | 
> | 
    if (usePeriodicBoundaryConditions_) | 
| 106 | 
> | 
      currentSnapshot_->wrapVector(r12); | 
| 107 | 
  | 
 | 
| 108 | 
  | 
    RealType distance = r12.length(); | 
| 109 | 
  | 
    int whichRBin = distance / deltaR_; | 
| 110 | 
  | 
 | 
| 111 | 
  | 
    if (distance <= len_) { | 
| 112 | 
+ | 
 | 
| 113 | 
  | 
      RealType cosAngle = evaluateAngle(sd1, sd2); | 
| 114 | 
  | 
      RealType halfBin = (nAngleBins_ - 1) * 0.5; | 
| 115 | 
  | 
      int whichThetaBin = halfBin * (cosAngle + 1.0); | 
| 151 | 
  | 
    Vector3d pos1 = sd1->getPos(); | 
| 152 | 
  | 
    Vector3d pos2 = sd2->getPos(); | 
| 153 | 
  | 
    Vector3d r12 = pos2 - pos1; | 
| 154 | 
< | 
    currentSnapshot_->wrapVector(r12); | 
| 154 | 
> | 
   | 
| 155 | 
> | 
    if (usePeriodicBoundaryConditions_) | 
| 156 | 
> | 
      currentSnapshot_->wrapVector(r12); | 
| 157 | 
> | 
 | 
| 158 | 
  | 
    r12.normalize(); | 
| 159 | 
  | 
    Vector3d dipole = sd1->getElectroFrame().getColumn(2); | 
| 160 | 
  | 
    dipole.normalize();     |