It's based on Kate Summerscale's The Suspicions of Mr Whicher: or the Murder at Road Hill House, which tells in novelised format the true story of the investigation of a notorious child murder in 1860s Wiltshire. Here's the offficial site: www.mrwhicher.com.
In June 1860, Francis Savill Kent, the 3-year-old son of a respectable family in Road (now Rode) near Frome, was found stabbed to death in the privy outside their home. Local police having failed to find the murderer, national outcry led to the talented Scotland Yard detective Jonathan ("Jack") Whicher being assigned to the case. Whicher strongly suspected Constance Kent, Savill's 16-year-old half-sister, and her brother William of murdering Savill out of half-sibling resentment. He had Constance arrested, but the case collapsed on lack of evidence, and he was pensioned off in disgrace with "mental depression arising from congestion of the brain". Five years later, however, Constance got religion and confessed to the crime. She received a death sentence, commuted to life imprisonment, and was released in 1885. She emigrated to Australia, joining William (who became an eminent marine biologist), and lived the remainder of her life as a respected nurse, dying aged 100 in 1944.
The drama conveys very well the frustrations of police work in an era before forensics and in a community where social hierarchies conspired to prevent unbiased investigation. As the Metropolitan Police Service account puts it - see Constance Kent and the Road Hill House Murder -
It is a classic illustration of how early investigations were directed heavily by magistrates, of the influence which well-to-do people could exert over local police officers, and of the importance of immediately searching and questioning the whole household at the scene of a crime, regardless of social status.
Then, as now, the public were horrified by child murder and wanted a result, but equally horrified by Whicher's then-unprecedented detective investigation of the Kent family (he evidently understood the unpalatable reality that family members are, with statistical justification, the prime suspects for child murders). Viewed purely as a drama, The Suspicions of Mr Whicher had strong resonances with Priestley's An Inspector Calls, with its unpicking of conflicts within a middle-class family with zero end result except their traumatic self-knowledge. Kate Summerscale - see the September 2008 Bookslut interview - further likens it to The Turn of the Screw (the TV adaptation strongly focusing on the theory that Constance and William Kent committed the crime together).
As the Wikipedia page for Constance Kent says, the Road Hill House case impinged on major issues including Priest-penitent privilege in England. The 1865 vindication was too late to save Whicher's police career, but he became a successful private investigator. A friend of Charles Dickens and Wilkie Collins, he was the prototype for "Sergeant Witchem" in a number of Dickens crime stories such as The Artful Touch, and "Sergeant Cuff" in the 1868 The Moonstone (see p139, Reassessing British literature, 2007). Elements of the Kent case also featured in Mary Elizabeth Braddon's 1862 Lady Audley's Secret. For other connections, see The prince of sleuths (Kate Summerscale, The Guardian, 5 April 2008).