Suppose I have a symplectic manifold $(M,\omega)$ and a line bundle $\mathcal L$ with a connection with curvature $\omega$ (or perhaps it's more standard to say $\frac i{2\pi}\omega$; anyway, the constant factor doesn't make any difference here).

Now I'd like to consider the following operation, and I'm hoping that it can be interpreted in some cohomology theory.

Consider objects of the form $(L,s)$, where $L\subset M$ is a lagrangian submanifold, and $s$ is a flat section of $\mathcal L|_L$ (note that since $\omega|_L=0$, the connection on $\mathcal L|_L$ is flat, so such sections exist at least locally).

Consider dual objects of the form $(L,s)$, where $L\subset M$ is a lagrangian submanifold, and $s$ is a flat section of $\mathcal L^\ast|_L$ (i.e. the dual bundle, with the induced connection).

Now if we have $(L_1,s_1)$ and $(L_2,s_2)$ (an object and a dual object), where $L_1$ and $L_2$ intersect transversally, then of course we can take the following quantity as their "pairing":

$$\langle(L_1,s_1),(L_2,s_2)\rangle:=\sum_{x\in L_1\cap L_2}\operatorname{sign}(x)\langle s_1(x),s_2(x)\rangle$$

Of course, this looks awfully similar to the intersection pairing (cup product) on $H^n(M)$ (say $\dim M=2n$). My question is: is there a (co)homology theory in which what I've written above is an honest intersection pairing (cup product)?

Of course, a natural thing to try is $H^n(M,\mathcal L)$ for the first type of object and $H^n(M,\mathcal L^\ast)$ for the dual object (singular homology with twisted coefficients). Then naturally the cup product goes to $H^{2n}(M,\mathcal L\otimes\mathcal L^\ast)=H^{2n}(M,\mathbb C)=\mathbb C$. But of course this is nonsense since $H^\ast(M,\mathcal L)$ doesn't make sense unless we specify a flat connection on $\mathcal L$, and our natural connection has curvature! Perhaps there's an easy fix that I'm missing.

locally constantsections of your bundle. I don't have a flat connection on $\mathcal L$, there's no notion of a "locally constant" section of $\mathcal L$. $\endgroup$ – John Pardon Jul 9 '11 at 20:41