To protect your daughter, you should file for custody. This could be done at the time of a divorce, but is handled as a separate proceeding.
What the court will do depends on the underlying facts, including the circumstances that led to his Megan's Law conviction, and the offenses for which he was convicted. Other facts such as the age of your daughter, the relationship he has with her, and the length of time he was in jail are also relevant. It is likely that the Court will either arrange for some form of supervised visitation, if any visitation is granted.
You should sit down with an attorney to discuss these issues in detail.
This is not intended to provide legal advice about your situation - just a few casual remarks about a legal question. We are a debt relief agency helping people file for bankruptcy.
If you have a custody order, you need to retain an attorney right away to file am Emergency Petition to suspend his periods of custody. If you don't have a court order, your attorney can file a Complaint for sole legal and physical custody.
My response is based solely on the limited information contained in the question. It is not meant to substitute your attorney's advice.
Sign up to receive a 3-part series of useful information and advice about child custody law.