497 EvtSpinType::spintype stype = EvtPDL::getSpinType(idEvt);
498 EvtParticle* partEvt;
500 case EvtSpinType::SCALAR:
501 partEvt =
new EvtScalarParticle();
504 partEvt =
new EvtStringParticle();
506 case EvtSpinType::DIRAC:
507 partEvt =
new EvtDiracParticle();
509 case EvtSpinType::VECTOR:
510 partEvt =
new EvtVectorParticle();
512 case EvtSpinType::RARITASCHWINGER:
513 partEvt =
new EvtRaritaSchwingerParticle();
515 case EvtSpinType::TENSOR:
516 partEvt =
new EvtTensorParticle();
518 case EvtSpinType::SPIN5HALF:
case EvtSpinType::SPIN3:
case EvtSpinType::SPIN7HALF:
case EvtSpinType::SPIN4:
519 partEvt =
new EvtHighSpinParticle();
522 std::cout <<
"Unknown spintype in EvtSpinType!" << std::endl;
528 HepMC::FourVector momHep = partHep->momentum();
529 momEvt.set(momHep.t(),momHep.x(),momHep.y(),momHep.z());
531 HepMC::GenVertex* initVert = partHep->production_vertex();
532 HepMC::FourVector posHep = initVert->position();
533 posEvt.set(posHep.t(),posHep.x(),posHep.y(),posHep.z());
534 partEvt->init(idEvt,momEvt);
535 if (stype == EvtSpinType::DIRAC
550 EvtSpinDensity theSpinDensity;
551 theSpinDensity.SetDim(2);
552 theSpinDensity.Set(0, 0, EvtComplex(1./2. + polVec.
z()/2., 0.));
553 theSpinDensity.Set(0, 1, EvtComplex(polVec.
x()/2., -polVec.
y()/2.));
554 theSpinDensity.Set(1, 0, EvtComplex(polVec.
x()/2., polVec.
y()/2.));
555 theSpinDensity.Set(1, 1, EvtComplex(1./2. - polVec.
z()/2., 0.));
557 partEvt->setSpinDensityForwardHelicityBasis(theSpinDensity);
560 partEvt->setDiagonalSpinDensity();
569 static EvtStdHep evtstdhep;
572 partEvt->makeStdHep(evtstdhep);
575 partEvt->deleteTree();
580 HepMC::GenVertex* theVerts[200];
581 for (
int ivert = 0; ivert < 200; ivert++) {
585 for (
int ipart = 0; ipart < evtstdhep.getNPart(); ipart++) {
586 int theMum = evtstdhep.getFirstMother(ipart);
587 if (theMum != -1 && !theVerts[theMum]) {
588 EvtVector4R theVpos = evtstdhep.getX4(ipart) + posEvt;
590 new HepMC::GenVertex(HepMC::FourVector(theVpos.get(1),
598 partHep->set_status(2);
599 if (theVerts[0]) theVerts[0]->add_particle_in( partHep );
601 for (
int ipart2 = 1; ipart2 < evtstdhep.getNPart(); ipart2++) {
602 int idHep = evtstdhep.getStdHepID(ipart2);
605 evtstdhep.getP4(ipart2).get(2),
606 evtstdhep.getP4(ipart2).get(3),
607 evtstdhep.getP4(ipart2).get(0)),
609 evtstdhep.getIStat(ipart2));
611 thePart->suggest_barcode(npartial +
nPythia);
612 int theMum2 = evtstdhep.getFirstMother(ipart2);
613 if (theMum2 != -1 && theVerts[theMum2]) theVerts[theMum2]->add_particle_out( thePart );
614 if (theVerts[ipart2]) theVerts[ipart2]->add_particle_in( thePart );
618 for (
int ipart3 = 0; ipart3 < evtstdhep.getNPart(); ipart3++) {
619 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