Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:20:02

0001 
0002 /***********************************************************************
0003 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
0004 *                                                                      *
0005 * This file is part of EvtGen.                                         *
0006 *                                                                      *
0007 * EvtGen is free software: you can redistribute it and/or modify       *
0008 * it under the terms of the GNU General Public License as published by *
0009 * the Free Software Foundation, either version 3 of the License, or    *
0010 * (at your option) any later version.                                  *
0011 *                                                                      *
0012 * EvtGen is distributed in the hope that it will be useful,            *
0013 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
0014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
0015 * GNU General Public License for more details.                         *
0016 *                                                                      *
0017 * You should have received a copy of the GNU General Public License    *
0018 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
0019 ***********************************************************************/
0020 
0021 #ifndef __EVTMTREE_HH__
0022 #define __EVTMTREE_HH__
0023 
0024 #include "EvtGenBase/EvtComplex.hh"
0025 #include "EvtGenBase/EvtMNode.hh"
0026 #include "EvtGenBase/EvtMParticle.hh"
0027 #include "EvtGenBase/EvtMRes.hh"
0028 #include "EvtGenBase/EvtPDL.hh"
0029 #include "EvtGenBase/EvtSpinAmp.hh"
0030 #include "EvtGenBase/EvtVector4R.hh"
0031 
0032 #include <vector>
0033 using std::vector;
0034 
0035 #include <string>
0036 using std::string;
0037 
0038 typedef string::const_iterator ptype;
0039 
0040 class EvtParticle;
0041 
0042 class EvtMTree {
0043   public:
0044     EvtMTree( const EvtId*, unsigned int );
0045     ~EvtMTree();
0046 
0047     // return the invariant amplitude of the entire tree
0048     EvtSpinAmp amplitude( EvtParticle* ) const;
0049 
0050     // add a decay tree to the list of trees that we posess
0051     void addtree( const string& );
0052 
0053   private:
0054     vector<EvtMNode*> _root;
0055     vector<string> _lbltbl;
0056     double _norm;
0057 
0058     bool parsecheck( char, const string& );
0059     void parseerror( bool, ptype&, ptype&, ptype& );
0060 
0061     string parseId( ptype&, ptype&, ptype& );
0062     string parseKey( ptype&, ptype&, ptype& );
0063     vector<string> parseArg( ptype&, ptype&, ptype& );
0064     vector<EvtComplex> parseAmps( ptype&, ptype&, ptype& );
0065     vector<EvtMNode*> duplicate( const vector<EvtMNode*>& ) const;
0066     vector<vector<EvtMNode*>> unionChildren( const string&,
0067                                              vector<vector<EvtMNode*>>& );
0068     vector<vector<EvtMNode*>> parseChildren( ptype&, ptype&, ptype& );
0069     vector<EvtMNode*> parsenode( const string&, bool );
0070     bool validTree( const EvtMNode* ) const;
0071 
0072     vector<EvtMNode*> makeparticles( const string& );
0073     EvtMRes* makeresonance( const EvtId&, const string&, const vector<string>&,
0074                             const string&, const vector<EvtComplex>&,
0075                             const vector<EvtMNode*>& );
0076 
0077     EvtSpinAmp getrotation( EvtParticle* ) const;
0078 };
0079 
0080 #endif