Modeling collisional and radiative processes in fusion plasmas with the kinetic particle-in-cell method