Also hit hard were Naugatuck , Torrington , Thomaston , Beacon Falls and Ansonia , flooded by the Naugatuck River ; the Unionville section of Farmington , New Hartford and Collinsville on the Farmington River ; and the northeastern towns of Putnam , Thompson and Danielson , which were severely damaged when a dam burst in Massachusetts , causing the Quinebaug River to flood those towns .