Study of the discharge gas trapping during thin film growth