Large Deviations for the Branching Brownian Motion in Presence of Selection or Coalescence