439 EvtSpinType::spintype stype = EvtPDL::getSpinType(idEvt);
440 EvtParticle* partEvt;
442 case EvtSpinType::SCALAR:
443 partEvt =
new EvtScalarParticle();
446 partEvt =
new EvtStringParticle();
448 case EvtSpinType::DIRAC:
449 partEvt =
new EvtDiracParticle();
451 case EvtSpinType::VECTOR:
452 partEvt =
new EvtVectorParticle();
454 case EvtSpinType::RARITASCHWINGER:
455 partEvt =
new EvtRaritaSchwingerParticle();
457 case EvtSpinType::TENSOR:
458 partEvt =
new EvtTensorParticle();
460 case EvtSpinType::SPIN5HALF:
case EvtSpinType::SPIN3:
case EvtSpinType::SPIN7HALF:
case EvtSpinType::SPIN4:
461 partEvt =
new EvtHighSpinParticle();
464 std::cout <<
"Unknown spintype in EvtSpinType!" << std::endl;
470 HepMC::FourVector momHep = partHep->momentum();
471 momEvt.set(momHep.t(),momHep.x(),momHep.y(),momHep.z());
473 HepMC::GenVertex* initVert = partHep->production_vertex();
474 HepMC::FourVector posHep = initVert->position();
475 posEvt.set(posHep.t(),posHep.x(),posHep.y(),posHep.z());
476 partEvt->init(idEvt,momEvt);
477 partEvt->setDiagonalSpinDensity();
485 static EvtStdHep evtstdhep;
488 partEvt->makeStdHep(evtstdhep);
500 partEvt->deleteTree();
505 HepMC::GenVertex* theVerts[200];
506 for (
int ivert = 0; ivert < 200; ivert++) {
510 for (
int ipart = 0; ipart < evtstdhep.getNPart(); ipart++) {
511 int theMum = evtstdhep.getFirstMother(ipart);
512 if (theMum != -1 && !theVerts[theMum]) {
513 EvtVector4R theVpos = evtstdhep.getX4(ipart) + posEvt;
515 new HepMC::GenVertex(HepMC::FourVector(theVpos.get(1),
523 partHep->set_status(2);
524 if (theVerts[0]) theVerts[0]->add_particle_in( partHep );
526 for (
int ipart2 = 1; ipart2 < evtstdhep.getNPart(); ipart2++) {
527 int idHep = evtstdhep.getStdHepID(ipart2);
530 evtstdhep.getP4(ipart2).get(2),
531 evtstdhep.getP4(ipart2).get(3),
532 evtstdhep.getP4(ipart2).get(0)),
534 evtstdhep.getIStat(ipart2));
536 thePart->suggest_barcode(npartial +
nPythia);
537 int theMum2 = evtstdhep.getFirstMother(ipart2);
538 if (theMum2 != -1 && theVerts[theMum2]) theVerts[theMum2]->add_particle_out( thePart );
539 if (theVerts[ipart2]) theVerts[ipart2]->add_particle_in( thePart );
543 for (
int ipart3 = 0; ipart3 < evtstdhep.getNPart(); ipart3++) {
544 if (theVerts[ipart3]) theEvent->add_vertex( theVerts[ipart3] );
void go_through_daughters(EvtParticle *part)