Added a flag to fill ROOT tree for all events (default) or only events with at least one hit in any sensitive detector (flag=1)