{% if Product.format is constant('\\Entity\\Master\\Format::MAGAZINE') %}
or
{% if Product.format == constant('\\Entity\\Master\\Format::MAGAZINE') %}