ATLAS Offline Software
Loading...
Searching...
No Matches
InDetSecVtxTrackSelectionTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4//Author: Lianyou Shan <lianyou.shan@cern.ch>
5// -*- c++ -*-
6#ifndef INDETSECVTXTRACKSELECTIONTOOL_H
7#define INDETSECVTXTRACKSELECTIONTOOL_H
8
9// Local include(s):
11
12// Framework include(s):
13#include "AsgTools/AsgTool.h"
14// #include "CxxUtils/checker_macros.h" // ATLAS_THREAD_SAFE
15#ifndef XAOD_ANALYSIS
16#include "GaudiKernel/ToolHandle.h"
17#include "GaudiKernel/ServiceHandle.h"
19#endif
20
21#include <atomic>
22#include <limits>
23#include <map>
24#include <cstdint>
25// #include <mutex>
26
27namespace InDet {
28
29 // forward declaration of helper classes
31 class SecVtxTrackCut;
32
36 public virtual IInDetTrackSelectionTool,
37 public asg::AsgTool {
38
39 friend class SecVtxTrackCut;
40
45
46 public:
48 InDetSecVtxTrackSelectionTool( const std::string& name );
49
50 // The default destructor is OK but it must be defined in the
51 // implementation file in order to forward declare with unique_ptr
53
56
58 virtual StatusCode initialize() override;
60 virtual StatusCode finalize() override;
61
63
66
68 virtual const asg::AcceptInfo& getAcceptInfo() const override;
69
71 virtual asg::AcceptData accept( const xAOD::IParticle* ) const override;
72
74
77
79 virtual asg::AcceptData accept( const xAOD::TrackParticle& track,
80 const xAOD::Vertex* vertex = nullptr ) const override;
81
82#ifndef XAOD_ANALYSIS
83 virtual asg::AcceptData accept( const Trk::Track& track,
84 const Trk::Vertex* vertex = nullptr) const override;
85#endif
86
88 virtual void setCutLevel( InDet::CutLevel level, bool overwrite = true ) override
89 __attribute__ ((deprecated("For consistency with the athena interface, the cut level is best set through the \"CutLevel\" property.")));
90
91 private:
92 bool m_isInitialized = false; // flag whether or not the tool has been initialized, to check erroneous use cases.
93 mutable std::atomic<bool> m_warnInit = false; // flag to keep track of whether we have warned about a lack of initialization
94
95 std::unordered_map< std::string, std::shared_ptr<SecVtxTrackAccessor> > m_trackAccessors;
96
97 // first element is cut family, second is the set of cuts
99
100 mutable std::atomic<uint64_t> m_numTracksProcessed = 0;
101 mutable std::atomic<uint64_t> m_numTracksPassed = 0;
102 // mutable std::vector<uint64_t> m_numTracksPassedCuts ATLAS_THREAD_SAFE; //!< tracks the number of tracks that passed each cut family Guarded by m_mutex
103 // mutable std::mutex m_mutex;
104
105 constexpr static double LOCAL_MAX_DOUBLE = 1.0e16;
106 constexpr static int LOCAL_MAX_INT = std::numeric_limits<int>::max();
107
110
111 DoubleProperty m_minD0{this, "minD0", -1., "Minimum |d0| of tracks"};
112 IntegerProperty m_NPixel0TRT
113 {this, "minNPixelHitsAtZeroTRT", -1, "Minimum number of Pixel hit upon zero TRT hit"};
114 IntegerProperty m_minInDetHits
115 {this, "minTotalHits", -1, "Minimum number of Pixel + SCT + TRT hits"};
116
117// ToolHandle< InDet::IInDetTrackSelectionTool > m_trkFilter ;
118#ifndef XAOD_ANALYSIS
119 bool m_initTrkTools = false;
121#endif // XAOD_ANALYSIS
122
123 }; // class InDetSecVtxTrackSelectionTool
124
125} // namespace InDet
126
127#endif // INDETSECVTXTRACKSELECTIONTOOL_INDETSECVTXTRACKSELECTIONTOOL_H
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
__attribute__((always_inline)) inline uint16_t TileCalibDrawerBase
#define max(a, b)
Definition cfImp.cxx:41
Object to describe a series of cuts.
Interface for track selection tool.
Implementation of the track selector tool.
asg::AcceptInfo m_acceptInfo
Object used to store the last decision.
std::atomic< uint64_t > m_numTracksPassed
a counter of the number of tracks that passed all cuts
virtual StatusCode finalize() override
Function finalizing the tool.
std::unordered_map< std::string, std::shared_ptr< SecVtxTrackAccessor > > m_trackAccessors
list of the accessors that need to be run for each track
std::atomic< uint64_t > m_numTracksProcessed
a counter of the number of tracks proccessed
virtual StatusCode initialize() override
Function initialising the tool.
virtual void setCutLevel(InDet::CutLevel level, bool overwrite=true) override __attribute__((deprecated("For consistency with the athena interface
Function to set the cut level within standalone ROOT.
bool m_initTrkTools
Whether to initialize the Trk::Track tools.
bool m_trackSumToolAvailable
Whether the summary tool is available.
ASG_TOOL_CLASS2(InDetSecVtxTrackSelectionTool, IAsgSelectionTool, InDet::IInDetTrackSelectionTool) public ~InDetSecVtxTrackSelectionTool()
Create a proper constructor for Athena.
virtual const asg::AcceptInfo & getAcceptInfo() const override
Get an object describing the "selection steps" of the tool.
std::map< std::string, std::vector< std::unique_ptr< SecVtxTrackCut > > > m_trackCuts
First element is the name of the cut family, second element is the set of cuts.
virtual asg::AcceptData accept(const xAOD::IParticle *) const override
Get the decision using a generic IParticle pointer.
This class is a simplest representation of a vertex candidate.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
STL class.
STL class.
Class providing the definition of the 4-vector interface.
Primary Vertex Finder.
STL namespace.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
#define private