Many nuclear reactions that are currently under investigation for nuclear physics interests, as well as astrophysics reasons, usually have very small cross sections. Therefore, it is critical to optimize the detector setup due to the fact that identifying correct particles under large other background events is rather difficult. A detector simulation code DETECT was developed for focal-plane detectors for a magnetic spectrograph in order to understand the behaviors of particles produced in nuclear reactions. This program simulates a particular detector's response while varying the input parameters. The DETECT program was found to be useful in the 12C( 12C, 6He) 18Ne and the 12C( 14N, 8Li) 18Ne experiments and can be used for other nuclear reaction studies using focal plane detectors.