Warning, /include/ThePEG/EventRecord/Particle.tcc is written in an unsupported language. File is not indexed.
0001 // -*- C++ -*-
0002 //
0003 // Particle.tcc is a part of ThePEG - Toolkit for HEP Event Generation
0004 // Copyright (C) 1999-2019 Leif Lonnblad
0005 //
0006 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 //
0010 // This is the implementation of the templated member functions of
0011 // the Particle class.
0012 //
0013
0014
0015 namespace ThePEG {
0016
0017 struct ParticleNumLess {
0018 bool operator() (tPPtr p1, tPPtr p2) const
0019 { return p1->number() < p2->number(); }
0020 };
0021
0022 template <typename Iterator>
0023 void Particle::
0024 PrintParticles(ostream & os, Iterator first, Iterator last, tcStepPtr step) {
0025 typedef multiset<PPtr,ParticleNumLess> NumSet;
0026 NumSet pset(first, last);
0027 for ( NumSet::iterator i = pset.begin(); i != pset.end(); ++i )
0028 (**i).print(os, step);
0029 }
0030
0031 template <typename Iterator>
0032 typename std::iterator_traits<Iterator>::value_type Particle::
0033 colourNeighbour(Iterator first, Iterator last, bool anti) const {
0034 if ( !hasColourInfo() || !hasColour(!anti) ) return tPPtr();
0035 tColinePtr line = colourLine(!anti);
0036 for ( ; first != last; ++first )
0037 if ( (**first).hasColourInfo() && (**first).hasColourLine(line, anti) )
0038 return *first;
0039 return tPPtr();
0040 }
0041
0042 }
0043