35{
36
38
39
40 if (!caloClustersReadHandle.isValid()){
41 ATH_MSG_WARNING(
" Invalid ReadHandle for xAOD::CaloCluster with key: " << caloClustersReadHandle.key());
42 return StatusCode::SUCCESS;
43 }
44
48 calclusters = caloCalClustersReadHandle.
get();
49 }
50
51 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{
m_caloMgrKey};
53
54
55 unsigned int nClusters = caloClustersReadHandle->size();
56 for (unsigned int iCluster = 0; iCluster < nClusters; ++iCluster) {
57
58 std::unique_ptr<eflowRecCluster> thisEFRecCluster = std::make_unique<eflowRecCluster>(ElementLink<xAOD::CaloClusterContainer>(*caloClustersReadHandle, iCluster), theCaloClusterContainer);
59
60 if (calclusters){
61 std::map<IdentifierHash,double> cellsWeightMap;
62 retrieveLCCalCellWeight(caloClustersReadHandle->at(iCluster)->e(), iCluster, cellsWeightMap, *calclusters,**caloMgrHandle);
63
64 thisEFRecCluster->setCellsWeight(std::move(cellsWeightMap));
65 }
66
68
70 std::string::size_type
pos = decorHandleName.find(
".");
71 std::string decorName = decorHandleName.substr(pos+1);
72
74 accessor(*theCaloClusterContainer[iCluster]) =
accessor(*caloClustersReadHandle->at(iCluster));
75 }
76
77 thisEFRecCluster->setClusterId(iCluster);
78 theEFlowRecClusterContainer.
push_back(std::move(thisEFRecCluster));
79 }
80
81 return StatusCode::SUCCESS;
82}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
const T * get(size_type n) const
Access an element, as an rvalue.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::Accessor< T, ALLOC > Accessor
const AccessorWrapper< T > * accessor(xAOD::JetAttribute::AttributeID id)
Returns an attribute accessor corresponding to an AttributeID.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.