File indexing completed on 2026-08-06 09:20:02
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifndef EVTHEPMCEVENT_HH
0022 #define EVTHEPMCEVENT_HH
0023
0024 #include "EvtGenBase/EvtVector4R.hh"
0025
0026 #ifdef EVTGEN_HEPMC3
0027 #include "HepMC3/GenEvent.h"
0028 #include "HepMC3/GenParticle.h"
0029 #include "HepMC3/GenVertex.h"
0030 #include "HepMC3/Print.h"
0031 #include "HepMC3/Units.h"
0032 typedef HepMC3::GenParticlePtr GenParticlePtr;
0033 typedef HepMC3::GenVertexPtr GenVertexPtr;
0034 typedef HepMC3::GenEvent GenEvent;
0035 typedef HepMC3::FourVector FourVector;
0036 typedef HepMC3::Units Units;
0037 inline GenParticlePtr newGenParticlePtr(
0038 const FourVector& mom = FourVector::ZERO_VECTOR(), int pid = 0,
0039 int status = 0 )
0040 {
0041 return std::make_shared<HepMC3::GenParticle>( mom, pid, status );
0042 }
0043 inline GenVertexPtr newGenVertexPtr(
0044 const FourVector& pos = FourVector::ZERO_VECTOR() )
0045 {
0046 return std::make_shared<HepMC3::GenVertex>( pos );
0047 }
0048 #else
0049 #include "HepMC/GenEvent.h"
0050 #include "HepMC/GenParticle.h"
0051 #include "HepMC/GenVertex.h"
0052 #include "HepMC/SimpleVector.h"
0053 #include "HepMC/Units.h"
0054 typedef HepMC::GenParticle* GenParticlePtr;
0055 typedef HepMC::GenVertex* GenVertexPtr;
0056 typedef HepMC::GenEvent GenEvent;
0057 typedef HepMC::FourVector FourVector;
0058 #define Units HepMC::Units
0059 inline GenParticlePtr newGenParticlePtr(
0060 const FourVector& mom = FourVector( 0.0, 0.0, 0.0, 0.0 ), int pid = 0,
0061 int status = 0 )
0062 {
0063 return new HepMC::GenParticle( mom, pid, status );
0064 }
0065 inline GenVertexPtr newGenVertexPtr(
0066 const FourVector& pos = FourVector( 0.0, 0.0, 0.0, 0.0 ) )
0067 {
0068 return new HepMC::GenVertex( pos );
0069 }
0070 #endif
0071
0072 class EvtParticle;
0073
0074 class EvtHepMCEvent {
0075 public:
0076 EvtHepMCEvent();
0077 virtual ~EvtHepMCEvent();
0078
0079
0080
0081 enum HepMCFrame
0082 {
0083 RESTFRAME = 1,
0084 LAB = 2,
0085 MOTHER = 3
0086 };
0087
0088 enum HepMCStatus
0089 {
0090 STABLE = 1,
0091 DECAYED = 2,
0092 HISTORY = 3
0093 };
0094
0095 void constructEvent( EvtParticle* baseParticle );
0096 void constructEvent( EvtParticle* baseParticle, EvtVector4R& translation );
0097
0098 GenEvent* getEvent() { return _theEvent; }
0099
0100
0101
0102
0103
0104
0105 GenParticlePtr createGenParticle( EvtParticle* theParticle, int frameType );
0106
0107
0108 FourVector getVertexCoord( EvtParticle* theParticle );
0109
0110 protected:
0111 private:
0112
0113 void deleteEvent();
0114
0115
0116
0117
0118 void addVertex( EvtParticle* inEvtParticle, GenParticlePtr inGenParticle );
0119
0120 GenEvent* _theEvent;
0121 EvtVector4R _translation;
0122 };
0123
0124 #endif