00001
00002 #ifndef HEPMC_GEN_PARTICLE_H
00003 #define HEPMC_GEN_PARTICLE_H
00004
00006
00007
00008
00009
00010
00011
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "HepMC/Flow.h"
00030 #include "HepMC/Polarization.h"
00031 #include "HepMC/SimpleVector.h"
00032 #include <iostream>
00033 #ifdef _WIN32
00034 #define hepmc_uint64_t __int64
00035 #else
00036 #include <stdint.h>
00037 #define hepmc_uint64_t uint64_t
00038 #endif
00039
00040 namespace HepMC {
00041
00042 class GenVertex;
00043 class GenEvent;
00044
00045
00047
00055 class GenParticle {
00056
00057 friend class GenVertex;
00058 friend class GenEvent;
00060 friend std::ostream& operator<<( std::ostream&, const GenParticle& );
00061
00062 public:
00064 GenParticle(void);
00066 GenParticle( const FourVector& momentum, int pdg_id,
00067 int status = 0, const Flow& itsflow = Flow(),
00068 const Polarization& polar = Polarization(0,0) );
00069 GenParticle( const GenParticle& inparticle );
00070 virtual ~GenParticle();
00071
00072 void swap( GenParticle & other);
00073 GenParticle& operator=( const GenParticle& inparticle );
00074
00075 bool operator==( const GenParticle& ) const;
00077 bool operator!=( const GenParticle& ) const;
00078
00080 void print( std::ostream& ostr = std::cout ) const;
00081
00082 operator HepMC::FourVector() const;
00083
00085
00087
00089 FourVector momentum() const;
00091 int pdg_id() const;
00093 int status() const;
00095 Flow flow() const;
00097 int flow( int code_index ) const;
00099 Polarization polarization() const;
00101 GenVertex* production_vertex() const;
00103 GenVertex* end_vertex() const;
00105 GenEvent* parent_event() const;
00106
00113 double generated_mass() const;
00114
00116 double generatedMass() const { return generated_mass(); }
00117
00118
00123 int barcode() const;
00124
00126 bool suggest_barcode( int the_bar_code );
00127
00128 void set_momentum( const FourVector& vec4 );
00129 void set_pdg_id( int id );
00130 void set_status( int status = 0 );
00131 void set_flow( const Flow& f );
00132 void set_flow( int code_index, int code = 0 );
00133
00134 void set_polarization( const Polarization& pol = Polarization(0,0) );
00137 void set_generated_mass( const double & m );
00138
00140 void setGeneratedMass( const double & m )
00141 { return set_generated_mass(m); }
00142
00143 protected:
00144
00145
00146
00148 void set_production_vertex_( GenVertex* productionvertex = 0);
00150 void set_end_vertex_( GenVertex* decayvertex = 0 );
00151 void set_barcode_( int the_bar_code );
00152
00153 private:
00154 FourVector m_momentum;
00155 int m_pdg_id;
00156 int m_status;
00157 Flow m_flow;
00158 Polarization m_polarization;
00159 GenVertex* m_production_vertex;
00160 GenVertex* m_end_vertex;
00161 int m_barcode;
00162 double m_generated_mass;
00163
00164
00165 };
00166
00168
00170
00171 inline GenParticle::operator HepMC::FourVector() const
00172 { return m_momentum; }
00173
00174 inline FourVector GenParticle::momentum() const
00175 { return m_momentum; }
00176
00177 inline int GenParticle::pdg_id() const { return m_pdg_id; }
00178
00179 inline int GenParticle::status() const { return m_status; }
00180
00181 inline GenVertex* GenParticle::production_vertex() const
00182 { return m_production_vertex; }
00183
00184 inline GenVertex* GenParticle::end_vertex() const { return m_end_vertex; }
00185
00186 inline Flow GenParticle::flow() const { return m_flow; }
00187
00188 inline int GenParticle::flow( int code_index ) const
00189 { return m_flow.icode( code_index ); }
00190
00191 inline Polarization GenParticle::polarization() const
00192 { return m_polarization; }
00193
00194 inline void GenParticle::set_momentum( const FourVector& vec4 )
00195 { m_momentum = vec4; }
00196
00197 inline void GenParticle::set_pdg_id( int id ) { m_pdg_id = id; }
00198
00199 inline void GenParticle::set_status( int status ) { m_status = status; }
00200
00201 inline void GenParticle::set_flow( const Flow& f ) { m_flow = f; }
00202
00203 inline void GenParticle::set_flow( int code_index, int code )
00204 {
00205 if ( code == 0 ) {
00206 m_flow.set_unique_icode( code_index );
00207 } else {
00208 m_flow.set_icode( code_index, code );
00209 }
00210 }
00211
00212 inline void GenParticle::set_polarization( const Polarization& polar )
00213 { m_polarization = polar; }
00214
00215 inline int GenParticle::barcode() const { return m_barcode; }
00216
00217 inline void GenParticle::set_barcode_( int bc ) { m_barcode = bc; }
00218
00219 }
00220
00221 #endif // HEPMC_GEN_PARTICLE_H
00222
00223