Fluence calculation

I am a beginner in Geant4 and currently working on calculating neutron fluence and the fluence of charged particles produced from neutron interactions with my detector material. I found that G4CellFlux and G4MultiFunctionalDetector can be used for this purpose, but I am not sure how to properly implement them. I understand that fluence can be calculated by dividing the particle track length by the scoring volume.

Could someone please guide me on how to do this correctly?
I would be very grateful for any help.
Thank you in advance!

Have a look at Command-based scoring — Book For Application Developers 11.3 documentation and examples/extended/runAndEvent/RE02.