code: public double calculatePiElectronegativity(IAtomContainer ac, IAtom atom, int maxIterations, int maxResonStruc) {
          maxI = maxIterations;
          maxRS = maxResonStruc;
  
          double electronegativity = 0;
  
          try {
              if (!ac.equals(acOldP)) {
                  molPi = ac.getBuilder().newInstance(IAtomContainer.class, ac);
  
                  peoe = new GasteigerMarsiliPartialCharges();
                  peoe.assignGasteigerMarsiliSigmaPartialCharges(molPi, true);
                  IAtomContainerSet iSet = ac.getBuilder().newInstance(IAtomContainerSet.class);
                  iSet.addAtomContainer(molPi);
                  iSet.addAtomContainer(molPi);
  
                  gasteigerFactors = pepe.assignrPiMarsilliFactors(iSet);
  
                  acOldP = ac;
              }
              IAtom atomi = molPi.getAtom(ac.indexOf(atom));
              int atomPosition = molPi.indexOf(atomi);
              int stepSize = pepe.getStepSize();
              int start = (stepSize * (atomPosition) + atomPosition);
              double q = atomi.getCharge();
              if (molPi.getConnectedLonePairsCount(molPi.getAtom(atomPosition)) > 0
                      || molPi.getMaximumBondOrder(atomi) != IBond.Order.SINGLE || atomi.getFormalCharge() != 0) {
                  return ((gasteigerFactors[1][start]) + (q * gasteigerFactors[1][start + 1]) + (gasteigerFactors[1][start + 2] * (q * q)));
              }
          } catch (Exception e) {
              logger.error(e);
          }
  
          return electronegativity;
      }
docs: calculate the electronegativity of orbitals pi.
  
  @param ac                    IAtomContainer
  @param atom                  atom for which effective atom electronegativity should be calculated
  @param maxIterations         The maximal number of Iteration
  @param maxResonStruc         The maximal number of Resonance Structures
  
  @return piElectronegativity