  We consider an optical hypersurface $\Sigma$ in the cotangent bundle
$\tau:T^*M\to M$ of a closed manifold $M$ endowed with a twisted symplectic
structure. We show that if the characteristic foliation of $\Sigma$ is Anosov,
then a smooth 1-form $\theta$ on $M$ is exact if and only $\tau^*\theta$ has
zero integral over every closed characteristic of $\Sigma$. This result is
derived from a related theorem about magnetic flows which generalizes our work
in \cite{DP}. Other rigidity issues are also discussed.
