84 for (
int m=0;
m<maxcombos;
m++) { list = list + (
itoa(
m));}
87 for (
int m=0;
m<kcombos;
m++) { seed = seed + (
itoa(
m));}
90 std::map< int, std::string > aTemplateCombos;
91 aTemplateCombos.clear();
93 aTemplateCombos[0] = seed;
96 int totalmatches = seed.size();
97 int totalIte = list.size();
99 for (
int ite = 0; ite < ((int)totalIte); ite++) {
104 for ( i=0; i< (int) totalmatches; i++) {
117 for (
int itemp=0; itemp<(int)newseed.size(); itemp++) {
118 if (itemp!=i) newseed2 = newseed2 + (newseed[itemp]);
129 for (
int j=0;
j<(int) list.size();
j++) {
131 bool Isnewelement =
true;
134 for (
int k=0;
k< (int)newseed2.size();
k++) {
135 if ( list[
j] == newseed2[
k] ) Isnewelement =
false;
139 newelement = list[
j];
143 candseed = candseed + newelement;
145 bool IsnewCombo =
true;
146 for (
int ic=0; ic<(int)aTemplateCombos.size(); ++ic ) {
149 for (
int ij=0; ij<(int)(aTemplateCombos[ic]).size(); ij++) {
151 for (
int ik=0; ik<(int)candseed.size(); ik++) {
152 if ( candseed[ik] == aTemplateCombos[ic][ij] ) nmatch++;
155 if (nmatch == (
int)totalmatches)
161 aTemplateCombos[(int)aTemplateCombos.size()] = candseed;
179 return aTemplateCombos;
191 std::map< int, std::string > aTemplateCombos;
192 aTemplateCombos.clear();
194 aTemplateCombos[0] =
"0123";
195 aTemplateCombos[1] =
"0132";
196 aTemplateCombos[2] =
"0213";
197 aTemplateCombos[3] =
"0231";
198 aTemplateCombos[4] =
"0312";
199 aTemplateCombos[5] =
"0321";
200 aTemplateCombos[6] =
"1203";
201 aTemplateCombos[7] =
"1230";
202 aTemplateCombos[8] =
"1302";
203 aTemplateCombos[9] =
"1320";
204 aTemplateCombos[10] =
"2301";
205 aTemplateCombos[11] =
"2310";
207 return aTemplateCombos;
216 std::map< Combo, int, minChi2 > allCombos;
217 std::map< Combo, int, maxSumEt > allCombosSumEt;
219 std::map< int, std::string > aTemplateCombos;
220 aTemplateCombos.clear();
222 if ( jets.size() == 4 ) aTemplateCombos[0] =
std::string(
"0123");
230 if (
verbosef)
std::cout <<
"[JetCombinatorics] size of vector of jets = " << jets.size() << std::endl;
232 for (
size_t ic=0; ic != aTemplateCombos.size(); ++ic) {
234 if (
verbosef)
std::cout <<
"[JetCombinatorics] get 4 jets from the list, cluster # " << ic <<
"/"<< aTemplateCombos.size()-1 << std::endl;
239 if (
verbosef)
std::cout <<
"[JetCombinatorics] template of 4 jets = " << aTemplate << std::endl;
242 std::vector< TLorentzVector > the4jets;
243 std::vector< int > the4Ids;
244 std::vector< double > thebdisc;
245 std::vector< double > theFlvCorr;
248 for (
int ij=0; ij<4; ij++) {
252 int tmpi = atoi((aTemplate.substr(ij,1)).c_str());
254 the4jets.push_back(jets[tmpi]);
255 the4Ids.push_back(tmpi);
256 if (
UsebTagging_ ) thebdisc.push_back( bdiscriminators[tmpi] );
260 if (
verbosef)
std::cout<<
"[JetCombinatorics] with these 4 jets, make 12 combinations: " <<std::endl;
272 acombo.
SetWp( the4jets[atoi((a4template.substr(0,1)).c_str())] );
273 acombo.
SetWq( the4jets[atoi((a4template.substr(1,1)).c_str())] );
274 acombo.
SetHadb( the4jets[atoi((a4template.substr(2,1)).c_str())] );
275 acombo.
SetLepb( the4jets[atoi((a4template.substr(3,1)).c_str())] );
278 acombo.
SetIdWp( the4Ids[atoi((a4template.substr(0,1)).c_str())] );
279 acombo.
SetIdWq( the4Ids[atoi((a4template.substr(1,1)).c_str())] );
280 acombo.
SetIdHadb( the4Ids[atoi((a4template.substr(2,1)).c_str())] );
281 acombo.
SetIdLepb( the4Ids[atoi((a4template.substr(3,1)).c_str())] );
285 acombo.
SetFlvCorrWp( theFlvCorr[atoi((a4template.substr(0,1)).c_str())] );
286 acombo.
SetFlvCorrWq( theFlvCorr[atoi((a4template.substr(1,1)).c_str())] );
287 acombo.
SetFlvCorrHadb( theFlvCorr[atoi((a4template.substr(2,1)).c_str())] );
288 acombo.
SetFlvCorrLepb( theFlvCorr[atoi((a4template.substr(3,1)).c_str())] );
295 acombo.
SetWp_disc( thebdisc[atoi((a4template.substr(0,1)).c_str())] );
296 acombo.
SetWq_disc( thebdisc[atoi((a4template.substr(1,1)).c_str())] );
297 acombo.
SetHadb_disc( thebdisc[atoi((a4template.substr(2,1)).c_str())] );
298 acombo.
SetLepb_disc( thebdisc[atoi((a4template.substr(3,1)).c_str())] );
310 std::cout <<
"[JetCombinatorics] ==> combination done:" << std::endl;
315 TLorentzVector aHadWP4 = acombo.
GetHadW();
316 TLorentzVector aLepWP4 = acombo.
GetLepW();
317 TLorentzVector aLepTopP4=acombo.
GetLepTop();
323 allCombos[acombo] =
n;
324 allCombosSumEt[acombo] =
n;
341 for ( std::map<Combo,int,minChi2>::const_iterator ite=
allCombos_.begin();
344 if (j == n) a = ite->first;
357 for ( std::map<Combo,int,maxSumEt>::const_iterator ite=
allCombosSumEt_.begin();
360 if (j == n) a = ite->first;
void UseMtopConstraint(bool option=true)
std::vector< double > flavorCorrections_
void FourJetsCombinations(const std::vector< TLorentzVector > &jets, const std::vector< double > &bdiscriminators)
void SetLepb_disc(double disc)
std::map< int, std::string > Template5jCombos_
void SetbDiscPdf(const TString &filename)
std::string itoa(int current)
std::map< int, std::string > Combinatorics(int k, int max=6)
void ApplyFlavorCorrections(bool option=true)
std::map< Combo, int, minChi2 > allCombos_
void SetFlvCorrLepb(double corr)
void SetWp_disc(double disc)
void SetHadb_disc(double disc)
void SetFlvCorrWq(double corr)
std::vector< TLorentzVector > cand1_
std::map< int, std::string > NestedCombinatorics()
void SetLepb(const TLorentzVector &Lepb)
const T & max(const T &a, const T &b)
void SetWq(const TLorentzVector &Wq)
Combo GetCombination(int n=0)
void SetHadb(const TLorentzVector &Hadb)
std::map< Combo, int, maxSumEt > allCombosSumEt_
std::map< int, std::string > Template4jCombos_
void SetFlvCorrWp(double corr)
Combo GetCombinationSumEt(int n=0)
void SetWq_disc(double disc)
void SetFlvCorrHadb(double corr)
void SetLepW(const TLorentzVector &LepW)
TLorentzVector GetLepTop()
void Usebtagging(bool option=true)
std::map< int, std::string > Template7jCombos_
std::map< int, std::string > Template6jCombos_
void SetSigmas(int type=0)
void SetWp(const TLorentzVector &Wp)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run