Skip to content

Commit

Permalink
Ensure HepMC 3.3 and make test build again with it
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Sep 17, 2024
1 parent c461117 commit 0611519
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ IF(TARGET ROOT::ROOTDataFrame)
endif()


find_package(HepMC3)
find_package(HepMC3 3.3)
find_package(HepPDT)

if(HepMC3_FOUND AND HepPDT_FOUND )
Expand Down
34 changes: 17 additions & 17 deletions test/hepmc/edm4hep_testhepmc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
// and converting it to the edm4hep data model
//////////////////////////////////////////////////////////////////////////

#include <iostream>
#include <memory>
#include <unordered_map>
#include "edm4hep/MCParticleCollection.h"

#include "HepMC3/GenEvent.h"
#include "HepMC3/GenParticle.h"
Expand All @@ -19,7 +17,9 @@
#include "podio/Frame.h"
#include "podio/ROOTWriter.h"

#include "edm4hep/MCParticleCollection.h"
#include <iostream>
#include <memory>
#include <unordered_map>

using namespace HepMC3;

Expand Down Expand Up @@ -65,39 +65,39 @@ int main() {
// #

// First create the event container
auto evt = new GenEvent();
auto evt = std::make_unique<GenEvent>();
// define the units
evt->set_units(HepMC3::Units::GEV, HepMC3::Units::MM);
//
// create vertex 1 and vertex 2, together with their inparticles
GenVertex* v1 = new GenVertex();
auto v1 = std::make_shared<GenVertex>();
evt->add_vertex(v1);
v1->add_particle_in(new GenParticle(FourVector(0, 0, 7000, 7000), 2212, 3));
GenVertex* v2 = new GenVertex();
v1->add_particle_in(std::make_shared<GenParticle>(FourVector(0, 0, 7000, 7000), 2212, 3));
auto v2 = std::make_shared<GenVertex>();
evt->add_vertex(v2);
v2->add_particle_in(new GenParticle(FourVector(0, 0, -7000, 7000), 2212, 3));
v2->add_particle_in(std::make_shared<GenParticle>(FourVector(0, 0, -7000, 7000), 2212, 3));
//
// create the outgoing particles of v1 and v2
GenParticle* p3 = new GenParticle(FourVector(.750, -1.569, 32.191, 32.238), 1, 3);
auto p3 = std::make_shared<GenParticle>(FourVector(.750, -1.569, 32.191, 32.238), 1, 3);
v1->add_particle_out(p3);
GenParticle* p4 = new GenParticle(FourVector(-3.047, -19., -54.629, 57.920), -2, 3);
auto p4 = std::make_shared<GenParticle>(FourVector(-3.047, -19., -54.629, 57.920), -2, 3);
v2->add_particle_out(p4);
//
// create v3
GenVertex* v3 = new GenVertex();
auto v3 = std::make_shared<GenVertex>();
evt->add_vertex(v3);
v3->add_particle_in(p3);
v3->add_particle_in(p4);
v3->add_particle_out(new GenParticle(FourVector(-3.813, 0.113, -1.833, 4.233), 22, 1));
GenParticle* p5 = new GenParticle(FourVector(1.517, -20.68, -20.605, 85.925), -24, 3);
v3->add_particle_out(std::make_shared<GenParticle>(FourVector(-3.813, 0.113, -1.833, 4.233), 22, 1));
auto p5 = std::make_shared<GenParticle>(FourVector(1.517, -20.68, -20.605, 85.925), -24, 3);
v3->add_particle_out(p5);
//
// create v4
GenVertex* v4 = new GenVertex(FourVector(0.12, -0.3, 0.05, 0.004));
auto v4 = std::make_shared<GenVertex>(FourVector(0.12, -0.3, 0.05, 0.004));
evt->add_vertex(v4);
v4->add_particle_in(p5);
v4->add_particle_out(new GenParticle(FourVector(-2.445, 28.816, 6.082, 29.552), 1, 1));
v4->add_particle_out(new GenParticle(FourVector(3.962, -49.498, -26.687, 56.373), -2, 1));
v4->add_particle_out(std::make_shared<GenParticle>(FourVector(-2.445, 28.816, 6.082, 29.552), 1, 1));
v4->add_particle_out(std::make_shared<GenParticle>(FourVector(3.962, -49.498, -26.687, 56.373), -2, 1));
//
// the event is complete, we now print it out to the screen
Print::content(*evt);
Expand Down

0 comments on commit 0611519

Please sign in to comment.