The Quality Assessment (QA) band is an important addition to Landsat data files. Each pixel in the QA band contains integers that represent bit-packed combinations of surface, atmosphere, and sensor conditions that can affect the overall usefulness of a given pixel. Landsat 8 Level 1 data products include a 16-bit QA file (.TIF), of which Bit 12-13 could be cirrus cloud and Bit 14-15 are cloudy pixels. Certain values occur regularly and can be interpreted without unpacking them into 16-bit strings and using as a reference. In general, the value from 36864 to 39936 may be cloud, from 53248 to 61440 are cloudy values.
so we used these values and negative value of TIR Band (Band 10) to create cloudy mask with main aim is removing cloud and cirrus cloud.