evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtMTree.hh
Go to the documentation of this file.
1 
2 /***********************************************************************
3 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4 * *
5 * This file is part of EvtGen. *
6 * *
7 * EvtGen is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * EvtGen is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19 ***********************************************************************/
20 
21 #ifndef __EVTMTREE_HH__
22 #define __EVTMTREE_HH__
23 
24 #include "EvtGenBase/EvtComplex.hh"
25 #include "EvtGenBase/EvtMNode.hh"
27 #include "EvtGenBase/EvtMRes.hh"
28 #include "EvtGenBase/EvtPDL.hh"
29 #include "EvtGenBase/EvtSpinAmp.hh"
31 
32 #include <vector>
33 using std::vector;
34 
35 #include <string>
36 using std::string;
37 
38 typedef string::const_iterator ptype;
39 
40 class EvtParticle;
41 
42 class EvtMTree {
43  public:
44  EvtMTree( const EvtId*, unsigned int );
45  ~EvtMTree();
46 
47  // return the invariant amplitude of the entire tree
49 
50  // add a decay tree to the list of trees that we posess
51  void addtree( const string& );
52 
53  private:
54  vector<EvtMNode*> _root;
55  vector<string> _lbltbl;
56  double _norm;
57 
58  bool parsecheck( char, const string& );
59  void parseerror( bool, ptype&, ptype&, ptype& );
60 
61  string parseId( ptype&, ptype&, ptype& );
62  string parseKey( ptype&, ptype&, ptype& );
63  vector<string> parseArg( ptype&, ptype&, ptype& );
64  vector<EvtComplex> parseAmps( ptype&, ptype&, ptype& );
65  vector<EvtMNode*> duplicate( const vector<EvtMNode*>& ) const;
66  vector<vector<EvtMNode*>> unionChildren( const string&,
67  vector<vector<EvtMNode*>>& );
68  vector<vector<EvtMNode*>> parseChildren( ptype&, ptype&, ptype& );
69  vector<EvtMNode*> parsenode( const string&, bool );
70  bool validTree( const EvtMNode* ) const;
71 
72  vector<EvtMNode*> makeparticles( const string& );
73  EvtMRes* makeresonance( const EvtId&, const string&, const vector<string>&,
74  const string&, const vector<EvtComplex>&,
75  const vector<EvtMNode*>& );
76 
78 };
79 
80 #endif
vector< EvtMNode * > duplicate(const vector< EvtMNode * > &) const
Definition: EvtMTree.cpp:244
~EvtMTree()
Definition: EvtMTree.cpp:44
string parseId(ptype &, ptype &, ptype &)
Definition: EvtMTree.cpp:137
vector< EvtComplex > parseAmps(ptype &, ptype &, ptype &)
Definition: EvtMTree.cpp:209
EvtSpinAmp getrotation(EvtParticle *) const
Definition: EvtMTree.cpp:419
bool validTree(const EvtMNode *) const
Definition: EvtMTree.cpp:386
vector< vector< EvtMNode * > > parseChildren(ptype &, ptype &, ptype &)
Definition: EvtMTree.cpp:289
bool parsecheck(char, const string &)
Definition: EvtMTree.cpp:50
string parseKey(ptype &, ptype &, ptype &)
Definition: EvtMTree.cpp:155
EvtMRes * makeresonance(const EvtId &, const string &, const vector< string > &, const string &, const vector< EvtComplex > &, const vector< EvtMNode * > &)
Definition: EvtMTree.cpp:84
void parseerror(bool, ptype &, ptype &, ptype &)
Definition: EvtMTree.cpp:115
vector< vector< EvtMNode * > > unionChildren(const string &, vector< vector< EvtMNode * >> &)
Definition: EvtMTree.cpp:255
vector< EvtMNode * > _root
Definition: EvtMTree.hh:54
EvtMTree(const EvtId *, unsigned int)
Definition: EvtMTree.cpp:37
vector< string > _lbltbl
Definition: EvtMTree.hh:55
Definition: EvtId.hh:27
void addtree(const string &)
Definition: EvtMTree.cpp:404
double _norm
Definition: EvtMTree.hh:56
vector< EvtMNode * > parsenode(const string &, bool)
Definition: EvtMTree.cpp:339
vector< EvtMNode * > makeparticles(const string &)
Definition: EvtMTree.cpp:61
string::const_iterator ptype
Definition: EvtMTree.hh:38
vector< string > parseArg(ptype &, ptype &, ptype &)
Definition: EvtMTree.cpp:173
EvtSpinAmp amplitude(EvtParticle *) const
Definition: EvtMTree.cpp:437