How to get the status of Backfill /Recalculate when the Analysis runs successfully via C# code?

 


image.png.png
There are around 25- 28 Analysis I am running in a loop on a single PI AF server, so once the first loop gets executed, I have to check the status if is completed or have error and also to log how many events processed. After logging the current loop results, it should run another analysis. How can I achieve this functionality with C# code?