/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Classes | Public Member Functions | Protected Member Functions | Private Attributes | Friends
HepMC::GenEvent Class Reference

The GenEvent class is the core of HepMC. More...

#include <GenEvent.h>

Collaboration diagram for HepMC::GenEvent:
Collaboration graph
[legend]

List of all members.

Classes

class  particle_const_iterator
 const particle iterator More...
class  particle_iterator
 non-const particle iterator More...
class  vertex_const_iterator
 const vertex iterator More...
class  vertex_iterator
 non-const vertex iterator More...

Public Member Functions

 GenEvent (int signal_process_id=0, int event_number=0, GenVertex *signal_vertex=0, const WeightContainer &weights=std::vector< double >(), const std::vector< long > &randomstates=std::vector< long >())
 default constructor creates null pointers to HeavyIon and PdfInfo
 GenEvent (int signal_process_id, int event_number, GenVertex *signal_vertex, const WeightContainer &weights, const std::vector< long > &randomstates, const HeavyIon &ion, const PdfInfo &pdf)
 explicit constructor that takes HeavyIon and PdfInfo
 GenEvent (const GenEvent &inevent)
 deep copy
GenEventoperator= (const GenEvent &inevent)
 make a deep copy
virtual ~GenEvent ()
 deletes all vertices/particles in this evt
void swap (GenEvent &other)
 swap
void print (std::ostream &ostr=std::cout) const
 dumps to ostr
void print_version (std::ostream &ostr=std::cout) const
 dumps release version to ostr
GenParticlebarcode_to_particle (int barCode) const
 assign a barcode to a particle
GenVertexbarcode_to_vertex (int barCode) const
 assign a barcode to a vertex
int signal_process_id () const
 unique signal process id
int event_number () const
 event number
int mpi () const
 number of multi parton interactions
double event_scale () const
 energy scale, see hep-ph/0109068
double alphaQCD () const
 QCD coupling, see hep-ph/0109068.
double alphaQED () const
 QED coupling, see hep-ph/0109068.
GenVertexsignal_process_vertex () const
 pointer to the vertex containing the signal process
bool valid_beam_particles () const
 test to see if we have two valid beam particles
std::pair< HepMC::GenParticle
*, HepMC::GenParticle * > 
beam_particles () const
 pair of pointers to the two incoming beam particles
WeightContainerweights ()
 direct access to the weights container is allowed.
const WeightContainerweights () const
 direct access to WeightContainer
HeavyIon const * heavy_ion () const
 access the HeavyIon container if it exists
HeavyIonheavy_ion ()
PdfInfo const * pdf_info () const
 access the PdfInfo container if it exists
PdfInfopdf_info ()
std::vector< long > random_states () const
 vector of integers containing information about the random state
void set_signal_process_id (int id)
 set unique signal process id
void set_event_number (int eventno)
 set event number
void set_mpi (int)
 set number of multi parton interactions
void set_event_scale (double scale)
 set energy scale
void set_alphaQCD (double a)
 set QCD coupling
void set_alphaQED (double a)
 set QED coupling
void set_signal_process_vertex (GenVertex *)
 set pointer to the vertex containing the signal process
bool set_beam_particles (GenParticle *, GenParticle *)
 set incoming beam particles
bool set_beam_particles (std::pair< HepMC::GenParticle *, HepMC::GenParticle * > const &)
 use a pair of GenParticle*'s to set incoming beam particles
void set_random_states (const std::vector< long > &randomstates)
 provide random state information
void set_heavy_ion (const HeavyIon &ion)
 provide a pointer to the HeavyIon container
void set_pdf_info (const PdfInfo &p)
 provide a pointer to the PdfInfo container
int particles_size () const
 how many particle barcodes exist?
bool particles_empty () const
 return true if there are no particle barcodes
int vertices_size () const
 how many vertex barcodes exist?
bool vertices_empty () const
 return true if there are no vertex barcodes
bool add_vertex (GenVertex *vtx)
 adds to evt and adopts
