ATLAS Offline Software
ReadxAOD.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
11 #ifndef ATHEXBASICS_READXAOD_H
12 #define ATHEXBASICS_READXAOD_H
13 
14 #include <atomic>
15 
17 #include "GaudiKernel/ToolHandle.h"
20 
22  public:
23  ReadxAOD(const std::string &name, ISvcLocator *pSvcLocator);
24 
25  virtual StatusCode initialize() override;
26  virtual StatusCode execute(const EventContext& ctx) const override;
27  virtual StatusCode finalize() override;
28 
29  private:
31  mutable std::atomic<unsigned int> m_nTracksBelow{0};
33  mutable std::atomic<unsigned int> m_nTracksAbove{0};
35  Gaudi::Property<float> m_cut
36  {this, "PtCut", 500.0, "pT Cut to apply to the tracks in MeV"};
38  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trackKey{this, "TrackParticlesKey", "InDetTrackParticles"};
40  ToolHandle<InDet::IInDetTrackSelectionTool> m_trackSelectionTool{this, "TrackSelectionTool", "InDetTrackSelectionTool", "Tool for selecting tracks"};
41 };
42 
43 #endif
ReadxAOD::m_nTracksBelow
std::atomic< unsigned int > m_nTracksBelow
Counter for tracks that have pT below the cut.
Definition: ReadxAOD.h:31
ReadxAOD::m_nTracksAbove
std::atomic< unsigned int > m_nTracksAbove
Counter for tracks that have pT above the cut.
Definition: ReadxAOD.h:33
ReadxAOD::m_trackSelectionTool
ToolHandle< InDet::IInDetTrackSelectionTool > m_trackSelectionTool
Tool handle for the track selection tool.
Definition: ReadxAOD.h:40
SG::ReadHandleKey< xAOD::TrackParticleContainer >
ReadxAOD::ReadxAOD
ReadxAOD(const std::string &name, ISvcLocator *pSvcLocator)
Definition: ReadxAOD.cxx:7
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ReadxAOD::m_trackKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackKey
Read handle for the offline object container - set to muons by default.
Definition: ReadxAOD.h:38
IInDetTrackSelectionTool.h
ReadxAOD::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: ReadxAOD.cxx:25
AthReentrantAlgorithm.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
ReadxAOD::initialize
virtual StatusCode initialize() override
Definition: ReadxAOD.cxx:11
ReadxAOD::finalize
virtual StatusCode finalize() override
Definition: ReadxAOD.cxx:49
ReadxAOD
Algorithm demonstrating reading of xAOD containers.
Definition: ReadxAOD.h:21
ReadxAOD::m_cut
Gaudi::Property< float > m_cut
pT cut in MeV
Definition: ReadxAOD.h:36
TrackParticleContainer.h