Origins of the H, He i and Ca ii line emission in classical T Tauri stars