| 98 | 
  | 
                 const std::string& sele1, int seleOffset, int nthetabins) | 
| 99 | 
  | 
    : StaticAnalyser(info, filename), selectionScript1_(sele1),   | 
| 100 | 
  | 
      evaluator1_(info), evaluator2_(info), seleMan1_(info), seleMan2_(info), | 
| 101 | 
< | 
      nThetaBins_(nthetabins),        | 
| 102 | 
< | 
      doVect_(false), doOffset_(true) { | 
| 101 | 
> | 
      nThetaBins_(nthetabins), seleOffset_(seleOffset),  | 
| 102 | 
> | 
      doVect_(false), doOffset_(true), doOffset2_(false) { | 
| 103 | 
> | 
     | 
| 104 | 
> | 
    setOutputName(getPrefix(filename) + ".pAngle"); | 
| 105 | 
> | 
     | 
| 106 | 
> | 
    evaluator1_.loadScriptString(sele1); | 
| 107 | 
> | 
    if (!evaluator1_.isDynamic()) { | 
| 108 | 
> | 
      seleMan1_.setSelectionSet(evaluator1_.evaluate()); | 
| 109 | 
> | 
    }             | 
| 110 | 
> | 
     | 
| 111 | 
> | 
    count_.resize(nThetaBins_); | 
| 112 | 
> | 
    histogram_.resize(nThetaBins_);     | 
| 113 | 
> | 
  } | 
| 114 | 
> | 
 | 
| 115 | 
> | 
  pAngle::pAngle(SimInfo* info, const std::string& filename,  | 
| 116 | 
> | 
                 const std::string& sele1, int seleOffset, int seleOffset2, | 
| 117 | 
> | 
                 int nthetabins) | 
| 118 | 
> | 
    : StaticAnalyser(info, filename), selectionScript1_(sele1),   | 
| 119 | 
> | 
      evaluator1_(info), evaluator2_(info), seleMan1_(info), seleMan2_(info), | 
| 120 | 
> | 
      nThetaBins_(nthetabins), seleOffset_(seleOffset),  | 
| 121 | 
> | 
      seleOffset2_(seleOffset2), | 
| 122 | 
> | 
      doVect_(false), doOffset_(true), doOffset2_(true) { | 
| 123 | 
  | 
     | 
| 124 | 
  | 
    setOutputName(getPrefix(filename) + ".pAngle"); | 
| 125 | 
  | 
     | 
| 171 | 
  | 
      } | 
| 172 | 
  | 
       | 
| 173 | 
  | 
      if (doVect_) { | 
| 174 | 
+ | 
 | 
| 175 | 
  | 
         | 
| 176 | 
  | 
        for (sd1 = seleMan1_.beginSelected(ii); sd1 != NULL;  | 
| 177 | 
  | 
             sd1 = seleMan1_.nextSelected(ii)) { | 
| 202 | 
  | 
            // This will require careful rewriting if StaticProps is | 
| 203 | 
  | 
            // ever parallelized.  For an example, see | 
| 204 | 
  | 
            // Thermo::getTaggedAtomPairDistance | 
| 205 | 
+ | 
            Vector3d r1; | 
| 206 | 
  | 
             | 
| 207 | 
< | 
            int sd2Index = sd1->getGlobalIndex() + seleOffset_; | 
| 208 | 
< | 
            sd2 = info_->getIOIndexToIntegrableObject(sd2Index); | 
| 209 | 
< | 
             | 
| 210 | 
< | 
            Vector3d r1 = CenterOfMass - sd1->getPos(); | 
| 207 | 
> | 
            if (doOffset2_) { | 
| 208 | 
> | 
              int sd1Aind = sd1->getGlobalIndex() + seleOffset2_; | 
| 209 | 
> | 
              StuntDouble* sd1A = info_->getIOIndexToIntegrableObject(sd1Aind); | 
| 210 | 
> | 
              r1 = CenterOfMass - sd1A->getPos();               | 
| 211 | 
> | 
            } else { | 
| 212 | 
> | 
              r1 = CenterOfMass - sd1->getPos(); | 
| 213 | 
> | 
            } | 
| 214 | 
> | 
 | 
| 215 | 
  | 
            if (usePeriodicBoundaryConditions_) | 
| 216 | 
  | 
              currentSnapshot_->wrapVector(r1); | 
| 217 | 
< | 
             | 
| 217 | 
> | 
 | 
| 218 | 
> | 
 | 
| 219 | 
> | 
            int sd2Index = sd1->getGlobalIndex() + seleOffset_; | 
| 220 | 
> | 
            sd2 = info_->getIOIndexToIntegrableObject(sd2Index); | 
| 221 | 
> | 
 | 
| 222 | 
  | 
            Vector3d r2 = CenterOfMass - sd2->getPos(); | 
| 223 | 
  | 
            if (usePeriodicBoundaryConditions_) | 
| 224 | 
  | 
              currentSnapshot_->wrapVector(r1); |