Finite time stability and L2 gain analysis for switched linear systems with state-dependent switching