ATLAS Offline Software
Loading...
Searching...
No Matches
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 {
20public:
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;
31private:
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
std::vector< std::pair< std::string, std::string > > m_cuts
TrackTruthSelectionTool(const std::string &name)
virtual ~TrackTruthSelectionTool()
ASG_TOOL_CLASS1(TrackTruthSelectionTool, IAsgSelectionTool)
virtual StatusCode finalize() override
virtual asg::AcceptData accept(const xAOD::IParticle *p) const override
The main accept method: the actual cuts are applied here.
virtual const asg::AcceptInfo & getAcceptInfo() const override
Declare the interface ID for this pure-virtual interface class to the Athena framework.
std::atomic< ULong64_t > m_numTruthProcessed
std::atomic< ULong64_t > m_numTruthPassed
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
std::vector< ULong64_t > m_numTruthPassedCuts ATLAS_THREAD_SAFE
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Class providing the definition of the 4-vector interface.
TruthParticle_v1 TruthParticle
Typedef to implementation.