How to define an irregular binning detector

Dear expert,

As shown in the figure, there is an irregular dendritic structure(blue part) in my simulations.
image

I want to get a spatial distribution of the energy deposition in the dendritic structure.
I know USRBIN can achieve it for a regular structure and I checked out the manual and forum and got some related information.
I think I need a user-defined binning by writing my own musrbr.f, lusrbl.f and fusrbv.f routines. But I still have some questions regarding these subroutines. How do I compile these routines with input file, do I need to compile three times or something?
As normally we only have one subroutine for one input file.
and I am also confused about the specific content for each subroutine, take musrbr.f as an example, it writes in the manual :

  • MUSRBR defines a discrete (integer) variable (by default: region number).
    Argument list (all variables are input only):
    IJ : particle type
    PCONTR : particle momentum
    XA,YA,ZA : particle position
    MREG : current region
    LATCLL : current lattice cell
    ICALL : internal code calling flag (not for general use)

what is particle type, is it beam particle type or the particle type I want to scoring?
If it’s the particle type I want to scoring, then what is the particle momentum?
and in my simulation, it’s a volumetric beam, what is the particle position in this case?
regarding the current lattice cell, there’s no lattice in my input file, what should I fill for this?
what is “ICALL”?

or it there any other way to go ?

Thanks in advance.

Best regards,

Qi