| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

HepMC::Flow Class Reference

The particle's flow object keeps track of an arbitrary number of flow patterns within a graph (i.e. More...

#include <Flow.h>

Collaboration diagram for HepMC::Flow:

[legend]
List of all members.

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
Flowoperator= (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
 returns all connected particles which have "code" in any of the num_indices beginning with index code_index.
std::vector< HepMC::GenParticle * > 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.
const GenParticleparticle_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

Private Attributes

GenParticlem_particle_owner
std::map< int, int > m_icode

Friends

std::ostream & operator<< (std::ostream &ostr, const Flow &f)
 for printing

Detailed Description

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.


Member Typedef Documentation

typedef std::map<int,int>::iterator HepMC::Flow::iterator

iterator for flow pattern container

Definition at line 126 of file Flow.h.

typedef std::map<int,int>::const_iterator HepMC::Flow::const_iterator

const iterator for flow pattern container

Definition at line 128 of file Flow.h.


Constructor & Destructor Documentation

HepMC::Flow::Flow ( GenParticle particle_owner = 0  ) 

default constructor

HepMC::Flow::Flow ( const Flow  ) 

copy

virtual HepMC::Flow::~Flow (  )  [virtual]


Member Function Documentation

void HepMC::Flow::swap ( Flow other  ) 

swap

Flow & HepMC::Flow::operator= ( const Flow  )  [inline]

make a copy

copies only the m_icode ... not the particle_owner this is intuitive behaviour so you can do oneparticle->flow() = otherparticle->flow()

Definition at line 201 of file Flow.h.

00201                                                      {
00205         //
00206         m_icode = inflow.m_icode;
00207         return *this;
00208     }

bool HepMC::Flow::operator== ( const Flow a  )  const [inline]

equality

equivalent flows have the same flow codes for all flow_numbers (i.e. their m_icode maps are identical), but they need not have the same m_particle owner

Definition at line 192 of file Flow.h.

00192                                                       {
00196         return (m_icode == a.m_icode);
00197     }

bool HepMC::Flow::operator!= ( const Flow a  )  const [inline]

inequality

Definition at line 198 of file Flow.h.

00198                                                       {
00199         return !( *this == a );
00200     }

void HepMC::Flow::print ( std::ostream &  ostr = std::cout  )  const

print Flow information to ostr

std::vector<HepMC::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.

std::vector<HepMC::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)

const GenParticle * HepMC::Flow::particle_owner (  )  const [inline]

find particle owning this Flow

Definition at line 160 of file Flow.h.

00160                                                          {
00161         return m_particle_owner;
00162     }

int HepMC::Flow::icode ( int  code_index = 1  )  const [inline]

flow code

Definition at line 163 of file Flow.h.

00163                                                  {
00164         std::map<int,int>::const_iterator a = m_icode.find(code_index);
00165         return a==m_icode.end() ? 0 : (*a).second;
00166     }

Flow HepMC::Flow::set_icode ( int  code_index,
int  code 
) [inline]

set flow code

Definition at line 167 of file Flow.h.

00167                                                           {
00168         m_icode[code_index] = code;
00169         return *this;
00170     }

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.

00171                                                      {
00174         m_icode[flow_num] = size_t(this);
00175         return *this;
00176     }

bool HepMC::Flow::empty (  )  const [inline]

return true if there is no flow container

Definition at line 177 of file Flow.h.

00177 { return (bool)m_icode.empty(); }

int HepMC::Flow::size (  )  const [inline]

size of flow pattern container

Definition at line 178 of file Flow.h.

00178 { return (int)m_icode.size(); }

void HepMC::Flow::clear (  )  [inline]

clear flow patterns

Definition at line 179 of file Flow.h.

00179 { m_icode.clear(); }

bool HepMC::Flow::erase ( int  code_index  )  [inline]

empty flow pattern container

Definition at line 180 of file Flow.h.

00180                                             {
00181         return (bool)m_icode.erase( code_index );
00182     }

Flow::iterator HepMC::Flow::begin (  )  [inline]

beginning of flow pattern container

Definition at line 183 of file Flow.h.

00183 { return m_icode.begin(); }

Flow::iterator HepMC::Flow::end (  )  [inline]

end of flow pattern container

Definition at line 184 of file Flow.h.

00184 { return m_icode.end(); }

Flow::const_iterator HepMC::Flow::begin (  )  const [inline]

beginning of flow pattern container

Definition at line 185 of file Flow.h.

00185 { return m_icode.begin(); }

Flow::const_iterator HepMC::Flow::end (  )  const [inline]

end of flow pattern container

Definition at line 186 of file Flow.h.

00186 { return m_icode.end(); }

void HepMC::Flow::connected_partners ( std::vector< HepMC::GenParticle * > *  output,
int  code,
int  code_index,
int  num_indices 
) const [protected]

for internal use only

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


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ostr,
const Flow f 
) [friend]

for printing


Member Data Documentation

GenParticle* HepMC::Flow::m_particle_owner [private]

Definition at line 152 of file Flow.h.

std::map<int,int> HepMC::Flow::m_icode [private]

Definition at line 153 of file Flow.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:56:44 2011 for HepMC by doxygen 1.4.7