Skip to content
Snippets Groups Projects
Commit d0066487 authored by John Derek Chapman's avatar John Derek Chapman
Browse files

Merge branch 'ATLASRECTS-4099_21_3' into '21.3'

Fix for ATLASRECTS-4099

See merge request atlas/athena!9380

Former-commit-id: c19706aa2ffcf6296b019106c0fc3568e9bfcbda
parents 916e0c97 429ba649
37 merge requests!46457Draft: Adding the tools to run over data,!46454Draft: Adding the tools to be able to run over data,!44869Draft: Update to candidate store,!4217921.9-first_steps-InDetTrackingGeometryXML,!39162Draft: Insert BCM' support,!38765Bis78 cabling,!36893Fix size of RPC active region in BIS78 and strip material,!3645821.9: Improving material map description (ATLITKSW-127),!36293WIP pixel updates,!34993KF-input adding jXERHO to the AOD outputs,!34864LH rings in front ot HR rigs,!34763Fix L1_4jJ15.0ETA25 item definition (ATR-21261),!33996WIP: Correct MM zpositions,!3291021.3 salva s0,!3217421.9 - Bug fix for test stream creation in RD53BEncodingTool,!3135321.3,!3134821.9 README Update,!31136added also PUsub for LargeR jets,!31123WIP: Master ttmdev,!3036121.9 fixing bug with layer indices in PixelRDOAnalysis,!28623Overlay as part of FastChain transform in 21.3,!28497ART tests - fixing the bugs,!27668Massimos 21.3 bis78,!27254WIP: Exclusive jets request -- Fix ExclusiveJets algo / ATR-17320,!26790Fixes for Simulation ART jobs (ATLASSIM-4309),!26747Update frozen shower generation scripts and code to be compatible with recent developments,!25405Add new ART test: test_physics_pp_v8_chainorder_build.sh,!2420321.3 l1 muon 00 - new MuCTPI_RDO.h,!23377WIP pixel ID scheme for ITk,!22214add an utility function to TrigT1TGCRecRoiSvc for storing ROI position and the eta/phi size,!22172changes related to 1-3 points in ATR-19579,!22124Changes related to ticket 19579,!22118Remove cabling information for new thresholds,!21304WIP: Fix ATR-19377 L1Topo vbs alg,!2117721.3 po bugfixes,!2060121.0 fix nightly test,!20518Mydev
......@@ -102,11 +102,7 @@ const Trk::Track* Muon::MuonAmbiTrackSelectionTool::getCleanedOutTrack(const Trk
ATH_MSG_VERBOSE("New Track " << m_printer->print(*ptrTrack));
std::map<Muon::MuonStationIndex::StIndex,int> sharedPrecisionPerLayer;
std::map<Muon::MuonStationIndex::StIndex,int> sharedTriggerEtaPerLayer;
std::map<Muon::MuonStationIndex::StIndex,int> sharedPhiPerLayer;
std::map<Muon::MuonStationIndex::StIndex,int> precisionPerLayer;
std::map<Muon::MuonStationIndex::StIndex,int> triggerEtaPerLayer;
std::map<Muon::MuonStationIndex::StIndex,int> phiPerLayer;
// loop over TSOS
DataVector<const Trk::TrackStateOnSurface>::const_iterator iTsos = tsos->begin();
......@@ -123,63 +119,39 @@ const Trk::Track* Muon::MuonAmbiTrackSelectionTool::getCleanedOutTrack(const Trk
const Trk::RIO_OnTrack* rot = dynamic_cast <const Trk::RIO_OnTrack*> (meas);
if (!rot) {
// could be a Pseudo-Measurement
// we are only interested in precision hits since only they have the resolution to distinguish between close-by tracks
// so we only take competing ROTs if they are CSC eta hits
const Trk::CompetingRIOsOnTrack* competingROT = dynamic_cast <const Trk::CompetingRIOsOnTrack*> (meas);
if (competingROT) {
bool measPhi = false;
++numhits;
const unsigned int numROTs = competingROT->numberOfContainedROTs();
bool overlap = false;
Muon::MuonStationIndex::StIndex stIndex = Muon::MuonStationIndex::StUnknown;
for( unsigned int i=0;i<numROTs;++i ){
const Trk::RIO_OnTrack* rot = &competingROT->rioOnTrack(i);
if( !rot || !rot->prepRawData() || !m_idHelperTool->isMuon(rot->identify()) ) continue;
stIndex = m_idHelperTool->stationIndex(rot->identify());
measPhi = m_idHelperTool->measuresPhi(rot->identify());
if(competingROT){
const unsigned int numROTs = competingROT->numberOfContainedROTs();
for( unsigned int i=0;i<numROTs;++i ){
const Trk::RIO_OnTrack* rot = &competingROT->rioOnTrack(i);
if( !rot || !rot->prepRawData() || !m_idHelperTool->isMuon(rot->identify()) ) continue;
//only use precision hits for muon track overlap
if(!m_idHelperTool->isMdt(rot->identify()) && !(m_idHelperTool->isCsc(rot->identify()) && !m_idHelperTool->measuresPhi(rot->identify()))) continue;
Muon::MuonStationIndex::StIndex stIndex = m_idHelperTool->stationIndex(rot->identify());
++precisionPerLayer[stIndex];
if ( m_assoTool->isUsed(*(rot->prepRawData()))) {
ATH_MSG_VERBOSE("Track overlap found! " << m_idHelperTool->toString(rot->identify()));
overlap = true;
break;
++numshared;
++sharedPrecisionPerLayer[stIndex];
}
}
if( overlap ){
++numshared;
if( measPhi ) ++sharedPhiPerLayer[stIndex];
else ++sharedTriggerEtaPerLayer[stIndex];
}else{
if( measPhi ) ++phiPerLayer[stIndex];
else ++triggerEtaPerLayer[stIndex];
}
}
}else{
if(!m_idHelperTool->isMuon(rot->identify())) continue;
if(!m_idHelperTool->isMdt(rot->identify()) && !(m_idHelperTool->isCsc(rot->identify()) && !m_idHelperTool->measuresPhi(rot->identify()))) continue; //only precision hits used for overlap
++numhits;
Muon::MuonStationIndex::StIndex stIndex = m_idHelperTool->stationIndex(rot->identify());
bool measPhi = m_idHelperTool->measuresPhi(rot->identify());
bool isTrigger = m_idHelperTool->isTrigger(rot->identify());
if( measPhi ) {
++phiPerLayer[stIndex];
}else{
if( isTrigger ) ++triggerEtaPerLayer[stIndex];
else ++precisionPerLayer[stIndex];
}
++precisionPerLayer[stIndex];
// allow no overlap
if ( m_assoTool->isUsed(*(rot->prepRawData()))) {
ATH_MSG_VERBOSE("Track overlap found! " << m_idHelperTool->toString(rot->identify()));
++numshared;
if( measPhi ) {
++sharedPhiPerLayer[stIndex];
}else{
if( isTrigger ) ++sharedTriggerEtaPerLayer[stIndex];
else ++sharedPrecisionPerLayer[stIndex];
}
++sharedPrecisionPerLayer[stIndex];
}
}
}
......
......@@ -16,13 +16,15 @@ atlas_depends_on_subdirs( PUBLIC
Tracking/TrkDetDescr/TrkDetElementBase
Tracking/TrkEvent/TrkEventUtils
Tracking/TrkEvent/TrkRIO_OnTrack
Tracking/TrkEvent/TrkTrack )
Tracking/TrkEvent/TrkCompetingRIOsOnTrack
Tracking/TrkEvent/TrkTrack
MuonSpectrometer/MuonIdHelpers)
# Component(s) in the package:
atlas_add_component( TrkAssociationTools
src/*.cxx
src/components/*.cxx
LINK_LIBRARIES AthenaBaseComps TrkToolInterfaces AtlasDetDescr Identifier GaudiKernel TrkDetElementBase TrkEventUtils TrkRIO_OnTrack TrkTrack )
LINK_LIBRARIES AthenaBaseComps TrkToolInterfaces AtlasDetDescr Identifier GaudiKernel TrkDetElementBase TrkEventUtils TrkRIO_OnTrack TrkCompetingRIOsOnTrack TrkTrack MuonIdHelpersLib)
# Install files from the package:
atlas_install_headers( TrkAssociationTools )
......
......@@ -14,6 +14,10 @@
class AtlasDetectorID;
class Identifier;
namespace Muon{
class MuonIdHelperTool;
}
namespace Trk {
class Track;
......@@ -80,6 +84,9 @@ namespace Trk {
/**holds the PRDs associated with each Track (i.e. the Track* is the key)*/
IPRD_AssociationTool::TrackPrepRawDataMap m_trackPrepRawDataMap;
ToolHandle<Muon::MuonIdHelperTool> m_idHelperTool;
};
inline bool Trk::PRD_AssociationTool::isUsed(const PrepRawData& prd) const
......
......@@ -6,12 +6,16 @@
#include "TrkDetElementBase/TrkDetElementBase.h"
#include "TrkTrack/Track.h"
#include "TrkRIO_OnTrack/RIO_OnTrack.h"
#include "TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h"
#include "TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h"
#include "TrkEventUtils/CreatePRD_MapPairFromTrack.h"
#include "TrkEventUtils/CreatePRD_VectorFromTrack.h"
#include "Identifier/Identifier.h"
#include "AtlasDetDescr/AtlasDetectorID.h"
#include "MuonIdHelpers/MuonIdHelperTool.h"
#include <cassert>
#include <vector>
//#include <functional>
......@@ -22,7 +26,8 @@ Trk::PRD_AssociationTool::PRD_AssociationTool(const std::string& t,
const std::string& n,
const IInterface* p )
:
AthAlgTool(t,n,p)
AthAlgTool(t,n,p),
m_idHelperTool("Muon::MuonIdHelperTool/MuonIdHelperTool")
{
declareInterface<IPRD_AssociationTool>(this);
}
......@@ -203,8 +208,26 @@ std::vector< const Trk::PrepRawData* > Trk::PRD_AssociationTool::getPrdsOnTrack(
for (;it!=itEnd;it++)
{
const RIO_OnTrack* rot = dynamic_cast<const RIO_OnTrack*>(*it);
if (0!=rot)
if (rot){
if(m_idHelperTool->isMuon(rot->identify())){
//only use precision hits for muon track overlap
if(!m_idHelperTool->isMdt(rot->identify()) && !(m_idHelperTool->isCsc(rot->identify()) && !m_idHelperTool->measuresPhi(rot->identify()))) continue;
}
vec.push_back(rot->prepRawData());
}
else{
const Trk::CompetingRIOsOnTrack* competingROT = dynamic_cast <const Trk::CompetingRIOsOnTrack*> (*it);
if(competingROT){
const unsigned int numROTs = competingROT->numberOfContainedROTs();
for( unsigned int i=0;i<numROTs;++i ){
const Trk::RIO_OnTrack* rot = &competingROT->rioOnTrack(i);
if( !rot || !rot->prepRawData() || !m_idHelperTool->isMuon(rot->identify()) ) continue;
//only use precision hits for muon track overlap
if(!m_idHelperTool->isMdt(rot->identify()) && !(m_idHelperTool->isCsc(rot->identify()) && !m_idHelperTool->measuresPhi(rot->identify()))) continue;
vec.push_back(rot->prepRawData());
}
}
}
}
ATH_MSG_DEBUG (" Getting "<<vec.size()<<" PRDs from track at:"<<&track);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment