457 EvtSpinType::spintype stype = EvtPDL::getSpinType(idEvt);
458 EvtParticle* partEvt;
460 case EvtSpinType::SCALAR:
461 partEvt =
new EvtScalarParticle();
464 partEvt =
new EvtStringParticle();
466 case EvtSpinType::DIRAC:
467 partEvt =
new EvtDiracParticle();
469 case EvtSpinType::VECTOR:
470 partEvt =
new EvtVectorParticle();
472 case EvtSpinType::RARITASCHWINGER:
473 partEvt =
new EvtRaritaSchwingerParticle();
475 case EvtSpinType::TENSOR:
476 partEvt =
new EvtTensorParticle();
478 case EvtSpinType::SPIN5HALF:
case EvtSpinType::SPIN3:
case EvtSpinType::SPIN7HALF:
case EvtSpinType::SPIN4:
479 partEvt =
new EvtHighSpinParticle();
482 std::cout <<
"Unknown spintype in EvtSpinType!" << std::endl;
488 HepMC::FourVector momHep = partHep->momentum();
489 momEvt.set(momHep.t(),momHep.x(),momHep.y(),momHep.z());
491 HepMC::GenVertex* initVert = partHep->production_vertex();
492 HepMC::FourVector posHep = initVert->position();
493 posEvt.set(posHep.t(),posHep.x(),posHep.y(),posHep.z());
494 partEvt->init(idEvt,momEvt);
495 if (stype == EvtSpinType::DIRAC
510 EvtSpinDensity theSpinDensity;
511 theSpinDensity.SetDim(2);
512 theSpinDensity.Set(0, 0, EvtComplex(1./2. + polVec.
z()/2., 0.));
513 theSpinDensity.Set(0, 1, EvtComplex(polVec.
x()/2., -polVec.
y()/2.));
514 theSpinDensity.Set(1, 0, EvtComplex(polVec.
x()/2., polVec.
y()/2.));
515 theSpinDensity.Set(1, 1, EvtComplex(1./2. - polVec.
z()/2., 0.));
517 partEvt->setSpinDensityForwardHelicityBasis(theSpinDensity);
520 partEvt->setDiagonalSpinDensity();
529 static EvtStdHep evtstdhep;
532 partEvt->makeStdHep(evtstdhep);
535 partEvt->deleteTree();
540 HepMC::GenVertex* theVerts[200];
541 for (
int ivert = 0; ivert < 200; ivert++) {
545 for (
int ipart = 0; ipart < evtstdhep.getNPart(); ipart++) {
546 int theMum = evtstdhep.getFirstMother(ipart);
547 if (theMum != -1 && !theVerts[theMum]) {
548 EvtVector4R theVpos = evtstdhep.getX4(ipart) + posEvt;
550 new HepMC::GenVertex(HepMC::FourVector(theVpos.get(1),
558 partHep->set_status(2);
559 if (theVerts[0]) theVerts[0]->add_particle_in( partHep );
561 for (
int ipart2 = 1; ipart2 < evtstdhep.getNPart(); ipart2++) {
562 int idHep = evtstdhep.getStdHepID(ipart2);
565 evtstdhep.getP4(ipart2).get(2),
566 evtstdhep.getP4(ipart2).get(3),
567 evtstdhep.getP4(ipart2).get(0)),
569 evtstdhep.getIStat(ipart2));
571 thePart->suggest_barcode(npartial +
nPythia);
572 int theMum2 = evtstdhep.getFirstMother(ipart2);
573 if (theMum2 != -1 && theVerts[theMum2]) theVerts[theMum2]->add_particle_out( thePart );
574 if (theVerts[ipart2]) theVerts[ipart2]->add_particle_in( thePart );
578 for (
int ipart3 = 0; ipart3 < evtstdhep.getNPart(); ipart3++) {
579 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