Behavior of charged particles confined in a magnetic mirror