The energy function terms mostly reside in src/core/scoring/methods. The derivatives are calculated on an individual basis.
The EnergyMethod base class has the function to request an individual EnergyMethod’s derivative against a DOF. (eval_dof_derivative, line 151 of src/core/scoring/methods/EnergyMethod.hh). It’s not really meant to be called from a high-level perspective but it will work.
If you want the derivative of the entire score function against a dof, then the ScoreFunction object has a similar function (also eval_dof_derivative, ScoreFunction.hh::634).
If you can’t get that function to work feel free to ask for more help. Your willingness to be pointed me to a class makes me assume you want to familiarize yourself with the code?