ATLAS Offline Software
TrackTruthSelectionTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INDETPHYSVALMONITORING_TRACKTRUTHSELECTORTOOL_H
6 #define INDETPHYSVALMONITORING_TRACKTRUTHSELECTORTOOL_H 1
7 
11 #include "AsgTools/AsgTool.h"
12 
13 #include <atomic>
14 #include <mutex>
15 
17  public virtual ::IAsgSelectionTool,
18  public asg::AsgTool {
20 public:
21  TrackTruthSelectionTool(const std::string& name);
22  // TrackTruthSelectionTool(const std::string& type,const std::string& name,const IInterface* parent);
23  virtual
25 
26  virtual StatusCode initialize() override;
27  virtual StatusCode finalize() override;
28  virtual const asg::AcceptInfo& getAcceptInfo( ) const override;
29  virtual asg::AcceptData accept(const xAOD::IParticle* p) const override;
30  virtual asg::AcceptData accept(const xAOD::TruthParticle* p) const;
31 private:
33  std::vector<std::pair<std::string, std::string> > m_cuts;
34  mutable std::atomic<ULong64_t> m_numTruthProcessed; // !< a counter of the number of tracks proccessed
35  mutable std::atomic<ULong64_t> m_numTruthPassed; // !< a counter of the number of tracks that passed all cuts
36  mutable std::vector<ULong64_t> m_numTruthPassedCuts ATLAS_THREAD_SAFE; // !< tracks the number of tracks that passed each cut family. Guarded by m_mutex
37  mutable std::mutex m_mutex; // !< To guard m_numTruthPassedCuts
38 
39  // Cut values;
40  float m_maxEta;
41  float m_maxPt;
42  float m_minPt;
46  // max decay radius for secondaries [mm];
47  // set to within (Run2) pixel by default; set to <0 for no cut
49  int m_pdgId;
50 };
51 
52 #endif // > !INDETPHYSVALMONITORING_TRACKTRUTHSELECTORTOOL_H
TrackTruthSelectionTool::m_numTruthProcessed
std::atomic< ULong64_t > m_numTruthProcessed
Definition: TrackTruthSelectionTool.h:34
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
TrackTruthSelectionTool::ASG_TOOL_CLASS1
ASG_TOOL_CLASS1(TrackTruthSelectionTool, IAsgSelectionTool)
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
TrackTruthSelectionTool::m_accept
asg::AcceptInfo m_accept
Definition: TrackTruthSelectionTool.h:32
TrackTruthSelectionTool::m_maxPt
float m_maxPt
Definition: TrackTruthSelectionTool.h:41
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
TrackTruthSelectionTool::ATLAS_THREAD_SAFE
std::vector< ULong64_t > m_numTruthPassedCuts ATLAS_THREAD_SAFE
Definition: TrackTruthSelectionTool.h:36
TrackTruthSelectionTool::~TrackTruthSelectionTool
virtual ~TrackTruthSelectionTool()
TrackTruthSelectionTool::m_requireCharged
bool m_requireCharged
Definition: TrackTruthSelectionTool.h:44
TrackTruthSelectionTool::m_numTruthPassed
std::atomic< ULong64_t > m_numTruthPassed
Definition: TrackTruthSelectionTool.h:35
TrackTruthSelectionTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: TrackTruthSelectionTool.cxx:33
TrackTruthSelectionTool::getAcceptInfo
virtual const asg::AcceptInfo & getAcceptInfo() const override
Declare the interface ID for this pure-virtual interface class to the Athena framework.
Definition: TrackTruthSelectionTool.cxx:84
IAsgSelectionTool
Definition: IAsgSelectionTool.h:28
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:40
IAsgSelectionTool.h
TrackTruthSelectionTool::accept
virtual asg::AcceptData accept(const xAOD::IParticle *p) const override
The main accept method: the actual cuts are applied here.
Definition: TrackTruthSelectionTool.cxx:89
TrackTruthSelectionTool::m_requireOnlyPrimary
bool m_requireOnlyPrimary
Definition: TrackTruthSelectionTool.h:43
asg::AcceptInfo
Definition: AcceptInfo.h:28
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
AthAlgTool.h
TrackTruthSelectionTool::m_minPt
float m_minPt
Definition: TrackTruthSelectionTool.h:42
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
TrackTruthSelectionTool::m_pdgId
int m_pdgId
Definition: TrackTruthSelectionTool.h:49
TrackTruthSelectionTool::m_requireStatus1
bool m_requireStatus1
Definition: TrackTruthSelectionTool.h:45
TrackTruthSelectionTool::m_maxEta
float m_maxEta
Definition: TrackTruthSelectionTool.h:40
TrackTruthSelectionTool::finalize
virtual StatusCode finalize() override
Definition: TrackTruthSelectionTool.cxx:155
TrackTruthSelectionTool
Definition: TrackTruthSelectionTool.h:18
TrackTruthSelectionTool::m_mutex
std::mutex m_mutex
Definition: TrackTruthSelectionTool.h:37
AsgTool.h
TruthParticle.h
asg::AcceptData
Definition: AcceptData.h:30
TrackTruthSelectionTool::m_cuts
std::vector< std::pair< std::string, std::string > > m_cuts
Definition: TrackTruthSelectionTool.h:33
TrackTruthSelectionTool::m_maxProdVertRadius
double m_maxProdVertRadius
Definition: TrackTruthSelectionTool.h:48
TrackTruthSelectionTool::TrackTruthSelectionTool
TrackTruthSelectionTool(const std::string &name)
Definition: TrackTruthSelectionTool.cxx:12