8 const Event& workEvent,
10 const std::vector<int>* typeIdx) {
13 Event workEventJet = workEvent;
17 std::set<int> typeSet[3];
23 for (
size_t i = 0;
i < 3;
i++) {
25 for (
size_t j = 0;
j < typeIdx[
i].size();
j++) {
32 int pos = typeIdx[
i][
j];
35 for (
int ip = 2; ip <
pos; ip++) {
40 if (hepeup.
MOTHUP[ip].first == hepeup.
MOTHUP[ip].second) {
46 typeSet[
i].insert(
pos);
59 for (
int i = 0;
i < workEventJet.size(); ++
i) {
60 if (!workEventJet[
i].isFinal())
67 int id = workEventJet[
i].idAbs();
69 workEventJet[
i].statusNeg();
75 int idx = workEventJet[
i].daughter1();
83 workEventJet[
i].statusNeg();
92 idx =
event[
idx].mother1();
95 }
else if (iType == 1) {
103 workEventJet[
i].statusNeg();
108 idx =
event[
idx].mother1();
141 for (
int i = 0;
i < workEventJet.size();
i++) {
144 if (workEventJet[
i].
status() < 0)
157 fastjet::PseudoJet partTmp = workEventJet[
i];
165 int parentId = fullEvent[
pos].mother1();
166 int parentPrevId = 0;
169 while (parentId > 0) {
170 if (parentId == fullEvent[
counter].mother2())
172 parentPrevId = parentId;
174 parentId = fullEvent[parentPrevId].mother1();
182 if ((parentId < parentPrevId) || parentId < fullEvent[
counter].mother2())
191 parentPrevId = parentId;
192 parentId = fullEvent[parentPrevId].mother1();
194 }
else if (parentId > parentPrevId ||
203 if (
abs(fullEvent[parentId].
status()) == 22 ||
abs(fullEvent[parentId].
status()) == 23)
207 if (
abs(fullEvent[parentId].
status()) < 22)
217 #include "HepMC/HEPEVT_Wrapper.h"
221 const Event& workEvent,
223 const std::vector<int>*) {
226 HepMC::HEPEVT_Wrapper::zero_everything();
230 std::vector<int> Py8PartonIdx;
231 Py8PartonIdx.clear();
232 std::vector<int> HEPEVTPartonIdx;
233 HEPEVTPartonIdx.clear();
239 int Py8PartonCounter = 0;
240 int HEPEVTPartonCounter = 0;
244 for (
int iprt = 1; iprt <
event.size(); iprt++) {
250 Py8PartonCounter = iprt;
256 for (
int iprt = 2; iprt < hepeup.
NUP; iprt++) {
258 HepMC::HEPEVT_Wrapper::set_id(
index, hepeup.
IDUP[iprt]);
259 HepMC::HEPEVT_Wrapper::set_status(
index, 2);
260 HepMC::HEPEVT_Wrapper::set_momentum(
261 index, hepeup.
PUP[iprt][0], hepeup.
PUP[iprt][1], hepeup.
PUP[iprt][2], hepeup.
PUP[iprt][4]);
262 HepMC::HEPEVT_Wrapper::set_mass(
index, hepeup.
PUP[iprt][4]);
264 HepMC::HEPEVT_Wrapper::set_parents(
index, 0, 0);
265 HepMC::HEPEVT_Wrapper::set_children(
index, 0, 0);
266 if (hepeup.
MOTHUP[iprt].first > 2 &&
267 hepeup.
MOTHUP[iprt].second > 2)
269 HEPEVTPartonCounter++;
272 Py8PartonIdx.push_back(Py8PartonCounter);
274 HEPEVTPartonIdx.push_back(HEPEVTPartonCounter);
275 HEPEVTPartonCounter++;
278 HepMC::HEPEVT_Wrapper::set_number_entries(
index);
283 for (
int iprt = 1; iprt < workEvent.size(); iprt++)
288 if (
part.status() < 51)
291 HepMC::HEPEVT_Wrapper::set_id(
index,
part.id());
294 HepMC::HEPEVT_Wrapper::set_status(
index, 1);
296 HepMC::HEPEVT_Wrapper::set_mass(
index,
part.m());
298 HepMC::HEPEVT_Wrapper::set_parents(
index, 0, 0);
300 HepMC::HEPEVT_Wrapper::set_children(
index, 0, 0);
309 for (
int idx = 0;
idx < (
int)Py8PartonIdx.size();
idx++) {
310 if (parentId == Py8PartonIdx[
idx]) {
311 int idx1 = HEPEVTPartonIdx[
idx];
312 HepMC::HEPEVT_Wrapper::set_parents(
index, idx1 + 1, idx1 + 1);
318 HepMC::HEPEVT_Wrapper::set_number_entries(
index);