SELECT
    detNormalizedStatImfile.*,
    detRunSummary.data_state
FROM detRunSummary
JOIN detNormalizedStatImfile
    USING(det_id,iteration)
WHERE
    detRunSummary.data_state = 'goto_cleaned'
AND detNormalizedStatImfile.data_state = 'full'
