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