HepMC3 event record library
TauolaHepMC3Particle.h
1// -*- C++ -*-
2//
3// This file is part of HepMC
4// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
5//
6#ifndef _TauolaHepMC3Particle_h_included_
7#define _TauolaHepMC3Particle_h_included_
8
9#warning "HepMC3 interface is available in the latest version of TAUOLA, see http://tauolapp.web.cern.ch/tauolapp/. This interface will be removed in the future HepMC3 versions."
10
11/**
12 * @class TauolaHepMC3Particle
13 *
14 * @brief Interface to GenParticle objects
15 *
16 * This class implements the virtual methods of
17 * TauolaParticle. In this way it provides an
18 * interface between the generic TauolaParticle class
19 * and a GenParticle object.
20 *
21 * This code is licensed under GNU General Public Licence.
22 * For more informations, see: http://www.gnu.org/licenses/
23 */
24
25#include <iostream>
26#include <vector>
27
28#include "HepMC3/GenParticle.h"
29#include "HepMC3/FourVector.h"
30#include "HepMC3/GenEvent.h"
31
32//#include "DecayList.h"
33#include "Tauola/TauolaParticle.h"
34#include "Tauola/f_Decay.h"
35namespace Tauolapp
36{
37using namespace HepMC3;
38
39class TauolaHepMC3Particle: public TauolaParticle {
40
41public:
42 /** General constructor */
44
46
47 /** Constructor which keeps a pointer to the GenParticle*/
48 TauolaHepMC3Particle(GenParticlePtr particle);
49
50 /** Constructor which creates a new GenParticle and
51 sets the properties pdg_id, statu and mass. */
52 TauolaHepMC3Particle(int pdg_id, int status, double mass);
53
54 /** Returns the GenParticlePtr */
55 GenParticlePtr getHepMC3();
56
57 /** Remove the decay branch from the event record and reset the particle status code to stable. */
58 void undecay();
59
60 /** Set the mothers of this particle via a vector of TauolaParticle*/
61 void setMothers(std::vector<TauolaParticle*> mothers);
62
63 /** Set the daughters of this particle via a vector of TauolaParticle*/
64 void setDaughters(std::vector<TauolaParticle*> daughters);
65
66 /** Returns the mothers of this particle via a vector of TauolaParticle */
67 std::vector<TauolaParticle*> getMothers();
68
69 /** Returns the daughters of this particle via a vector of TauolaParticle */
70 std::vector<TauolaParticle*> getDaughters();
71
72 /** Set the PDG ID code of this particle */
73 void setPdgID(int pdg_id);
74
75 /** Set the status of this particle */
76 void setStatus(int statu);
77
78 /** Set the mass of this particle */
79 void setMass(double mass);
80
81 /** Get the PDG ID code of this particle */
82 int getPdgID();
83
84 /** Get the status of this particle */
85 int getStatus();
86
87 /** Get the barcode of this particle */
89
90 /** Check that the 4 momentum in conserved at the vertices producing
91 and ending this particle */
93
94 /** Overriding of TauolaParticle decayEndgame method.
95 Converts the momentum and length units
96 and sets the vector (X,T) position */
98
99 /** Create a new particle of type TauolaHepMC3Particle, with the given
100 properties. The new particle bares no relations to this
101 particle, but it provides a way of creating a instance of
102 this derived class. eg. createNewParticle() is used inside
103 filhep_() so that a TauolaHepMC3Particle can be created without
104 the method having explicit knowledge of the TauolaHepMC3Particle
105 class */
106 TauolaHepMC3Particle * createNewParticle(int pdg_id, int status, double mass,
107 double px, double py,
108 double pz, double e);
109
110 /** Print some information about this particle to standard output */
111 void print();
112
113 /** Returns the px component of the four vector*/
114 double getPx();
115
116 /** Returns the py component of the four vector */
117 double getPy();
118
119 /** Returns the pz component of the four vector */
120 double getPz();
121
122 /** Returns the energy component of the four vector */
123 double getE();
124
125 /** Set the px component of the four vector */
126 void setPx( double px );
127
128 /** Set the px component of the four vector */
129 void setPy( double py );
130
131 /** Set the pz component of the four vector */
132 void setPz( double pz );
133
134 /** Set the energy component of the four vector */
135 void setE( double e );
136
137
138private:
139
140 /** Sets the position for whole decay tree starting from given particle */
141 void recursiveSetPosition(GenParticlePtr p,FourVector pos);
142
143 /** A pointer to the GenParticle particle */
144 GenParticlePtr m_particle;
145
146 /** A list of mothers */
147 std::vector<TauolaParticle*> m_mothers;
148
149 /** A list of daughters */
150 std::vector<TauolaParticle*> m_daughters;
151
152 /** List to keep track of new particles which have been
153 created from this one, so we can call their destructor later */
154 std::vector<TauolaParticle*> m_created_particles;
155
156};
157
158} // namespace Tauolapp
159#endif
Definition of class FourVector.
Definition of class GenEvent.
Definition of class GenParticle.
Generic 4-vector.
Definition: FourVector.h:36
std::vector< TauolaParticle * > getDaughters()
std::vector< TauolaParticle * > m_created_particles
std::vector< TauolaParticle * > m_daughters
void setMothers(std::vector< TauolaParticle * > mothers)
TauolaHepMC3Particle(GenParticlePtr particle)
void setDaughters(std::vector< TauolaParticle * > daughters)
void recursiveSetPosition(GenParticlePtr p, FourVector pos)
std::vector< TauolaParticle * > getMothers()
TauolaHepMC3Particle * createNewParticle(int pdg_id, int status, double mass, double px, double py, double pz, double e)
std::vector< TauolaParticle * > m_mothers
TauolaHepMC3Particle(int pdg_id, int status, double mass)
HepMC3 main namespace.