Event couns with condition

I have placed multiple detector which have different detector ID. And assigned a common logical volume “logicDetector” as my sensitive detector. Now I am simulating with 100000000 events of 1 MeV gamma rays. This gamma can fully deposit its energy by interacting with any detector and hence we can have photo peak.There will be Compton effect when events gets scattered from any detector then deposit some of its energy and then escape . Or this event can deposit part of its energy in detector 1 and other part in detector 2 then get escape. I want to count total number of escape events which got escape after scattering from one detector. Can you help me ?

@shapeandsymmetry have you been able to find out the solution to this problem? I also have a similar issue.