  Optimisation of heat engines at the micro-scale has applications in
biological and artificial nano-technology, and stimulates theoretical research
in non-equilibrium statistical physics. Here we consider non-interacting
overdamped particles confined by an external harmonic potential, in contact
either with a thermal reservoir or with a stochastic self-propulsion force
(active Ornstein-Uhlenbeck model). A cyclical machine is produced by periodic
variation of the parameters of the potential and of the noise. An exact mapping
between the passive and the active model allows us to define the effective
temperature $T_{eff}(t)$ which is meaningful for the thermodynamic performance
of the engine. We show that $T_{eff}(t)$ is different from all other known
active temperatures, typically used in static situations. The mapping allows us
to optimise the active engine, whatever are the values of the persistence time
or self-propulsion velocity. In particular - through linear irreversible
thermodynamics (small amplitude of the cycle) - we give explicit formula for
the optimal cycle period and phase delay (between the two modulated parameters,
stiffness and temperature) achieving maximum power with Curzon-Ahlborn
efficiency. In the quasi-static limit, the formula for $T_{eff}(t)$ simplifies
and coincides with a recently proposed temperature for stochastic
thermodynamics, bearing a compact expression for the maximum efficiency. A
point - overlooked in recent literature - is made about the difficulty in
defining efficiency without a consistent definition of effective temperature.
