std::vector<TruthVariables> TruthLevel::Jets(Event const& event, PreCuts const& pre_cuts, std::function<Particle(Particle&)> const&)const { INFO0; auto particle = event.Partons().GenParticles(); auto tops = CopyIfParticle(particle, Id::top); CHECK(tops.size() == 2, tops.size()); std::vector<TruthVariables> truths; for (auto const & top : tops) { if (top.Pt() < pre_cuts.PtLowerCut().Get(Id::top) || top.Pt() > pre_cuts.PtUpperCut().Get(Id::top)) continue; TruthVariables truth; truth.SetTop(top); auto bottoms = CopyIfMother(CopyIfParticle(particle, Id::bottom), top); CHECK(bottoms.size() == 1, bottoms.size()); truth.SetBottom(bottoms.front()); auto Ws = CopyIfMother(CopyIfParticle(particle, Id::W), top); CHECK(Ws.size() == 1, Ws.size()); truth.SetW(Ws.front()); auto quarks = CopyIfGrandMother(CopyIfQuark(particle), top); CHECK(quarks.size() == 2, quarks.size()); truth.SetQuark1(quarks.at(0)); truth.SetQuark2(quarks.at(1)); truths.emplace_back(truth); } return truths; }
int SignatureLeptonTagger::Train(Event const& event, boca::PreCuts const&, Tag tag) { INFO0; std::vector<Lepton> leptons = event.Leptons().leptons(); if (leptons.size() < 2) return 0; std::vector<Particle> particles = event.Partons().GenParticles(); std::vector<Particle> lepton_particle = CopyIfParticles(particles, {Id::electron, Id::muon}); // ERROR(lepton_particle); lepton_particle = CopyIfGrandMother(lepton_particle, Id::top); // ERROR(lepton_particle); std::vector<Lepton> final_leptons = CopyIfClose(leptons, lepton_particle); // ERROR(final_leptons); std::vector<Doublet> doublets = higgs_reader_.Multiplets(event); std::vector<Particle> higgses = CopyIfParticles(particles, {Id::higgs, Id::CP_violating_higgs}); std::vector<Doublet> final_doublets = BestMatches(doublets, higgses, tag); std::vector<MultipletSignature<Quartet211>> quartets = Triples(final_leptons, final_doublets, [&](Singlet const& singlet_1, Singlet const& singlet_2, Doublet const& doublet) { MultipletSignature<Quartet211> quartet = Signature(doublet, singlet_1, singlet_2); quartet.SetTag(tag); return quartet; }); DEBUG(quartets.size()); if (tag == Tag::signal) quartets = ReduceResult(quartets, 1); DEBUG(quartets.size()); return SaveEntries(quartets); }
std::vector<Particle> VetoTopPartnerLeptonic::Particles(boca::Event const& event) const { auto particles = event.GenParticles(); auto leptons = CopyIfLepton(particles); auto candidate = CopyIfGreatGrandMother(leptons, Id::top_partner); int id; if (candidate.empty()) { candidate = CopyIfMother(CopyIfGrandMother(leptons, Id::top_partner), Id::W); if (candidate.empty()) return {}; id = candidate.front().Info().Family().Member(Relative::grand_mother).Id(); } else id = candidate.front().Info().Family().Member(Relative::great_grand_mother).Id(); return CopyIfExactParticle(particles, id); }
std::vector<Particle> NewPartnerLeptonic::Particles(boca::Event const& event) const { auto particles = event.GenParticles(); auto leptons = CopyIfLepton(particles); auto candidate = CopyIfGreatGrandMother(leptons, Id::top_partner); if (!candidate.empty()) { CHECK(leptons.size() == 1, leptons.size()); auto grand_grand_mother = candidate.front().Info().Family().Member(Relative::great_grand_mother).Id(); return CopyIfExactParticle(particles, grand_grand_mother); } else { // this is necessary because madspin doesnt label relations correctly candidate = CopyIfGrandMother(leptons, Id::top_partner); candidate = CopyIfMother(candidate, Id::W); if (candidate.empty()) return {}; auto grand_mother = candidate.front().Info().Family().Member(Relative::grand_mother).Id(); return CopyIfExactParticle(particles, grand_mother); } }