7#define HEPMC3_HEPEVT_NMXHEP 4000
16#include "HepMC3TestUtils.h"
21 std::shared_ptr<GenRunInfo> run = std::make_shared<GenRunInfo>();
23 GenParticlePtr b2 = std::make_shared<GenParticle>(
FourVector( 0.0, 0.0, 7000.0, 7000.0 ),2212, 3 );
24 GenParticlePtr b1 = std::make_shared<GenParticle>(
FourVector( 0.750, -1.569, 32.191, 32.238), 1, 3 );
25 GenParticlePtr b3 = std::make_shared<GenParticle>(
FourVector( 0.750, -1.569, 32.191, -32.238), 1, 3 );
26 GenVertexPtr v1 = std::make_shared<GenVertex>();
27 v1->add_particle_in (b1);
28 v1->add_particle_in(b2);
29 v1->add_particle_out(b3);
31 for (
size_t z= 0; z < 5; z++) {
32 std::vector<GenParticlePtr> particles = evt.
particles();
33 for (
auto p: particles) {
34 if (p->end_vertex())
continue;
35 GenParticlePtr p2 = std::make_shared<GenParticle>(
FourVector( 0.0, 0.0, 7000.0+0.01*evt.
particles().size(), 7000.0 ),2212, 3 );
36 GenParticlePtr p1 = std::make_shared<GenParticle>(
FourVector( 0.750, -1.569, 32.191+0.01*evt.
particles().size(), 32.238), 1, 3 );
37 GenVertexPtr v = std::make_shared<GenVertex>();
38 v->add_particle_in (p);
39 v->add_particle_out(p1);
40 v->add_particle_out(p2);
89 std::shared_ptr<WriterAscii> w1 = std::make_shared<WriterAscii>(
"testHEPEVTWrapper1output1.txt");
90 w1->write_event(evt1);
92 std::shared_ptr<WriterAscii> w2= std::make_shared<WriterAscii>(
"testHEPEVTWrapper1output2.txt");
93 w2->write_event(evt2);
95 std::shared_ptr<WriterAscii> w3= std::make_shared<WriterAscii>(
"testHEPEVTWrapper1output3.txt");
96 w3->write_event(evt3);
98 std::shared_ptr<WriterAscii> w4= std::make_shared<WriterAscii>(
"testHEPEVTWrapper1output4.txt");
99 w4->write_event(evt4);
101 std::shared_ptr<WriterAscii> w5= std::make_shared<WriterAscii>(
"testHEPEVTWrapper1output5.txt");
102 w5->write_event(evt5);
104 std::shared_ptr<WriterAscii> w6= std::make_shared<WriterAscii>(
"testHEPEVTWrapper1output6.txt");
105 w6->write_event(evt6);
107 return COMPARE_ASCII_FILES(
"testHEPEVTWrapper1output1.txt",
"testHEPEVTWrapper1output2.txt") +
108 COMPARE_ASCII_FILES(
"testHEPEVTWrapper1output2.txt",
"testHEPEVTWrapper1output3.txt") +
109 COMPARE_ASCII_FILES(
"testHEPEVTWrapper1output3.txt",
"testHEPEVTWrapper1output4.txt") +
110 COMPARE_ASCII_FILES(
"testHEPEVTWrapper1output4.txt",
"testHEPEVTWrapper1output5.txt") +
111 COMPARE_ASCII_FILES(
"testHEPEVTWrapper1output5.txt",
"testHEPEVTWrapper1output6.txt")
Definition of class GenEvent.
Definition of class GenParticle.
Definition of class GenVertex.
Definition of class HEPEVT_Wrapper.
#define HEPMC3_HEPEVT_NMXHEP
Definition of class HEPEVT_Wrapper_Runtime.
Definition of class HEPEVT_Wrapper_Runtime_Static.
Definition of class HEPEVT_Wrapper_Template.
Definition of class WriterAscii.
Stores event-related information.
void add_vertex(GenVertexPtr v)
Add vertex.
void set_run_info(std::shared_ptr< GenRunInfo > run)
Set the GenRunInfo object by smart pointer.
const std::vector< ConstGenParticlePtr > & particles() const
Get list of particles (const)
static bool HEPEVT_to_GenEvent(GenEvent *evt)
Convert HEPEVT to GenEvent.
static void print_hepevt(std::ostream &ostr=std::cout)
Print information from HEPEVT common block.
static void set_max_number_entries(unsigned int size)
Set block size.
static void set_hepevt_address(char *c)
Set Fortran block address.
An interface to HEPEVT common block implemented to deal with varying block size in runtime.
bool HEPEVT_to_GenEvent(GenEvent *evt) const
Convert HEPEVT to GenEvent.
bool GenEvent_to_HEPEVT(const GenEvent *evt)
Convert GenEvent to HEPEVT.
void allocate_internal_storage()
Allocates m_internal_storage storage in smart pointer to hold HEPEVT of fixed size.
void set_max_number_entries(unsigned int size)
Set block size.
void set_hepevt_address(char *c)
Set Fortran block address.
void copy_to_internal_storage(char *c, int N)
Copies the content of foreight common block into the internal storage.
An interface to HEPEVT common block implemented as template class.
bool HEPEVT_to_GenEvent(GenEvent *evt) const
Convert HEPEVT to GenEvent.
void allocate_internal_storage()
Allocates m_internal_storage storage in smart pointer to hold HEPEVT of fixed size.
void set_hepevt_address(char *c)
Set Fortran block address.
void copy_to_internal_storage(char *c, int N)
Copies the content of foreight common block into the internal storage.
static bool HEPEVT_to_GenEvent(GenEvent *evt)
Convert HEPEVT to GenEvent.
static void set_hepevt_address(char *c)
Set Fortran block address.
C structure representing Fortran common block HEPEVT T. Sjöstrand et al., "A proposed standard event ...