513 int nParton = typeIdx[0].size();
516 if (!slowJet->setup(workEventJet)) {
518 "Warning in JetMatchingMadgraph:matchPartonsToJets" 519 "Light: the SlowJet algorithm failed on setup");
522 double localQcutSq =
qCutSq;
525 while (slowJet->sizeAll() - slowJet->sizeJet() > 0) {
526 if (slowJet->dNext() > localQcutSq)
528 dOld = slowJet->dNext();
531 int nJets = slowJet->sizeJet();
532 int nClus = slowJet->sizeAll();
539 int nCLjets = nClus -
nJets;
546 ?
npNLO() - typeIdx[2].size()
574 if (nCLjets < nRequested)
579 if (nCLjets > nRequested)
589 if (
doFxFx &&
npNLO() < nJetMax && nCLjets > nRequested)
596 if (!slowJet->setup(workEventJet)) {
598 "Warning in JetMatchingMadgraph:matchPartonsToJets" 599 "Light: the SlowJet algorithm failed on setup");
606 while (slowJet->sizeAll() - slowJet->sizeJet() > 0) {
607 if (slowJet->dNext() > localQcutSq)
614 while (slowJet->sizeAll() - slowJet->sizeJet() > nParton)
621 if (
clFact >= 0. && nParton > 0) {
624 for (
int i = 0;
i < nParton; ++
i)
625 partonPt.push_back(eventProcess[typeIdx[0][
i]].pT2());
629 nJets = slowJet->sizeJet();
630 nClus = slowJet->sizeAll();
637 tempEvent.init(
"(tempEvent)", particleDataPtr);
639 double pTminEstimate = -1.;
643 for (
int i =
nJets;
i < nClus; ++
i) {
645 ID_GLUON, 98, 0, 0, 0, 0, 0, 0, slowJet->p(
i).px(), slowJet->p(
i).py(), slowJet->p(
i).pz(), slowJet->p(
i).e());
647 pTminEstimate =
max(pTminEstimate, slowJet->pT(
i));
648 if (
nPass == nRequested)
652 int tempSize = tempEvent.size();
654 vector<bool> jetAssigned;
655 jetAssigned.assign(tempSize,
false);
659 vector<vector<bool> > partonMatchesJet;
660 partonMatchesJet.reserve(nParton);
661 for (
int i = 0;
i < nParton; ++
i)
662 partonMatchesJet.push_back(vector<bool>(tempEvent.size(),
false));
679 while (
doFxFx && iNow < tempSize) {
682 tempEventJet.init(
"(tempEventJet)", particleDataPtr);
683 for (
int i = 0;
i < nParton; ++
i) {
689 tempEventJet.clear();
690 tempEventJet.append(ID_GLUON,
698 tempEvent[iNow].
px(),
699 tempEvent[iNow].
py(),
700 tempEvent[iNow].pz(),
701 tempEvent[iNow].
e());
703 Vec4 pIn = eventProcess[typeIdx[0][
i]].p();
704 tempEventJet.append(ID_GLUON, 99, 0, 0, 0, 0, 0, 0, pIn.px(), pIn.py(), pIn.pz(), pIn.e());
707 if (!slowJet->setup(tempEventJet)) {
709 "Warning in JetMatchingMadgraph:matchPartonsToJets" 710 "Light: the SlowJet algorithm failed on setup");
715 if (slowJet->iNext() == tempEventJet.size() - 1 && slowJet->jNext() > -1 && slowJet->dNext() < localQcutSq) {
716 jetAssigned[iNow] =
true;
717 partonMatchesJet[
i][iNow] =
true;
722 if (jetAssigned[iNow])
737 if (
npNLO() < nJetMax && nMatched != nRequested)
738 return UNMATCHED_PARTON;
739 if (
npNLO() == nJetMax && nMatched < nRequested)
740 return UNMATCHED_PARTON;
750 while (!
doFxFx && iNow < nParton) {
752 tempEventJet.init(
"(tempEventJet)", particleDataPtr);
753 for (
int i = 0;
i < tempSize; ++
i) {
756 Vec4 pIn = tempEvent[
i].p();
758 tempEventJet.append(ID_GLUON, 98, 0, 0, 0, 0, 0, 0, pIn.px(), pIn.py(), pIn.pz(), pIn.e());
761 Vec4 pIn = eventProcess[typeIdx[0][iNow]].p();
763 tempEventJet.append(ID_GLUON, 99, 0, 0, 0, 0, 0, 0, pIn.px(), pIn.py(), pIn.pz(), pIn.e());
764 if (!slowJet->setup(tempEventJet)) {
766 "Warning in JetMatchingMadgraph:matchPartonsToJets" 767 "Light: the SlowJet algorithm failed on setup");
772 if (slowJet->iNext() == tempEventJet.size() - 1 && slowJet->jNext() > -1 && slowJet->dNext() < localQcutSq) {
774 for (
int i = 0;
i != tempSize; ++
i) {
779 if (iKnt == slowJet->jNext())
780 jetAssigned[
i] =
true;
783 return UNMATCHED_PARTON;
790 if (nParton > 0 && pTminEstimate > 0)
791 eTpTlightMin = pTminEstimate;
constexpr int pow2(int x)
void setDJR(const Pythia8::Event &event)
Pythia8::Event workEventJetSave