// Functions for four-vector class // Glen Cowan, RHUL Physics Dept., 4 December 2001. #include #include #include #include #include "Utils.h" #include "FourVector.h" #include "GenEvent.h" #include "random.h" GenEvent::GenEvent (FourVector P1, FourVector P2, FourVector P3, FourVector P4){ P1Val = P1; P2Val = P2; P3Val = P3; P4Val = P4; flav1Val = 0; flav2Val = 0; flav3Val = 0; flav4Val = 0; } GenEvent::GenEvent (FourVector P1, int flav1, FourVector P2, int flav2, FourVector P3, int flav3, FourVector P4, int flav4){ P1Val = P1; P2Val = P2; P3Val = P3; P4Val = P4; flav1Val = flav1; flav2Val = flav2; flav3Val = flav3; flav4Val = flav4; } GenEvent::GenEvent(){ flav1Val = 0; flav2Val = 0; flav3Val = 0; flav4Val = 0; } FourVector GenEvent::P1() { return P1Val; } FourVector GenEvent::P2() { return P2Val; } FourVector GenEvent::P3() { return P3Val; } FourVector GenEvent::P4() { return P4Val; } int GenEvent::flav1() { return flav1Val; } int GenEvent::flav2() { return flav2Val; } int GenEvent::flav3() { return flav3Val; } int GenEvent::flav4() { return flav4Val; } void GenEvent::shuffle_jets(){ vector v; for (int i=0; i<4; i++){ v.push_back(i); } FourVector Ptemp[4]; int ftemp[4]; Ptemp[v[0]] = P1Val; Ptemp[v[1]] = P2Val; Ptemp[v[2]] = P3Val; Ptemp[v[3]] = P4Val; ftemp[v[0]] = flav1Val; ftemp[v[1]] = flav2Val; ftemp[v[2]] = flav3Val; ftemp[v[3]] = flav4Val; random_shuffle(v.begin(), v.end()); P1Val = Ptemp[v[0]]; P2Val = Ptemp[v[1]]; P3Val = Ptemp[v[2]]; P4Val = Ptemp[v[3]]; flav1Val = ftemp[v[0]]; flav2Val = ftemp[v[1]]; flav3Val = ftemp[v[2]]; flav4Val = ftemp[v[3]]; }