23 template <
typename NUM>
24 inline NUM
sqr(NUM x) {
return x*x; }
31 ANCESTORS = 0, FIND_ANCESTORS = 0, FIND_ALL_ANCESTORS = 0, ancestors = 0,
32 DESCENDANTS = 1, FIND_DESCENDANTS = 1, FIND_ALL_DESCENDANTS = 1, descendants = 1,
33 PARENTS = 2, FIND_PARENTS = 2, FIND_MOTHERS = 2, parents = 2,
34 CHILDREN = 3, FIND_CHILDREN = 3, FIND_DAUGHTERS = 3, children = 3,
35 PRODUCTION_SIBLINGS = 4, FIND_PRODUCTION_SIBLINGS = 4
40 #ifndef HEPMC_NO_DEPRECATED 49 #if __cplusplus >= 201103L 50 #define HEPMC_HAS_CXX11 52 #if !defined(HEPMC_HAS_CXX11) && (__GNUC__) && (__cplusplus) && (__GXX_EXPERIMENTAL_CXX0X__) 53 #define HEPMC_HAS_CXX0X_GCC_ONLY 58 #ifdef HEPMC_HAS_CXX11 59 #define FOREACH( iterator, container ) for ( iterator: container ) 61 #if !defined(__CINT__) 82 namespace foreach_detail {
89 operator bool()
const {
return false; }
109 auto_any<typename T::const_iterator> begin(T
const& t)
115 auto_any<typename T::const_iterator> end(T
const& t)
122 bool done(auto_any_base
const& cur, auto_any_base
const& end, T&)
124 typedef typename T::iterator iter_type;
125 return auto_any_cast<iter_type>(cur) == auto_any_cast<iter_type>(end);
129 void next(auto_any_base
const& cur, T&)
131 ++auto_any_cast<
typename T::iterator>(cur);
135 typename T::reference deref(auto_any_base
const& cur, T&)
137 return *auto_any_cast<
typename T::iterator>(cur);
145 #define FOREACH(item, container) \ 146 if(hepmc_embedded_boost::foreach_detail::auto_any_base const& b = hepmc_embedded_boost::foreach_detail::begin(container)) {} else \ 147 if(hepmc_embedded_boost::foreach_detail::auto_any_base const& e = hepmc_embedded_boost::foreach_detail::end(container)) {} else \ 148 for(;!hepmc_embedded_boost::foreach_detail::done(b,e,container); hepmc_embedded_boost::foreach_detail::next(b,container)) \ 149 if (bool ugly_and_unique_break = false) {} else \ 150 for(item = hepmc_embedded_boost::foreach_detail::deref(b,container); !ugly_and_unique_break; ugly_and_unique_break = true) 158 #ifndef HEPMC_DEPRECATED 159 #define HEPMC_DEPRECATED(x) Neater/extensible C++11 availability test.
NUM sqr(NUM x)
Handy number squaring function.
Definition of template class SmartPointer.
Relationship
List of methods of searching starting from a particle or vertex.