Commit 4ac3eabf authored by Johannes Elmsheuser's avatar Johannes Elmsheuser
Browse files

Merge branch 'mu-ovlprm' into 'master'

Move overlap removal from muon hypo alg to hypo tool

Closes ATR-23996

See merge request atlas/athena!46094
parents 1b076ced 9c789b76
......@@ -113,9 +113,7 @@ StatusCode TrigMuonEFHypoAlg::execute( const EventContext& context ) const
auto newd = newDecisionIn( decisions, hypoAlgNodeName() );
// push_back to toolInput
bool isOverlap=false;
if(m_checkOvlp) isOverlap=checkOvlp(muon, toolInput);
toolInput.emplace_back( newd, muon, isOverlap, previousDecision );
toolInput.emplace_back( newd, muon, previousDecision );
newd -> setObjectLink( featureString(), muonEL );
TrigCompositeUtils::linkToPrevious( newd, previousDecision, context );
......@@ -149,15 +147,6 @@ StatusCode TrigMuonEFHypoAlg::execute( const EventContext& context ) const
return StatusCode::SUCCESS;
}
bool TrigMuonEFHypoAlg::checkOvlp(const xAOD::Muon *mu, std::vector<TrigMuonEFHypoTool::MuonEFInfo> toolInput) const{
bool overlap=false;
for(uint i=0; i<toolInput.size(); i++){
if(toolInput.at(i).muon->p4() == mu->p4()) overlap=true;
}
return overlap;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
......
......@@ -24,15 +24,12 @@ class TrigMuonEFHypoAlg
private:
bool checkOvlp(const xAOD::Muon *mu, std::vector<TrigMuonEFHypoTool::MuonEFInfo> toolInput) const;
ToolHandleArray<TrigMuonEFHypoTool> m_hypoTools {this, "HypoTools", {}, "Tools to perform selection"};
SG::ReadHandleKey<xAOD::MuonContainer> m_muonKey{
this, "MuonDecisions", "MuonEFCombiner_MuonData", "Name of the input data on xAOD::MuonContainer produced by MuonCreatorAlg"};
Gaudi::Property<bool> m_mapToPrevDec{
this, "MapToPreviousDecisions", false, "Map to decisions from previous decisions (needed if IM has mergeUsingFeature=True)"};
Gaudi::Property< bool > m_checkOvlp {
this, "DoOverlapRemoval", true, "Check for overlapping muons"};
};
......
......@@ -83,8 +83,6 @@ bool TrigMuonEFHypoTool::decideOnSingleObject(TrigMuonEFHypoTool::MuonEFInfo& in
return false;
}
if(m_checkOvlp && input.isOverlapping) return false;
if (muon->primaryTrackParticle()) { // was there a muon in this RoI ?
const xAOD::TrackParticle* tr = muon->trackParticle(m_type);
if (!tr) {
......@@ -181,8 +179,19 @@ StatusCode TrigMuonEFHypoTool::decide(std::vector<MuonEFInfo>& toolInput) const
return StatusCode::SUCCESS;
}
StatusCode TrigMuonEFHypoTool::inclusiveSelection(std::vector<MuonEFInfo>& toolInput) const{
for (auto& tool : toolInput){
for (uint i=0; i<toolInput.size(); i++){
auto& tool = toolInput.at(i);
if(TrigCompositeUtils::passed(m_decisionId.numeric(), tool.previousDecisionIDs)){
bool overlap = false;
if(m_checkOvlp){
for(uint j=i+1; j<toolInput.size();j++){
auto& tool2 = toolInput.at(j);
if(TrigCompositeUtils::passed(m_decisionId.numeric(), tool2.previousDecisionIDs))
if(tool2.muon->p4()==tool.muon->p4()) overlap=true;
}
}
if(overlap) continue;
if(decideOnSingleObject(tool, 0)==true){
if(m_nscan){
ATH_MSG_DEBUG("Applying narrow-scan selection");
......
......@@ -23,18 +23,15 @@ class TrigMuonEFHypoTool: public ::AthAlgTool {
struct MuonEFInfo {
MuonEFInfo( TrigCompositeUtils::Decision* d,
const xAOD::Muon* m,
bool o,
const TrigCompositeUtils::Decision* previousDecision )
: decision( d ),
muon( m ),
isOverlapping( o ),
previousDecisionIDs(TrigCompositeUtils::decisionIDs( previousDecision ).begin(),
TrigCompositeUtils::decisionIDs( previousDecision ).end() )
{}
TrigCompositeUtils::Decision* decision;
const xAOD::Muon* muon;
bool isOverlapping;
const TrigCompositeUtils::DecisionIDContainer previousDecisionIDs;
};
virtual StatusCode initialize() override;
......
......@@ -8099,34 +8099,35 @@ HLT_mu24_ivarmedium_L1MU20:
3: 4
4: 4
HLT_mu24_ivarmedium_mu6_L1MU20:
eventCount: 1
eventCount: 2
stepCounts:
0: 3
1: 2
2: 2
3: 1
4: 1
3: 2
4: 2
stepFeatures:
0: 17
1: 9
2: 7
3: 5
4: 1
4: 2
HLT_mu24_ivarmedium_mu6_ivarmedium_L1MU20:
eventCount: 0
eventCount: 1
stepCounts:
0: 3
1: 2
2: 2
3: 1
3: 2
4: 1
stepFeatures:
0: 17
1: 9
2: 7
3: 5
4: 2
4: 4
HLT_mu24_ivarmedium_mu6_ivarmedium_probe_L1MU20:
eventCount: 0
eventCount: 1
stepCounts:
0: 6
1: 4
......@@ -8136,7 +8137,8 @@ HLT_mu24_ivarmedium_mu6_ivarmedium_probe_L1MU20:
5: 2
6: 2
7: 2
8: 1
8: 2
9: 1
stepFeatures:
0: 7
1: 4
......@@ -8147,23 +8149,23 @@ HLT_mu24_ivarmedium_mu6_ivarmedium_probe_L1MU20:
6: 5
7: 5
8: 3
9: 1
9: 2
HLT_mu24_ivarmedium_mu6_ivarperf_L1MU20:
eventCount: 1
eventCount: 2
stepCounts:
0: 3
1: 2
2: 2
3: 1
4: 1
3: 2
4: 2
stepFeatures:
0: 17
1: 9
2: 7
3: 5
4: 3
4: 5
HLT_mu24_ivarmedium_mu6_ivarperf_probe_L1MU20:
eventCount: 1
eventCount: 2
stepCounts:
0: 6
1: 4
......@@ -8173,8 +8175,8 @@ HLT_mu24_ivarmedium_mu6_ivarperf_probe_L1MU20:
5: 2
6: 2
7: 2
8: 1
9: 1
8: 2
9: 2
stepFeatures:
0: 7
1: 4
......@@ -8185,9 +8187,9 @@ HLT_mu24_ivarmedium_mu6_ivarperf_probe_L1MU20:
6: 5
7: 5
8: 3
9: 2
9: 3
HLT_mu24_ivarmedium_mu6_probe_L1MU20:
eventCount: 1
eventCount: 2
stepCounts:
0: 6
1: 4
......@@ -8197,7 +8199,7 @@ HLT_mu24_ivarmedium_mu6_probe_L1MU20:
5: 2
6: 2
7: 2
8: 1
8: 2
stepFeatures:
0: 7
1: 4
......@@ -8225,19 +8227,19 @@ HLT_mu24_mu10noL1_L1MU20:
4: 4
5: 4
HLT_mu24_mu6_L1MU20:
eventCount: 1
eventCount: 2
stepCounts:
0: 3
1: 2
2: 2
3: 1
3: 2
stepFeatures:
0: 17
1: 9
2: 7
3: 5
HLT_mu24_mu6_probe_L1MU20:
eventCount: 1
eventCount: 2
stepCounts:
0: 6
1: 4
......@@ -8246,7 +8248,7 @@ HLT_mu24_mu6_probe_L1MU20:
4: 2
5: 2
6: 2
7: 1
7: 2
stepFeatures:
0: 7
1: 4
......
#
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
#
from ..Menu.MenuComponents import MenuSequence, RecoFragmentsPool
......@@ -572,7 +572,6 @@ def muEFSAFSSequence(is_probe_leg=False):
from TrigMuonHypo.TrigMuonHypoConfig import TrigMuonEFHypoAlg
trigMuonEFSAFSHypo = TrigMuonEFHypoAlg( "TrigMuonEFSAFSHypoAlg" )
trigMuonEFSAFSHypo.MuonDecisions = sequenceOut
trigMuonEFSAFSHypo.DoOverlapRemoval=False
from TrigMuonHypo.TrigMuonHypoConfig import TrigMuonEFMSonlyHypoToolFromName
......@@ -620,7 +619,6 @@ def muEFCBFSSequence(is_probe_leg=False):
from TrigMuonHypo.TrigMuonHypoConfig import TrigMuonEFHypoAlg
trigMuonEFCBFSHypo = TrigMuonEFHypoAlg( "TrigMuonEFFSCombinerHypoAlg" )
trigMuonEFCBFSHypo.MuonDecisions = sequenceOut
trigMuonEFCBFSHypo.DoOverlapRemoval=False
from TrigMuonHypo.TrigMuonHypoConfig import TrigMuonEFCombinerHypoToolFromName
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment