Production, transfer and injection of charged particles in traps and storage rings