コード例 #1
0
std::vector<Jet> MuXboostedBTagging::CoreCandidates(std::vector<Lepton> const &muons, Jet const &jet) const
{
    INFO0;
    auto recluster_input = muons;
    for (auto const &consituent : jet.Constituents()) {
        if (consituent.Info().ContainsDetectorPart(DetectorPart::tower) && consituent.Pt() < min_tower_pt_ratio_ * jet.Pt()) continue; // Don't use
        recluster_input.emplace_back(consituent);
    }
    // Recluster the jet, to find core candidates
    auto cluster_sequence = boca::ClusterSequence {recluster_input, fastjet::JetDefinition(fastjet::antikt_algorithm, core_jet_radius / rad, &Settings::Recombiner())};
    // Get the core candidates (NOT sorted by pT until we remove muons)
    auto core_candidates = cluster_sequence.InclusiveJets();
    if (core_candidates.empty()) return core_candidates;
    cluster_sequence.NoLongerNeeded();

    // If a taggable muon is inside a core candidate, remove the muon p4
    for (auto const &muon : muons) for (auto &core_candidate : core_candidates) if (muon.DeltaRTo(core_candidate) < core_jet_radius) {
                core_candidate -= muon;
                break;
            }

    // Sort the core candidates by pT (highest to lowest)
    core_candidates = SortedByPt(core_candidates);
    return core_candidates;
}
コード例 #2
0
boost::optional<Doublet> Higgs::MassDrop(Doublet const& doublet)
{
    INFO0;
    auto cluster_sequence = ClusterSequence{doublet.Constituents(), Settings::JetDefinition(doublet.DeltaR() + 2. * Settings::JetConeSize())};
    auto exclusive_jets = cluster_sequence.ExclusiveJets(1);
    if (exclusive_jets.empty()) return boost::none;
    auto mass_drop_tagger = fastjet::MassDropTagger{0.667, 0.09};
    auto mass_drop_jet = mass_drop_tagger(exclusive_jets.front().FastJet());
    if (mass_drop_jet == 0) return boost::none;

    auto radius = boca::Jet(mass_drop_jet.pieces().at(0)).DeltaRTo(mass_drop_jet.pieces().at(1));
    radius = std::min(radius / 2., 300_mrad);
    auto filter = fastjet::Filter{Settings::JetDefinition(radius), fastjet::SelectorNHardest(3)};
    auto filtered_jet = filter.result(mass_drop_jet);
    if (!filtered_jet.has_pieces()) return boost::none;
    auto pieces = SortedByPt(JetVector(filtered_jet.pieces()));
    if (pieces.size() < 2) return boost::none;
    return Doublet(bottom_reader_.Multiplet(pieces.at(0)), bottom_reader_.Multiplet(pieces.at(1)));
}
コード例 #3
0
ファイル: TruthVariables.cpp プロジェクト: Teddym0913/BoCA
void TruthVariables::SetJets(std::vector<Jet> const& jets)
{
    jets_ = SortedByPt(jets);
}
コード例 #4
0
ファイル: TruthVariables.cpp プロジェクト: Teddym0913/BoCA
void TruthVariables::SetDetectable(const std::vector< Particle >& jets)
{
    detectable_ = SortedByPt(jets);
}
コード例 #5
0
ファイル: TruthVariables.cpp プロジェクト: Teddym0913/BoCA
void TruthVariables::SetTops(const std::vector< Particle >& tops)
{
    CHECK(tops.size() == 2, tops.size());
    tops_ = SortedByPt(tops);
}
コード例 #6
0
ファイル: TruthVariables.cpp プロジェクト: Teddym0913/BoCA
void TruthVariables::SetBosons(const std::vector< Particle >& bosons)
{
    CHECK(bosons.size() == 6, bosons.size());
    bosons_ = SortedByPt(bosons);
}
コード例 #7
0
ファイル: TruthVariables.cpp プロジェクト: Teddym0913/BoCA
void TruthVariables::SetLeptons(const std::vector< Particle >& leptons)
{
    leptons_ = SortedByPt(leptons);
}
コード例 #8
0
int SignatureNeutral::Train(boca::Event const& event, PreCuts const&, Tag tag)
{
    INFO0;
    auto higgs = heavy_higgs_semi_reader_.Tagger().HiggsParticle(event, tag);
    auto sextets = heavy_higgs_semi_reader_.Multiplets(event);
    sextets = BestMatches(sextets, higgs, tag);

    auto doublets = jet_pair_reader_.Multiplets(event);
    auto bottoms = SortedByPt(jet_pair_reader_.Tagger().PairBottomQuarks(event, tag));

    auto particles = event.GenParticles();
    auto tops = CopyIfParticle(particles, Id::top);
    auto tops_even = CopyIfMother(tops, Id::heavy_higgs);
    auto tops_odd = CopyIfMother(tops, Id::CP_odd_higgs);
    auto top_higgs = Combine(tops_even, tops_odd);
    auto one_close_to_top = 0, two_close_to_top = 0;

    if (top_higgs.size() == 2) {

        for (auto const & doublet : doublets) {
            if ((Close<boca::Jet>(top_higgs.at(0))(doublet.Singlet1()) && Close<boca::Jet>(top_higgs.at(1))(doublet.Singlet2())) || (Close<boca::Jet>(top_higgs.at(1))(doublet.Singlet1()) && Close<boca::Jet>(top_higgs.at(0))(doublet.Singlet2()))) two_close_to_top++;
            if ((Close<boca::Jet>(top_higgs.at(0))(doublet.Singlet1()) || Close<boca::Jet>(top_higgs.at(1))(doublet.Singlet2())) || (Close<boca::Jet>(top_higgs.at(1))(doublet.Singlet1()) || Close<boca::Jet>(top_higgs.at(0))(doublet.Singlet2()))) one_close_to_top++;
        }
    }

//     ERROR(one_close_to_top, two_close_to_top);
    static auto close_to_top_ = 0;
    if (one_close_to_top == 6) {
        ++close_to_top_;
    }

    std::vector<Doublet> final_doublets;
    switch (tag) {
    case Tag::signal :
        if (bottoms.size() == 2) {

            for (auto const & doublet : doublets) {
                if ((Close<boca::Jet>(bottoms.at(0))(doublet.Singlet1()) && Close<boca::Jet>(bottoms.at(1))(doublet.Singlet2())) || (Close<boca::Jet>(bottoms.at(1))(doublet.Singlet1()) && Close<boca::Jet>(bottoms.at(0))(doublet.Singlet2()))) final_doublets.emplace_back(doublet);

            }
        } else ERROR(bottoms.size());
        break;
    case Tag::background :
        final_doublets = doublets;
        break;
    }

    static auto zero_doublets = 0;
    if (one_close_to_top < 6 && final_doublets.empty()) {
        ++zero_doublets;
    }

    std::vector<Octet62> octets;
    for (auto const & doublet : final_doublets) {
        for (auto const & sextet : sextets) {
            Octet62 octet(sextet, doublet);
            if (octet.Overlap()) continue;
            octet.SetTag(tag);
            octets.emplace_back(octet);
        }
    }
    static auto zero_octets = 0;
    if (one_close_to_top < 6 && !final_doublets.empty() && octets.empty()) {
        ++zero_octets;
    }
//     ERROR(close_to_top_, zero_doublets, zero_octets);

    if (tag == Tag::signal && octets.size() > 1) {
        INFO(octets.size());
        std::sort(octets.begin(), octets.end());
        octets.erase(octets.begin() + 1, octets.end());
    }

    return SaveEntries(octets);
}