34 bool matchHadb =
false;
35 bool matchLepb =
false;
36 bool matchHadp =
false;
37 bool matchHadq =
false;
38 bool matchHadpq =
false;
39 bool matchHadqp =
false;
40 bool matchLepl =
false;
41 bool matchLepn =
false;
44 std::cout <<
"== start matching the objects " << std::endl;
46 double drLepl = 0, drLepn = 0, drHadb = 0, drLepb = 0, drHadp = 0, drHadq = 0, drHadpq = 0,
54 std::cout <<
"== not found genEvent " << std::endl;
55 }
else if (genEvent.
isValid()) {
57 std::cout <<
"== found genEvent " << std::endl;
62 std::cout <<
"== genEvent->isSemiLeptonic() && genEvent->numberOfBQuarks() == 2 " << std::endl;
77 std::cout <<
"== matching lepton " << std::endl;
78 if (solution.
getDecay() ==
"electron")
80 matchLepl = (drLepl < 0.3);
83 std::cout <<
"== lepton is matched " << std::endl;
86 matchLepn = (drLepn < 0.3);
90 matchHadb = (drHadb < 0.3);
94 matchLepb = (drLepb < 0.3);
98 matchHadp = (drHadp < 0.3);
102 matchHadpq = (drHadpq < 0.3);
106 matchHadq = (drHadq < 0.3);
110 matchHadqp = (drHadqp < 0.3);
137 std::cout <<
"== objects matched" << std::endl;
143 std::cout <<
"== start calculating observables" << std::endl;
156 std::cout <<
"== observable 1 " << Obs1 << std::endl;
163 IntBoolPair(2, ((matchHadp && matchHadq) || (matchHadpq && matchHadqp)) && matchHadb && matchLepb));
166 std::cout <<
"== observable 2 " << Obs2 << std::endl;
172 if (solution.
getDecay() ==
"electron")
178 std::cout <<
"== observable 3 " << Obs3 << std::endl;
187 std::cout <<
"== observable 4 " << Obs4 << std::endl;
195 std::cout <<
"== observable 5 " << Obs5 << std::endl;
210 std::cout <<
"== observable 6 " << Obs6 << std::endl;
223 std::cout <<
"== observable 7 " << Obs7 << std::endl;
231 std::cout <<
"== observable 8 " << Obs8 << std::endl;
239 std::cout <<
"== observable 9 " << Obs9 << std::endl;
247 std::cout <<
"== observable 10 " << Obs10 << std::endl;
255 std::cout <<
"== observable 11 " << Obs11 << std::endl;
263 std::cout <<
"== observable 12 " << Obs12 << std::endl;
271 std::cout <<
"== observable 13 " << Obs13 << std::endl;
279 std::cout <<
"== observable 14 " << Obs14 << std::endl;
287 std::cout <<
"== observable 15 " << Obs15 << std::endl;
295 std::cout <<
"== observable 16 " << Obs16 << std::endl;
303 std::cout <<
"== observable 17 " << Obs17 << std::endl;
311 std::cout <<
"== observable 18 " << Obs18 << std::endl;
319 std::cout <<
"== observable 19 " << Obs19 << std::endl;
327 std::cout <<
"== observable 20 " << Obs20 << std::endl;
335 std::cout <<
"== observable 21 " << Obs21 << std::endl;
343 std::cout <<
"== observable 22 " << Obs22 << std::endl;
351 std::cout <<
"== observable 23 " << Obs23 << std::endl;
359 std::cout <<
"== observable 24 " << Obs24 << std::endl;
367 std::cout <<
"== observable 25 " << Obs25 << std::endl;
375 std::cout <<
"== observable 26 " << Obs26 << std::endl;
383 std::cout <<
"== observable 27 " << Obs27 << std::endl;
391 std::cout <<
"== observable 28 " << Obs28 << std::endl;
399 std::cout <<
"== observable 29 " << Obs29 << std::endl;
407 std::cout <<
"== observable 30 " << Obs30 << std::endl;
415 std::cout <<
"== observable 31 " << Obs31 << std::endl;
418 double Obs32 = -999.;
421 if (solution.
getDecay() ==
"electron")
427 std::cout <<
"== observable 32 " << Obs32 << std::endl;
430 double Obs33 = -999.;
433 if (solution.
getDecay() ==
"electron")
439 std::cout <<
"== observable 33 " << Obs33 << std::endl;
442 double Obs34 = -999.;
445 if (solution.
getDecay() ==
"electron")
451 std::cout <<
"== observable 34 " << Obs34 << std::endl;
459 std::cout <<
"== observable 35 " << Obs35 << std::endl;
467 std::cout <<
"== observable 36 " << Obs36 << std::endl;
475 std::cout <<
"== observable 37 " << Obs37 << std::endl;
480 if (Obs38 > 3.1415927)
481 Obs38 = 2 * 3.1415927 - Obs31;
482 if (Obs38 < -3.1415927)
483 Obs38 = -2 * 3.1415927 - Obs31;
486 IntBoolPair(38, matchLepl && matchLepn && ((matchHadp && matchHadq) || (matchHadpq && matchHadqp))));
489 std::cout <<
"== observable 38 " << Obs38 << std::endl;
495 IntBoolPair(39, matchLepl && matchLepn && ((matchHadp && matchHadq) || (matchHadpq && matchHadqp))));
498 std::cout <<
"== observable 39 " << Obs39 << std::endl;
504 IntBoolPair(40, matchLepl && matchLepn && ((matchHadp && matchHadq) || (matchHadpq && matchHadqp))));
507 std::cout <<
"== observable 40 " << Obs40 << std::endl;
513 IntBoolPair(41, matchLepl && matchLepn && ((matchHadp && matchHadq) || (matchHadpq && matchHadqp))));
516 std::cout <<
"== observable 41 " << Obs41 << std::endl;
520 if (Obs42 > 3.1415927)
521 Obs42 = 2 * 3.1415927 - Obs42;
522 if (Obs42 < -3.1415927)
523 Obs42 = -2 * 3.1415927 - Obs42;
528 std::cout <<
"== observable 42 " << Obs42 << std::endl;
536 std::cout <<
"== observable 43 " << Obs43 << std::endl;
544 std::cout <<
"== observable 44 " << Obs44 << std::endl;
552 std::cout <<
"== observable 45 " << Obs45 << std::endl;
556 if (Obs46 > 3.1415927)
557 Obs46 = 2 * 3.1415927 - Obs46;
558 if (Obs46 < -3.1415927)
559 Obs46 = -2 * 3.1415927 - Obs46;
564 std::cout <<
"== observable 46 " << Obs46 << std::endl;
572 std::cout <<
"== observable 47 " << Obs47 << std::endl;
580 std::cout <<
"== observable 48 " << Obs48 << std::endl;
588 std::cout <<
"== observable 49 " << Obs49 << std::endl;
592 if (Obs50 > 3.1415927)
593 Obs50 = 2 * 3.1415927 - Obs50;
594 if (Obs50 < -3.1415927)
595 Obs50 = -2 * 3.1415927 - Obs50;
600 std::cout <<
"== observable 50 " << Obs50 << std::endl;
608 std::cout <<
"== observable 51 " << Obs51 << std::endl;
616 std::cout <<
"== observable 52 " << Obs52 << std::endl;
624 std::cout <<
"== observable 53 " << Obs53 << std::endl;
628 if (Obs54 > 3.1415927)
629 Obs54 = 2 * 3.1415927 - Obs54;
630 if (Obs54 < -3.1415927)
631 Obs54 = -2 * 3.1415927 - Obs54;
636 std::cout <<
"== observable 54 " << Obs54 << std::endl;
644 std::cout <<
"== observable 55 " << Obs55 << std::endl;
652 std::cout <<
"== observable 56 " << Obs56 << std::endl;
660 std::cout <<
"== observable 57 " << Obs57 << std::endl;
663 double Obs58 = -999.;
666 if (solution.
getDecay() ==
"electron")
668 if (Obs58 > 3.1415927)
669 Obs58 = 2 * 3.1415927 - Obs58;
670 if (Obs58 < -3.1415927)
671 Obs58 = -2 * 3.1415927 - Obs58;
676 std::cout <<
"== observable 58 " << Obs58 << std::endl;
679 double Obs59 = -999.;
682 if (solution.
getDecay() ==
"electron")
688 std::cout <<
"== observable 59 " << Obs59 << std::endl;
691 double Obs60 = -999.;
694 if (solution.
getDecay() ==
"electron")
700 std::cout <<
"== observable 60 " << Obs60 << std::endl;
703 double Obs61 = -999.;
706 if (solution.
getDecay() ==
"electron")
712 std::cout <<
"== observable 61 " << Obs61 << std::endl;
718 ((jets->size() > 4 && (*jets)[3].p4().Et() > 0.00001) ? (*jets)[4].p4().Et() / (*jets)[3].p4().Et() : 1.0);
722 IntBoolPair(62, ((matchHadp && matchHadq) || (matchHadpq && matchHadqp)) && matchHadb && matchLepb));
725 std::cout <<
"== observable 62 " << Obs62 << std::endl;
727 float calJetsSumEt = 0;
728 for (
unsigned int i = 4;
i < jets->size();
i++) {
729 calJetsSumEt += (*jets)[
i].p4().Et();
733 double Obs63_den = (jets->size() > 4) ? ((*jets)[0].p4().Et() + (*jets)[1].p4().Et() + (*jets)[2].p4().Et() +
734 (*jets)[3].p4().Et() + (*jets)[4].p4().Et())
736 double Obs63 = (Obs63_den > 0.00001) ? calJetsSumEt / Obs63_den : 1.0;
740 IntBoolPair(63, ((matchHadp && matchHadq) || (matchHadpq && matchHadqp)) && matchHadb && matchLepb));
743 std::cout <<
"== observable 63 " << Obs63 << std::endl;
749 IntBoolPair(64, ((matchHadp && matchHadq) || (matchHadpq && matchHadqp)) && matchHadb && matchLepb));
752 std::cout <<
"== observable 64 " << Obs64 << std::endl;
758 IntBoolPair(65, ((matchHadp && matchHadq) || (matchHadpq && matchHadqp)) && matchHadb && matchLepb));
761 std::cout <<
"== observable 65 " << Obs65 << std::endl;
767 IntBoolPair(66, ((matchHadp && matchHadq) || (matchHadpq && matchHadqp)) && matchHadb && matchLepb));
770 std::cout <<
"observables calculated" << std::endl;
reco::Particle getCalHadW() const
bool isSemiLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as semi-laptonic
pat::Jet getRecLepb() const
const LorentzVector & p4(P4Kind kind) const
TtSemiLRJetCombObservables(edm::ConsumesCollector &&iC, const edm::EDGetTokenT< std::vector< pat::Jet > > &jetSourceToken)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
pat::Jet getCalHadq() const
const reco::GenParticle * getGenLept() const
pat::Particle getFitLepn() const
double pt() const final
transverse momentum
reco::Particle getFitHadt() const
std::string getDecay() const
std::pair< unsigned int, bool > IntBoolPair
float bDiscriminator(const std::string &theLabel) const
-— methods for accessing b-tagging info -—
const reco::GenParticle * getGenHadq() const
const LorentzVector & p4() const
four-momentum Lorentz vector
const reco::GenParticle * getGenLepb() const
edm::EDGetTokenT< TtGenEvent > genEvtToken_
pat::Electron getRecLepe() const
std::vector< IntBoolPair > operator()(TtSemiEvtSolution &, const edm::Event &iEvent, bool matchOnly=false)
const reco::GenParticle * getGenHadp() const
Class derived from the TopGenEvent for ttbar events.
pat::Jet getRecHadp() const
const reco::GenParticle * getGenHadb() const
const reco::GenParticle * getGenLepl() const
reco::Particle getCalLept() const
edm::EDGetTokenT< std::vector< pat::Jet > > jetSourceToken_
const LorentzVector & p4() const final
four-momentum Lorentz vector
std::vector< IntDblPair > evtselectVarVal
pat::Jet getRecHadb() const
void setLRJetCombObservables(const std::vector< std::pair< unsigned int, double > > &varval)
pat::Jet getCalHadb() const
std::pair< unsigned int, double > IntDblPair
~TtSemiLRJetCombObservables()
int numberOfBQuarks(bool fromTopQuark=true) const
return number of b quarks in the decay chain
pat::Jet getRecHadq() const
const reco::GenParticle * getGenLepn() const
pat::Muon getRecLepm() const
pat::Jet getCalLepb() const
std::vector< IntBoolPair > evtselectVarMatch
pat::MET getRecLepn() const
reco::Particle getCalHadt() const
reco::Particle getRecLepW() const
double getProbChi2() const
reco::Particle getFitLept() const
pat::Jet getCalHadp() const