EvtGen 2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Loading...
Searching...
No Matches
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
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"
32typedef HepMC3::GenParticlePtr GenParticlePtr;
33typedef HepMC3::GenVertexPtr GenVertexPtr;
34typedef HepMC3::GenEvent GenEvent;
35typedef HepMC3::FourVector FourVector;
36typedef HepMC3::Units Units;
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}
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"
54typedef HepMC::GenParticle* GenParticlePtr;
55typedef HepMC::GenVertex* GenVertexPtr;
56typedef HepMC::GenEvent GenEvent;
57typedef HepMC::FourVector FourVector;
58#define Units HepMC::Units
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}
66 const FourVector& pos = FourVector( 0.0, 0.0, 0.0, 0.0 ) )
67{
68 return new HepMC::GenVertex( pos );
69}
70#endif
71
72class EvtParticle;
73
75 public:
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
82 {
84 LAB = 2,
86 };
87 // Select the GenParticle status
89 {
90 STABLE = 1,
93 };
94
95 void constructEvent( EvtParticle* baseParticle );
96 void constructEvent( EvtParticle* baseParticle, EvtVector4R& translation );
97
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
122};
123
124#endif
HepMC3::GenVertexPtr GenVertexPtr
GenVertexPtr newGenVertexPtr(const FourVector &pos=FourVector::ZERO_VECTOR())
HepMC3::GenEvent GenEvent
GenParticlePtr newGenParticlePtr(const FourVector &mom=FourVector::ZERO_VECTOR(), int pid=0, int status=0)
HepMC3::GenParticlePtr GenParticlePtr
HepMC3::Units Units
HepMC3::FourVector FourVector
GenEvent * m_theEvent
EvtVector4R m_translation
GenEvent * getEvent()
GenParticlePtr createGenParticle(EvtParticle *theParticle, int frameType)
void constructEvent(EvtParticle *baseParticle)
FourVector getVertexCoord(EvtParticle *theParticle)
void addVertex(EvtParticle *inEvtParticle, GenParticlePtr inGenParticle)
virtual ~EvtHepMCEvent()