How can a detector distinguish between a photon and a gluon 
*

*Considering that both gluons and photons have no mass, no charge and spin 1, I was wondering how one can tell the difference, if they hit a detector after a collision at the LHC.

*I know that gluons are supposed to have a color, but I have never heard, that someone measured the color. How can you measure the color of a gluon, which would certainly provide a way of telling the difference between a gluon and a photon?

 A: Gluons are never found in isolation. If you had a way of directly detecting the mass, charge, and spin of particles, and detector finds something with no mass and no charge and spin 1, it's a photon, definitely not a gluon.
Besides, photons interact electromagnetically, whereas gluons don't. The way modern detectors are constructed, they typically have a silicon tracker in the center, which detects charged particles, surrounded by a layer of electromagnetic calorimeters, which detect electromagnetically interacting particles, and then a layer of hadronic calorimeters, which detect high-mass particles that weren't stopped by the EM calorimeters. Photons are the only particles that deposit energy in the electromagnetic calorimeter but don't register in the silicon tracker or the hadronic calorimeter. If gluons were able to propagate independently, they would probably barely register on any of the detector components because the strongly interacting parts, the atomic nuclei, are so small (of course, if gluons weren't confined, who knows if that would still be the case).
A: Indeed you cannot measure gluons, since the fact that they are color charged implies they are always confined. Thus, while photon may freely escape from the colission, gluons, like quarks, may not. That is the reason why you measure in your detectors hadronized matter, whose color content is "white". 
A: A picture is worth a thousand words.


Three-jet event. Electronic display of an electron-positron collision in the ALEPH detector at CERN, the European particle physics laboratory near Geneva. The display shows a cross-section of the detector, with the beam tube in the centre (blue) surrounded by various detector components (blue and red). The electron and positron, accelerated to high energy in CERN's LEP collider, annihilate at centre to create a quark and an antiquark, one of which radiates a gluon (carrier of the strong nuclear force). Although too short-lived to be detected directly, the quark, antiquark, & gluon each decays into jets of hadrons that spread out through the detector.

The dark part is a Time Projection Chamber (TPC) that sees individual charged particles. This event is interpreted as a quark antiquark gluon jets. All jets are identified by the energy deposited, but further assumptions are needed to choose which is the gluon jet. The fact is that detectors measure the energy of gluon jets. 
Photons, and they exist within these jets too, are identified if they deposit energy in the electromagnetic calorimeter, the first red circle, but no charged track (from the dark area) enters the detector where the energy is deposited.  The hadronic calorimeter is the second dark circle, it absorbs all the energy from hadrons.
You can see some photons on the top right and bottom left, where the TPC is dark, no charged tracks, and a signal exists in the electromagnetic calorimeter.
