The sonar equipment on a Submarine is complicated but very interesting to study.
The "T" shaped piece of equipment is the pick up for the JP receiver. JP collects sounds in the audible frequency range
The two "balls" under the sub are actually two different sensors.
On the Starboard is the QB sensor and on the Port side is the JK/QC
These are used to collect sounds in the supersonic (inaudible) frequency ranges.
While both the QB and QC can be used for active "pinging", Normally only the QB is used. There is another system called NM which is only used to determine depth under Keel.
One thing I did not know was that the JP operator is not in the conning tower but in the Forward Torpedo Room. Gee Hollywood always has him in the control room.
A very good source about the different sonar systems on American Fleet Submarines can be accessed at
http://www.maritime.org/fleetsub/sonar/chap1.htm
I can, and have, spent hours reading these technical manuals. So glad such information is online.