Effective Lagrangian of the two Higgs doublet model