21 #include "EvtGen_i/EvtGenExternal/EvtPythia.hh"
23 #include "EvtGenBase/EvtDecayBase.hh"
24 #include "EvtGenBase/EvtId.hh"
25 #include "EvtGenBase/EvtPDL.hh"
26 #include "EvtGenBase/EvtParticle.hh"
27 #include "EvtGenBase/EvtPatches.hh"
28 #include "EvtGenBase/EvtSpinDensity.hh"
30 #include "EvtGenModels/EvtAbsExternalGen.hh"
32 #include "EvtGen_i/EvtGenExternal/EvtExternalGenFactory.hh"
37 EvtPythia::EvtPythia()
45 EvtPythia::~EvtPythia()
47 m_commandList.clear();
57 return new EvtPythia();
67 void EvtPythia::initProbMax()
72 void EvtPythia::decay( EvtParticle*
p )
80 if ( !m_pythiaEngine ) {
81 m_pythiaEngine = EvtExternalGenFactory::getInstance()->getGenerator(
82 EvtExternalGenFactory::PythiaGenId );
85 if ( m_pythiaEngine ) {
86 m_pythiaEngine->doDecay(
p );
89 this->fixPolarisations(
p );
92 void EvtPythia::fixPolarisations( EvtParticle*
p )
100 int nDaug =
p->getNDaug();
103 static const EvtId Jpsi = EvtPDL::getId(
"J/psi" );
105 for (
i = 0;
i < nDaug;
i++ ) {
106 EvtParticle* theDaug =
p->getDaug(
i );
109 if ( theDaug->getId() == Jpsi ) {
113 rho.set( 0, 0, 0.5 );
114 rho.set( 0, 1, 0.0 );
115 rho.set( 0, 2, 0.0 );
117 rho.set( 1, 0, 0.0 );
118 rho.set( 1, 1, 1.0 );
119 rho.set( 1, 2, 0.0 );
121 rho.set( 2, 0, 0.0 );
122 rho.set( 2, 1, 0.0 );
123 rho.set( 2, 2, 0.5 );
125 EvtVector4R p4Psi = theDaug->getP4();
127 double alpha = atan2( p4Psi.get( 2 ), p4Psi.get( 1 ) );
128 double beta = acos( p4Psi.get( 3 ) / p4Psi.d3mag() );
130 theDaug->setSpinDensityForwardHelicityBasis(
rho, alpha,
beta,
132 setDaughterSpinDensity(
i );
138 std::string EvtPythia::commandName()
145 return std::string(
"JetSetPar" );
151 m_commandList.push_back(
cmd );