/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/BesEvtGen/BesEvtGen-00-03-58/src/EvtGen/EvtGenBase/EvtStdHep.cc

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //
00003 // Environment:
00004 //      This software is part of the EvtGen package developed jointly
00005 //      for the BaBar and CLEO collaborations.  If you use all or part
00006 //      of it, please give an appropriate acknowledgement.
00007 //
00008 // Copyright Information: See EvtGen/COPYRIGHT
00009 //      Copyright (C) 1998      Caltech, UCSB
00010 //
00011 // Module: EvtStdHep.cc
00012 //
00013 // Description: Class produce the StdHep representation of the decay.
00014 //
00015 // Modification history:
00016 //
00017 //    RYD       March 11, 1998       Module created
00018 //
00019 //------------------------------------------------------------------------
00020 #include "EvtGenBase/EvtPatches.hh"
00021 
00022 #include <iostream>
00023 #include <iomanip>
00024 #include "EvtGenBase/EvtVector4R.hh"
00025 #include "EvtGenBase/EvtStdHep.hh"
00026 using std::endl;
00027 using std::ios;
00028 using std::ostream;
00029 using std::setiosflags;
00030 
00031 //typedef long ios::fmtflags;
00032 
00033 void EvtStdHep::init(){
00034   _npart=0;
00035 }
00036   
00037 int EvtStdHep::getNPart(){
00038   return _npart;
00039 }
00040 
00041 void EvtStdHep::createParticle(EvtVector4R p4,EvtVector4R x,int prntfirst,
00042                                 int prntlast, int id){
00043 
00044   _p4[_npart]=p4;
00045   _x[_npart]=x;
00046   _prntfirst[_npart]=prntfirst;
00047   _prntlast[_npart]=prntlast;
00048   _daugfirst[_npart]=-1;
00049   _dauglast[_npart]=-1;
00050   _id[_npart]=id;
00051   _istat[_npart]=1;
00052 
00053   //we also need to fix up the parents pointer to the daughter!
00054 
00055   if (prntfirst>=0) {
00056     int i;
00057     for (i=prntfirst;i<=prntlast;i++){
00058       _istat[i]=2;
00059       if (_daugfirst[i]==-1) _daugfirst[i]=_npart;
00060       if (_dauglast[i]<_npart) _dauglast[i]=_npart;
00061     }
00062  
00063   }
00064 
00065   _npart++;
00066 
00067 }
00068 
00069 void EvtStdHep::translate(EvtVector4R d){
00070 
00071   int i;
00072   for(i=0;i<_npart;i++){
00073     _x[i]+=d;
00074   }
00075 
00076 }
00077 
00078  
00079 
00080 ostream& operator<<(ostream& s, const EvtStdHep& stdhep){
00081 
00082   int w=s.width();
00083   int p=s.precision();
00084   ios::fmtflags f=s.flags();
00085 
00086 
00087   s <<endl;
00088   s << "  N      Id Ist   M1   M2   DF   DL      px      py      pz       E       t       x       y       z"<<endl;
00089   int i;
00090   for(i=0;i<stdhep._npart;i++){
00091     
00092     s.width(3);
00093     s<<i<<" ";
00094     s.width(7);
00095     s<<stdhep._id[i]<<" ";
00096     s.width(3);
00097     s<<stdhep._istat[i]<<" ";
00098     s.width(4);
00099     s<<stdhep._prntfirst[i]<<" ";
00100     s.width(4);
00101     s<<stdhep._prntlast[i]<<" ";
00102     s.width(4);
00103     s<<stdhep._daugfirst[i]<<" ";
00104     s.width(4);
00105     s<<stdhep._dauglast[i]<<" ";
00106     s.width(7);
00107     s.precision(4);
00108     s<<setiosflags( ios::right|ios::fixed );
00109     s<<stdhep._p4[i].get(1)<<" ";
00110     s.width(7);
00111     s.precision(4);
00112     s<<setiosflags( ios::right|ios::fixed );
00113     s<<stdhep._p4[i].get(2)<<" ";
00114     s.width(7);
00115     s.precision(4);
00116     s<<setiosflags( ios::right|ios::fixed );
00117     s<<stdhep._p4[i].get(3)<<" ";
00118     s.width(7);
00119     s.precision(4);
00120     s<<setiosflags( ios::right|ios::fixed );
00121     s<<stdhep._p4[i].get(0)<<" ";
00122     s.width(7);
00123     s.precision(4);
00124     s<<setiosflags( ios::right|ios::fixed );
00125     s<<stdhep._x[i].get(0)<<" ";
00126     s.width(7);
00127     s.precision(4);
00128     s<<setiosflags( ios::right|ios::fixed );
00129     s<<stdhep._x[i].get(1)<<" ";
00130     s.width(7);
00131     s.precision(4);
00132     s<<setiosflags( ios::right|ios::fixed );
00133     s<<stdhep._x[i].get(2)<<" ";
00134     s.width(7);
00135     s.precision(4);
00136     s<<setiosflags( ios::right|ios::fixed );
00137     s<<stdhep._x[i].get(3)<<endl;
00138     s.width(0);
00139   }
00140   
00141   s<<endl;
00142 
00143   s.width(w);
00144   s.precision(p);
00145   s.flags(f);
00146   
00147   return s;
00148 
00149 }  
00150 
00151 

Generated on Tue Nov 29 23:12:15 2016 for BOSS_7.0.2 by  doxygen 1.4.7