ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCalibClusterDecoratorTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
8
19
21 const EventContext& ctx,
22 [[maybe_unused]] xAOD::CaloClusterContainer* theClusColl) const {
23
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
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}
62
64 return StatusCode::SUCCESS;
65}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Handle class for adding a decoration to an object.
virtual StatusCode initialize() override
ToolHandle< ICaloCalibClusterTruthAttributerTool > m_truthAttributerTool
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *theClusColl) const override final
Gaudi::Property< unsigned int > m_numTruthParticles
SG::ReadHandleKey< std::map< Identifier, std::vector< const CaloCalibrationHit * > > > m_mapIdentifierToCalibHitsReadHandleKey
SG::WriteDecorHandleKey< xAOD::CaloClusterContainer > m_caloClusterWriteDecorHandleKeyNLeadingTruthParticles
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Handle class for adding a decoration to an object.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.