1 //--------------------------------------------------------------------------
4 // This software is part of the EvtGen package developed jointly
5 // for the BaBar and CLEO collaborations. If you use all or part
6 // of it, please give an appropriate acknowledgement.
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 1998 Caltech, UCSB
11 // Module: EvtGen/EvtDecayIncoherent.cc
15 // Modification history:
17 // DJL/RYD August 11, 1998 Module created
19 //------------------------------------------------------------------------
20 #include "EvtGenBase/EvtPatches.hh"
22 #include "EvtGenBase/EvtDecayBase.hh"
23 #include "EvtGenBase/EvtDecayIncoherent.hh"
24 #include "EvtGenBase/EvtParticle.hh"
25 #include "EvtGenBase/EvtRadCorr.hh"
26 #include "EvtGenBase/EvtReport.hh"
27 #include "EvtGenBase/EvtPDL.hh"
30 void EvtDecayIncoherent::makeDecay(EvtParticle* p, bool recursive){
32 //initialize this the hard way..
34 for (size_t i=0; i<static_cast<unsigned int>(MAX_DAUG); i++ ) {
38 _daugsDecayedByParentModel=false;
45 rho.setDiag(p->getSpinStates());
47 p->setSpinDensityBackward(rho);
49 if (getPHOTOS() || EvtRadCorr::alwaysRadCorr()) {
50 EvtRadCorr::doRadCorr(p);
53 if(!recursive) return;
55 //Now decay the daughters.
57 if ( !daugsDecayedByParentModel()) {
59 for(size_t i=0;i<p->getNDaug();i++){
60 //Need to set the spin density of the daughters to be
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.
67 if ( isDaughterSpinDensitySet(i)==0 ) {
68 p->getDaug(i)->setSpinDensityForward(rho);
71 //report(INFO,"EvtGen") << "spinDensitymatrix already set!!!\n";
72 EvtSpinDensity temp=p->getDaug(i)->getSpinDensityForward();
73 // report(INFO,"EvtGen") <<temp<<endl;
75 //Now decay the daughter. Really!
76 p->getDaug(i)->decay();