Expressing the hardness of water by ppm CaCO3 is nothing but a conventional convenience in water industry. There is a background behind it.
Basically, you titrate hard water with ethylenediamminetetraacetate (EDTA) and the moles of EDTA consumed are assumed to be consumed by Ca2+ ions only. As you would guess, this is not true because hard water contains many other ions which can form a complex with EDTA especially magnesium is always present. Anions have nothing to do with the calculation of ppm CaCO3. The calculation is rather trivial
moles of EDTA used = moles of Ca2+ (as calcium forms 1:1 complex with EDTA) = moles of CaCO3 and even = moles of Ca(HCO3)2.
One can easily convert moles of CaCO3 into parts per million from the known volume of hard water taken from titration.