double BCAL_tdiff_res(double geometric_mean, int ilayer) { double &x = geometric_mean; switch(ilayer){ case 1: return 0.0968807+(1.45687/(pow(x,0.802512)-19.8842)); break; case 2: return 0.0667442+(23740.6/(pow(x,2.46481)+25388.9)); break; case 3: return 0.0721332+(9.65737e+06/(pow(x,3.64047)+2.00087e+07)); break; case 4: return 0.07784+(6569.23/(pow(x,2.38406)-2662.26)); break; case 5: return 0.0801771+(5.40202e+06/(pow(x,3.50433)+1.15558e+07)); break; case 6: return 0.0751894+(4.58137e+06/(pow(x,3.47181)+8.369e+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; }