19 sprintf(
temp,
"%d",
i);
73 for (
int m = 0;
m < maxcombos;
m++) {
74 list = list + (
itoa(
m));
78 for (
int m = 0;
m < kcombos;
m++) {
82 std::map<int, std::string> aTemplateCombos;
83 aTemplateCombos.clear();
85 aTemplateCombos[0] =
seed;
88 int totalmatches =
seed.size();
89 int totalIte = list.size();
91 for (
int ite = 0; ite < ((
int)totalIte); ite++) {
95 for (
i = 0;
i < (
int)totalmatches;
i++) {
107 for (
int itemp = 0; itemp < (
int)newseed.size(); itemp++) {
109 newseed2 = newseed2 + (newseed[itemp]);
120 for (
int j = 0;
j < (
int)list.size();
j++) {
122 bool Isnewelement =
true;
125 for (
int k = 0;
k < (
int)newseed2.size();
k++) {
126 if (list[
j] == newseed2[
k])
127 Isnewelement =
false;
130 newelement = list[
j];
134 candseed = candseed + newelement;
136 bool IsnewCombo =
true;
137 for (
int ic = 0; ic < (
int)aTemplateCombos.size(); ++ic) {
139 for (
int ij = 0; ij < (
int)(aTemplateCombos[ic]).size(); ij++) {
140 for (
int ik = 0; ik < (
int)candseed.size(); ik++) {
141 if (candseed[ik] == aTemplateCombos[ic][ij])
145 if (nmatch == (
int)totalmatches)
150 aTemplateCombos[(
int)aTemplateCombos.size()] = candseed;
167 return aTemplateCombos;
174 std::map<int, std::string> aTemplateCombos;
175 aTemplateCombos.clear();
177 aTemplateCombos[0] =
"0123";
178 aTemplateCombos[1] =
"0132";
179 aTemplateCombos[2] =
"0213";
180 aTemplateCombos[3] =
"0231";
181 aTemplateCombos[4] =
"0312";
182 aTemplateCombos[5] =
"0321";
183 aTemplateCombos[6] =
"1203";
184 aTemplateCombos[7] =
"1230";
185 aTemplateCombos[8] =
"1302";
186 aTemplateCombos[9] =
"1320";
187 aTemplateCombos[10] =
"2301";
188 aTemplateCombos[11] =
"2310";
190 return aTemplateCombos;
197 std::map<Combo, int, minChi2> allCombos;
198 std::map<Combo, int, maxSumEt> allCombosSumEt;
200 std::map<int, std::string> aTemplateCombos;
201 aTemplateCombos.clear();
203 if (
jets.size() == 4)
205 if (
jets.size() == 5)
207 if (
jets.size() == 6)
209 if (
jets.size() == 7)
217 std::cout <<
"[JetCombinatorics] size of vector of jets = " <<
jets.size() << std::endl;
219 for (
size_t ic = 0; ic != aTemplateCombos.size(); ++ic) {
221 std::cout <<
"[JetCombinatorics] get 4 jets from the list, cluster # " << ic <<
"/" << aTemplateCombos.size() - 1
228 std::cout <<
"[JetCombinatorics] template of 4 jets = " << aTemplate << std::endl;
231 std::vector<TLorentzVector> the4jets;
232 std::vector<int> the4Ids;
233 std::vector<double> thebdisc;
234 std::vector<double> theFlvCorr;
237 for (
int ij = 0; ij < 4; ij++) {
241 int tmpi = atoi((aTemplate.substr(ij, 1)).c_str());
243 the4jets.push_back(
jets[tmpi]);
244 the4Ids.push_back(tmpi);
252 std::cout <<
"[JetCombinatorics] with these 4 jets, make 12 combinations: " << std::endl;
260 std::cout <<
"[JetCombinatorics] ==> combination: " << a4template <<
" is # " << itemplate <<
"/"
265 acombo.
SetWp(the4jets[atoi((a4template.substr(0, 1)).c_str())]);
266 acombo.
SetWq(the4jets[atoi((a4template.substr(1, 1)).c_str())]);
267 acombo.
SetHadb(the4jets[atoi((a4template.substr(2, 1)).c_str())]);
268 acombo.
SetLepb(the4jets[atoi((a4template.substr(3, 1)).c_str())]);
271 acombo.
SetIdWp(the4Ids[atoi((a4template.substr(0, 1)).c_str())]);
272 acombo.
SetIdWq(the4Ids[atoi((a4template.substr(1, 1)).c_str())]);
273 acombo.
SetIdHadb(the4Ids[atoi((a4template.substr(2, 1)).c_str())]);
274 acombo.
SetIdLepb(the4Ids[atoi((a4template.substr(3, 1)).c_str())]);
278 acombo.
SetFlvCorrWp(theFlvCorr[atoi((a4template.substr(0, 1)).c_str())]);
279 acombo.
SetFlvCorrWq(theFlvCorr[atoi((a4template.substr(1, 1)).c_str())]);
280 acombo.
SetFlvCorrHadb(theFlvCorr[atoi((a4template.substr(2, 1)).c_str())]);
281 acombo.
SetFlvCorrLepb(theFlvCorr[atoi((a4template.substr(3, 1)).c_str())]);
287 acombo.
SetWp_disc(thebdisc[atoi((a4template.substr(0, 1)).c_str())]);
288 acombo.
SetWq_disc(thebdisc[atoi((a4template.substr(1, 1)).c_str())]);
289 acombo.
SetHadb_disc(thebdisc[atoi((a4template.substr(2, 1)).c_str())]);
290 acombo.
SetLepb_disc(thebdisc[atoi((a4template.substr(3, 1)).c_str())]);
300 std::cout <<
"[JetCombinatorics] ==> combination done:" << std::endl;
305 TLorentzVector aHadWP4 = acombo.
GetHadW();
306 TLorentzVector aLepWP4 = acombo.
GetLepW();
307 TLorentzVector aLepTopP4 = acombo.
GetLepTop();
312 allCombos[acombo] =
n;
313 allCombosSumEt[acombo] =
n;
327 for (std::map<Combo, int, minChi2>::const_iterator ite =
allCombos_.begin(); ite !=
allCombos_.end(); ++ite) {