ATLAS Offline Software
Loading...
Searching...
No Matches
TrackParticleThinningPHYS.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Author: James Catmore (James.Catmore@cern.ch)
6// Removes all ID tracks which do not pass a user-defined cut
7
10
11// Athena initialize and finalize
13{
15 ATH_CHECK( m_trackZ0PVKey.initialize() );
16 ATH_CHECK( m_tightPrimaryKey.initialize() );
17 return StatusCode::SUCCESS;
18}
19
20
21std::vector<int> DerivationFramework::TrackParticleThinningPHYS::updateMask(const EventContext& ctx, const xAOD::TrackParticleContainer* trackParticles) const
22{
23 SG::ReadDecorHandle<xAOD::TrackParticleContainer, bool> tightPrimaryHandle(m_tightPrimaryKey, ctx); // TODO CHECK TYPE
25 unsigned int index{0};
26 std::vector<int> entries;
27 if (z0AtPV->size() != trackParticles->size()) {
28 ATH_MSG_ERROR("z0AtPV->size() != trackParticles->size() - the job bail out now.");
29 return entries;
30 }
31 entries.reserve(trackParticles->size());
32 for (const auto* trackParticle : *trackParticles) {
33 // Inner detector group recommendations for indet tracks in analysis
34 // https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/DaodRecommendations
35 entries.push_back( (tightPrimaryHandle(*trackParticle) && (std::abs(z0AtPV->at(index)) * sin(trackParticle->theta()) < 3.0 * Gaudi::Units::mm) && (trackParticle->pt() > 10 * Gaudi::Units::GeV)) ? 1 : 0);
36 ++index;
37 }
38 return entries;
39}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
Handle class for reading a decoration on an object.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual std::vector< int > updateMask(const EventContext &ctx, const xAOD::TrackParticleContainer *trackParticles) const override final
SG::ReadHandleKey< std::vector< float > > m_trackZ0PVKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_tightPrimaryKey
Handle class for reading a decoration on an object.
double entries
Definition listroot.cxx:49
Definition index.py:1
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".