00001 #ifndef __EVTMTREE_HH__
00002 #define __EVTMTREE_HH__
00003
00004 #include "EvtGenBase/EvtPDL.hh"
00005 #include "EvtGenBase/EvtSpinAmp.hh"
00006 #include "EvtGenBase/EvtComplex.hh"
00007 #include "EvtGenBase/EvtVector4R.hh"
00008
00009 #include "EvtGenBase/EvtMNode.hh"
00010 #include "EvtGenBase/EvtMParticle.hh"
00011 #include "EvtGenBase/EvtMRes.hh"
00012
00013 #include <vector>
00014 using std::vector;
00015
00016 #include <string>
00017 using std::string;
00018
00019 typedef string::const_iterator ptype;
00020
00021 class EvtMTree {
00022
00023 public:
00024
00025 EvtMTree( const EvtId * idtbl, int ndaug );
00026 ~EvtMTree( );
00027
00028
00029 EvtSpinAmp amplitude( const vector<EvtVector4R>&
00030 product) const;
00031
00032
00033 void addtree( const string& args );
00034
00035 private:
00036
00037 vector< EvtMNode * > _root;
00038 vector<string> _lbltbl;
00039 double _norm;
00040
00041 bool parsecheck( char arg, const string& chars );
00042 void parseerror( bool, ptype&, ptype&, ptype& );
00043
00044 string parseId( ptype&, ptype&, ptype& );
00045 string parseKey( ptype&, ptype&, ptype& );
00046 vector<string> parseArg( ptype&, ptype&, ptype& );
00047 vector<EvtComplex> parseAmps( ptype&, ptype&, ptype& );
00048 vector<EvtMNode *> duplicate( const vector<EvtMNode *>& ) const;
00049 vector<vector<EvtMNode * > > unionChildren( const string&,
00050 vector<vector<EvtMNode * > >& );
00051 vector<vector<EvtMNode * > > parseChildren( ptype&, ptype&, ptype& );
00052 vector<EvtMNode *> parsenode( const string& , bool );
00053 bool validTree( const EvtMNode * ) const;
00054
00055 vector<EvtMNode *> makeparticles( const string& );
00056 EvtMRes * makeresonance( const EvtId&, const string &,
00057 const vector<string>&, const string& ,
00058 const vector<EvtComplex>& , const vector<EvtMNode * >& );
00059
00060 };
00061
00062 #endif