Hello
I think you can achieve what you want using BRIDGE_MATRX:
which is implemented in the master version of PLUMED. To get the equivalent of the coordination number from the python code in your email you do
ones: ONES SIZE=<number of atoms in group speciesB>
cmap: BRIDGE_MATRIX GROUPA=speciesA GROUPB=speciesB GROUPC=speciesB SWITCH={RATIONAL R_0=0.1}
slist: MATRIX_VECTOR_PRODUCT ARG=cmap,ones
slist is a vector of these coordination numbers. To calculate the average, lowest, and number less than 3 you do:
# This is the average
mean: MEAN ARG=slist PERIODIC=NO
# This is the lowest
lowest: LOWEST ARG=slist
# This is the number less than 3
sf: LESS_THAN ARG=slist SWITCH={RATIONAL R_0=3}
Lt3: SUM ARG=sf PERIODIC=NO
If you look through the manual, you will see that you can do all the operations on the distribution of numbers in this vector.
Hope this helps
Gareth