Dear @rachel.hen.shukrun ,
Based on other topics in this forum I would suggest you to rather use an mgdraw.f routine which you could customize to your problem. If you have a look at this post, the mgdraw routine is used to write out continuous and discrete energy depositions (variable DTRACK(MTRACK) described in the mgdraw documentation). You can adapt the routine to select only the photons (JTRACK=7) within the energy deposition windows you would like to impose. To make one further suggestion: it is probably the best to make a simple case where you then compare your mgdraw output with EVENTBIN results, just to make sure they produce the same thing as described here.
Hopefully this helps, best regards!
Andreas