00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012 #include <iostream>
00013 #include "jbltools/kinfit/FourJetPairing.h"
00014 #include "jbltools/kinfit/JetFitObject.h"
00015
00016 FourJetPairing::FourJetPairing (JetFitObject *jets_[]) {
00017
00018 for (int i = 0; i < NJETS; ++i) jets[i] = jets_[i];
00019 iperm = 0;
00020
00021
00022
00023 int perms[NPERM][NJETS] = {{1, 2, 3, 4},
00024 {1, 3, 2, 4},
00025 {1, 4, 2, 3}};
00026
00027 for (int i = 0; i < NPERM; ++i)
00028 for (int j = 0; j < NJETS; ++j)
00029 permutations[i][j] = perms[i][j];
00030
00031 }
00032
00033 int FourJetPairing::nextPermutation (JetFitObject *permObjects[]) {
00034
00035 for (int ijet = 0; ijet < NJETS; ++ijet) {
00036 permObjects[ijet] = jets[permutations[iperm][ijet]-1];
00037 }
00038
00039 ++iperm;
00040 return iperm;
00041 }
00042
00043
00044
00045