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
9
10// Athena initialize and finalize
12{
14 ATH_CHECK( m_trackZ0PVKey.initialize() );
15 return StatusCode::SUCCESS;
16}
17
18
20{
21 const EventContext& ctx = Gaudi::Hive::currentContext();
22 static const SG::ConstAccessor< bool > tightPrimaryAcc( "DFCommonTightPrimary" ); // TODO CHECK TYPE
24 unsigned int index{0};
25 std::vector<int> entries;
26 if (z0AtPV->size() != trackParticles->size()) {
27 ATH_MSG_ERROR("z0AtPV->size() != trackParticles->size() - the job bail out now.");
28 return entries;
29 }
30 entries.reserve(trackParticles->size());
31 for (const auto* trackParticle : *trackParticles) {
32 // Inner detector group recommendations for indet tracks in analysis
33 // https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/DaodRecommendations
34 entries.push_back( (tightPrimaryAcc(*trackParticle) && (std::abs(z0AtPV->at(index)) * sin(trackParticle->theta()) < 3.0 * Gaudi::Units::mm) && (trackParticle->pt() > 10 * Gaudi::Units::GeV)) ? 1 : 0);
35 ++index;
36 }
37 return entries;
38}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
size_type size() const noexcept
Returns the number of elements in the collection.
virtual std::vector< int > updateMask(const xAOD::TrackParticleContainer *trackParticles) const override final
SG::ReadHandleKey< std::vector< float > > m_trackZ0PVKey
double entries
Definition listroot.cxx:49
Definition index.py:1
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".