  The present dynamical configuration of planets in binary star systems may not
reflect their formation process since the binary orbit may have changed in the
past after the planet formation process was completed. An observed binary
system may have been part of a former hierarchical triple that became unstable
after the planets completed their growth around the primary star.
Alternatively, in a dense stellar environment even a single stellar encounter
between the star pair and a singleton may singificantly alter the binary orbit.
In both cases the planets we observe at present would have formed when the
dynamical environment was different from the presently observed one.
  We have numerically integrated the trajectories of the stars (binary plus
singleton) and of test planets to investigate the abovementioned mechanisms.
  Our simulations show that the circumstellar environment during planetary
formation around the primary was gravitationally less perturbed when the binary
was part of a hierarchical triple because the binary was necessarely wider and,
possibly, less eccentric. This circumstance has consequences for the planetary
system in terms of orbital spacing, eccentricity, and mass of the individual
planets. Even in the case of a single stellar encounter the present appearance
of a planetary system in a binary may significantly differ from what it had
while planet formation was ongoing. However, while in the case of instability
of a triple the trend is always towards a tighter and more eccentric binary
system, when a single stellar encounter affects the system the orbit of the
binary can become wider and be circularized.
