charge calib and mask for bg optimization added