Does $m$ in this problem refer to the total mass of the system or just the mass of a single body? I am trying to figure something out in this problem:

I am having trouble with these types of problems because often I don't understand which forces I need to consider when setting up $F=ma$.
Here is what I have got so far:

*

*I separated the force of gravity $m_1 g$ and $m_2 g$ acting on the relative bodies into the horizontal and vertical components. Because I can assume there is no friction the vertical component doesn't matter. For the forces along the plane I get:

$$F=ma \iff F_1-F_T=ma \iff m_1g\sin{\theta_1}-F_T=\color{red}{ma}\\ F= ma \iff F_2-F_T=ma \iff m_2g\sin{\theta_2}-F_T=\color{red}{ma}$$
Here is my first question: Does the $\color{red}{m}$ in both equations refer to the total mass $m_1+m_2$ of the system or only to the mass I am setting up the equation for? For example, should the first equation read: $$m_1g\sin{\theta_1}-F_T=m_1 a_1?$$
My second question: If the only force pulling $m_1$ up the slope is $F_T$ (tension), why can't I just say $F_T=m_2g$? It seems to me that $m_2g$ is the only thing causing $F_T$.
I hope my questions make sense.
 A: The net force on a system is equal to the total mass of that system times the acceleration of that system. So the $m$ in the equation refers to object or set of objects you're setting the equation up for. In the equation $F_1-F_T=ma$, you're using the force on the left object, so you should use the mass on the left object $m_1$. Whatever object $F$ refers to, should be the object $m$ and $a$ refer to.

If the only force pulling $m_1$ up the slope is $F_T$ (tension), why can't I just say $F_T=m_2g$? It seems to me that $m_2g$ is the only thing causing $F_T$.

How fast $m_1$ falls depends on how large $m_1$ is. If $m_2$ were significantly larger than $m_1$, say 100kg vs. 1g, then the tension would be negligible. The tension isn't created solely by $m_2g$, but also by $m_1g$. Considering that the problem statement is symmetric with respect to left and right sides, how could the tension depend on only one side?
A: The first thing you should do in such a problem is decide on the system(s) that you are going to consider and you will then apply $F=ma$ to that system.  
In this case there are two systems (mass $m_1$ and mass $m_2$) as shown in the diagram below which are constrained to move with the same acceleration $a$ if the string connecting them is inextensible.  
 
The next think to do is to draw a free body diagram for each of the systems which you have done by considering only the forces acting in directions parallel to the inclined plane.  
Now apply Newton's second law to each of the systems taking the positive directions as shown by $x_1$ and $x_2$.  
$F_1-F_T = m_1 a$ and $F_T-F_2 = m_2 a$ 
Having set up theses two equations you can eliminate $F_T$.  
$F_1-F_2 = (m_1+m_2)a$ 
Having obtained this equation you might think "Why did I not choose both masses as the system? as the equation looks like an application of Newton's second law to such a system.
The reason that you should not do this is because $F=ma$ is actually a vector equation $\vec F = m \vec a$ and by considering each mass separately the application of $\vec F = m \vec a$ is easily converted into a scalar equation.  
For mass $m_1$ the two forces acting on the mass are $F_1 \hat x_1$ and $-F_T \hat x_1$ and the acceleration is $a \hat x_1$ where $\hat x_1$ is the unit vector in the $x_1$ direction. 
$\vec F = m \vec a \Rightarrow F_1 \hat x_1-F_T \hat x_1 = m_1 a \hat x_1\Rightarrow F_1-F_T = m_1 a$ 
and a similar thing can be done for mass $m_2$.
For the two masses you could introduce a single coordinate system and apply Newton's second law but to get to the final result would be very convoluted and messy.
A: 1st eq. should be m1g-T=m1a1 ,as you are balancing force on 1st block . So mass and acc. of 1st is to be taken into consideration and for the same reason 2nd eq. should be T-m2g= m2a2 and if we talk about a1 and a2 than a1=a2 as the string in between m1 and m2 is inextensible and if both a1 and a2 are not equal than length of string would change which is not possible
A: The $m$ should be $m_1$ in the first equation and $m_2$ in the second equation. $a$ is the same magnitude in both equations, but $m_1a$ in the first equation should have a negative sign to show the force is to the left. Then for the two equations we have
$$m_1gSinθ_1- F_T = -m_1a$$
$$m_2gSinθ_2- F_T =  m_2a$$
We have two equations, and two unknowns. Eliminating $F_T$ and solving for $a$ gives
$$a = \frac{m_2gSinθ_2 – m_1gSinθ_1}{m_1 + m_2}$$
You can do some checks. For example, if the masses are the same and the angles are the same, you will get $a=0$ as expected.
If you keep the angles the same and say $m_2=2m_1$, you will get a positive value $a=1/3 g$
Finally, if you let the masses be the same, but $θ_2 > θ_1$, you will get a positive value of $a$.
Hope this helps
