CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtStdHep.cc
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2//
3// Environment:
4// This software is part of the EvtGen package developed jointly
5// for the BaBar and CLEO collaborations. If you use all or part
6// of it, please give an appropriate acknowledgement.
7//
8// Copyright Information: See EvtGen/COPYRIGHT
9// Copyright (C) 1998 Caltech, UCSB
10//
11// Module: EvtStdHep.cc
12//
13// Description: Class produce the StdHep representation of the decay.
14//
15// Modification history:
16//
17// RYD March 11, 1998 Module created
18//
19//------------------------------------------------------------------------
21
22#include <iostream>
23#include <iomanip>
26using std::endl;
27using std::ios;
28using std::ostream;
29using std::setiosflags;
30
31//typedef long ios::fmtflags;
32
34 _npart=0;
35}
36
38 return _npart;
39}
40
42 int prntlast, int id){
43
44 _p4[_npart]=p4;
45 _x[_npart]=x;
46 _prntfirst[_npart]=prntfirst;
47 _prntlast[_npart]=prntlast;
48 _daugfirst[_npart]=-1;
49 _dauglast[_npart]=-1;
50 _id[_npart]=id;
51 _istat[_npart]=1;
52
53 //we also need to fix up the parents pointer to the daughter!
54
55 if (prntfirst>=0) {
56 int i;
57 for (i=prntfirst;i<=prntlast;i++){
58 _istat[i]=2;
59 if (_daugfirst[i]==-1) _daugfirst[i]=_npart;
60 if (_dauglast[i]<_npart) _dauglast[i]=_npart;
61 }
62
63 }
64
65 _npart++;
66
67}
68
70
71 int i;
72 for(i=0;i<_npart;i++){
73 _x[i]+=d;
74 }
75
76}
77
78
79
80ostream& operator<<(ostream& s, const EvtStdHep& stdhep){
81
82 int w=s.width();
83 int p=s.precision();
84 ios::fmtflags f=s.flags();
85
86
87 s <<endl;
88 s << " N Id Ist M1 M2 DF DL px py pz E t x y z"<<endl;
89 int i;
90 for(i=0;i<stdhep._npart;i++){
91
92 s.width(3);
93 s<<i<<" ";
94 s.width(7);
95 s<<stdhep._id[i]<<" ";
96 s.width(3);
97 s<<stdhep._istat[i]<<" ";
98 s.width(4);
99 s<<stdhep._prntfirst[i]<<" ";
100 s.width(4);
101 s<<stdhep._prntlast[i]<<" ";
102 s.width(4);
103 s<<stdhep._daugfirst[i]<<" ";
104 s.width(4);
105 s<<stdhep._dauglast[i]<<" ";
106 s.width(7);
107 s.precision(4);
108 s<<setiosflags( ios::right|ios::fixed );
109 s<<stdhep._p4[i].get(1)<<" ";
110 s.width(7);
111 s.precision(4);
112 s<<setiosflags( ios::right|ios::fixed );
113 s<<stdhep._p4[i].get(2)<<" ";
114 s.width(7);
115 s.precision(4);
116 s<<setiosflags( ios::right|ios::fixed );
117 s<<stdhep._p4[i].get(3)<<" ";
118 s.width(7);
119 s.precision(4);
120 s<<setiosflags( ios::right|ios::fixed );
121 s<<stdhep._p4[i].get(0)<<" ";
122 s.width(7);
123 s.precision(4);
124 s<<setiosflags( ios::right|ios::fixed );
125 s<<stdhep._x[i].get(0)<<" ";
126 s.width(7);
127 s.precision(4);
128 s<<setiosflags( ios::right|ios::fixed );
129 s<<stdhep._x[i].get(1)<<" ";
130 s.width(7);
131 s.precision(4);
132 s<<setiosflags( ios::right|ios::fixed );
133 s<<stdhep._x[i].get(2)<<" ";
134 s.width(7);
135 s.precision(4);
136 s<<setiosflags( ios::right|ios::fixed );
137 s<<stdhep._x[i].get(3)<<endl;
138 s.width(0);
139 }
140
141 s<<endl;
142
143 s.width(w);
144 s.precision(p);
145 s.flags(f);
146
147 return s;
148
149}
150
151
Double_t x[10]
ostream & operator<<(ostream &s, const EvtStdHep &stdhep)
Definition: EvtStdHep.cc:80
XmlRpcServer s
Definition: HelloServer.cpp:11
void translate(EvtVector4R d)
Definition: EvtStdHep.cc:69
void createParticle(EvtVector4R p4, EvtVector4R x, int prntfirst, int prntlast, int id)
Definition: EvtStdHep.cc:41
void init()
Definition: EvtStdHep.cc:33
int getNPart()
Definition: EvtStdHep.cc:37
double get(int i) const
Definition: EvtVector4R.hh:179