441 EvtSpinType::spintype stype = EvtPDL::getSpinType(idEvt);
442 EvtParticle* partEvt;
444 case EvtSpinType::SCALAR:
445 partEvt =
new EvtScalarParticle();
448 partEvt =
new EvtStringParticle();
450 case EvtSpinType::DIRAC:
451 partEvt =
new EvtDiracParticle();
453 case EvtSpinType::VECTOR:
454 partEvt =
new EvtVectorParticle();
456 case EvtSpinType::RARITASCHWINGER:
457 partEvt =
new EvtRaritaSchwingerParticle();
459 case EvtSpinType::TENSOR:
460 partEvt =
new EvtTensorParticle();
462 case EvtSpinType::SPIN5HALF:
case EvtSpinType::SPIN3:
case EvtSpinType::SPIN7HALF:
case EvtSpinType::SPIN4:
463 partEvt =
new EvtHighSpinParticle();
466 std::cout <<
"Unknown spintype in EvtSpinType!" << std::endl;
472 HepMC::FourVector momHep = partHep->momentum();
473 momEvt.set(momHep.t(),momHep.x(),momHep.y(),momHep.z());
475 HepMC::GenVertex* initVert = partHep->production_vertex();
476 HepMC::FourVector posHep = initVert->position();
477 posEvt.set(posHep.t(),posHep.x(),posHep.y(),posHep.z());
478 partEvt->init(idEvt,momEvt);
479 if (stype == EvtSpinType::DIRAC
494 EvtSpinDensity theSpinDensity;
495 theSpinDensity.SetDim(2);
496 theSpinDensity.Set(0, 0, EvtComplex(1./2. + polVec.
z()/2., 0.));
497 theSpinDensity.Set(0, 1, EvtComplex(polVec.
x()/2., -polVec.
y()/2.));
498 theSpinDensity.Set(1, 0, EvtComplex(polVec.
x()/2., polVec.
y()/2.));
499 theSpinDensity.Set(1, 1, EvtComplex(1./2. - polVec.
z()/2., 0.));
501 partEvt->setSpinDensityForwardHelicityBasis(theSpinDensity);
504 partEvt->setDiagonalSpinDensity();
513 static EvtStdHep evtstdhep;
516 partEvt->makeStdHep(evtstdhep);
519 partEvt->deleteTree();
524 HepMC::GenVertex* theVerts[200];
525 for (
int ivert = 0; ivert < 200; ivert++) {
529 for (
int ipart = 0; ipart < evtstdhep.getNPart(); ipart++) {
530 int theMum = evtstdhep.getFirstMother(ipart);
531 if (theMum != -1 && !theVerts[theMum]) {
532 EvtVector4R theVpos = evtstdhep.getX4(ipart) + posEvt;
534 new HepMC::GenVertex(HepMC::FourVector(theVpos.get(1),
542 partHep->set_status(2);
543 if (theVerts[0]) theVerts[0]->add_particle_in( partHep );
545 for (
int ipart2 = 1; ipart2 < evtstdhep.getNPart(); ipart2++) {
546 int idHep = evtstdhep.getStdHepID(ipart2);
549 evtstdhep.getP4(ipart2).get(2),
550 evtstdhep.getP4(ipart2).get(3),
551 evtstdhep.getP4(ipart2).get(0)),
553 evtstdhep.getIStat(ipart2));
555 thePart->suggest_barcode(npartial +
nPythia);
556 int theMum2 = evtstdhep.getFirstMother(ipart2);
557 if (theMum2 != -1 && theVerts[theMum2]) theVerts[theMum2]->add_particle_out( thePart );
558 if (theVerts[ipart2]) theVerts[ipart2]->add_particle_in( thePart );
562 for (
int ipart3 = 0; ipart3 < evtstdhep.getNPart(); ipart3++) {
563 if (theVerts[ipart3]) theEvent->add_vertex( theVerts[ipart3] );
void go_through_daughters(EvtParticle *part)
U second(std::pair< T, U > const &p)
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
std::map< int, float > polarizations
Vector3DBase unit() const