Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TrackTruthSelectionTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 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:
32  asg::AcceptInfo m_accept{"TrackTruthSelection"};
33  std::vector<std::pair<std::string, std::string> > m_cuts;
34  mutable std::atomic<ULong64_t> m_numTruthProcessed{0}; // !< a counter of the number of tracks proccessed
35  mutable std::atomic<ULong64_t> m_numTruthPassed{0}; // !< 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  FloatProperty m_maxEta{this, "maxEta", 2.5};
41  FloatProperty m_maxPt{this, "maxPt", -1.};
42  FloatProperty m_minPt{this, "minPt", 400.};
43  BooleanProperty m_requireOnlyPrimary{this, "requireOnlyPrimary", true};
44  BooleanProperty m_requireCharged{this, "requireCharged", true};
45  BooleanProperty m_requireStable{this, "requireStable", true};
46  // max decay radius for secondaries [mm];
47  // set to within (Run2) pixel by default; set to <0 for no cut
48  FloatProperty m_maxProdVertRadius{this, "maxProdVertRadius", 110.};
49  IntegerProperty m_pdgId{this, "pdgId", -1};
50 };
51 
52 #endif // > !INDETPHYSVALMONITORING_TRACKTRUTHSELECTORTOOL_H
TrackTruthSelectionTool::m_numTruthProcessed
std::atomic< ULong64_t > m_numTruthProcessed
Definition: TrackTruthSelectionTool.h:34
TrackTruthSelectionTool::m_maxPt
FloatProperty m_maxPt
Definition: TrackTruthSelectionTool.h:41
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
TrackTruthSelectionTool::ASG_TOOL_CLASS1
ASG_TOOL_CLASS1(TrackTruthSelectionTool, IAsgSelectionTool)
TrackTruthSelectionTool::m_accept
asg::AcceptInfo m_accept
Definition: TrackTruthSelectionTool.h:32
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::m_requireStable
BooleanProperty m_requireStable
Definition: TrackTruthSelectionTool.h:45
TrackTruthSelectionTool::m_pdgId
IntegerProperty m_pdgId
Definition: TrackTruthSelectionTool.h:49
TrackTruthSelectionTool::~TrackTruthSelectionTool
virtual ~TrackTruthSelectionTool()
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:20
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:71
IAsgSelectionTool
Definition: IAsgSelectionTool.h:28
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
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:76
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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:37
AthAlgTool.h
TrackTruthSelectionTool::m_requireCharged
BooleanProperty m_requireCharged
Definition: TrackTruthSelectionTool.h:44
TrackTruthSelectionTool::m_maxProdVertRadius
FloatProperty m_maxProdVertRadius
Definition: TrackTruthSelectionTool.h:48
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrackTruthSelectionTool::m_requireOnlyPrimary
BooleanProperty m_requireOnlyPrimary
Definition: TrackTruthSelectionTool.h:43
TrackTruthSelectionTool::m_maxEta
FloatProperty m_maxEta
Definition: TrackTruthSelectionTool.h:40
TrackTruthSelectionTool::finalize
virtual StatusCode finalize() override
Definition: TrackTruthSelectionTool.cxx:142
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::TrackTruthSelectionTool
TrackTruthSelectionTool(const std::string &name)
Definition: TrackTruthSelectionTool.cxx:12
TrackTruthSelectionTool::m_minPt
FloatProperty m_minPt
Definition: TrackTruthSelectionTool.h:42