restoring detector1d.cpp