ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCalibClusterDecoratorTool Class Reference

#include <CaloCalibClusterDecoratorTool.h>

Inheritance diagram for CaloCalibClusterDecoratorTool:
Collaboration diagram for CaloCalibClusterDecoratorTool:

Public Member Functions

virtual StatusCode execute (const EventContext &ctx, xAOD::CaloClusterContainer *theClusColl) const override final
virtual StatusCode initialize () override
virtual StatusCode finalize () override
virtual ~CaloCalibClusterDecoratorTool ()

Private Attributes

SG::ReadHandleKey< std::map< Identifier, std::vector< const CaloCalibrationHit * > > > m_mapIdentifierToCalibHitsReadHandleKey
SG::WriteDecorHandleKey< xAOD::CaloClusterContainerm_caloClusterWriteDecorHandleKeyNLeadingTruthParticles
ToolHandle< ICaloCalibClusterTruthAttributerToolm_truthAttributerTool
Gaudi::Property< unsigned int > m_numTruthParticles

Detailed Description

Definition at line 22 of file CaloCalibClusterDecoratorTool.h.

Constructor & Destructor Documentation

◆ ~CaloCalibClusterDecoratorTool()

virtual CaloCalibClusterDecoratorTool::~CaloCalibClusterDecoratorTool ( )
inlinevirtual

Definition at line 36 of file CaloCalibClusterDecoratorTool.h.

36{};

Member Function Documentation

◆ execute()

StatusCode CaloCalibClusterDecoratorTool::execute ( const EventContext & ctx,
xAOD::CaloClusterContainer * theClusColl ) const
finaloverridevirtual

Definition at line 20 of file CaloCalibClusterDecoratorTool.cxx.

22 {
23
24 SG::ReadHandle<std::map<Identifier,std::vector<const CaloCalibrationHit*> > >
25 mapIdentifierToCalibHitsReadHandle(m_mapIdentifierToCalibHitsReadHandleKey, ctx);
26
27 if (!mapIdentifierToCalibHitsReadHandle.isValid()) {
28 ATH_MSG_WARNING("Could not retrieve map between Identifier and calibraiton hits from Storegae");
29 return StatusCode::FAILURE;
30 }
31
32 SG::WriteDecorHandle<xAOD::CaloClusterContainer,
33 std::vector<std::pair<unsigned int, double> > >
34 caloClusterWriteDecorHandleNLeadingTruthParticles(
36
37 for (const auto* thisCaloCluster : *caloClusterWriteDecorHandleNLeadingTruthParticles) {
38
39 std::vector<std::pair<unsigned int, double> > newTruthIDTruthPairs;
40
42 m_truthAttributerTool->calculateTruthEnergies(
43 *thisCaloCluster,
45 *mapIdentifierToCalibHitsReadHandle,
46 newTruthIDTruthPairs));
47
48 for (const auto& thisPair : newTruthIDTruthPairs) {
50 "Cluster Final loop: Particle with truthID " << thisPair.first
51 << " has truth energy of " << thisPair.second
52 << " for cluster with e, eta " << thisCaloCluster->e()
53 << " and " << thisCaloCluster->eta());
54 }
55
56 caloClusterWriteDecorHandleNLeadingTruthParticles(*thisCaloCluster)
57 = std::move(newTruthIDTruthPairs);
58 }
59
60 return StatusCode::SUCCESS;
61}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
ToolHandle< ICaloCalibClusterTruthAttributerTool > m_truthAttributerTool
Gaudi::Property< unsigned int > m_numTruthParticles
SG::ReadHandleKey< std::map< Identifier, std::vector< const CaloCalibrationHit * > > > m_mapIdentifierToCalibHitsReadHandleKey
SG::WriteDecorHandleKey< xAOD::CaloClusterContainer > m_caloClusterWriteDecorHandleKeyNLeadingTruthParticles
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.

◆ finalize()

StatusCode CaloCalibClusterDecoratorTool::finalize ( )
overridevirtual

Definition at line 63 of file CaloCalibClusterDecoratorTool.cxx.

63 {
64 return StatusCode::SUCCESS;
65}

◆ initialize()

StatusCode CaloCalibClusterDecoratorTool::initialize ( )
overridevirtual

Definition at line 9 of file CaloCalibClusterDecoratorTool.cxx.

9 {
10
12
14
16
17 return StatusCode::SUCCESS;
18}

Member Data Documentation

◆ m_caloClusterWriteDecorHandleKeyNLeadingTruthParticles

SG::WriteDecorHandleKey<xAOD::CaloClusterContainer> CaloCalibClusterDecoratorTool::m_caloClusterWriteDecorHandleKeyNLeadingTruthParticles
private
Initial value:
{
this,
"CaloClusterWriteDecorHandleKey_NLeadingTruthParticles",
"CaloCalTopoClusters.calclus_NLeadingTruthParticleBarcodeEnergyPairs"
}

Definition at line 48 of file CaloCalibClusterDecoratorTool.h.

48 {
49 this,
50 "CaloClusterWriteDecorHandleKey_NLeadingTruthParticles",
51 "CaloCalTopoClusters.calclus_NLeadingTruthParticleBarcodeEnergyPairs"
52 };

◆ m_mapIdentifierToCalibHitsReadHandleKey

SG::ReadHandleKey<std::map<Identifier,std::vector<const CaloCalibrationHit*> > > CaloCalibClusterDecoratorTool::m_mapIdentifierToCalibHitsReadHandleKey
private
Initial value:
{
this,
"IdentifierToCalibHitsMapName",
"IdentifierToCalibHitsMap",
"ReadHandleKey for the map between Identifiers and sets of calibration hits"
}

Definition at line 40 of file CaloCalibClusterDecoratorTool.h.

40 {
41 this,
42 "IdentifierToCalibHitsMapName",
43 "IdentifierToCalibHitsMap",
44 "ReadHandleKey for the map between Identifiers and sets of calibration hits"
45 };

◆ m_numTruthParticles

Gaudi::Property<unsigned int> CaloCalibClusterDecoratorTool::m_numTruthParticles
private
Initial value:
{
this,
"NumTruthParticles",
20,
"Set number of truth particles per CaloCluster/PFO for which we store calibration hit energy"
}

Definition at line 63 of file CaloCalibClusterDecoratorTool.h.

63 {
64 this,
65 "NumTruthParticles",
66 20,
67 "Set number of truth particles per CaloCluster/PFO for which we store calibration hit energy"
68 };

◆ m_truthAttributerTool

ToolHandle<ICaloCalibClusterTruthAttributerTool> CaloCalibClusterDecoratorTool::m_truthAttributerTool
private
Initial value:
{
this,
"TruthAttributerTool",
"",
"ToolHandle to a tool to create the calibration hit truth information that we need for the decoration"
}

Definition at line 55 of file CaloCalibClusterDecoratorTool.h.

55 {
56 this,
57 "TruthAttributerTool",
58 "",
59 "ToolHandle to a tool to create the calibration hit truth information that we need for the decoration"
60 };

The documentation for this class was generated from the following files: