EvtGen 2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Loading...
Searching...
No Matches
EvtDecayIncoherent.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
24#include "EvtGenBase/EvtPDL.hh"
28
30{
31 //initialize this the hard way..
32 //Lange June 26, 2000
33 for ( size_t i = 0; i < static_cast<unsigned int>( MAX_DAUG ); i++ ) {
34 m_spinDensitySet[i] = 0;
35 }
36
38
39 decay( p );
40 p->setDecayProb( 1.0 );
41
43
44 rho.setDiag( p->getSpinStates() );
45
46 p->setSpinDensityBackward( rho );
47
48 if ( ( getFSR() || EvtRadCorr::alwaysRadCorr() ) &&
51 }
52
53 if ( !recursive )
54 return;
55
56 //Now decay the daughters.
57
59 for ( size_t i = 0; i < p->getNDaug(); i++ ) {
60 //Need to set the spin density of the daughters to be
61 //diagonal.
62 rho.setDiag( p->getDaug( i )->getSpinStates() );
63 //if (p->getDaug(i)->getNDaug()==0){
64 //only do this if the user has not already set the
65 //spin density matrix herself.
66 //Lange June 26, 2000
67 if ( isDaughterSpinDensitySet( i ) == 0 ) {
68 p->getDaug( i )->setSpinDensityForward( rho );
69 } else {
70 //EvtGenReport(EVTGEN_INFO,"EvtGen") << "spinDensitymatrix already set!!!\n";
72 // EvtGenReport(EVTGEN_INFO,"EvtGen") <<temp<<endl;
73 }
74 //Now decay the daughter. Really!
75 p->getDaug( i )->decay();
76 }
77 }
78}
const int MAX_DAUG
bool getFSR() const
virtual void decay(EvtParticle *p)=0
bool daugsDecayedByParentModel() const
bool m_daugsDecayedByParentModel
void makeDecay(EvtParticle *p, bool recursive=true) override
int isDaughterSpinDensitySet(int daughter)
int m_spinDensitySet[MAX_DAUG]
void setSpinDensityBackward(const EvtSpinDensity &rho)
void setSpinDensityForward(const EvtSpinDensity &rho)
void setDecayProb(double p)
int getSpinStates() const
EvtParticle * getDaug(const int i)
size_t getNDaug() const
EvtSpinDensity getSpinDensityForward()
static bool alwaysRadCorr()
static bool neverRadCorr()
static void doRadCorr(EvtParticle *p)
void setDiag(int n)