Lorentz transformations: Which coordinate system is marked? I am confused about a basic special relativity question. So we have the Lorentz transformations
$$\begin{align}
x' &= \gamma(x-ut) \\
t' &= \gamma(t-ux/c^2)\ ,
\end{align}$$
where frame $S'$ is moving with velocity $u$ relative to the frame $S$ and the two frames coincide at $t=t'=0$.
So my confusion is: How do you know which should be the marked coordinate system in a given situation? (I know I could just apply the formula for length contraction but I'd like to understand it this way). 
I thought I had figured it out and that it depends on the direction of travel: $S'$ is moving with speed $u>0$ in the positive direction relative to $S$. And at first sight this works for my specific example which goes like this:

Q: A muon is created 6km above the earth, moving towards it at $0.998c$. Seen from a frame moving with the muon, what is its distance to the earth?
 A: So going with the logic above at first everything seems fine. I choose two reference frames in which the muon's position is $y_{\mu}=y_{\mu}'=0$ at $t=t'=0$, and the $y$-axes are pointing upwards from the earth. In this setup the frame standing still relative to the earth is moving in the positive direction of the other one, so the latter one should be the marked one. 
Then the distance to the earth is measured from both coordinate systems, still at $t=t'=0$ (I'm actually a bit fuzzy about this too, can one say it like this?). In the marked frame standing still relative to the earth we find $y'_E=-6\text{km}$. The distance in this frame is therefore
$$L'=y_{\mu}'-y'_E=6\text{km}\ .$$
Now in the other frame moving with the muon we get
$$L=y_{\mu}-y_E=\frac{y_{\mu}'}{\gamma}+ut-\biggl(\frac{y_E'}{\gamma}+ut\biggr)=\frac{L'}{\gamma}=379\text{ m}\ ,$$
and this gives the right, length-contracted answer.
PROBLEM: If I now turn the coordinate systems upside down, that is pointing from the muon towards the earth (which should be completely fine), I get the wrong answer using the same logic. In this case the frame moving with the muon is traveling in the positive direction relative to the other one so I get the opposite choice of which frame is marked.
Where is the mistake in the logic?
A: The "mark" (or perhaps more correctly, "prime") distinguishes two inertial frames of reference. You can "mark" either frame however you wish - it is merely a notation, but the convention I establish below is very common.


*

*Length is the spatial distance between "events" that occur at the same time - the events are the front and back of an object. 

*"Proper length" is the length in the frame in which the front and back of the object are at rest. This is the unprimed frame $O$. Let us denote proper length by $L_0$.

*"Contracted length" is the length in a frame in which the front and back of the object are not at rest, but moving at a constant speed $v$. This is the primed frame $O^\prime$. Let us denote contracted length by $L^\prime$
The four-vector between the object's front and back in its rest frame is
$$
\Delta x^\mu = x^\mu_{Front} - x^\mu_{Back} = (0, L_0, 0, 0).
$$
Boosting to a frame in which the object is not at rest, we find
$$
(\Delta x^\mu)^\prime = (\gamma\beta L_0, \gamma L_0, 0, 0).
$$
Now the front and back events don't occur at the same time. We adjust for this, finding the usual formula for length contraction:
$$
L^\prime = \gamma L_0 - \beta \delta t = \gamma L_0 - \beta^2\gamma L_0 = L_0 / \gamma 
$$
In this formula, the primed length $L^\prime$ must be the length in the frame in which the object is not at rest. You can choose a different convention for $O^\prime$ and $O$ if you like, but you cannot change the physics - the length is contracted in the frame in which the object is not at rest.
