Suppose I have a meromorphic function in several variables $f(x_1,\ldots,x_k,y_1,\ldots,y_m)$ and I want to integrate along the torus $T^m$ given by $|y_1|=\cdots=|y_m|=1$. It is not true in general that the result is a meromorphic function in $x_i$, for a counterexample take $$ \int \frac{1}{1-x_1(y_1+y_1^{-1})} \frac{d y_1}{y_1}. $$ It is true however in the following case
Assumption. Suppose $f$ is a meromorphic function on $(\mathbb{C}^*)^{k+m}$ whose poles all lie in subtori, i.e. sets of the form $$ \{x_1,\ldots,x_k,y_1,\ldots,y_m: \prod x_i^{a_i} \prod y_j^{b_j} = 1\} $$ for integer vectors $a\in\mathbb{Z}^k$, $b\in\mathbb{Z}^m$ such that $a\neq 0$.
Then by iterated integration one can prove that the integral along $T^m$ $$ I(f)(x_1,\ldots,x_k)=\int f(x_1,\ldots,x_k,y_1,\ldots,y_m) \frac{d y_1}{y_1} \cdots \frac{d y_m}{y_m} $$ has a meromorphic continuation, again with poles in subtori. It is not true that the integral above is itself a meromorphic function. What is true however, that you can take the integral for $x_1,\ldots,x_k$ in the neighborhood of some point $x_1^0,\ldots,x_k^0$, and then meromorphically extend it to the whole of $(\mathbb{C}^*)^k$. So you get different meromorphic functions for different choices of the initial point $x_1^0,\ldots,x_k^0$. In fact, dependence on the initial point is discrete in the following sense: Vectors $a_i$ define hyperplanes in $\mathbb{R}^k$ thereby splitting it into regions. The points $x_1^0,\ldots,x_k^0$ are sent to $\mathbb{R}^k$ by taking $\log|\cdot|$, and points from the same region produce the same meromorphic function.
Question. Describe the maximal possible set of poles of this meromorphic function in terms of the poles of $f$ and the choice of the initial point $x_1^0,\ldots,x_k^0$, i.e. a region of $\mathbb{R}^k$?
Did anyone study this?
While typing this question I thought of a conjectural answer. Note that each pair $(a,b)$ specifying a pole of $f$ as above can be replaced by $(-a,-b)$. The choice of a region corresponds to a choice of sign, i.e. we can assume that $\sum_i a_i \log |x_i^0|> 0$. Now consider $r+1$-tuples of pairs $(r\leq m)$ $(a^{(1)},b^{(1)}),\ldots,(a^{(r+1)},b^{(r+1)})$ such that $0$ is in the interior of the $r$-simplex with vertices $b^{(1)},\ldots,b^{(r+1)}$. Call such tuples critical. For each critical tuple we can uniquely write $$ 0 = \sum_i c_i b^{(i)} $$ for some positive integers $c_i$ normalized by the condition $\gcd(c_1,\ldots,c_{r+1})=1$. Take $$ \sum_i c_i a^{(i)}. $$ This is a vector in $\mathbb{Z}^k$ which gives us a subtorus in $(\mathbb{C}^*)^k$. I think this collection of subtori, where we go over all critical tuples is precisely where the poles of $I(f)$ are.
If this is true, how to describe the "wall-crossing" when we move from one region to a different region?
Can we do the same for functions with infinitely many poles, for instance products of ratios of $q$-exponentials?