95 std::vector<std::vector<FlowElementLink_t>> electronNeutralFEVec(electronReadHandle->size());
96 std::vector<std::vector<FlowElementLink_t>> electronChargedFEVec(electronReadHandle->size());
98 std::vector<std::vector<FlowElementLink_t>> photonNeutralFEVec(photonReadHandle->size());
99 std::vector<std::vector<FlowElementLink_t>> photonChargedFEVec(photonReadHandle->size());
111 std::vector<ElectronLink_t> FEElectronLinks;
112 std::vector<PhotonLink_t> FEPhotonLinks;
115 if(FE->otherObjects().empty() || FE->otherObjects().at(0)==
nullptr){
116 neutralFEElectronWriteDecorHandle(*FE)=FEElectronLinks;
117 neutralFEPhotonWriteDecorHandle(*FE)=FEPhotonLinks;
122 size_t FEClusterIndex=FE->otherObjects().at(0)->index();
123 double FE_cluster_E=FE->otherObjects().at(0)->p4().E();
124 bool neg_E_cluster=(FE_cluster_E<0);
128 for (
const xAOD::Electron* electron: *electronNeutralFEWriteDecorHandle){
136 size_t electronClusterIndex=cluster->index();
138 if(electronClusterIndex==FEClusterIndex){
139 FEElectronLinks.emplace_back(*electronReadHandle,electron->index() );
142 electronNeutralFEVec.at(electron->index()).emplace_back(*neutralFEReadHandle, FE->index() );
144 ATH_MSG_ERROR(
"Negative energy cluster found and matched to electron");
154 for (
const xAOD::Photon* photon: *photonNeutralFEWriteDecorHandle){
160 size_t photonClusterIndex=cluster->index();
162 if(photonClusterIndex==FEClusterIndex){
164 FEPhotonLinks.emplace_back(*photonReadHandle,photon->index() );
167 photonNeutralFEVec.at(photon->index()).emplace_back(*neutralFEReadHandle, FE->index() );
170 ATH_MSG_ERROR(
"Negative energy cluster found and matched to photon");
180 neutralFEElectronWriteDecorHandle(*FE)=FEElectronLinks;
181 neutralFEPhotonWriteDecorHandle(*FE)=FEPhotonLinks;
190 std::vector<ElectronLink_t> FEElectronLinks;
191 std::vector<PhotonLink_t> FEPhotonLinks;
194 if(FE->chargedObjects().empty() || FE->chargedObjects().at(0)==
nullptr){
195 chargedFEElectronWriteDecorHandle (*FE) = FEElectronLinks;
196 chargedFEPhotonWriteDecorHandle (*FE) = FEPhotonLinks;
200 size_t FETrackIndex=FE->chargedObjects().at(0)->index();
203 for (
const xAOD::Electron* electron: *electronChargedFEWriteDecorHandle){
208 size_t electronTrackIndex = electronTrack->index();
211 if(electronTrackIndex==FETrackIndex){
214 FEElectronLinks.emplace_back(*electronReadHandle, electron->index() );
217 electronChargedFEVec.at(electron->index()).emplace_back(*chargedFEReadHandle, FE->index() );
223 for(
const xAOD::Photon* photon: *photonChargedFEWriteDecorHandle){
228 size_t photonTrackIndex=photonTrack->index();
231 if (photonTrackIndex==FETrackIndex){
234 FEPhotonLinks.emplace_back(*photonReadHandle, photon->index() );
237 photonChargedFEVec.at(photon->index()).emplace_back(*chargedFEReadHandle, FE->index() );
246 chargedFEElectronWriteDecorHandle (*FE) = FEElectronLinks;
248 chargedFEPhotonWriteDecorHandle (*FE) = FEPhotonLinks;
258 for (
const xAOD::Electron* electron : *electronNeutralFEWriteDecorHandle){
259 electronNeutralFEWriteDecorHandle (*electron) = electronNeutralFEVec.at(electron->index());
260 electronChargedFEWriteDecorHandle (*electron) = electronChargedFEVec.at(electron->index());
263 for (
const xAOD::Photon* photon: *photonNeutralFEWriteDecorHandle){
264 photonNeutralFEWriteDecorHandle (*photon) = photonNeutralFEVec.at(photon->index());
265 photonChargedFEWriteDecorHandle (*photon) = photonChargedFEVec.at(photon->index());
270 return StatusCode::SUCCESS;