bool remove_vertex (GenVertex *vtx)
 erases vtx from evt
void clear ()
 empties the entire event
vertex_const_iterator vertices_begin () const
 begin vertex iteration
vertex_const_iterator vertices_end () const
 end vertex iteration
vertex_iterator vertices_begin ()
 begin vertex iteration
vertex_iterator vertices_end ()
 end vertex iteration
particle_const_iterator particles_begin () const
 begin particle iteration
particle_const_iterator particles_end () const
 end particle iteration
particle_iterator particles_begin ()
 begin particle iteration
particle_iterator particles_end ()
 end particle iteration

Protected Member Functions

bool set_barcode (GenParticle *p, int suggested_barcode=0)
 set the barcode - intended for use by GenParticle
bool set_barcode (GenVertex *v, int suggested_barcode=0)
 set the barcode - intended for use by GenVertex
void remove_barcode (GenParticle *p)
 intended for use by GenParticle
void remove_barcode (GenVertex *v)
 intended for use by GenVertex
void delete_all_vertices ()
 delete all vertices owned by this event

Private Attributes

int m_signal_process_id
int m_event_number
int m_mpi
double m_event_scale
double m_alphaQCD
double m_alphaQED
GenVertexm_signal_process_vertex
GenParticlem_beam_particle_1
GenParticlem_beam_particle_2
WeightContainer m_weights
std::vector< long > m_random_states
std::map< int,
HepMC::GenVertex
*, std::greater< int > > 
m_vertex_barcodes
std::map< int,
HepMC::GenParticle
*, std::less< int > > 
m_particle_barcodes
HeavyIonm_heavy_ion
PdfInfom_pdf_info

Friends

class GenParticle
class GenVertex
class vertex_const_iterator
class vertex_iterator
class particle_const_iterator
class particle_iterator

Detailed Description

The GenEvent class is the core of HepMC.

HepMC::GenEvent contains information about generated particles. GenEvent is structured as a set of vertices which contain the particles.

Definition at line 142 of file GenEvent.h.


Constructor & Destructor Documentation

HepMC::GenEvent::GenEvent ( int  signal_process_id = 0,
int  event_number = 0,
GenVertex signal_vertex = 0,
const WeightContainer weights = std::vector< double >(),
const std::vector< long > &  randomstates = std::vector< long >() 
)

default constructor creates null pointers to HeavyIon and PdfInfo

HepMC::GenEvent::GenEvent ( int  signal_process_id,
int  event_number,
GenVertex signal_vertex,
const WeightContainer weights,
const std::vector< long > &  randomstates,
const HeavyIon ion,
const PdfInfo pdf 
)

explicit constructor that takes HeavyIon and PdfInfo

HepMC::GenEvent::GenEvent ( const GenEvent inevent)

deep copy

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

deletes all vertices/particles in this evt


Member Function Documentation

GenEvent& HepMC::GenEvent::operator= ( const GenEvent inevent)

make a deep copy

void HepMC::GenEvent::swap ( GenEvent other)

swap

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

dumps to ostr

void HepMC::GenEvent::print_version ( std::ostream &  ostr = std::cout) const

dumps release version to ostr

GenParticle * HepMC::GenEvent::barcode_to_particle ( int  barCode) const [inline]

assign a barcode to a particle

Each vertex or particle has a barcode, which is just an integer which uniquely identifies it inside the event (i.e.

there is a one to one mapping between particle memory addresses and particle barcodes... and the same applied for vertices).

The value of a barcode has NO MEANING and NO ORDER! For the user's convenience, when an event is read in via an IO_method from an indexed list (like the HEPEVT common block), then the index will become the barcode for that particle.

Particle barcodes are always positive integers. The barcodes are chosen and set automatically when a vertex or particle comes under the ownership of an event (i.e. it is contained in an event).

Definition at line 618 of file GenEvent.h.

    { 
        std::map<int,HepMC::GenParticle*>::const_iterator i 
            = m_particle_barcodes.find(barCode);
        return ( i != m_particle_barcodes.end() ) ? (*i).second : 0;
    }
GenVertex * HepMC::GenEvent::barcode_to_vertex ( int  barCode) const [inline]

assign a barcode to a vertex

Each vertex or particle has a barcode, which is just an integer which uniquely identifies it inside the event (i.e.

there is a one to one mapping between particle memory addresses and particle barcodes... and the same applied for vertices).

The value of a barcode has NO MEANING and NO ORDER! For the user's convenience, when an event is read in via an IO_method from an indexed list (like the HEPEVT common block), then the index will become the barcode for that particle.

Vertex barcodes are always negative integers. The barcodes are chosen and set automatically when a vertex or particle comes under the ownership of an event (i.e. it is contained in an event).

Definition at line 638 of file GenEvent.h.

    {
        std::map<int,GenVertex*,std::greater<int> >::const_iterator i 
            = m_vertex_barcodes.find(barCode);
        return ( i != m_vertex_barcodes.end() ) ? (*i).second : 0;
    }
int HepMC::GenEvent::signal_process_id ( ) const [inline]

unique signal process id

The integer ID that uniquely specifies this signal process, i.e.

MSUB in Pythia. It is necessary to package this with each event rather than with the run because many processes may be generated within one run.

Definition at line 522 of file GenEvent.h.

    { return m_signal_process_id; }
int HepMC::GenEvent::event_number ( ) const [inline]

event number

Definition at line 525 of file GenEvent.h.

{ return m_event_number; }
int HepMC::GenEvent::mpi ( ) const [inline]

number of multi parton interactions

Returns the number of multi parton interactions in the event.

This number is -1 if it is not set.

Definition at line 529 of file GenEvent.h.

{ return m_mpi; }
double HepMC::GenEvent::event_scale ( ) const [inline]

energy scale, see hep-ph/0109068

Definition at line 531 of file GenEvent.h.

{ return m_event_scale; }
double HepMC::GenEvent::alphaQCD ( ) const [inline]

QCD coupling, see hep-ph/0109068.

Definition at line 533 of file GenEvent.h.

{ return m_alphaQCD; }
double HepMC::GenEvent::alphaQED ( ) const [inline]

QED coupling, see hep-ph/0109068.

Definition at line 535 of file GenEvent.h.

{ return m_alphaQED; }
GenVertex * HepMC::GenEvent::signal_process_vertex ( ) const [inline]

pointer to the vertex containing the signal process

returns a (mutable) pointer to the signal process vertex

Definition at line 537 of file GenEvent.h.

bool HepMC::GenEvent::valid_beam_particles ( ) const

test to see if we have two valid beam particles

std::pair< HepMC::GenParticle *, HepMC::GenParticle * > HepMC::GenEvent::beam_particles ( ) const [inline]

pair of pointers to the two incoming beam particles

Definition at line 659 of file GenEvent.h.

                                                                                         {
        return std::pair<GenParticle *,GenParticle *> (m_beam_particle_1, m_beam_particle_2);
    }
WeightContainer & HepMC::GenEvent::weights ( ) [inline]

direct access to the weights container is allowed.

Thus you can use myevt.weights()[2]; to access element 2 of the weights. or use myevt.weights().push_back( mywgt ); to add an element. and you can set the weights with myevt.weights() = myvector; direct access to WeightContainer

Definition at line 542 of file GenEvent.h.

{ return m_weights; }
const WeightContainer & HepMC::GenEvent::weights ( ) const [inline]

direct access to WeightContainer

Definition at line 544 of file GenEvent.h.

    { return m_weights; }
HeavyIon const * HepMC::GenEvent::heavy_ion ( ) const [inline]

access the HeavyIon container if it exists

Definition at line 547 of file GenEvent.h.

    { return m_heavy_ion; }
HeavyIon * HepMC::GenEvent::heavy_ion ( ) [inline]

Definition at line 550 of file GenEvent.h.

    { return m_heavy_ion; }
PdfInfo const * HepMC::GenEvent::pdf_info ( ) const [inline]

