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.
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"
26 #include "EvtGenBase/EvtPatches.hh"
27 #include "EvtGenBase/EvtRadCorr.hh"
28 #include "EvtGenBase/EvtReport.hh"
29 
30 void EvtDecayIncoherent::makeDecay( EvtParticle* p, bool recursive )
31 {
32  //initialize this the hard way..
33  //Lange June 26, 2000
34  for ( size_t i = 0; i < static_cast<unsigned int>( MAX_DAUG ); i++ ) {
35  spinDensitySet[i] = 0;
36  }
37 
39 
40  decay( p );
41  p->setDecayProb( 1.0 );
42 
43  EvtSpinDensity rho;
44 
45  rho.setDiag( p->getSpinStates() );
46 
47  p->setSpinDensityBackward( rho );
48 
49  if ( getPHOTOS() || EvtRadCorr::alwaysRadCorr() ) {
51  }
52 
53  if ( !recursive )
54  return;
55 
56  //Now decay the daughters.
57 
58  if ( !daugsDecayedByParentModel() ) {
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 }
EvtSpinDensity getSpinDensityForward()
Definition: EvtParticle.hh:364
void setSpinDensityForward(const EvtSpinDensity &rho)
Definition: EvtParticle.hh:337
void setDecayProb(double p)
void setDiag(int n)
void setSpinDensityBackward(const EvtSpinDensity &rho)
Definition: EvtParticle.hh:369
static void doRadCorr(EvtParticle *p)
Definition: EvtRadCorr.cpp:54
int getSpinStates() const
void makeDecay(EvtParticle *p, bool recursive=true) override
size_t getNDaug() const
bool _daugsDecayedByParentModel
int getPHOTOS() const
Definition: EvtDecayBase.hh:69
int spinDensitySet[MAX_DAUG]
virtual void decay(EvtParticle *p)=0
const int MAX_DAUG
Definition: EvtParticle.hh:42
EvtParticle * getDaug(int i)
Definition: EvtParticle.cpp:91
int isDaughterSpinDensitySet(int daughter)
bool daugsDecayedByParentModel()
static bool alwaysRadCorr()
Definition: EvtRadCorr.cpp:68