20 return StatusCode::SUCCESS;
31 for (
auto thisFlowElement : *cellListWriteDecorHandle){
33 std::vector<std::pair<const xAOD::IParticle*,float> > theOtherPairs_charged = thisFlowElement->otherObjectsAndWeights();
35 std::vector<ElementLink<CaloCellContainer> > cellsToDecorate;
37 for (
const auto & [theCluster_charged,
weight] : theOtherPairs_charged){
40 for (
auto thisNeutralFE : *neutralPFOReadHandle){
41 std::vector<std::pair<const xAOD::IParticle*,float> > theOtherPairs_neutral = thisNeutralFE->otherObjectsAndWeights();
42 if (1 != theOtherPairs_neutral.size())
ATH_MSG_WARNING(
"Expected neutral FE to have only 1 topocluster link");
44 const xAOD::IParticle* theCluster_neutral = theOtherPairs_neutral.at(0).first;
46 if (theCluster_charged == theCluster_neutral){
49 if (not chargedCluster){
50 ATH_MSG_WARNING(
"dynamic_cast to (charged) CaloCluster failed in execute");
58 if (not neutralCluster){
59 ATH_MSG_WARNING(
"dynamic_cast to (neutral) CaloCluster failed in execute");
65 for ( ; chargedClusterCellLinksItr != chargedClusterCellLinks->
end(); ++chargedClusterCellLinksItr ) {
67 const CaloCell* chargedCell = *chargedClusterCellLinksItr;
71 bool cellInNeutralCluster =
false;
72 for (
auto neutralCell : *neutralClusterCellLinks){
75 if (chargedCell == neutralCell) cellInNeutralCluster =
true;
87 cellListWriteDecorHandle(*thisFlowElement) = cellsToDecorate;
91 return StatusCode::SUCCESS;
99 return StatusCode::SUCCESS;