23 hepeup.
PUP[index][3]);
44 for(
int i = nup - 2;
i != nup; ++
i) {
45 bosonPx += hepeup.
PUP[
i][0];
46 bosonPy += hepeup.
PUP[
i][1];
47 bosonPz += hepeup.
PUP[
i][2];
48 bosonE += hepeup.
PUP[
i][3];
49 hepeup.
MOTHUP[
i].first = nup + 1;
51 iwch = (iwch - hepeup.
IDUP[
i] % 2);
62 double bosonMass =
std::sqrt(bosonE * bosonE -
66 if (iwch > 0) bosonId = 24;
67 if (iwch < 0) bosonId = -24;
70 hepeup.
IDUP[bosonIndex] = bosonId;
71 hepeup.
ISTUP[bosonIndex] = 2;
72 hepeup.
MOTHUP[bosonIndex].first = 1;
73 hepeup.
MOTHUP[bosonIndex].second = 2;
74 hepeup.
PUP[bosonIndex][0] = bosonPx;
75 hepeup.
PUP[bosonIndex][1] = bosonPy;
76 hepeup.
PUP[bosonIndex][2] = bosonPz;
77 hepeup.
PUP[bosonIndex][3] = bosonE;
78 hepeup.
PUP[bosonIndex][4] = bosonMass;
79 hepeup.
ICOLUP[bosonIndex].first = 0;
80 hepeup.
ICOLUP[bosonIndex].second = 0;
83 for(
int i = 0;
i < hepeup.
NUP;
i++)
95 for(
int i = 0;
i != nup; ++
i) {
98 if(ivstart == 0) ivstart =
i;
102 int nvb = ivend-ivstart;
105 for(
int i = 0;
i != nvb; ++
i) {
106 hepeup.
MOTHUP[nup - 2*
i -1].first = ivend-
i;
107 hepeup.
MOTHUP[nup - 2*i -2].first = ivend-
i;
108 hepeup.
MOTHUP[nup - 2*i -1].second = 0;
109 hepeup.
MOTHUP[nup - 2*i -2].second = 0;
113 for(
int i = 0;
i < hepeup.
NUP;
i++)
121 using namespace math;
123 int nup = hepeup.
NUP;
126 int thirdID = hepeup.
IDUP[2];
128 std::cout <<
"Top is NOT in the third position - no need to fix." << std::endl;
153 for (
int iw = 0; iw != 2; ++iw) {
154 int iwdec = nup - 4 + 2*iw;
158 for(
int iup = iwdec; iup != iwdec+2; ++iup){
159 hepeup.
MOTHUP[iup].first = iwup+1;
160 hepeup.
MOTHUP[iup].second = 0;
161 iwch = (iwch - hepeup.
IDUP[iup]%2);
164 hepeup.
IDUP[iwup] = 24;
165 hepeup.
IDUP[ibup] = 5;
166 hepeup.
MOTHUP[iwup].first = it+1;
167 hepeup.
MOTHUP[iwup].second = 0;
168 hepeup.
MOTHUP[ibup].first = it+1;
169 hepeup.
MOTHUP[ibup].second = 0;
172 hepeup.
IDUP[iwup] = -24;
173 hepeup.
IDUP[ibup] = -5;
174 hepeup.
MOTHUP[iwup].first = itbar+1;
175 hepeup.
MOTHUP[iwup].second = 0;
176 hepeup.
MOTHUP[ibup].first = itbar+1;
177 hepeup.
MOTHUP[ibup].second = 0;
179 hepeup.
ISTUP[iwup] = 2;
180 hepeup.
ISTUP[ibup] = 1;
189 hepeup.
PUP[iwup][0] = bosonW.Px();
190 hepeup.
PUP[iwup][1] = bosonW.Py();
191 hepeup.
PUP[iwup][2] = bosonW.Pz();
192 hepeup.
PUP[iwup][3] = bosonW.E();
193 hepeup.
PUP[iwup][4] = bosonW.M();
196 int topIndex = (hepeup.
MOTHUP[iwup].first)-1;
201 hepeup.
PUP[ibup][0] = bottomQuark.Px();
202 hepeup.
PUP[ibup][1] = bottomQuark.Py();
203 hepeup.
PUP[ibup][2] = bottomQuark.Pz();
204 hepeup.
PUP[ibup][3] = bottomQuark.E();
205 hepeup.
PUP[ibup][4] = bottomQuark.M();
208 hepeup.
ICOLUP[iwup].first = 0;
209 hepeup.
ICOLUP[iwup].second = 0;
215 for(
int i = 0;
i < hepeup.
NUP;
i++)
223 using namespace math;
225 int nup = hepeup.
NUP;
228 int fourthID = hepeup.
IDUP[3];
230 std::cout <<
"Top is NOT in the fourth position - no need to fix." << std::endl;
255 for (
int iw = 0; iw != 2; ++iw) {
256 int iwdec = nup - 4 + 2*iw;
260 for(
int iup = iwdec; iup != iwdec+2; ++iup){
261 hepeup.
MOTHUP[iup].first = iwup+1;
262 hepeup.
MOTHUP[iup].second = 0;
263 iwch = (iwch - hepeup.
IDUP[iup]%2);
266 hepeup.
IDUP[iwup] = 24;
267 hepeup.
IDUP[ibup] = 5;
268 hepeup.
MOTHUP[iwup].first = it+1;
269 hepeup.
MOTHUP[iwup].second = 0;
270 hepeup.
MOTHUP[ibup].first = it+1;
271 hepeup.
MOTHUP[ibup].second = 0;
274 hepeup.
IDUP[iwup] = -24;
275 hepeup.
IDUP[ibup] = -5;
276 hepeup.
MOTHUP[iwup].first = itbar+1;
277 hepeup.
MOTHUP[iwup].second = 0;
278 hepeup.
MOTHUP[ibup].first = itbar+1;
279 hepeup.
MOTHUP[ibup].second = 0;
281 hepeup.
ISTUP[iwup] = 2;
282 hepeup.
ISTUP[ibup] = 1;
291 hepeup.
PUP[iwup][0] = bosonW.Px();
292 hepeup.
PUP[iwup][1] = bosonW.Py();
293 hepeup.
PUP[iwup][2] = bosonW.Pz();
294 hepeup.
PUP[iwup][3] = bosonW.E();
295 hepeup.
PUP[iwup][4] = bosonW.M();
298 int topIndex = (hepeup.
MOTHUP[iwup].first)-1;
303 hepeup.
PUP[ibup][0] = bottomQuark.Px();
304 hepeup.
PUP[ibup][1] = bottomQuark.Py();
305 hepeup.
PUP[ibup][2] = bottomQuark.Pz();
306 hepeup.
PUP[ibup][3] = bottomQuark.E();
307 hepeup.
PUP[ibup][4] = bottomQuark.M();
310 hepeup.
ICOLUP[iwup].first = 0;
311 hepeup.
ICOLUP[iwup].second = 0;
317 for(
int i = 0;
i < hepeup.
NUP;
i++)
324 using namespace math;
326 int nup = hepeup.
NUP;
331 if(itopprc >= 3) nw = 2;
337 for(
int i =0;
i!= 2; ++
i) {
339 hepeup.
PUP[
i][4] = mb;
340 double energyb = hepeup.
PUP[
i][3];
349 if(hepeup.
IDUP[2] == 6)
351 else if(hepeup.
IDUP[2] == -6)
354 std::cout <<
"Wrong assumption about top position, stop." << std::endl;
372 for(
int iup = iwdec; iup != iwdec+2; ++iup) {
373 hepeup.
MOTHUP[iup].first = iwup+1;
374 hepeup.
MOTHUP[iup].second = 0;
375 iwch = (iwch - hepeup.
IDUP[iup]%2);
379 hepeup.
IDUP[iwup] = 24;
380 hepeup.
IDUP[ibup] = 5;
381 hepeup.
MOTHUP[iwup].first = it+1;
382 hepeup.
MOTHUP[iwup].second = 0;
383 hepeup.
MOTHUP[ibup].first = it+1;
384 hepeup.
MOTHUP[ibup].second = 0;
387 hepeup.
IDUP[iwup] = -24;
388 hepeup.
IDUP[ibup] = -5;
389 hepeup.
MOTHUP[iwup].first = itbar+1;
390 hepeup.
MOTHUP[iwup].second = 0;
391 hepeup.
MOTHUP[ibup].first = itbar+1;
392 hepeup.
MOTHUP[ibup].second = 0;
394 hepeup.
ISTUP[iwup] = 2;
395 hepeup.
ISTUP[ibup] = 1;
404 hepeup.
PUP[iwup][0] = bosonW.Px();
405 hepeup.
PUP[iwup][1] = bosonW.Py();
406 hepeup.
PUP[iwup][2] = bosonW.Pz();
407 hepeup.
PUP[iwup][3] = bosonW.E();
408 hepeup.
PUP[iwup][4] = bosonW.M();
411 int topIndex = (hepeup.
MOTHUP[iwup].first)-1;
416 hepeup.
PUP[ibup][0] = bottomQuark.Px();
417 hepeup.
PUP[ibup][1] = bottomQuark.Py();
418 hepeup.
PUP[ibup][2] = bottomQuark.Pz();
419 hepeup.
PUP[ibup][3] = bottomQuark.E();
420 hepeup.
PUP[ibup][4] = bottomQuark.M();
423 hepeup.
ICOLUP[iwup].first = 0;
424 hepeup.
ICOLUP[iwup].second = 0;
439 for(
int iup = iwdec; iup != iwdec+2; ++iup) {
440 hepeup.
MOTHUP[iup].first = iwup+1;
441 hepeup.
MOTHUP[iup].second = 0;
442 iwch = (iwch - hepeup.
IDUP[iup]%2);
444 hepeup.
ISTUP[iwup] = 2;
445 hepeup.
ICOLUP[iwup].first = 0;
446 hepeup.
ICOLUP[iwup].second = 0;
math::XYZTLorentzVector vectorFromHepeup(const lhef::HEPEUP &hepeup, int index)
U second(std::pair< T, U > const &p)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void fixEventWZ(lhef::HEPEUP &hepeup)
Fixes Event Record for ihrd = 1,2,3,4,10,14,15.
std::vector< std::pair< int, int > > MOTHUP
void fixEventMultiBoson(lhef::HEPEUP &hepeup)
Fixes Event Record for ihrd = 5.
void fixEventHiggsTTbar(lhef::HEPEUP &hepeup)
Fixes Event Record for ihrd = 8.
std::vector< FiveVector > PUP
std::vector< double > SPINUP
Abs< T >::type abs(const T &t)
void fixEventSingleTop(lhef::HEPEUP &hepeup, double mb, int itopprc)
Fixes Event Record for ihrd = 13.
void fixEventTTbar(lhef::HEPEUP &hepeup)
Fixes Event Record for ihrd = 6.
std::vector< std::pair< int, int > > ICOLUP
math::XYZTLorentzVector XYZTLorentzVector