ATLAS Offline Software
InvariantMassTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef DERIVATIONFRAMEWORK_INVARIANTMASSTOOL_H
6 #define DERIVATIONFRAMEWORK_INVARIANTMASSTOOL_H
7 
8 
11 
17 #include <string>
18 #include <vector>
19 
20 class TVector3;
21 class EventContext;
22 
23 namespace DerivationFramework {
24 
26  class InvariantMassTool : public extends<ExpressionParserUser<AthAlgTool,kInvariantMassToolParserNum>, IAugmentationTool> {
27  public:
28 
29  using base_class::base_class;
30 
31  virtual StatusCode initialize() override final;
32  virtual StatusCode finalize() override final;
33  virtual StatusCode addBranches(const EventContext& ctx) const override final;
34 
35  private:
36  Gaudi::Property<std::string> m_expression{this, "ObjectRequirements", "true"};
37  Gaudi::Property<std::string> m_expression2{this, "SecondObjectRequirements", ""};
38  SG::WriteHandleKey<std::vector<float> > m_sgName {this,"StoreGateEntryName","","SG key of output object"};
39  Gaudi::Property<float> m_massHypothesis{this, "MassHypothesis", 0.0};
40  Gaudi::Property<float> m_massHypothesis2{this, "SecondMassHypothesis", 2.0};
41  SG::ReadHandleKey<xAOD::IParticleContainer> m_containerName {this,"ContainerName","","SG key of first container"};
42  SG::ReadHandleKey<xAOD::IParticleContainer> m_containerName2 {this,"SecondContainerName","","SG key of second container"};
43  SG::ReadDecorHandleKeyArray<xAOD::IParticleContainer> m_inputDecorNames {this, "InputDecorNames",{},"SG keys for decorations of first (and second) container(s)"};
44  StatusCode getInvariantMasses(std::vector<float>*, const EventContext& ctx) const;
45  static float calculateInvariantMass(const TVector3& v1, const TVector3&v2,float M1,float M2) ;
46  };
47 }
48 
49 #endif // DERIVATIONFRAMEWORK_INVARIANTMASSTOOL_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
DerivationFramework::kInvariantMassToolParserNum
@ kInvariantMassToolParserNum
Definition: InvariantMassTool.h:25
DerivationFramework::EInvariantMassToolParser
EInvariantMassToolParser
Definition: InvariantMassTool.h:25
DerivationFramework::InvariantMassTool::m_containerName
SG::ReadHandleKey< xAOD::IParticleContainer > m_containerName
Definition: InvariantMassTool.h:41
IAugmentationTool.h
ExpressionParserUser.h
DerivationFramework::InvariantMassTool::finalize
virtual StatusCode finalize() override final
Definition: InvariantMassTool.cxx:31
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:45
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
DerivationFramework::InvariantMassTool::calculateInvariantMass
static float calculateInvariantMass(const TVector3 &v1, const TVector3 &v2, float M1, float M2)
Definition: InvariantMassTool.cxx:138
DerivationFramework::InvariantMassTool::m_massHypothesis
Gaudi::Property< float > m_massHypothesis
Definition: InvariantMassTool.h:39
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IParticleContainer.h
AthAlgTool.h
DerivationFramework::kInvariantMassToolParser2
@ kInvariantMassToolParser2
Definition: InvariantMassTool.h:25
DerivationFramework::InvariantMassTool::m_expression
Gaudi::Property< std::string > m_expression
Definition: InvariantMassTool.h:36
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::InvariantMassTool::m_containerName2
SG::ReadHandleKey< xAOD::IParticleContainer > m_containerName2
Definition: InvariantMassTool.h:42
DerivationFramework::InvariantMassTool::initialize
virtual StatusCode initialize() override final
Definition: InvariantMassTool.cxx:13
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
DerivationFramework::InvariantMassTool::m_expression2
Gaudi::Property< std::string > m_expression2
Definition: InvariantMassTool.h:37
DerivationFramework::InvariantMassTool::getInvariantMasses
StatusCode getInvariantMasses(std::vector< float > *, const EventContext &ctx) const
Definition: InvariantMassTool.cxx:51
ReadCellNoiseFromCoolCompare.v2
v2
Definition: ReadCellNoiseFromCoolCompare.py:364
DerivationFramework::InvariantMassTool::addBranches
virtual StatusCode addBranches(const EventContext &ctx) const override final
Definition: InvariantMassTool.cxx:37
DerivationFramework::InvariantMassTool::m_inputDecorNames
SG::ReadDecorHandleKeyArray< xAOD::IParticleContainer > m_inputDecorNames
Definition: InvariantMassTool.h:43
DerivationFramework::InvariantMassTool
Definition: InvariantMassTool.h:26
DerivationFramework::InvariantMassTool::m_sgName
SG::WriteHandleKey< std::vector< float > > m_sgName
Definition: InvariantMassTool.h:38
DerivationFramework::kInvariantMassToolParser1
@ kInvariantMassToolParser1
Definition: InvariantMassTool.h:25
ReadDecorHandleKeyArray.h
DerivationFramework::InvariantMassTool::m_massHypothesis2
Gaudi::Property< float > m_massHypothesis2
Definition: InvariantMassTool.h:40