; (C) to assist in identifying any person who has been lawfully arrested, during the process of booking that person after an arrest or during that person’s custodial detention; or (D) to assist in identifying any person— (i) if the appropriate prosecutor determines that an emergency situation exists— (I) that involves immediate danger of death or serious physical injury to any person; or (II) that requires the use of facial recognition in conjunction with a reference photo database to occur before an order authorizing such use can, with due diligence, be obtained; and (ii) there are grounds upon which an order could be entered under this section to authorize such use. (2) Subsequent authorization If an investigative or law enforcement officer uses facial recognition pursuant to paragraph (1)(D), the prosecutor shall apply for an order approving the use under subsection (b) within 12 hours after the use occurred. The use shall immediately terminate when the application for approval is denied, or in the absence of an application, within 12 hours. In cases where an order is not obtained or denied, the officer shall destroy all information obtained as a result of the search. (3) Affidavit required With respect to use of facial recognition pursuant to paragraph (1)(D), an appropriate prosecutor shall submit an affidavit to the court identifying specific details on why they believe that an emergency situation under clause (i) exists. (d) State law preserved The authorities provided by subsections (b) and (c) do not authorize access reference photo databases maintained by a State, or a political subdivision of a State, unless State law expressly and unambiguously authorizes an investigative or law enforcement officer to— (1) access driver’s license and identification document photos