ATLAS Offline Software
PMGDecayProductsSelectionTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 
7 
8 
9 #ifndef PMG_TOOLS__PMG_DECAY_PRODUCTS_SELECTION_TOOL_H
10 #define PMG_TOOLS__PMG_DECAY_PRODUCTS_SELECTION_TOOL_H
11 
12 #include <AsgTools/AsgTool.h>
16 
17 
18 namespace PMGTools
19 {
22 
24  : public asg::AsgTool, virtual public IAsgSelectionTool
25  {
26  // Create a proper constructor for Athena
28 
29 
30 
31  public:
32  PMGDecayProductsSelectionTool (const std::string& name);
33 
34 
35 
36 
37  //
38  // inherited interface
39  //
40 
41  virtual StatusCode initialize () override;
42 
43  virtual const asg::AcceptInfo& getAcceptInfo () const override;
44 
45  virtual asg::AcceptData accept (const xAOD::IParticle* /*part*/) const override;
46 
47 
48 
49  //
50  // private interface
51  //
52 
54  private:
55  asg::AcceptData hasRequiredInitialParent (const xAOD::TruthParticle *truthParticle, asg::AcceptData& acceptData) const;
56 
58  private:
59  size_t getNParents (const xAOD::TruthParticle *truthParticle) const;
60 
62  private:
63  const xAOD::TruthParticle* getParent (const xAOD::TruthParticle *truthParticle,
64  size_t index) const;
65 
68 
69  private:
70  std::vector<int> m_requiredParentPDGIDs;
71  std::vector<int> m_allowedIntermediatePDGIDs;
72 
74 
75  private:
80 
82  private:
84 
86  private:
87  std::unique_ptr<const SG::AuxElement::Accessor<std::vector<ElementLink<xAOD::TruthParticleContainer>>>> m_parentsAccessor{};
88  };
89 }
90 
91 #endif
PMGTools::PMGDecayProductsSelectionTool::m_requiredParentPDGIDs
std::vector< int > m_requiredParentPDGIDs
tool properties
Definition: PMGDecayProductsSelectionTool.h:70
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
index
Definition: index.py:1
PMGTools::PMGDecayProductsSelectionTool::hasRequiredInitialParent
asg::AcceptData hasRequiredInitialParent(const xAOD::TruthParticle *truthParticle, asg::AcceptData &acceptData) const
Helper function to check for required parent particles.
Definition: PMGDecayProductsSelectionTool.cxx:106
TruthParticleContainer.h
PMGTools::PMGDecayProductsSelectionTool::getNParents
size_t getNParents(const xAOD::TruthParticle *truthParticle) const
Helper function to get the number of parent particles.
Definition: PMGDecayProductsSelectionTool.cxx:148
PMGTools::PMGDecayProductsSelectionTool::getParent
const xAOD::TruthParticle * getParent(const xAOD::TruthParticle *truthParticle, size_t index) const
Helper function get a parent by index.
Definition: PMGDecayProductsSelectionTool.cxx:163
PMGTools::PMGDecayProductsSelectionTool::m_accept
asg::AcceptInfo m_accept
the AcceptInfo we are using
Definition: PMGDecayProductsSelectionTool.h:83
PMGTools::PMGDecayProductsSelectionTool::m_parentsAccessor
std::unique_ptr< const SG::AuxElement::Accessor< std::vector< ElementLink< xAOD::TruthParticleContainer > > > > m_parentsAccessor
common parents accessor
Definition: PMGDecayProductsSelectionTool.h:87
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
PMGTools::PMGDecayProductsSelectionTool::m_requiredParentIndex
int m_requiredParentIndex
Index for the required parent particles.
Definition: PMGDecayProductsSelectionTool.h:79
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
PMGTools::PMGDecayProductsSelectionTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: PMGDecayProductsSelectionTool.cxx:37
PMGTools
Tool providing sample cross-sections and k-factors etc.
Definition: AnalysisCommon/PMGTools/PMGTools/IPMGCrossSectionTool.h:15
PMGTools::PMGDecayProductsSelectionTool::m_truthParticleIndex
int m_truthParticleIndex
Index for the truth particle link.
Definition: PMGDecayProductsSelectionTool.h:77
PMGTools::PMGDecayProductsSelectionTool::getAcceptInfo
virtual const asg::AcceptInfo & getAcceptInfo() const override
Declare the interface ID for this pure-virtual interface class to the Athena framework.
Definition: PMGDecayProductsSelectionTool.cxx:73
PMGTools::PMGDecayProductsSelectionTool::accept
virtual asg::AcceptData accept(const xAOD::IParticle *) const override
The main accept method: the actual cuts are applied here.
Definition: PMGDecayProductsSelectionTool.cxx:81
PMGTools::PMGDecayProductsSelectionTool::PMGDecayProductsSelectionTool
PMGDecayProductsSelectionTool(const std::string &name)
standard constructor
Definition: PMGDecayProductsSelectionTool.cxx:27
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
PMGTools::PMGDecayProductsSelectionTool
an IAsgSelectionTool that select particles based on the allowed decay chain
Definition: PMGDecayProductsSelectionTool.h:25
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
AsgTool.h
TruthParticle.h
PMGTools::PMGDecayProductsSelectionTool::m_allowedIntermediatePDGIDs
std::vector< int > m_allowedIntermediatePDGIDs
Definition: PMGDecayProductsSelectionTool.h:71
asg::AcceptData
Definition: AcceptData.h:30