Copying input information of DepositionReader to the output Tree

I am using Allpix2 with ALPIDE sensors to read from an external Geant4 simulation. I am using the DepositionReader module to read from a tree. I want to compare the input information (energy, position etc) with the output of Allpix2, on an event by event basis. Is it possible to get the information of the input tree copied to the output of ROOTObjectWriter?

Thank you,

Dear @asantra

If you write MCParticles and DepositedCharge objects to the output file, then you can compare them:

include = MCParticle, DepositedCharge
file_name = "myfile.root"

Please observe though that these are charge carriers, not energy as in your input, and when calculating their number the Fano factor has been taken into account.