1 //--------------------------------------------------------------------------
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.
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 1998 Caltech, UCSB
11 // Module: EvtStdHep.cc
13 // Description: Class produce the StdHep representation of the decay.
15 // Modification history:
17 // RYD March 11, 1998 Module created
19 //------------------------------------------------------------------------
20 #include "EvtGenBase/EvtPatches.hh"
24 #include "EvtGenBase/EvtVector4R.hh"
25 #include "EvtGenBase/EvtStdHep.hh"
29 void EvtStdHep::init(){
33 int EvtStdHep::getNPart(){
37 void EvtStdHep::createParticle(EvtVector4R p4,EvtVector4R x,int prntfirst,
38 int prntlast, int id){
42 _prntfirst[_npart]=prntfirst;
43 _prntlast[_npart]=prntlast;
44 _daugfirst[_npart]=-1;
49 //we also need to fix up the parents pointer to the daughter!
53 for (i=prntfirst;i<=prntlast;i++){
55 if (_daugfirst[i]==-1) _daugfirst[i]=_npart;
56 if (_dauglast[i]<_npart) _dauglast[i]=_npart;
65 void EvtStdHep::translate(EvtVector4R d){
68 for(i=0;i<_npart;i++){
76 ostream& operator<<(ostream& s, const EvtStdHep& stdhep){
80 std::ios::fmtflags f=s.flags();
84 s << " N Id Ist M1 M2 DF DL px py pz E t x y z"<<endl;
86 for(i=0;i<stdhep._npart;i++){
91 s<<stdhep._id[i]<<" ";
93 s<<stdhep._istat[i]<<" ";
95 s<<stdhep._prntfirst[i]<<" ";
97 s<<stdhep._prntlast[i]<<" ";
99 s<<stdhep._daugfirst[i]<<" ";
101 s<<stdhep._dauglast[i]<<" ";
104 s<<setiosflags( ios::right|ios::fixed );
105 s<<stdhep._p4[i].get(1)<<" ";
108 s<<setiosflags( ios::right|ios::fixed );
109 s<<stdhep._p4[i].get(2)<<" ";
112 s<<setiosflags( ios::right|ios::fixed );
113 s<<stdhep._p4[i].get(3)<<" ";
116 s<<setiosflags( ios::right|ios::fixed );
117 s<<stdhep._p4[i].get(0)<<" ";
120 s<<setiosflags( ios::right|ios::fixed );
121 s<<stdhep._x[i].get(0)<<" ";
124 s<<setiosflags( ios::right|ios::fixed );
125 s<<stdhep._x[i].get(1)<<" ";
128 s<<setiosflags( ios::right|ios::fixed );
129 s<<stdhep._x[i].get(2)<<" ";
132 s<<setiosflags( ios::right|ios::fixed );
133 s<<stdhep._x[i].get(3)<<endl;
141 s.flags((std::ios::fmtflags)f);