The two Zero Degree Calorimeters (ZDCs) of the CMS experiment are located at $pm 140~$m from the collision point and detect neutral particles in the $|eta| > 8.3$ pseudorapidity region. This paper presents a study on the performance of the ZDC in the 2016 pPb run. The response of the detectors to ultrarelativistic neutrons is studied using in-depth Monte Carlo simulations. A method of signal extraction based on template fits is presented, along with a dedicated calibration procedure. A deconvolution technique for the correction of overlapping collision events is discussed.