22 ATH_MSG_ERROR(
"PFData::caloObjects is null; caller must set it before invoking the radial energy calculator tool");
23 return StatusCode::FAILURE;
28 for (
auto thisEflowCaloObject : *theEflowCaloObjectContainer){
31 if (thisEflowCaloObject->nClusters() < 1 )
continue;
33 const std::vector<std::pair<eflowTrackClusterLink*,std::pair<float,float> > > matchedTrackList = thisEflowCaloObject->efRecLink();
35 for(
auto track: matchedTrackList){
39 std::vector<eflowRecCluster*> matchedClusters;
40 matchedClusters.clear();
42 for (
auto *thisEFlowTrackClusterLink : links) matchedClusters.push_back(thisEFlowTrackClusterLink->getCluster());
44 std::vector<std::pair<xAOD::CaloCluster*, bool> > clusterSubtractionList;
45 clusterSubtractionList.reserve(matchedClusters.size());
46 for (
auto *thisEFlowRecCluster : matchedClusters) clusterSubtractionList.emplace_back(thisEFlowRecCluster->getCluster(),
false);
51 std::vector<int> layerToStoreVector;
52 std::vector<float> radiusToStoreVector;
53 std::vector<float> avgEdensityToStoreVector;
63 double eta_extr = calorimeterCellList.
etaFF(layer);
64 ATH_MSG_DEBUG(
"extrapolated eta ["<<layer<<
"] is "<<eta_extr);
65 double phi_extr = calorimeterCellList.
phiFF(layer);
66 ATH_MSG_DEBUG(
"extrapolated phi ["<<layer<<
"] is "<<phi_extr);
68 if (eta_extr == -999.0){
73 for (
unsigned int indexOfRing = 0; indexOfRing < 100; indexOfRing++){
76 if(beginRing == calorimeterCellList.
end())
break;
78 int totalCellsinRing = 0;
79 double totalEnergyPerRing = 0;
80 double energyDensityPerRing = 0;
81 double averageEnergyDensityPerRing = 0;
84 std::vector<std::pair<const CaloCell*,int> > tempVector = (*beginRing).second;
87 for (
auto thisPair : tempVector){
93 ATH_MSG_DEBUG(
" cell eta and phi are " << (thisPair.first)->eta() <<
" and " << (thisPair.first)->phi() <<
" with index " << thisPair.second <<
" and sampling of " << sampling);
94 ATH_MSG_DEBUG(
" cell energy is " << (thisPair.first)->energy());
96 totalCellsinRing += 1;
98 totalEnergyPerRing += (thisPair.first)->energy();
99 double totalEnergyCell = (thisPair.first)->energy();
101 ATH_MSG_DEBUG(
" Total E per Ring is " << totalEnergyPerRing);
103 double cellVolume = DDE->
volume();
106 double energyDensityCell = totalEnergyCell/(cellVolume/1000.);
107 ATH_MSG_DEBUG(
" E density per Cell is " << energyDensityCell);
108 ATH_MSG_DEBUG(
" Initial added E density per Cell is " << energyDensityPerRing);
109 energyDensityPerRing += energyDensityCell;
110 ATH_MSG_DEBUG(
" Final added E density per Cell is " << energyDensityPerRing);
111 averageEnergyDensityPerRing = energyDensityPerRing/((totalCellsinRing)*(efRecTrack->
getTrack()->e()/1000.));
117 ATH_MSG_DEBUG(
" Average E density per Ring is " << averageEnergyDensityPerRing);
120 if (averageEnergyDensityPerRing != 0){
121 avgEdensityToStoreVector.push_back(averageEnergyDensityPerRing);
124 layerToStoreVector.push_back(layerToStore);
125 double radiusToStore = (indexOfRing)*ringThickness;
127 radiusToStoreVector.push_back(radiusToStore);
144 return StatusCode::SUCCESS;
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
virtual double e() const override final
The total energy of the particle.