EvtGen
2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Toggle main menu visibility
Loading...
Searching...
No Matches
EvtGenBase
EvtHepMCEvent.hh
Go to the documentation of this file.
1
2
/***********************************************************************
3
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4
* *
5
* This file is part of EvtGen. *
6
* *
7
* EvtGen is free software: you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation, either version 3 of the License, or *
10
* (at your option) any later version. *
11
* *
12
* EvtGen is distributed in the hope that it will be useful, *
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
* GNU General Public License for more details. *
16
* *
17
* You should have received a copy of the GNU General Public License *
18
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19
***********************************************************************/
20
21
#ifndef EVTHEPMCEVENT_HH
22
#define EVTHEPMCEVENT_HH
23
24
#include "
EvtGenBase/EvtVector4R.hh
"
25
26
#ifdef EVTGEN_HEPMC3
27
#include "HepMC3/GenEvent.h"
28
#include "HepMC3/GenParticle.h"
29
#include "HepMC3/GenVertex.h"
30
#include "HepMC3/Print.h"
31
#include "HepMC3/Units.h"
32
typedef
HepMC3::GenParticlePtr
GenParticlePtr
;
33
typedef
HepMC3::GenVertexPtr
GenVertexPtr
;
34
typedef
HepMC3::GenEvent
GenEvent
;
35
typedef
HepMC3::FourVector
FourVector
;
36
typedef
HepMC3::Units
Units
;
37
inline
GenParticlePtr
newGenParticlePtr
(
38
const
FourVector
& mom = FourVector::ZERO_VECTOR(),
int
pid = 0,
39
int
status = 0 )
40
{
41
return
std::make_shared<HepMC3::GenParticle>( mom, pid, status );
42
}
43
inline
GenVertexPtr
newGenVertexPtr
(
44
const
FourVector
& pos = FourVector::ZERO_VECTOR() )
45
{
46
return
std::make_shared<HepMC3::GenVertex>( pos );
47
}
48
#else
49
#include "HepMC/GenEvent.h"
50
#include "HepMC/GenParticle.h"
51
#include "HepMC/GenVertex.h"
52
#include "HepMC/SimpleVector.h"
53
#include "HepMC/Units.h"
54
typedef
HepMC::GenParticle*
GenParticlePtr
;
55
typedef
HepMC::GenVertex*
GenVertexPtr
;
56
typedef
HepMC::GenEvent
GenEvent
;
57
typedef
HepMC::FourVector
FourVector
;
58
#define Units HepMC::Units
59
inline
GenParticlePtr
newGenParticlePtr
(
60
const
FourVector
& mom =
FourVector
( 0.0, 0.0, 0.0, 0.0 ),
int
pid = 0,
61
int
status = 0 )
62
{
63
return
new
HepMC::GenParticle( mom, pid, status );
64
}
65
inline
GenVertexPtr
newGenVertexPtr
(
66
const
FourVector
& pos =
FourVector
( 0.0, 0.0, 0.0, 0.0 ) )
67
{
68
return
new
HepMC::GenVertex( pos );
69
}
70
#endif
71
72
class
EvtParticle
;
73
74
class
EvtHepMCEvent
{
75
public
:
76
EvtHepMCEvent
();
77
virtual
~EvtHepMCEvent
();
78
79
// Select what frame a given GenParticle is in:
80
// its own restframe, the lab frame (first mother), or its mother's frame
81
enum
HepMCFrame
82
{
83
RESTFRAME
= 1,
84
LAB
= 2,
85
MOTHER
= 3
86
};
87
// Select the GenParticle status
88
enum
HepMCStatus
89
{
90
STABLE
= 1,
91
DECAYED
= 2,
92
HISTORY
= 3
93
};
94
95
void
constructEvent
(
EvtParticle
* baseParticle );
96
void
constructEvent
(
EvtParticle
* baseParticle,
EvtVector4R
& translation );
97
98
GenEvent
*
getEvent
() {
return
m_theEvent
; }
99
100
// Methods used to create GenParticles and FourVectors of vertices.
101
// Make these public so that other classes may call them if they use EvtHepMCEvent.
102
103
// Create a GenParticle using info from the EvtParticle, specifying what frame
104
// the 4-momentum is from.
105
GenParticlePtr
createGenParticle
(
EvtParticle
* theParticle,
int
frameType );
106
107
// Find out the decay vertex position for the given EvtParticle.
108
FourVector
getVertexCoord
(
EvtParticle
* theParticle );
109
110
protected
:
111
private
:
112
// Delete the event structure (called by destructor)
113
void
deleteEvent
();
114
115
// Add a vertex to the event. This is called by the constructEvent function
116
// and is recursive, i.e. it loops through all possible daughter particles and
117
// their descendents.
118
void
addVertex
(
EvtParticle
* inEvtParticle,
GenParticlePtr
inGenParticle );
119
120
GenEvent
*
m_theEvent
;
121
EvtVector4R
m_translation
;
122
};
123
124
#endif
GenVertexPtr
HepMC3::GenVertexPtr GenVertexPtr
Definition
EvtHepMCEvent.hh:33
newGenVertexPtr
GenVertexPtr newGenVertexPtr(const FourVector &pos=FourVector::ZERO_VECTOR())
Definition
EvtHepMCEvent.hh:43
GenEvent
HepMC3::GenEvent GenEvent
Definition
EvtHepMCEvent.hh:34
newGenParticlePtr
GenParticlePtr newGenParticlePtr(const FourVector &mom=FourVector::ZERO_VECTOR(), int pid=0, int status=0)
Definition
EvtHepMCEvent.hh:37
GenParticlePtr
HepMC3::GenParticlePtr GenParticlePtr
Definition
EvtHepMCEvent.hh:32
Units
HepMC3::Units Units
Definition
EvtHepMCEvent.hh:36
FourVector
HepMC3::FourVector FourVector
Definition
EvtHepMCEvent.hh:35
EvtVector4R.hh
EvtHepMCEvent::m_theEvent
GenEvent * m_theEvent
Definition
EvtHepMCEvent.hh:120
EvtHepMCEvent::m_translation
EvtVector4R m_translation
Definition
EvtHepMCEvent.hh:121
EvtHepMCEvent::HepMCFrame
HepMCFrame
Definition
EvtHepMCEvent.hh:82
EvtHepMCEvent::MOTHER
@ MOTHER
Definition
EvtHepMCEvent.hh:85
EvtHepMCEvent::RESTFRAME
@ RESTFRAME
Definition
EvtHepMCEvent.hh:83
EvtHepMCEvent::LAB
@ LAB
Definition
EvtHepMCEvent.hh:84
EvtHepMCEvent::HepMCStatus
HepMCStatus
Definition
EvtHepMCEvent.hh:89
EvtHepMCEvent::HISTORY
@ HISTORY
Definition
EvtHepMCEvent.hh:92
EvtHepMCEvent::STABLE
@ STABLE
Definition
EvtHepMCEvent.hh:90
EvtHepMCEvent::DECAYED
@ DECAYED
Definition
EvtHepMCEvent.hh:91
EvtHepMCEvent::EvtHepMCEvent
EvtHepMCEvent()
Definition
EvtHepMCEvent.cpp:26
EvtHepMCEvent::getEvent
GenEvent * getEvent()
Definition
EvtHepMCEvent.hh:98
EvtHepMCEvent::createGenParticle
GenParticlePtr createGenParticle(EvtParticle *theParticle, int frameType)
Definition
EvtHepMCEvent.cpp:75
EvtHepMCEvent::constructEvent
void constructEvent(EvtParticle *baseParticle)
Definition
EvtHepMCEvent.cpp:45
EvtHepMCEvent::getVertexCoord
FourVector getVertexCoord(EvtParticle *theParticle)
Definition
EvtHepMCEvent.cpp:172
EvtHepMCEvent::addVertex
void addVertex(EvtParticle *inEvtParticle, GenParticlePtr inGenParticle)
Definition
EvtHepMCEvent.cpp:117
EvtHepMCEvent::deleteEvent
void deleteEvent()
Definition
EvtHepMCEvent.cpp:36
EvtHepMCEvent::~EvtHepMCEvent
virtual ~EvtHepMCEvent()
Definition
EvtHepMCEvent.cpp:31
EvtParticle
Definition
EvtParticle.hh:45
EvtVector4R
Definition
EvtVector4R.hh:29
Generated by
1.17.0