ATLAS Offline Software
DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.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 DERIVATIONFRAMEWORK_TRUTHISOLATIONTOOL_H
6 #define DERIVATIONFRAMEWORK_TRUTHISOLATIONTOOL_H
7 
8 #include <string>
9 
13 #include "Gaudi/Property.h"
17 #include "GaudiKernel/ToolHandle.h"
18 
19 namespace DerivationFramework {
20 
22  public:
23  TruthIsolationTool(const std::string& t, const std::string& n, const IInterface* p);
25  virtual StatusCode initialize() override;
26  virtual StatusCode addBranches() const override;
27 
28  private:
31  {this, "isoParticlesKey", "TruthParticles", "Name of TruthParticle key for input"};
34  {this, "allParticlesKey", "TruthParticles", "Name of Truthparticle key to find in iso cone"};
37  {this, "DoNotSet_isoDecorKeys", {}, "WriteDecorHandleKeyArray - set internally but must be property"};
39  Gaudi::Property<std::vector<float> > m_coneSizes
40  {this, "IsolationConeSizes", {0.2}, "Vector of sizes of dR cone in which to include particles"};
42  Gaudi::Property<bool> m_chargedOnly
43  {this, "ChargedParticlesOnly", false, "Only keep charged particles in isolation cone"};
45  Gaudi::Property<std::vector<int> > m_listOfPIDs
46  {this, "particleIDsToCalculate", {11,13,22}, "List of the pdgIDs of particles for which to calculate isolation"};
48  Gaudi::Property<std::vector<int> > m_excludeFromCone
49  {this, "excludeIDsFromCone", {}, "List of the pdgIDs of particles to exclude from the cone when calculating isolation"};
51  Gaudi::Property<std::string> m_isoVarNamePrefix
52  {this, "IsolationVarNamePrefix", "", "Prefix of name of the variable to add to output xAOD"};
54  Gaudi::Property<bool> m_includeNonInteracting
55  {this, "IncludeNonInteracting", false, "Include non-interacting particles in the isolation definition"};
57  Gaudi::Property<bool> m_variableR
58  {this, "VariableR", false, "Use radius that shrinks with pT in isolation"};
59 
60  std::vector<float> m_coneSizesSort;
61 
62  //private helper functions
64  const std::vector<const xAOD::TruthParticle*> &,
65  std::vector<float>&) const;
66  static float calculateDeltaR2(const xAOD::IParticle *p1, float eta2, float phi2) ;
67  };
68 }
69 
70 #endif // DERIVATIONFRAMEWORK_TRUTHISOLATIONTOOL_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
DerivationFramework::TruthIsolationTool::m_isoParticlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_isoParticlesKey
Parameter: input collection key.
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:31
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
IAugmentationTool.h
TruthParticleContainer.h
DerivationFramework::TruthIsolationTool::initialize
virtual StatusCode initialize() override
Definition: DerivationFramework/DerivationFrameworkMCTruth/src/TruthIsolationTool.cxx:30
DerivationFramework::TruthIsolationTool::m_isoVarNamePrefix
Gaudi::Property< std::string > m_isoVarNamePrefix
Parameter: name of output variable.
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:52
DerivationFramework::TruthIsolationTool::m_coneSizesSort
std::vector< float > m_coneSizesSort
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:60
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DerivationFramework::TruthIsolationTool::m_listOfPIDs
Gaudi::Property< std::vector< int > > m_listOfPIDs
Parameter: List of pdgIDs of particles to dress.
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:46
SG::ReadHandleKey< xAOD::TruthParticleContainer >
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:40
DerivationFramework::TruthIsolationTool::m_chargedOnly
Gaudi::Property< bool > m_chargedOnly
Parameter: only use charged particles for iso?
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:43
DerivationFramework::TruthIsolationTool::TruthIsolationTool
TruthIsolationTool(const std::string &t, const std::string &n, const IInterface *p)
Definition: DerivationFramework/DerivationFrameworkMCTruth/src/TruthIsolationTool.cxx:17
DerivationFramework::IAugmentationTool
Definition: IAugmentationTool.h:24
DerivationFramework::TruthIsolationTool::calcIsos
void calcIsos(const xAOD::TruthParticle *particle, const std::vector< const xAOD::TruthParticle * > &, std::vector< float > &) const
Definition: DerivationFramework/DerivationFrameworkMCTruth/src/TruthIsolationTool.cxx:109
DerivationFramework::TruthIsolationTool
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:21
DerivationFramework::TruthIsolationTool::addBranches
virtual StatusCode addBranches() const override
Pass the thinning service
Definition: DerivationFramework/DerivationFrameworkMCTruth/src/TruthIsolationTool.cxx:54
DerivationFramework::TruthIsolationTool::m_allParticlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_allParticlesKey
Parameter: input collection key for particles used in calculation.
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:34
beamspotman.n
n
Definition: beamspotman.py:731
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
DerivationFramework::TruthIsolationTool::m_variableR
Gaudi::Property< bool > m_variableR
Parameter: Use variable radius?
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:58
AthAlgTool.h
DerivationFramework::TruthIsolationTool::~TruthIsolationTool
~TruthIsolationTool()
Definition: DerivationFramework/DerivationFrameworkMCTruth/src/TruthIsolationTool.cxx:26
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::TruthIsolationTool::m_coneSizes
Gaudi::Property< std::vector< float > > m_coneSizes
Parameter: Cone size for Isolation.
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:40
DerivationFramework::TruthIsolationTool::m_includeNonInteracting
Gaudi::Property< bool > m_includeNonInteracting
Parameter: Include non-interacting particles?
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:55
DecayGraphHelper.h
DerivationFramework::TruthIsolationTool::m_excludeFromCone
Gaudi::Property< std::vector< int > > m_excludeFromCone
Parameter: List of pdgIDs to exclude from cone calculation.
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:49
WriteDecorHandleKeyArray.h
DerivationFramework::TruthIsolationTool::m_isoDecorKeys
SG::WriteDecorHandleKeyArray< xAOD::TruthParticleContainer, float > m_isoDecorKeys
Decor handle key array.
Definition: DerivationFramework/DerivationFrameworkMCTruth/DerivationFrameworkMCTruth/TruthIsolationTool.h:37
DerivationFramework::TruthIsolationTool::calculateDeltaR2
static float calculateDeltaR2(const xAOD::IParticle *p1, float eta2, float phi2)
Definition: DerivationFramework/DerivationFrameworkMCTruth/src/TruthIsolationTool.cxx:147
AthAlgTool
Definition: AthAlgTool.h:26