ATLAS Offline Software
ThinningToolExample.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef DERIVATIONFRAMEWORK_THINNINGTOOLEXAMPLE_H
6 #define DERIVATIONFRAMEWORK_THINNINGTOOLEXAMPLE_H
7 
8 #include <string>
9 #include <atomic>
10 
11 // Gaudi & Athena basics
15 
16 // DerivationFramework includes
18 
19 
20 namespace DerivationFramework {
21 
26  class ThinningToolExample : public extends<AthAlgTool, IThinningTool> {
27 
28  public:
30  using base_class::base_class;
31 
33  virtual ~ThinningToolExample();
34 
35  // Athena algtool's Hooks
36  virtual StatusCode initialize() override;
37  virtual StatusCode finalize() override;
38 
40  virtual StatusCode doThinning() const override;
41 
42  private:
43  Gaudi::Property<std::string> m_streamName
44  { this, "StreamName", "", "Name of the stream being thinned" };
45 
46  Gaudi::Property<double> m_trackPtCut
47  { this, "TrackPtCut", 20.0, "Track p_T cut in GeV" };
48 
50  { this, "InDetTrackParticlesKey", "InDetTrackParticles", "Key for track particle container" };
51 
52  mutable std::atomic<unsigned int> m_ntot{0};
53  mutable std::atomic<unsigned int> m_npass{0};
54 
55  };
56 
57 }
58 
59 #endif
DerivationFramework::ThinningToolExample::m_streamName
Gaudi::Property< std::string > m_streamName
Definition: ThinningToolExample.h:44
SG::ThinningHandleKey
HandleKey object for adding thinning to an object.
Definition: ThinningHandleKey.h:38
IThinningTool.h
DerivationFramework::ThinningToolExample::~ThinningToolExample
virtual ~ThinningToolExample()
Destructor.
Definition: ThinningToolExample.cxx:21
DerivationFramework::ThinningToolExample::initialize
virtual StatusCode initialize() override
Definition: ThinningToolExample.cxx:26
DerivationFramework::ThinningToolExample::m_npass
std::atomic< unsigned int > m_npass
Definition: ThinningToolExample.h:53
DerivationFramework::ThinningToolExample::m_inDetSGKey
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_inDetSGKey
Definition: ThinningToolExample.h:50
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::ThinningToolExample::finalize
virtual StatusCode finalize() override
Definition: ThinningToolExample.cxx:33
DerivationFramework::ThinningToolExample::m_trackPtCut
Gaudi::Property< double > m_trackPtCut
Definition: ThinningToolExample.h:47
DerivationFramework::ThinningToolExample::m_ntot
std::atomic< unsigned int > m_ntot
Definition: ThinningToolExample.h:52
DerivationFramework::ThinningToolExample
Definition: ThinningToolExample.h:26
ThinningHandleKey.h
HandleKey object for adding thinning to an object.
DerivationFramework::ThinningToolExample::doThinning
virtual StatusCode doThinning() const override
Check that the current event passes this filter.
Definition: ThinningToolExample.cxx:41
TrackParticleContainer.h