455 EvtSpinType::spintype stype = EvtPDL::getSpinType(idEvt);
456 EvtParticle* partEvt;
458 case EvtSpinType::SCALAR:
459 partEvt =
new EvtScalarParticle();
462 partEvt =
new EvtStringParticle();
464 case EvtSpinType::DIRAC:
465 partEvt =
new EvtDiracParticle();
467 case EvtSpinType::VECTOR:
468 partEvt =
new EvtVectorParticle();
470 case EvtSpinType::RARITASCHWINGER:
471 partEvt =
new EvtRaritaSchwingerParticle();
473 case EvtSpinType::TENSOR:
474 partEvt =
new EvtTensorParticle();
476 case EvtSpinType::SPIN5HALF:
case EvtSpinType::SPIN3:
case EvtSpinType::SPIN7HALF:
case EvtSpinType::SPIN4:
477 partEvt =
new EvtHighSpinParticle();
480 std::cout <<
"Unknown spintype in EvtSpinType!" << std::endl;
486 HepMC::FourVector momHep = partHep->momentum();
487 momEvt.set(momHep.t(),momHep.x(),momHep.y(),momHep.z());
489 HepMC::GenVertex* initVert = partHep->production_vertex();
490 HepMC::FourVector posHep = initVert->position();
491 posEvt.set(posHep.t(),posHep.x(),posHep.y(),posHep.z());
492 partEvt->init(idEvt,momEvt);
493 if (stype == EvtSpinType::DIRAC
508 EvtSpinDensity theSpinDensity;
509 theSpinDensity.SetDim(2);
510 theSpinDensity.Set(0, 0, EvtComplex(1./2. + polVec.
z()/2., 0.));
511 theSpinDensity.Set(0, 1, EvtComplex(polVec.
x()/2., -polVec.
y()/2.));
512 theSpinDensity.Set(1, 0, EvtComplex(polVec.
x()/2., polVec.
y()/2.));
513 theSpinDensity.Set(1, 1, EvtComplex(1./2. - polVec.
z()/2., 0.));
515 partEvt->setSpinDensityForwardHelicityBasis(theSpinDensity);
518 partEvt->setDiagonalSpinDensity();
527 static EvtStdHep evtstdhep;
530 partEvt->makeStdHep(evtstdhep);
533 partEvt->deleteTree();
538 HepMC::GenVertex* theVerts[200];
539 for (
int ivert = 0; ivert < 200; ivert++) {
543 for (
int ipart = 0; ipart < evtstdhep.getNPart(); ipart++) {
544 int theMum = evtstdhep.getFirstMother(ipart);
545 if (theMum != -1 && !theVerts[theMum]) {
546 EvtVector4R theVpos = evtstdhep.getX4(ipart) + posEvt;
548 new HepMC::GenVertex(HepMC::FourVector(theVpos.get(1),
556 partHep->set_status(2);
557 if (theVerts[0]) theVerts[0]->add_particle_in( partHep );
559 for (
int ipart2 = 1; ipart2 < evtstdhep.getNPart(); ipart2++) {
560 int idHep = evtstdhep.getStdHepID(ipart2);
563 evtstdhep.getP4(ipart2).get(2),
564 evtstdhep.getP4(ipart2).get(3),
565 evtstdhep.getP4(ipart2).get(0)),
567 evtstdhep.getIStat(ipart2));
569 thePart->suggest_barcode(npartial +
nPythia);
570 int theMum2 = evtstdhep.getFirstMother(ipart2);
571 if (theMum2 != -1 && theVerts[theMum2]) theVerts[theMum2]->add_particle_out( thePart );
572 if (theVerts[ipart2]) theVerts[ipart2]->add_particle_in( thePart );
576 for (
int ipart3 = 0; ipart3 < evtstdhep.getNPart(); ipart3++) {
577 if (theVerts[ipart3]) theEvent->add_vertex( theVerts[ipart3] );
std::map< int, float > polarizations
U second(std::pair< T, U > const &p)
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
void go_through_daughters(EvtParticle *part)
Vector3DBase unit() const