EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HepMC3Vertex.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file HepMC3Vertex.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
13 
14 #include <HepMC3/FourVector.h>
15 #include <HepMC3/GenParticle.h>
16 #include <HepMC3/GenVertex.h>
17 
18 namespace ActsExamples {
19 
21 struct HepMC3Vertex {
22  public:
26  std::unique_ptr<SimVertex> processVertex(
27  const std::shared_ptr<HepMC3::GenVertex> vertex);
28 
33  bool inEvent(const std::shared_ptr<HepMC3::GenVertex> vertex);
34 
38  int id(const std::shared_ptr<HepMC3::GenVertex> vertex);
39 
43  std::vector<SimParticle> particlesIn(
44  const std::shared_ptr<HepMC3::GenVertex> vertex);
45 
49  std::vector<SimParticle> particlesOut(
50  const std::shared_ptr<HepMC3::GenVertex> vertex);
51 
55  Acts::Vector3D position(const std::shared_ptr<HepMC3::GenVertex> vertex);
56 
60  double time(const std::shared_ptr<HepMC3::GenVertex> vertex);
61 
65  void addParticleIn(std::shared_ptr<HepMC3::GenVertex> vertex,
66  std::shared_ptr<SimParticle> particle);
67 
71  void addParticleOut(std::shared_ptr<HepMC3::GenVertex> vertex,
72  std::shared_ptr<SimParticle> particle);
73 
77  void removeParticleIn(std::shared_ptr<HepMC3::GenVertex> vertex,
78  std::shared_ptr<SimParticle> particle);
79 
83  void removeParticleOut(std::shared_ptr<HepMC3::GenVertex> vertex,
84  std::shared_ptr<SimParticle> particle);
85 
89  void position(const std::shared_ptr<HepMC3::GenVertex> vertex,
91 
95  void time(const std::shared_ptr<HepMC3::GenVertex> vertex, double time);
96 
97  private:
101  std::vector<SimParticle> genParticlesToActs(
102  const std::vector<HepMC3::GenParticlePtr>& genParticles);
103 
108  HepMC3::GenParticlePtr actsParticleToGen(
109  std::shared_ptr<SimParticle> actsParticle);
110 
117  HepMC3::GenParticlePtr matchParticles(
118  const std::vector<HepMC3::GenParticlePtr>& genParticles,
119  std::shared_ptr<SimParticle> actsParticle);
120 };
121 } // namespace ActsExamples