Hide if Custom Post Type is empty

hide div tag if Custom Post Type is empty

<?php 
$query = new WP_Query( array( 'post_type' => 'tour' ) );  
$postnum = 0;                
if ( $query->have_posts() ) : ?>
    <div id="tour" class="block" style="margin-top: 50% !important;">
        <h3 class="block">tour > </h3>
        <div class="row events">

            <?php while ( $query->have_posts() ) : $query->the_post(); ?>
            <div class="col-sm-4 text-left event-cell isold">
            <h3><?php the_title(); ?></h3>
            <h4>Date: <?php echo get_post_meta($post->ID, 'eventdate', true); ?></h4>
            <h4><?php echo get_post_meta($post->ID, 'eventlocation', true); ?><br/>Starts at: <?php echo get_post_meta($post->ID, 'eventtime', true); ?></h4>
            <div>/////////////////////<br/>
            <?php echo get_post_meta($post->ID, 'eventtype', true); ?></div>
            </div>
            <?php $postnum++; // Increment counter
            if ($postnum == 3){ ?>
            <div class="clearfix hidden-xs"></div>
            <?php } ?>
            <?php endwhile;?>
       </div>
    </div>
<?php else : ?>
<?php endif; ?>