454 EvtSpinType::spintype stype = EvtPDL::getSpinType(idEvt);
455 EvtParticle* partEvt;
457 case EvtSpinType::SCALAR:
458 partEvt =
new EvtScalarParticle();
461 partEvt =
new EvtStringParticle();
463 case EvtSpinType::DIRAC:
464 partEvt =
new EvtDiracParticle();
466 case EvtSpinType::VECTOR:
467 partEvt =
new EvtVectorParticle();
469 case EvtSpinType::RARITASCHWINGER:
470 partEvt =
new EvtRaritaSchwingerParticle();
472 case EvtSpinType::TENSOR:
473 partEvt =
new EvtTensorParticle();
475 case EvtSpinType::SPIN5HALF:
case EvtSpinType::SPIN3:
case EvtSpinType::SPIN7HALF:
case EvtSpinType::SPIN4:
476 partEvt =
new EvtHighSpinParticle();
479 std::cout <<
"Unknown spintype in EvtSpinType!" << std::endl;
485 HepMC::FourVector momHep = partHep->momentum();
486 momEvt.set(momHep.t(),momHep.x(),momHep.y(),momHep.z());
488 HepMC::GenVertex* initVert = partHep->production_vertex();
489 HepMC::FourVector posHep = initVert->position();
490 posEvt.set(posHep.t(),posHep.x(),posHep.y(),posHep.z());
491 partEvt->init(idEvt,momEvt);
492 if (stype == EvtSpinType::DIRAC
507 EvtSpinDensity theSpinDensity;
508 theSpinDensity.SetDim(2);
509 theSpinDensity.Set(0, 0, EvtComplex(1./2. + polVec.
z()/2., 0.));
510 theSpinDensity.Set(0, 1, EvtComplex(polVec.
x()/2., -polVec.
y()/2.));
511 theSpinDensity.Set(1, 0, EvtComplex(polVec.
x()/2., polVec.
y()/2.));
512 theSpinDensity.Set(1, 1, EvtComplex(1./2. - polVec.
z()/2., 0.));
514 partEvt->setSpinDensityForwardHelicityBasis(theSpinDensity);
517 partEvt->setDiagonalSpinDensity();
526 static EvtStdHep evtstdhep;
529 partEvt->makeStdHep(evtstdhep);
532 partEvt->deleteTree();
537 HepMC::GenVertex* theVerts[200];
538 for (
int ivert = 0; ivert < 200; ivert++) {
542 for (
int ipart = 0; ipart < evtstdhep.getNPart(); ipart++) {
543 int theMum = evtstdhep.getFirstMother(ipart);
544 if (theMum != -1 && !theVerts[theMum]) {
545 EvtVector4R theVpos = evtstdhep.getX4(ipart) + posEvt;
547 new HepMC::GenVertex(HepMC::FourVector(theVpos.get(1),
555 partHep->set_status(2);
556 if (theVerts[0]) theVerts[0]->add_particle_in( partHep );
558 for (
int ipart2 = 1; ipart2 < evtstdhep.getNPart(); ipart2++) {
559 int idHep = evtstdhep.getStdHepID(ipart2);
562 evtstdhep.getP4(ipart2).get(2),
563 evtstdhep.getP4(ipart2).get(3),
564 evtstdhep.getP4(ipart2).get(0)),
566 evtstdhep.getIStat(ipart2));
568 thePart->suggest_barcode(npartial +
nPythia);
569 int theMum2 = evtstdhep.getFirstMother(ipart2);
570 if (theMum2 != -1 && theVerts[theMum2]) theVerts[theMum2]->add_particle_out( thePart );
571 if (theVerts[ipart2]) theVerts[ipart2]->add_particle_in( thePart );
575 for (
int ipart3 = 0; ipart3 < evtstdhep.getNPart(); ipart3++) {
576 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