Beam studies in muon and neutrino physics