Simulation of the data acquisition chain of a detector