15 {
16
18
19 for (auto thisEflowCaloObject : theEflowCaloObjectContainer){
20
21
22 if (thisEflowCaloObject->nClusters() < 1 ) continue;
23
24 const std::vector<std::pair<eflowTrackClusterLink*,std::pair<float,float> > > matchedTrackList = thisEflowCaloObject->efRecLink();
25
26 for(const auto& track: matchedTrackList){
27
28 eflowRecTrack* efRecTrack = (
track.first)->getTrack();
29
30 std::vector<eflowRecCluster*> matchedClusters;
32 for (auto *thisEFlowTrackClusterLink : links) matchedClusters.push_back(thisEFlowTrackClusterLink->getCluster());
33
34 std::vector<std::pair<xAOD::CaloCluster*, bool> > clusterSubtractionList;
35 clusterSubtractionList.reserve(matchedClusters.size());
36 for (auto *thisEFlowRecCluster : matchedClusters) clusterSubtractionList.emplace_back(thisEFlowRecCluster->getCluster(),false);
37
38 eflowCellList calorimeterCellList;
40
41 std::vector<int> layerToStoreVector;
42 std::vector<float> radiusToStoreVector;
43 std::vector<float> avgEdensityToStoreVector;
44
45
47
52
53 double eta_extr = calorimeterCellList.
etaFF(layer);
54 ATH_MSG_DEBUG(
"extrapolated eta ["<<layer<<
"] is "<<eta_extr);
55 double phi_extr = calorimeterCellList.
phiFF(layer);
56 ATH_MSG_DEBUG(
"extrapolated phi ["<<layer<<
"] is "<<phi_extr);
57
58 if (eta_extr == -999.0){
59 continue;
60 }
61
62
63 for (unsigned int indexOfRing = 0; indexOfRing < 100; indexOfRing++){
64
66 if(beginRing == calorimeterCellList.
end())
break;
67
68 int totalCellsinRing = 0;
69 double totalEnergyPerRing = 0;
70 double energyDensityPerRing = 0;
71 double averageEnergyDensityPerRing = 0;
72
73
74 const std::vector<std::pair<const CaloCell*,int> >& tempVector = (*beginRing).second;
75
76
77 for (const auto& thisPair : tempVector){
78 const CaloDetDescrElement* DDE = (thisPair.first)->caloDDE();
80
82
83 ATH_MSG_DEBUG(
" cell eta and phi are " << (thisPair.first)->eta() <<
" and " << (thisPair.first)->phi() <<
" with index " << thisPair.second <<
" and sampling of " << sampling);
84 ATH_MSG_DEBUG(
" cell energy is " << (thisPair.first)->energy());
85
86 totalCellsinRing += 1;
87
88 totalEnergyPerRing += (thisPair.first)->
energy();
89 double totalEnergyCell = (thisPair.first)->
energy();
92
93 double cellVolume = DDE->
volume();
95
96 double energyDensityCell = totalEnergyCell/(cellVolume/1000.);
97 ATH_MSG_DEBUG(
" E density per Cell is " << energyDensityCell);
98 ATH_MSG_DEBUG(
" Initial added E density per Cell is " << energyDensityPerRing);
99 energyDensityPerRing += energyDensityCell;
100 ATH_MSG_DEBUG(
" Final added E density per Cell is " << energyDensityPerRing);
101 averageEnergyDensityPerRing = energyDensityPerRing/((totalCellsinRing)*(efRecTrack->
getTrack()->
e()/1000.));
102
103 }
104
107 ATH_MSG_DEBUG(
" Average E density per Ring is " << averageEnergyDensityPerRing);
108
109
110 if (averageEnergyDensityPerRing != 0){
111 avgEdensityToStoreVector.push_back(averageEnergyDensityPerRing);
114 layerToStoreVector.push_back(layerToStore);
115 double radiusToStore = (indexOfRing)*ringThickness;
117 radiusToStoreVector.push_back(radiusToStore);
118 }
120
121 }
122
123 }
124
125
129
130 }
131
132 }
133
134 return StatusCode::SUCCESS;
135}
CaloSampling::CaloSample CaloSample
CaloCell_ID::CaloSample getSampling() const
cell sampling
float volume() const
cell volume
static LAYER translateSampl(CaloCell_ID::CaloSample sampl)
static const int nRegions
double etaFF(eflowCaloENUM layer) const
double phiFF(eflowCaloENUM layer) const
CellIt getLowerBound(eflowCaloENUM layer, double r)
const std::vector< eflowTrackClusterLink * > & getClusterMatches() const
void setRadiusCellOrderVector(const std::vector< float > &radiusToStoreVector)
const xAOD::TrackParticle * getTrack() const
const eflowTrackCaloPoints & getTrackCaloPoints() const
void setLayerCellOrderVector(const std::vector< int > &layerToStoreVector)
void setAvgEDensityCellOrderVector(const std::vector< float > &avgEdensityToStoreVector)
static double ringThickness(const eflowCaloENUM &layer)
static void makeOrderedCellList(const eflowTrackCaloPoints &trackCalo, const std::vector< std::pair< xAOD::CaloCluster *, bool > > &clusters, eflowCellList &orderedCells)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
virtual double e() const override final
The total energy of the particle.
std::map< eflowCellPosition, std::vector< std::pair< constCaloCell *, int > > >::iterator CellIt
eflowCalo::LAYER eflowCaloENUM