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
EvtStdHep.cpp
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
22
24
25#include <iomanip>
26#include <iostream>
27using namespace std;
28
30{
31 m_npart = 0;
32}
33
35{
36 return m_npart;
37}
38
40 int prntlast, int id )
41{
42 m_p4[m_npart] = p4;
43 m_x[m_npart] = x;
44 m_prntfirst[m_npart] = prntfirst;
45 m_prntlast[m_npart] = prntlast;
46 m_daugfirst[m_npart] = -1;
47 m_dauglast[m_npart] = -1;
48 m_id[m_npart] = id;
49 m_istat[m_npart] = 1;
50
51 //we also need to fix up the parents pointer to the daughter!
52
53 if ( prntfirst >= 0 ) {
54 int i;
55 for ( i = prntfirst; i <= prntlast; i++ ) {
56 m_istat[i] = 2;
57 if ( m_daugfirst[i] == -1 )
59 if ( m_dauglast[i] < m_npart )
61 }
62 }
63
64 m_npart++;
65}
66
68{
69 int i;
70 for ( i = 0; i < m_npart; i++ ) {
71 m_x[i] += d;
72 }
73}
74
75ostream& operator<<( ostream& s, const EvtStdHep& stdhep )
76{
77 int w = s.width();
78 int p = s.precision();
79 std::ios::fmtflags f = s.flags();
80
81 s << endl;
82 s << " N Id Ist M1 M2 DF DL px py pz E t x y z"
83 << endl;
84 int i;
85 for ( i = 0; i < stdhep.m_npart; i++ ) {
86 s.width( 3 );
87 s << i << " ";
88 s.width( 7 );
89 s << stdhep.m_id[i] << " ";
90 s.width( 3 );
91 s << stdhep.m_istat[i] << " ";
92 s.width( 4 );
93 s << stdhep.m_prntfirst[i] << " ";
94 s.width( 4 );
95 s << stdhep.m_prntlast[i] << " ";
96 s.width( 4 );
97 s << stdhep.m_daugfirst[i] << " ";
98 s.width( 4 );
99 s << stdhep.m_dauglast[i] << " ";
100 s.width( 7 );
101 s.precision( 4 );
102 s << setiosflags( ios::right | ios::fixed );
103 s << stdhep.m_p4[i].get( 1 ) << " ";
104 s.width( 7 );
105 s.precision( 4 );
106 s << setiosflags( ios::right | ios::fixed );
107 s << stdhep.m_p4[i].get( 2 ) << " ";
108 s.width( 7 );
109 s.precision( 4 );
110 s << setiosflags( ios::right | ios::fixed );
111 s << stdhep.m_p4[i].get( 3 ) << " ";
112 s.width( 7 );
113 s.precision( 4 );
114 s << setiosflags( ios::right | ios::fixed );
115 s << stdhep.m_p4[i].get( 0 ) << " ";
116 s.width( 7 );
117 s.precision( 4 );
118 s << setiosflags( ios::right | ios::fixed );
119 s << stdhep.m_x[i].get( 0 ) << " ";
120 s.width( 7 );
121 s.precision( 4 );
122 s << setiosflags( ios::right | ios::fixed );
123 s << stdhep.m_x[i].get( 1 ) << " ";
124 s.width( 7 );
125 s.precision( 4 );
126 s << setiosflags( ios::right | ios::fixed );
127 s << stdhep.m_x[i].get( 2 ) << " ";
128 s.width( 7 );
129 s.precision( 4 );
130 s << setiosflags( ios::right | ios::fixed );
131 s << stdhep.m_x[i].get( 3 ) << endl;
132 s.width( 0 );
133 }
134
135 s << endl;
136
137 s.width( w );
138 s.precision( p );
139 s.flags( (std::ios::fmtflags)f );
140
141 return s;
142}
ostream & operator<<(ostream &s, const EvtStdHep &stdhep)
Definition EvtStdHep.cpp:75
int m_daugfirst[EVTSTDHEPLENGTH]
Definition EvtStdHep.hh:62
int m_prntfirst[EVTSTDHEPLENGTH]
Definition EvtStdHep.hh:60
void translate(EvtVector4R d)
Definition EvtStdHep.cpp:67
EvtVector4R m_x[EVTSTDHEPLENGTH]
Definition EvtStdHep.hh:59
int m_id[EVTSTDHEPLENGTH]
Definition EvtStdHep.hh:64
int m_prntlast[EVTSTDHEPLENGTH]
Definition EvtStdHep.hh:61
int m_npart
Definition EvtStdHep.hh:57
void createParticle(EvtVector4R p4, EvtVector4R x, int prntfirst, int prntlast, int id)
Definition EvtStdHep.cpp:39
void init()
Definition EvtStdHep.cpp:29
EvtVector4R m_p4[EVTSTDHEPLENGTH]
Definition EvtStdHep.hh:58
int m_istat[EVTSTDHEPLENGTH]
Definition EvtStdHep.hh:65
int m_dauglast[EVTSTDHEPLENGTH]
Definition EvtStdHep.hh:63
int getNPart()
Definition EvtStdHep.cpp:34
double get(int i) const