How is the Tower of London connected to London?

I think it used to be the city Jail. Now its a museum type thing, and you can go there and see the crown jewels on display etc....Provided I don't have my places muddled up.