ATLAS Offline Software
Loading...
Searching...
No Matches
OfflineTrackQualitySelectionTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
9
10namespace IDTPM {
11
14
16{
18 ATH_CHECK( m_offlineTool.retrieve() );
19 return StatusCode::SUCCESS;
20}
21
23 TrackAnalysisCollections& trkAnaColls )
24{
25 std::vector< const xAOD::TrackParticle* > selected;
26 for( const xAOD::TrackParticle* track :
28 if( accept( track ) ) selected.push_back( track );
29 }
30
31 ATH_MSG_DEBUG( "Size before selection: " <<
32 trkAnaColls.offlTrackVec( TrackAnalysisCollections::FS ).size() <<
33 "\t Size after selection: " << selected.size() );
34
37
38 return StatusCode::SUCCESS;
39}
40
42{
44 if ( not m_offlineTool->accept( track ) ) return false; // TODO vertex needs to be provided here
45
47 if (m_maxPt!=-9999. and (pT(*track)) > m_maxPt ) return false;
48 if (m_maxEta!=-9999. and (eta(*track)) > m_maxEta ) return false;
49 if (m_minEta!=-9999. and (eta(*track)) < m_minEta ) return false;
50 if (m_minPhi!=-9999. and (phi(*track)) < m_minPhi ) return false;
51 if (m_maxPhi!=-9999. and (phi(*track)) > m_maxPhi ) return false;
52 if (m_minD0!=-9999. and (d0(*track)) < m_minD0 ) return false;
53 if (m_minZ0!=-9999. and (z0(*track)) < m_minZ0 ) return false;
54 if (m_minQoPT!=-9999. and (qOverPT(*track)) < m_minQoPT ) return false;
55 if (m_maxQoPT!=-9999. and (qOverPT(*track)) > m_maxQoPT ) return false;
56 if (m_minAbsEta!=-9999. and std::fabs(eta(*track)) < m_minAbsEta ) return false;
57 if (m_minAbsPhi!=-9999. and std::fabs(phi(*track)) < m_minAbsPhi ) return false;
58 if (m_maxAbsPhi!=-9999. and std::fabs(phi(*track)) > m_maxAbsPhi ) return false;
59 if (m_minAbsD0!=-9999. and std::fabs(d0(*track)) < m_minAbsD0 ) return false;
60 if (m_maxAbsD0!=-9999. and std::fabs(d0(*track)) > m_maxAbsD0 ) return false;
61 if (m_minAbsZ0!=-9999. and std::fabs(z0(*track)) < m_minAbsZ0 ) return false;
62 if (m_maxAbsZ0!=-9999. and std::fabs(z0(*track)) > m_maxAbsZ0 ) return false;
63 if (m_minAbsQoPT!=-9999. and std::fabs(qOverPT(*track)) < m_minAbsQoPT ) return false;
64 if (m_maxAbsQoPT!=-9999. and std::fabs(qOverPT(*track)) > m_maxAbsQoPT ) return false;
65 if ( !m_etaBins.empty() ) {
66 if (!m_minHitsVec.empty() and !nHitsSelVec(*track, m_minHitsVec, m_etaBins)) return false;
67 if (!m_minPtVec.empty() and !minPtSelVec(*track, m_minPtVec, m_etaBins)) return false;
68 if (!m_maxD0Vec.empty() and !maxD0SelVec(*track, m_maxD0Vec, m_etaBins)) return false;
69 if (!m_maxZ0Vec.empty() and !maxZ0SelVec(*track, m_maxZ0Vec, m_etaBins)) return false;
70 }
71
72 return true;
73}
74
75} // namespace IDTPM
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Utility methods to access offline object decorations.
Class to hold for each event collections needed in the TrkAnalsis.
Utility methods to access track/truth particles parmeters in a consitent way in this package.
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
virtual StatusCode selectTracks(TrackAnalysisCollections &trkAnaColls) override
ToolHandle< InDet::IInDetTrackSelectionTool > m_offlineTool
const std::vector< const xAOD::TrackParticle * > & offlTrackVec(Stage stage=FULL)
StatusCode fillOfflTrackVec(const std::vector< const xAOD::TrackParticle * > &vec, Stage stage=FULL)
Offline tracks.
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition AsgTool.h:133
Athena include(s).
bool maxZ0SelVec(const xAOD::TrackParticle &track, const std::vector< float > &maxZ0, const std::vector< float > &etaBins)
float pT(const U &p)
Accessor utility function for getting the value of pT.
bool minPtSelVec(const xAOD::TrackParticle &track, const std::vector< float > &minPt, const std::vector< float > &etaBins)
bool nHitsSelVec(const PARTICLE &p, const std::vector< unsigned int > &minHits, const std::vector< float > &etaBins)
float qOverPT(const U &p)
float z0(const U &p)
float d0(const U &p)
bool maxD0SelVec(const xAOD::TrackParticle &track, const std::vector< float > &maxD0, const std::vector< float > &etaBins)
TrackParticle_v1 TrackParticle
Reference the current persistent version: