![]() |
HepMC Reference DocumentationHepMC |
#include <GenParticle.h>
Public Member Functions | |
GenParticle (void) | |
default constructor | |
GenParticle (const FourVector &momentum, int pdg_id, int status=0, const Flow &itsflow=Flow(), const Polarization &polar=Polarization(0, 0)) | |
constructor requires momentum and particle ID | |
GenParticle (const GenParticle &inparticle) | |
shallow copy. | |
virtual | ~GenParticle () |
void | swap (GenParticle &other) |
swap | |
GenParticle & | operator= (const GenParticle &inparticle) |
bool | operator== (const GenParticle &) const |
check for equality | |
bool | operator!= (const GenParticle &) const |
check for inequality | |
void | print (std::ostream &ostr=std::cout) const |
dump this particle's full info to ostr | |
operator HepMC::FourVector () const | |
conversion operator | |
FourVector | momentum () const |
standard 4 momentum | |
int | pdg_id () const |
particle ID | |
int | status () const |
HEPEVT decay status. | |
Flow | flow () const |
particle flow | |
int | flow (int code_index) const |
particle flow index | |
Polarization | polarization () const |
polarization information | |
GenVertex * | production_vertex () const |
pointer to the production vertex | |
GenVertex * | end_vertex () const |
pointer to the decay vertex | |
GenEvent * | parent_event () const |
pointer to the event that owns this particle | |
double | generated_mass () const |
mass as generated | |
double | generatedMass () const |
generatedMass() is included for backwards compatibility with CLHEP HepMC | |
int | barcode () const |
particle barcode | |
bool | suggest_barcode (int the_bar_code) |
In general there is no reason to "suggest_barcode". | |
void | set_momentum (const FourVector &vec4) |
set standard 4 momentum | |
void | set_pdg_id (int id) |
set particle ID | |
void | set_status (int status=0) |
set decay status | |
void | set_flow (const Flow &f) |
set particle flow | |
void | set_flow (int code_index, int code=0) |
void | set_polarization (const Polarization &pol=Polarization(0, 0)) |
set polarization | |
void | set_generated_mass (const double &m) |
define the actual generated mass | |
void | setGeneratedMass (const double &m) |
setGeneratedMass() is included for backwards compatibility with CLHEP HepMC | |
Protected Member Functions | |
void | set_production_vertex_ (GenVertex *productionvertex=0) |
set production vertex | |
void | set_end_vertex_ (GenVertex *decayvertex=0) |
set decay vertex | |
void | set_barcode_ (int the_bar_code) |
for use by GenEvent only | |
Friends | |
class | GenVertex |
class | GenEvent |
std::ostream & | operator<< (std::ostream &, const GenParticle &) |
print particle |
HepMC::GenParticle contains momentum, generated mass, particle ID, decay status, flow, polarization, pointers to production and decay vertices and a unique barcode identfier.
example_BuildEventFromScratch.cc, and example_UsingIterators.cc.
Definition at line 55 of file GenParticle.h.
HepMC::GenParticle::GenParticle | ( | void | ) |
HepMC::GenParticle::GenParticle | ( | const FourVector & | momentum, | |
int | pdg_id, | |||
int | status = 0 , |
|||
const Flow & | itsflow = Flow() , |
|||
const Polarization & | polar = Polarization(0, 0) | |||
) |
constructor requires momentum and particle ID
Definition at line 23 of file GenParticle.cc.
References set_flow().
HepMC::GenParticle::GenParticle | ( | const GenParticle & | inparticle | ) |
shallow copy.
Shallow copy: does not copy the vertex pointers (note - impossible to copy vertex pointers which having the vertex and particles in/out point-back to one another -- unless you copy the entire tree -- which we don't want to do)
Definition at line 37 of file GenParticle.cc.
References barcode(), set_end_vertex_(), set_production_vertex_(), and suggest_barcode().
HepMC::GenParticle::~GenParticle | ( | ) | [virtual] |
Definition at line 58 of file GenParticle.cc.
References parent_event(), and HepMC::GenEvent::remove_barcode().
void HepMC::GenParticle::swap | ( | GenParticle & | other | ) |
swap
Definition at line 63 of file GenParticle.cc.
References m_barcode, m_end_vertex, m_flow, m_generated_mass, m_momentum, m_pdg_id, m_polarization, m_production_vertex, m_status, HepMC::Polarization::swap(), HepMC::Flow::swap(), and HepMC::FourVector::swap().
Referenced by operator=().
GenParticle & HepMC::GenParticle::operator= | ( | const GenParticle & | inparticle | ) |
shallow.
Shallow: does not copy the vertex pointers (note - impossible to copy vertex pointers which having the vertex and particles in/out point-back to one another -- unless you copy the entire tree -- which we don't want to do)
Definition at line 77 of file GenParticle.cc.
References swap().
bool HepMC::GenParticle::operator== | ( | const GenParticle & | ) | const |
check for equality
consistent with the definition of the copy constructor as a shallow constructor,.. this operator does not test the vertex pointers. Does not compare barcodes.
Definition at line 89 of file GenParticle.cc.
References generated_mass(), m_flow, momentum(), pdg_id(), polarization(), and status().
bool HepMC::GenParticle::operator!= | ( | const GenParticle & | ) | const |
void HepMC::GenParticle::print | ( | std::ostream & | ostr = std::cout |
) | const |
dump this particle's full info to ostr
Dump this particle's full info to ostr, where by default particle.print(); will dump to cout.
Definition at line 106 of file GenParticle.cc.
References HepMC::GenVertex::barcode(), barcode(), HepMC::FourVector::e(), end_vertex(), momentum(), pdg_id(), polarization(), production_vertex(), HepMC::FourVector::px(), HepMC::FourVector::py(), HepMC::FourVector::pz(), and status().
HepMC::GenParticle::operator HepMC::FourVector | ( | ) | const [inline] |
FourVector HepMC::GenParticle::momentum | ( | ) | const [inline] |
standard 4 momentum
Definition at line 174 of file GenParticle.h.
Referenced by HepMC::operator<<(), operator==(), and print().
int HepMC::GenParticle::pdg_id | ( | ) | const [inline] |
particle ID
Definition at line 177 of file GenParticle.h.
Referenced by HepMC::operator<<(), operator==(), and print().
int HepMC::GenParticle::status | ( | ) | const [inline] |
HEPEVT decay status.
Definition at line 179 of file GenParticle.h.
Referenced by HepMC::operator<<(), operator==(), and print().
Flow HepMC::GenParticle::flow | ( | ) | const [inline] |
int HepMC::GenParticle::flow | ( | int | code_index | ) | const [inline] |
Polarization HepMC::GenParticle::polarization | ( | ) | const [inline] |
polarization information
Definition at line 191 of file GenParticle.h.
Referenced by operator==(), and print().
GenVertex * HepMC::GenParticle::production_vertex | ( | ) | const [inline] |
pointer to the production vertex
Definition at line 181 of file GenParticle.h.
Referenced by HepMC::GenVertex::add_particle_out(), HepMC::Flow::connected_partners(), HepMC::Flow::dangling_connected_partners(), parent_event(), print(), and HepMC::GenVertex::remove_particle().
GenVertex * HepMC::GenParticle::end_vertex | ( | ) | const [inline] |
pointer to the decay vertex
Definition at line 184 of file GenParticle.h.
Referenced by HepMC::GenVertex::add_particle_in(), HepMC::Flow::connected_partners(), HepMC::Flow::dangling_connected_partners(), HepMC::operator<<(), parent_event(), print(), and HepMC::GenVertex::remove_particle().
GenEvent * HepMC::GenParticle::parent_event | ( | ) | const |
pointer to the event that owns this particle
Definition at line 123 of file GenParticle.cc.
References end_vertex(), HepMC::GenVertex::parent_event(), and production_vertex().
Referenced by set_end_vertex_(), set_production_vertex_(), suggest_barcode(), and ~GenParticle().
double HepMC::GenParticle::generated_mass | ( | ) | const |
mass as generated
Because of precision issues, the generated mass is not always the same as the mass calculated from the momentum 4 vector. If the generated mass has been set, then generated_mass() returns that value. If the generated mass has not been set, then generated_mass() returns the mass calculated from the momentum 4 vector.
Definition at line 233 of file GenParticle.cc.
Referenced by generatedMass(), and operator==().
double HepMC::GenParticle::generatedMass | ( | ) | const [inline] |
generatedMass() is included for backwards compatibility with CLHEP HepMC
Definition at line 116 of file GenParticle.h.
References generated_mass().
int HepMC::GenParticle::barcode | ( | ) | const [inline] |
particle barcode
The barcode is the particle's reference number, every vertex in the event has a unique barcode. Particle barcodes are positive numbers, vertex barcodes are negative numbers.
Definition at line 215 of file GenParticle.h.
Referenced by GenParticle(), HepMC::operator<<(), print(), set_end_vertex_(), and set_production_vertex_().
bool HepMC::GenParticle::suggest_barcode | ( | int | the_bar_code | ) |
In general there is no reason to "suggest_barcode".
allows a barcode to be suggested for this particle. In general it is better to let the event pick the barcode for you, which is automatic. Returns TRUE if the suggested barcode has been accepted (i.e. the suggested barcode has not already been used in the event, and so it was used). Returns FALSE if the suggested barcode was rejected, or if the particle is not yet part of an event, such that it is not yet possible to know if the suggested barcode will be accepted).
Definition at line 153 of file GenParticle.cc.
References parent_event(), HepMC::GenEvent::set_barcode(), and set_barcode_().
Referenced by GenParticle().
void HepMC::GenParticle::set_momentum | ( | const FourVector & | vec4 | ) | [inline] |
void HepMC::GenParticle::set_pdg_id | ( | int | id | ) | [inline] |
void HepMC::GenParticle::set_status | ( | int | status = 0 |
) | [inline] |
void HepMC::GenParticle::set_flow | ( | const Flow & | f | ) | [inline] |
void HepMC::GenParticle::set_flow | ( | int | code_index, | |
int | code = 0 | |||
) | [inline] |
set particle flow index
Definition at line 203 of file GenParticle.h.
References HepMC::Flow::set_icode(), and HepMC::Flow::set_unique_icode().
void HepMC::GenParticle::set_polarization | ( | const Polarization & | pol = Polarization(0, 0) |
) | [inline] |
void HepMC::GenParticle::set_generated_mass | ( | const double & | m | ) |
define the actual generated mass
If you do not call set_generated_mass(), then generated_mass() will simply return the mass calculated from momentum()
Definition at line 237 of file GenParticle.cc.
Referenced by setGeneratedMass().
void HepMC::GenParticle::setGeneratedMass | ( | const double & | m | ) | [inline] |
setGeneratedMass() is included for backwards compatibility with CLHEP HepMC
Definition at line 140 of file GenParticle.h.
References set_generated_mass().
void HepMC::GenParticle::set_production_vertex_ | ( | GenVertex * | productionvertex = 0 |
) | [protected] |
set production vertex
Definition at line 129 of file GenParticle.cc.
References barcode(), parent_event(), and HepMC::GenEvent::remove_barcode().
Referenced by HepMC::GenVertex::add_particle_out(), GenParticle(), and HepMC::GenVertex::remove_particle().
void HepMC::GenParticle::set_end_vertex_ | ( | GenVertex * | decayvertex = 0 |
) | [protected] |
set decay vertex
Definition at line 142 of file GenParticle.cc.
References barcode(), parent_event(), and HepMC::GenEvent::remove_barcode().
Referenced by HepMC::GenVertex::add_particle_in(), GenParticle(), and HepMC::GenVertex::remove_particle().
void HepMC::GenParticle::set_barcode_ | ( | int | the_bar_code | ) | [inline, protected] |
for use by GenEvent only
Definition at line 217 of file GenParticle.h.
Referenced by suggest_barcode().
friend class GenVertex [friend] |
Definition at line 57 of file GenParticle.h.
friend class GenEvent [friend] |
Definition at line 58 of file GenParticle.h.
std::ostream& operator<< | ( | std::ostream & | ostr, | |
const GenParticle & | part | |||
) | [friend] |