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.
EvtMParticle.cpp
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 
22 
23 #include "EvtGenBase/EvtPatches.hh"
25 
26 EvtMParticle::EvtMParticle( int label, const EvtId& id )
27 {
28  _id = id;
30  _resonance.push_back( label );
31 }
32 
33 EvtSpinAmp EvtMParticle::amplitude( const vector<EvtVector4R>& /*product*/ ) const
34 {
35  vector<EvtSpinType::spintype> types( 2, getspintype() );
36  EvtSpinAmp amp( types, EvtComplex( 0.0, 0.0 ) );
37 
38  for ( int i = -_twospin; i <= _twospin; i += 2 )
39  amp( i, i ) = EvtComplex( 1.0, 0.0 );
40 
41  return amp;
42 }
43 
45 {
46  return new EvtMParticle( _resonance[0], _id );
47 }
EvtMNode * duplicate() const override
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
Definition: EvtId.hh:27
EvtMParticle(int label, const EvtId &id)
static int getSpin2(spintype stype)
Definition: EvtSpinType.cpp:26
vector< int > _resonance
Definition: EvtMNode.hh:84
EvtSpinAmp amplitude(const vector< EvtVector4R > &product) const override