ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HepMC3Event.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file HepMC3Event.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 
11 #include <HepMC3/FourVector.h>
12 #include <HepMC3/GenEvent.h>
13 #include <HepMC3/GenParticle.h>
14 #include <HepMC3/GenVertex.h>
15 #include <HepPID/ParticleIDMethods.hh>
16 
19 #include "Acts/Utilities/Units.hpp"
20 
21 namespace FW {
22 
24 struct HepMC3Event {
25  public:
29 
34  void momentumUnit(std::shared_ptr<HepMC3::GenEvent> event,
35  const double momentumUnit);
36 
41  void lengthUnit(std::shared_ptr<HepMC3::GenEvent> event,
42  const double lengthUnit);
43 
48  void shiftPositionBy(std::shared_ptr<HepMC3::GenEvent> event,
49  const Acts::Vector3D& deltaPos, const double deltaTime);
50 
55  void shiftPositionTo(std::shared_ptr<HepMC3::GenEvent> event,
56  const Acts::Vector3D& pos, const double time);
57 
61  void shiftPositionTo(std::shared_ptr<HepMC3::GenEvent> event,
62  const Acts::Vector3D& pos);
63 
67  void shiftPositionTo(std::shared_ptr<HepMC3::GenEvent> event,
68  const double time);
69 
73 
77  void addParticle(std::shared_ptr<HepMC3::GenEvent> event,
78  std::shared_ptr<SimParticle> particle);
79 
84  void addVertex(std::shared_ptr<HepMC3::GenEvent> event,
85  const std::shared_ptr<SimVertex> vertex);
89 
93  void removeParticle(std::shared_ptr<HepMC3::GenEvent> event,
94  const std::shared_ptr<SimParticle>& particle);
95 
101  void removeVertex(std::shared_ptr<HepMC3::GenEvent> event,
102  const std::shared_ptr<SimVertex>& vertex);
103 
107 
111  double momentumUnit(const std::shared_ptr<HepMC3::GenEvent> event);
112 
116  double lengthUnit(const std::shared_ptr<HepMC3::GenEvent> event);
117 
121  Acts::Vector3D eventPos(const std::shared_ptr<HepMC3::GenEvent> event);
122 
126  double eventTime(const std::shared_ptr<HepMC3::GenEvent> event);
127 
131  std::vector<std::unique_ptr<SimParticle>> particles(
132  const std::shared_ptr<HepMC3::GenEvent> event);
133 
137  std::vector<std::unique_ptr<SimVertex>> vertices(
138  const std::shared_ptr<HepMC3::GenEvent> event);
139 
143  std::vector<std::unique_ptr<SimParticle>> beams(
144  const std::shared_ptr<HepMC3::GenEvent> event);
145 
149  std::vector<std::unique_ptr<SimParticle>> finalState(
150  const std::shared_ptr<HepMC3::GenEvent> event);
151 
152  private:
157  HepMC3::GenParticlePtr actsParticleToGen(
158  std::shared_ptr<SimParticle> actsParticle);
159 
164  HepMC3::GenVertexPtr createGenVertex(
165  const std::shared_ptr<SimVertex>& actsVertex);
166 
177  bool compareVertices(const std::shared_ptr<SimVertex>& actsVertex,
178  const HepMC3::GenVertexPtr& genVertex);
179 };
180 } // namespace FW