How can i get runid in primarygeneratoraction?

I refer to the code to get the energy deposition in the exampleB1, after a lot of modification but wrong.
very upset o(╥﹏╥)o