![]() |
HepMC Reference DocumentationHepMC |
#include <Flow.h>
Public Types | |
typedef std::map< int, int >::iterator | iterator |
iterator for flow pattern container | |
typedef std::map< int, int >::const_iterator | const_iterator |
const iterator for flow pattern container | |
Public Member Functions | |
Flow (GenParticle *particle_owner=0) | |
default constructor | |
Flow (const Flow &) | |
copy | |
virtual | ~Flow () |
void | swap (Flow &other) |
swap | |
Flow & | operator= (const Flow &) |
make a copy | |
bool | operator== (const Flow &a) const |
equality | |
bool | operator!= (const Flow &a) const |
inequality | |
void | print (std::ostream &ostr=std::cout) const |
print Flow information to ostr | |
std::vector< HepMC::GenParticle * > | connected_partners (int code, int code_index=1, int num_indices=2) const |
std::vector< HepMC::GenParticle * > | dangling_connected_partners (int code, int code_index=1, int num_indices=2) const |
const GenParticle * | particle_owner () const |
find particle owning this Flow | |
int | icode (int code_index=1) const |
flow code | |
Flow | set_icode (int code_index, int code) |
set flow code | |
Flow | set_unique_icode (int code_index=1) |
set unique flow code | |
bool | empty () const |
return true if there is no flow container | |
int | size () const |
size of flow pattern container | |
void | clear () |
clear flow patterns | |
bool | erase (int code_index) |
empty flow pattern container | |
iterator | begin () |
beginning of flow pattern container | |
iterator | end () |
end of flow pattern container | |
const_iterator | begin () const |
beginning of flow pattern container | |
const_iterator | end () const |
end of flow pattern container | |
Protected Member Functions | |
void | connected_partners (std::vector< HepMC::GenParticle * > *output, int code, int code_index, int num_indices) const |
for internal use only | |
void | dangling_connected_partners (std::vector< HepMC::GenParticle * > *output, std::vector< HepMC::GenParticle * > *visited_particles, int code, int code_index, int num_indices) const |
for internal use only | |
Friends | |
std::ostream & | operator<< (std::ostream &ostr, const Flow &f) |
for printing |
The particle's flow object keeps track of an arbitrary number of flow patterns within a graph (i.e. color flow, charge flow, lepton number flow, ...) Flow patterns are coded with an integer, in the same manner as in Herwig.
Definition at line 66 of file Flow.h.
typedef std::map<int,int>::const_iterator HepMC::Flow::const_iterator |
typedef std::map<int,int>::iterator HepMC::Flow::iterator |
HepMC::Flow::Flow | ( | GenParticle * | particle_owner = 0 |
) |
HepMC::Flow::Flow | ( | const Flow & | ) |
Flow::const_iterator HepMC::Flow::begin | ( | ) | const [inline] |
Flow::iterator HepMC::Flow::begin | ( | ) | [inline] |
void HepMC::Flow::connected_partners | ( | std::vector< HepMC::GenParticle * > * | output, | |
int | code, | |||
int | code_index, | |||
int | num_indices | |||
) | const [protected] |
for internal use only
protected: for recursive use by Flow::connected_partners()
Definition at line 60 of file Flow.cc.
References HepMC::GenParticle::end_vertex(), HepMC::family, HepMC::not_in_vector(), p, HepMC::GenVertex::particles_begin(), HepMC::GenVertex::particles_end(), and HepMC::GenParticle::production_vertex().
std::vector< GenParticle * > HepMC::Flow::connected_partners | ( | int | code, | |
int | code_index = 1 , |
|||
int | num_indices = 2 | |||
) | const |
returns all connected particles which have "code" in any of the num_indices beginning with index code_index.
Returns all flow partners which have "code" in any of the num_indices beginning with index code_index. m_particle_owner is included in the result. Return is by value since the set should never be very big. EXAMPLE: if you want to find all flow partners that have the same code in indices 2,3,4 as particle p has in index 2, you would use: set<GenParticle*> result = p->flow().connected_partners(p->flow().icode(2),2,3);
Definition at line 38 of file Flow.cc.
References icode(), and HepMC::detail::output().
void HepMC::Flow::dangling_connected_partners | ( | std::vector< HepMC::GenParticle * > * | output, | |
std::vector< HepMC::GenParticle * > * | visited_particles, | |||
int | code, | |||
int | code_index, | |||
int | num_indices | |||
) | const [protected] |
for internal use only
protected: for recursive use by Flow::dangling_connected_partners
Definition at line 123 of file Flow.cc.
References HepMC::GenParticle::end_vertex(), HepMC::family, HepMC::not_in_vector(), p, HepMC::GenVertex::particles_begin(), HepMC::GenVertex::particles_end(), and HepMC::GenParticle::production_vertex().
std::vector< GenParticle * > HepMC::Flow::dangling_connected_partners | ( | int | code, | |
int | code_index = 1 , |
|||
int | num_indices = 2 | |||
) | const |
same as connected_partners, but returns only those particles which are connected to <=1 other particles (i.e. the flow line "dangles" at these particles)
Definition at line 108 of file Flow.cc.
References icode(), and HepMC::detail::output().
bool HepMC::Flow::empty | ( | ) | const [inline] |
Flow::const_iterator HepMC::Flow::end | ( | ) | const [inline] |
Flow::iterator HepMC::Flow::end | ( | ) | [inline] |
bool HepMC::Flow::erase | ( | int | code_index | ) | [inline] |
empty flow pattern container
Definition at line 180 of file Flow.h.
Referenced by main().
int HepMC::Flow::icode | ( | int | code_index = 1 |
) | const [inline] |
flow code
Definition at line 163 of file Flow.h.
Referenced by connected_partners(), dangling_connected_partners(), and HepMC::GenParticle::flow().
bool HepMC::Flow::operator!= | ( | const Flow & | a | ) | const [inline] |
bool HepMC::Flow::operator== | ( | const Flow & | a | ) | const [inline] |
const GenParticle * HepMC::Flow::particle_owner | ( | ) | const [inline] |
void HepMC::Flow::print | ( | std::ostream & | ostr = std::cout |
) | const |
Flow HepMC::Flow::set_icode | ( | int | code_index, | |
int | code | |||
) | [inline] |
set flow code
Definition at line 167 of file Flow.h.
Referenced by HepMC::detail::read_particle(), and HepMC::GenParticle::set_flow().
Flow HepMC::Flow::set_unique_icode | ( | int | code_index = 1 |
) | [inline] |
set unique flow code
use this method if you want to assign a unique flow code, but do not want the burden of choosing it yourself
Definition at line 171 of file Flow.h.
Referenced by HepMC::GenParticle::set_flow().
int HepMC::Flow::size | ( | ) | const [inline] |
void HepMC::Flow::swap | ( | Flow & | other | ) |
swap
Definition at line 28 of file Flow.cc.
References m_icode, and m_particle_owner.
Referenced by HepMC::GenParticle::swap().
std::ostream& operator<< | ( | std::ostream & | ostr, | |
const Flow & | f | |||
) | [friend] |