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.
EvtMNode.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 __EVTMNODE_HH__
22 #define __EVTMNODE_HH__
23 
24 #include "EvtGenBase/EvtComplex.hh"
25 #include "EvtGenBase/EvtPDL.hh"
26 #include "EvtGenBase/EvtSpinAmp.hh"
29 
30 #include <vector>
31 using std::vector;
32 
33 #include <string>
34 using std::string;
35 
36 class EvtMNode {
37  public:
38  EvtMNode() {}
39  virtual ~EvtMNode(){};
40 
41  // calculate the amplitude associated event this->children return a
42  // vector of the form A_{\lambda this} and sum over allowed angular
43  // momenta of the children
44  virtual EvtSpinAmp amplitude( const vector<EvtVector4R>& product ) const = 0;
45 
46  // get the 4 vector associated with this node
47  EvtVector4R get4vector( const vector<EvtVector4R>& product ) const;
48 
49  // get twice the spin of the particle
50  int getspin() const { return _twospin; }
52  {
53  return EvtPDL::getSpinType( _id );
54  }
55 
56  // get the id of this node
57  EvtId getid() const { return _id; }
58 
59  // return which particles this is a combination of
60  const vector<int>& getresonance() const { return _resonance; }
61 
62  void setparent( EvtMNode* parent ) { _parent = parent; }
63  EvtMNode* getparent() const { return _parent; }
64 
65  // get the number of children that this node has
66  virtual int getnchild() const = 0;
67 
68  // return the value of the resonance shape
69  virtual EvtComplex line( const vector<EvtVector4R>& product ) const = 0;
70 
71  // return a pointer node
72  virtual EvtMNode* duplicate() const = 0;
73 
74  protected:
75  // store the EvtId of the particle (just in case we need it to access
76  // further informatoin about it)
78 
79  // store TWICE the spin of this resonance (this is to deal with spin 1/2
80  int _twospin;
81 
82  // store the particles that form this resonance, this should match up
83  // with the child nodes from below, and is calculated internally
84  vector<int> _resonance;
85 
86  // store the parent node of this one
88 };
89 
90 #endif
EvtVector4R get4vector(const vector< EvtVector4R > &product) const
Definition: EvtMNode.cpp:25
int getspin() const
Definition: EvtMNode.hh:50
EvtMNode * _parent
Definition: EvtMNode.hh:87
static EvtSpinType::spintype getSpinType(EvtId i)
Definition: EvtPDL.cpp:377
int _twospin
Definition: EvtMNode.hh:80
EvtId _id
Definition: EvtMNode.hh:77
EvtSpinType::spintype getspintype() const
Definition: EvtMNode.hh:51
virtual EvtComplex line(const vector< EvtVector4R > &product) const =0
Definition: EvtId.hh:27
EvtMNode()
Definition: EvtMNode.hh:38
virtual ~EvtMNode()
Definition: EvtMNode.hh:39
const vector< int > & getresonance() const
Definition: EvtMNode.hh:60
virtual EvtMNode * duplicate() const =0
vector< int > _resonance
Definition: EvtMNode.hh:84
virtual int getnchild() const =0
virtual EvtSpinAmp amplitude(const vector< EvtVector4R > &product) const =0
EvtId getid() const
Definition: EvtMNode.hh:57
EvtMNode * getparent() const
Definition: EvtMNode.hh:63
void setparent(EvtMNode *parent)
Definition: EvtMNode.hh:62