backtrackLayers function

Backtrack layers from average or summary profile