double BCAL_tdiff_res(double geometric_mean, int ilayer) { double &x = geometric_mean; switch(ilayer){ case 1: return 0.0478516+(2.42114e+07/(pow(x,4.03893)+3.95261e+07)); break; case 2: return 0.0884494+(9.45097e+07/(pow(x,4.42168)+1.50837e+08)); break; case 3: return 0.0873282+(3.41902e+07/(pow(x,4.19954)+4.45608e+07)); break; case 4: return 0.0918899+(9.82373e+06/(pow(x,3.91009)+1.25462e+07)); break; case 5: return 0.095673+(3.1992e+07/(pow(x,4.13052)+5.01282e+07)); break; case 6: return 0.0739511+(730145/(pow(x,3.20325)+1.0452e+06)); break; case 7: return 100.0; break; case 8: return 100.0; break; case 9: return 100.0; break; case 10: return 100.0; break; return 100.0; } return 1000.0; }