Scoring charcteristic X-rays and Rayl

Dear all,
I would like to count the number of photons undergoing Rayleigh scattering in volume A ,exiting this volume (A) and entering another volume B.
I want also to count the characteristic X-rays created in a volume A and entering a volume B. I think this can be done with prestep and poststep in SteppinAction.cc. Any hint will be appreciated. Thanks.

Best regards
A. Hod