11 #include "HepMC/Search/Filter.h" 13 #include "HepMC/GenEvent.h" 14 #include "HepMC/GenVertex.h" 15 #include "HepMC/GenParticle.h" 36 case STATUS: value = p->status();
break;
37 case PDG_ID: value = p->pid();
break;
38 case ABS_PDG_ID: value = abs( p->pid() );
break;
41 ERROR(
"Unsupported filter ("<<
m_int<<
")" )
45 DEBUG( 10,
"Filter: checking id="<<p->id()<<
" param="<<
m_int<<
" operator="<<
m_operator<<
" value="<<value<<
" compare to="<<
m_int_value )
64 DEBUG( 10,
"Filter: checking id="<<p->id()<<
" param="<<
m_bool<<
" value="<<
m_bool_value<<
" (bool)" )
67 case HAS_END_VERTEX: result = (bool) p->end_vertex();
break;
68 case HAS_PRODUCTION_VERTEX: result = (bool) p->production_vertex();
break;
69 case HAS_SAME_PDG_ID_DAUGHTER:
70 buf = p->end_vertex();
76 if( buf->particles_out().size() == 0 ) {
83 if( p_out->pid() == p->pid() ) {
90 case IS_STABLE: result = (bool) (p->status() == 1);
break;
91 case IS_BEAM: result = (bool) (p->status() == 4);
break;
108 case ATTRIBUTE_EXISTS: ret = (attribute.length() > 0);
break;
109 case ATTRIBUTE_IS_EQUAL: ret = (
m_attribute_str.compare(attribute) == 0);
break;
bool m_bool_value
Filter parameter for boolean-type filter.
FilterParamType m_value_type
Parameter type.
FilterBoolParam m_bool
Boolean value (if boolean parameter type)
bool passed_attribute_filter(const GenParticlePtr &p) const
Filter::passed_filter helper for attribute-type filters.
FilterOperator m_operator
Operator used by filter.
Smart pointer for HepMC objects.
bool passed_bool_filter(const GenParticlePtr &p) const
Filter::passed_filter helper for pointer-type filters.
bool passed_int_filter(const GenParticlePtr &p) const
Filter::passed_filter helper for integer-type filters.
FilterAttributeParam m_attribute
Attribute value (if attribute parameter type)
FilterIntegerParam m_int
Integer value (if integer parameter type)
string m_attribute_str
Filter parameter for attribute-type filters.
bool passed_filter(const GenParticlePtr &p) const
Check if HepMC::GenParticle passed this filter.
string m_attribute_name
Filter parameter for attribute-type filters.
int m_int_value
Filter parameter for integer-type filter.
Definition of template class SmartPointer.