how to call the category of the post

Well first off, that code’s a mess to read, some formatting would definitely help get you an answer. That said, here’s the documentation on WP_Query and some sample code to boot

$args = array(
    'post_status' => 'publish',
    'tax_query'   => array(
        array(
            'taxonomy' => 'category',
            'field'    => 'slug',
            'terms'    => 'your_cat_slug'
        )
    ) 
);
$posts = new WP_Query( $args );

I’ve used ‘tax_query’ rather than ‘category_name’ because I feel it is more flexible while being more understandable (and thus easy to use) at the same time, if you have any issues with understanding the code, read the documentation, WP_Query is SO well documented it’s crazy.

edit

Updated code

$cats = array();
foreach( get_the_category() as $cat ) {
    $cats[] = $cat->cat_ID;
}
$args = array(
    'post_status'    => 'publish',
    'posts_per_page' => -1,
    'tax_query' => array(
        array(
            'taxonomy'         => 'category',
            'field'            => 'id',
            'terms'            => $cats,
            'include_children' => false
        )
    )
);
print_r( WP_Query( $args ) as $post );