80 if (!scellsHandle.isValid())
83 return StatusCode::FAILURE;
88 for (
const CaloCell *scell : *scellsHandle)
93 scells.
assign(scellsHandle->begin(), scellsHandle->end());
95 auto clusters = std::make_unique<xAOD::TrigEMClusterContainer>();
96 auto auxClusters = std::make_unique<xAOD::TrigEMClusterAuxContainer>();
97 clusters->setStore(auxClusters.get());
105 const TileID *tileIDHelper{
nullptr};
110 if (!tileCellHandle.isValid())
113 return StatusCode::FAILURE;
115 tileCellCont.
assign(tileCellHandle->begin(), tileCellHandle->end());
121 if (!triggerTowerHandle.isValid())
124 return StatusCode::FAILURE;
126 TTs = triggerTowerHandle.cptr();
130 for (
const auto &algCl : algResults)
133 clusters->push_back(cl);
134 cl->setEta(algCl.eta);
135 cl->setPhi(algCl.phi);
136 cl->setEt(algCl.clusterET);
137 cl->setWstot(algCl.l1Width);
138 if (algCl.hadET > -999)
140 cl->setEhad1(algCl.hadET);
142 cl->setE233(algCl.l2ClusterET33);
143 cl->setE237(algCl.l2ClusterET37);
144 decRun3REta(*cl) = algCl.rEta;
145 decRun3RHad(*cl) = algCl.rHad;
146 decRun3REtaL12(*cl) = algCl.rEtaL12;
147 decPassRun3ClusterEnergy(*cl) = algCl.passClusterEnergy;
148 decPassRun3REta(*cl) = algCl.passREta;
149 decPassRun3RHad(*cl) = algCl.passRHad;
150 decPassRun3wstot(*cl) = algCl.passWstot;
172 if (!ttHandle.isValid())
175 return StatusCode::FAILURE;
177 TTs = ttHandle.cptr();
180 std::vector<const CaloCell *> cellsAround;
181 std::vector<const CaloCell *> cellsAboveThr;
182 cellsAround.reserve(200);
183 cellsAboveThr.reserve(200);
188 for (
auto cellAbove : cellsAboveThr)
194 float etaCluster{0}, phiCluster{0};
196 if (std::abs(etaCluster) > 998.0)
211 float clusterTime = 0;
212 float clusterTimeWeight = 0;
213 for (
auto cellAround : cellsAround)
217 clusterTime += cellAround->time() * cellAround->et();
218 clusterTimeWeight += cellAround->et();
220 if (std::abs(clusterTimeWeight) > 0.1)
222 clusterTime /= clusterTimeWeight;
226 clusterTime = -999.99;
228 ATH_MSG_DEBUG(
"CELL versus CLUSTER : " << cellAbove->eta() <<
" " << cellAbove->phi() <<
" " << etaCluster <<
" " << phiCluster <<
" " << cellAbove->eta() - etaCluster <<
" " << cellAbove->phi() - phiCluster);
231 std::vector<const CaloCell *> cellsAround2;
235 std::vector<const xAOD::TriggerTower *> TTsAround;
250 clusters->push_back(cl);
251 for (
unsigned int i = 0; i < (
unsigned int)CaloSampling::CaloSample::Unknown; i++)
255 cl->setEnergy(
et * TMath::CosH(cellAbove->eta()));
257 cl->setEta(cellAbove->eta());
258 cl->setPhi(cellAbove->phi());
259 cl->setE237(clusterEmEnergy32);
260 cl->setE277(clusterEmEnergy72);
261 cl->setEhad1(clusterHadEnergy);
262 cl->setE233(clusterTime);
264 float wstot_nor = 0.;
265 for (
auto cellAround : cellsAround)
267 unsigned int layer = cellAround->caloDDE()->getSampling();
269 if ((layer == 1) || (layer == 5))
271 if (cellAround->et() < 10)
273 wstot += (cellAround->et() *
pow(cellAround->eta() - etaCluster, 2));
274 wstot_nor += (cellAround->et());
277 if (std::abs(wstot_nor) > 0.01)
278 wstot = std::sqrt(wstot / wstot_nor);
284 ATH_CHECK(writeHandle.
record(std::move(clusters), std::move(auxClusters)));
286 return StatusCode::SUCCESS;