this is my first question on electronics, so I hope I will get it right. :) GSM and GPS are topics which are quite new to me, but I will try to be as clear as I can. Is it possible to collect data about all the present GSM devices in the room or on a floor, with my device, and then calculate via GPS the distance between my GSM device and all the others? Can it be done via GPS or should it be done via GSM module? Can that kind of collecting be done, at all? Thanks in advance!
You can use GPS to calculate the position of your own device if you happen to have a good enough sky view to receive the GPS signal. Otherwise, GPS is not useful. GPS is the Global Positioning System. A GPS receiver uses signals transmitted by GPS satellites to determine it's location. However, the GPS signals are very weak and cannot penetrate effectively through buildings so GPS is of little use indoors. Also, a GPS receiver can only determine the location of it's antenna. It cannot be used to determine the location of another device.
As for tracking GSM devices, the best you will be able to do is radio direction finding, and then only when the units are transmitting. It may be possible to extract some information about the GSM devices, but it will require a highly specialized receiver. A software defined radio unit would probably be the most economical route. Also, you would likely have to break GSM's encryption if you want to gather any information about these devices. This is likely illegal. Another possibility is to build your own base station and set it up so that the phones connect to you. However, this is far more complicated and even more illegal because you would have to transmit on licensed frequencies.
They transmit very intermittently on high power (you can occasionally hear "bipping" on cheap computer speakers when SMSing, see Why does GSM cause speakers to buzz?). If you fill a building with 900MHz recievers you could probably do time-of-flight direction finding, but it would be neither cheap nor easy.
GPS is recieve-only. So you'd need the cooperation of the phones via an app or similar.