Root:Simultanoeus fiiting by user defined function

I am doing simultaneous fitting of the data of the two detectors. The fitting function is user defined and it is dependent on the angle of the detectors also. Since it has the factor of the angle of the detector, so it will be different for both the detectors.
Fitting each detector by its individual fitting function is done, but how to fit the data of both the detectors i.e. simultaneous fitting taking into account that angles of both the detectors are different.

Thank you