6 #include "GaudiKernel/Bootstrap.h"
18 const std::vector<std::pair<xAOD::CaloCluster*, bool>>& clusterList,
19 std::vector<std::pair<float, float>>& clusterSubtractedEnergyRatios,
21 unsigned int trackIndex)
const
27 ATH_MSG_DEBUG(
"Executing markSubtractionStatus and have clusterList of size " << clusterList.size() <<
", clusterSubtractedEnergyRatios of size " << clusterSubtractedEnergyRatios.size() <<
" and trackIndex of " << trackIndex);
29 const std::vector<std::pair<eflowTrackClusterLink*, std::pair<float,float> > >& matchedTrackList = thisEflowCaloObject.
efRecLink();
31 unsigned int clusCounter = 0;
32 for (
auto thisClusterPair : clusterList){
34 ATH_MSG_DEBUG(
"Cluster with e and eta " << thisCluster->
e() <<
" and " << thisCluster->
eta());
36 for (
const auto & thisTrackClusterLinkPair : matchedTrackList){
38 if (trackIndex != thisTrackClusterLinkPair.first->getTrack()->getTrack()->index()){
43 ATH_MSG_DEBUG(
"Track with e and eta " << thisTrackClusterLinkPair.first->getTrack()->getTrack()->e() <<
" and " << thisTrackClusterLinkPair.first->getTrack()->getTrack()->eta());
46 if (!std::isnan(thisTrackClusterLinkPair.second.first)) {
56 ATH_MSG_DEBUG(
"Comparing clusters with energies " << thisCluster->
e() <<
" and " << thisMatchedTrackCluster->
e());
57 if (thisCluster == thisMatchedTrackCluster){
59 if (thisClusterPair.second && !std::isnan(clusterSubtractedEnergyRatios[clusCounter].first)) {
60 ATH_MSG_DEBUG(
"Will set ratio to be " << clusterSubtractedEnergyRatios[clusCounter].
first);
77 const std::vector<std::pair<eflowTrackClusterLink*, std::pair<float,float> > >& matchedTrackList = thisEflowCaloObject.
efRecLink();
79 auto accumulateTrackEnergy = [](
float sum, std::pair<eflowTrackClusterLink*, std::pair<float,float> > thisPair){
return sum + thisPair.first->getTrack()->getTrack()->e();};
80 float totalTrackE =
std::accumulate(matchedTrackList.begin(),matchedTrackList.end(),0.0,accumulateTrackEnergy);
83 for (
const auto & thisTrackClusterLinkPair : matchedTrackList){
84 ATH_MSG_DEBUG(
"Track with e and eta " << thisTrackClusterLinkPair.first->getTrack()->getTrack()->e() <<
" and " << thisTrackClusterLinkPair.first->getTrack()->getTrack()->eta());
85 ATH_MSG_DEBUG(
"will annihilate cluster with e and eta " << thisTrackClusterLinkPair.first->getCluster()->getCluster()->e() <<
" and " << thisTrackClusterLinkPair.first->getCluster()->getCluster()->eta());
86 float trackEFraction = thisTrackClusterLinkPair.first->getTrack()->getTrack()->e()/totalTrackE;