8 return StatusCode::SUCCESS;
13 if (passingLegs.size() == 0) {
14 return StatusCode::SUCCESS;
17 std::vector<std::vector<Combo::LegDecision>> legDecisions;
26 std::unordered_set<TrigCompositeUtils::DecisionID> dispj_leg_ids;
28 ATH_MSG_DEBUG(
"Have "<<passingLegs.size()<<
" passing legs in");
30 for(
auto it : passingLegs){
31 if(
it.second.size() == 0)
continue;
35 dispj_leg_ids.insert(
it.first);
39 ATH_MSG_DEBUG(
"Have "<<dispj_leg_ids.size()<<
" dispjet legs");
41 std::vector<const xAOD::Jet*> input_jets;
42 std::map<const xAOD::Jet*, std::vector<Combo::LegDecision>> jet_decisions;
45 for(
const auto& leg_decs : legDecisions){
46 for(
auto dec_pair : leg_decs){
51 if(dispj_leg_ids.count(dec_pair.first) == 0)
continue;
54 std::vector<TrigCompositeUtils::LinkInfo<xAOD::JetContainer>> jet_feature_links = TrigCompositeUtils::findLinks<xAOD::JetContainer>(decision,
TrigCompositeUtils::featureString(), TrigDefs::lastFeatureOfType);
55 if(jet_feature_links.size() == 0)
continue;
62 jet_decisions[
jet].push_back(dec_pair);
71 for(
auto pair: jet_decisions){
72 input_jets.push_back(pair.first);
75 if(input_jets.size() == 0){
80 return StatusCode::SUCCESS;
87 ATH_MSG_DEBUG(
"Reject event as it has "<<input_jets.size()<<
" input passing jets but max jet cut is "<<
m_maxjets);
89 return StatusCode::SUCCESS;
94 std::sort(input_jets.begin(), input_jets.end(), [](
const xAOD::Jet*
a,
const xAOD::Jet*
b) ->
bool
96 return a->pt() > b->pt();
103 unsigned int n_jets_passed = 0;
105 for(
size_t i = 0;
i<input_jets.size();
i++){
110 for(
auto leg_dec_pair: jet_decisions.at(input_jets.at(
i))){
111 accepted_decisions_by_leg[leg_dec_pair.first].push_back(leg_dec_pair.second);
112 ATH_MSG_DEBUG(
"Accepting decision for jet "<<input_jets.at(
i)->pt()/1000.0);
117 if(n_jets_passed < input_jets.size()){
121 for (
auto& legIt : passingLegs) {
122 if(dispj_leg_ids.count(legIt.first) == 0)
continue;
124 auto accepted_decisions_on_leg = accepted_decisions_by_leg.find(legIt.first);
126 if(accepted_decisions_on_leg != accepted_decisions_by_leg.end()){
128 legIt.second = accepted_decisions_on_leg->second;
129 ATH_MSG_DEBUG(
"Updating leg "<<legIt.first<<
" with "<<accepted_decisions_on_leg->second.size()<<
" decisions");
133 ATH_MSG_DEBUG(
"Updating leg "<<legIt.first<<
"; clearing decisions");
134 legIt.second.clear();
141 for(
size_t i=0;
i<lm.size();
i++){
144 if(passingLegs[legId].
size() < (
size_t)(lm.at(
i))){
147 ATH_MSG_DEBUG(
"Leg "<<legId<<
" fails mulitplicity check, rejecting event");
149 return StatusCode::SUCCESS;
153 return StatusCode::SUCCESS;