access the PdfInfo container if it exists

Definition at line 553 of file GenEvent.h.

    { return m_pdf_info; }
PdfInfo * HepMC::GenEvent::pdf_info ( ) [inline]

Definition at line 556 of file GenEvent.h.

    { return m_pdf_info; }
std::vector< long > HepMC::GenEvent::random_states ( ) const [inline]

vector of integers containing information about the random state

Vector of integers which specify the random number generator's state for this event.

It is left to the generator to make use of this. We envision a vector of RndmStatesTags to be included with a run class which would specify the meaning of the random_states.

Definition at line 564 of file GenEvent.h.

    { return m_random_states; }
void HepMC::GenEvent::set_signal_process_id ( int  id) [inline]

set unique signal process id

Definition at line 567 of file GenEvent.h.

void HepMC::GenEvent::set_event_number ( int  eventno) [inline]

set event number

Definition at line 570 of file GenEvent.h.

    { m_event_number = eventno; }
void HepMC::GenEvent::set_mpi ( int  nmpi) [inline]

set number of multi parton interactions

Use this to set the number of multi parton interactions in each event.

Definition at line 574 of file GenEvent.h.

    { m_mpi = nmpi; }
void HepMC::GenEvent::set_event_scale ( double  scale) [inline]

set energy scale

Definition at line 578 of file GenEvent.h.

{ m_event_scale = sc; }
void HepMC::GenEvent::set_alphaQCD ( double  a) [inline]

set QCD coupling

Definition at line 580 of file GenEvent.h.

{ m_alphaQCD = a; }
void HepMC::GenEvent::set_alphaQED ( double  a) [inline]

set QED coupling

Definition at line 582 of file GenEvent.h.

{ m_alphaQED = a; }
void HepMC::GenEvent::set_signal_process_vertex ( GenVertex vtx) [inline]

set pointer to the vertex containing the signal process

Definition at line 584 of file GenEvent.h.

bool HepMC::GenEvent::set_beam_particles ( GenParticle ,
GenParticle  
)

set incoming beam particles

bool HepMC::GenEvent::set_beam_particles ( std::pair< HepMC::GenParticle *, HepMC::GenParticle * > const &  )

use a pair of GenParticle*'s to set incoming beam particles

void HepMC::GenEvent::set_random_states ( const std::vector< long > &  randomstates) [inline]

provide random state information

Definition at line 595 of file GenEvent.h.

    { m_random_states = randomstates; }
void HepMC::GenEvent::set_heavy_ion ( const HeavyIon ion) [inline]

provide a pointer to the HeavyIon container

Definition at line 589 of file GenEvent.h.

    { m_heavy_ion = new HeavyIon(ion); }
void HepMC::GenEvent::set_pdf_info ( const PdfInfo p) [inline]

provide a pointer to the PdfInfo container

Definition at line 592 of file GenEvent.h.

    { m_pdf_info = new PdfInfo(p); }
int HepMC::GenEvent::particles_size ( ) const [inline]

how many particle barcodes exist?

Definition at line 645 of file GenEvent.h.

                                              {
        return (int)m_particle_barcodes.size();
    }
bool HepMC::GenEvent::particles_empty ( ) const [inline]

return true if there are no particle barcodes

Definition at line 648 of file GenEvent.h.

                                                {
        return (bool)m_particle_barcodes.empty();
    }
int HepMC::GenEvent::vertices_size ( ) const [inline]

how many vertex barcodes exist?

Definition at line 651 of file GenEvent.h.

                                             {
        return (int)m_vertex_barcodes.size();
    }
bool HepMC::GenEvent::vertices_empty ( ) const [inline]

return true if there are no vertex barcodes

Definition at line 654 of file GenEvent.h.

                                               {
        return (bool)m_vertex_barcodes.empty();
    }
bool HepMC::GenEvent::add_vertex ( GenVertex vtx)

adds to evt and adopts

bool HepMC::GenEvent::remove_vertex ( GenVertex vtx)

erases vtx from evt

void HepMC::GenEvent::clear ( )

empties the entire event

vertex_const_iterator HepMC::GenEvent::vertices_begin ( ) const [inline]

begin vertex iteration

Definition at line 294 of file GenEvent.h.

vertex_const_iterator HepMC::GenEvent::vertices_end ( ) const [inline]

end vertex iteration

Definition at line 298 of file GenEvent.h.

vertex_iterator HepMC::GenEvent::vertices_begin ( ) [inline]

begin vertex iteration

Definition at line 351 of file GenEvent.h.

vertex_iterator HepMC::GenEvent::vertices_end ( ) [inline]

end vertex iteration

Definition at line 355 of file GenEvent.h.

particle_const_iterator HepMC::GenEvent::particles_begin ( ) const [inline]

begin particle iteration

Definition at line 413 of file GenEvent.h.

particle_const_iterator HepMC::GenEvent::particles_end ( ) const [inline]

end particle iteration

Definition at line 417 of file GenEvent.h.

particle_iterator HepMC::GenEvent::particles_begin ( ) [inline]

begin particle iteration

Definition at line 466 of file GenEvent.h.

particle_iterator HepMC::GenEvent::particles_end ( ) [inline]

end particle iteration

Definition at line 470 of file GenEvent.h.

bool HepMC::GenEvent::set_barcode ( GenParticle p,
int  suggested_barcode = 0 
) [protected]

set the barcode - intended for use by GenParticle

bool HepMC::GenEvent::set_barcode ( GenVertex v,
int  suggested_barcode = 0 
) [protected]

set the barcode - intended for use by GenVertex

void HepMC::GenEvent::remove_barcode ( GenParticle p) [inline, protected]

intended for use by GenParticle

Definition at line 599 of file GenEvent.h.

    { m_particle_barcodes.erase( p->barcode() ); }
void HepMC::GenEvent::remove_barcode ( GenVertex v) [inline, protected]

intended for use by GenVertex

Definition at line 602 of file GenEvent.h.

    { m_vertex_barcodes.erase( v->barcode() ); }
void HepMC::GenEvent::delete_all_vertices ( ) [protected]

delete all vertices owned by this event


Friends And Related Function Documentation

friend class GenParticle [friend]

Definition at line 143 of file GenEvent.h.

friend class GenVertex [friend]

Definition at line 144 of file GenEvent.h.

friend class vertex_const_iterator [friend]

Definition at line 292 of file GenEvent.h.

friend class vertex_iterator [friend]

Definition at line 349 of file GenEvent.h.

friend class particle_const_iterator [friend]

Definition at line 411 of file GenEvent.h.

friend class particle_iterator [friend]

Definition at line 464 of file GenEvent.h.


Member Data Documentation

Definition at line 492 of file GenEvent.h.

Definition at line 493 of file GenEvent.h.

int HepMC::GenEvent::m_mpi [private]

Definition at line 494 of file GenEvent.h.

Definition at line 495 of file GenEvent.h.

double HepMC::GenEvent::m_alphaQCD [private]

Definition at line 496 of file GenEvent.h.

double HepMC::GenEvent::m_alphaQED [private]

Definition at line 497 of file GenEvent.h.

Definition at line 498 of file GenEvent.h.

Definition at line 499 of file GenEvent.h.

Definition at line 500 of file GenEvent.h.

Definition at line 501 of file GenEvent.h.

std::vector<long> HepMC::GenEvent::m_random_states [private]

Definition at line 503 of file GenEvent.h.

std::map< int,HepMC::GenVertex*,std::greater<int> > HepMC::GenEvent::m_vertex_barcodes [private]

Definition at line 506 of file GenEvent.h.

std::map< int,HepMC::GenParticle*,std::less<int> > HepMC::GenEvent::m_particle_barcodes [private]

Definition at line 507 of file GenEvent.h.

Definition at line 508 of file GenEvent.h.

Definition at line 509 of file GenEvent.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 Fri May 16 2014 09:49:37 for HepMC by doxygen 1.7.4