175 {
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200 double totalEnergy = 0.;
201 double leadingEnergy = 0.;
202 std::unique_ptr<CaloCellList> myList = nullptr;
203
206 myList = std::make_unique<CaloCellList>(detMgr,cellContainer, iCalo);
210 myList = std::make_unique<CaloCellList>(detMgr,cellContainer, iCalo);
214 myList = std::make_unique<CaloCellList>(detMgr,cellContainer, iCalo);
216 }
217
218 int countCoreCells = 0;
219 int countSelected = 0;
220 bool compartment[4] = {false, false, false, false};
221 double measuredSamplings = 0.;
222
223 if (myList && myList->ncells()) {
224
225 const CaloCell* lastCell = *(myList->end() - 1);
226
227
228 for (int coreSampling = 0; coreSampling != 4; ++coreSampling) {
229 const CaloCell* coreCell = nullptr;
230 double coreRadius = 0.;
231 for (const CaloCell* cell : *myList) {
233
234 if (cell != lastCell && sampling != coreSampling) continue;
235
239
240 if (sampling == coreSampling) {
241 if (!coreCell || radius < coreRadius) {
244 }
245 }
246
247 if (cell != lastCell || !coreCell) continue;
248
249 for (const CaloCell* cell2 : *myList) {
251 if (sampling != coreSampling) continue;
252
253 double cellEnergy = cell2->energy();
254 double noiseRms = noiseCDO->
getNoise(cell2->ID(), cell2->gain());
255
256
259
260 if (cellSelected) {
261 ++countSelected;
262 totalEnergy += cellEnergy;
263 compartment[coreSampling] = true;
264 if (coreSampling < 2) leadingEnergy += cellEnergy;
265 }
266 if (cell2 == coreCell) {
267 ++countCoreCells;
277 }
278 }
280 std::string
info =
"";
281 std::string
type =
" Tile ";
286 }
287 if (cellSelected && cell2 == coreCell) {
288 info =
" selected core cell# ";
289 } else if (cellSelected) {
290 info =
" selected cell# ";
291 } else if (cell2 == coreCell) {
292 info =
" cell in core NOT selected";
293 }
294
297 << type << " Sampling: " << std::setw(1) << coreSampling << " Radius :" << std::setw(6)
298 << std::setprecision(0) << cell2->caloDDE()->r() << " Eta : " << std::setw(6)
299 << std::setprecision(2) << cell2->eta() << " Phi : " << std::setw(6) << std::setprecision(2)
300 << cell2->phi() << " Noise level : " << std::setw(6) << std::setprecision(0) << noiseRms
301 << " Energy : " << std::setw(7) << std::setprecision(0) << cell2->energy() << info);
302 } else if (cellSelected) {
304 << type << " Sampling: " << std::setw(1) << coreSampling << " Radius :" << std::setw(6)
305 << std::setprecision(0) << cell2->caloDDE()->r() << " Eta : " << std::setw(6)
306 << std::setprecision(2) << cell2->eta() << " Phi : " << std::setw(6) << std::setprecision(2)
307 << cell2->phi() << " Noise level : " << std::setw(6) << std::setprecision(0) << noiseRms
308 << " Energy : " << std::setw(7) << std::setprecision(0) << cell2->energy() << info
309 << countSelected);
310 } else {
312 << type << " Sampling: " << std::setw(1) << coreSampling << " Radius :" << std::setw(6)
313 << std::setprecision(0) << cell2->caloDDE()->r() << " Eta : " << std::setw(6)
314 << std::setprecision(2) << cell2->eta() << " Phi : " << std::setw(6) << std::setprecision(2)
315 << cell2->phi() << " Noise level : " << std::setw(6) << std::setprecision(0) << noiseRms
316 << " Energy : " << std::setw(7) << std::setprecision(0) << cell2->energy() << info);
317 }
318 }
319 }
320 }
321 }
322
324 std::string
info =
"";
325 std::string
type =
" Tile ";
330 }
331
332 ATH_MSG_DEBUG(type <<
" at eta = " << muEta <<
" : selected " << countSelected <<
" from measured cone with "
333 << countCoreCells << " cells forming core");
334 }
335
336 for (
int i = 0;
i < 4; ++
i)
337 if (compartment[i]) measuredSamplings +=
m_caloParamTool->caloCompartmentDepth(isubcalo, i);
338
339
341 caloMeas.Tile_EnergyMeasured(totalEnergy);
342 caloMeas.Tile_SamplingFraction(measuredSamplings);
344 caloMeas.LArHEC_EnergyMeasured(totalEnergy);
345 caloMeas.LArHEC_SamplingFraction(measuredSamplings);
347 caloMeas.LArEM_EnergyMeasured(totalEnergy);
348 caloMeas.LArEM_FirstCompartmentEnergy(leadingEnergy);
349 caloMeas.LArEM_SamplingFraction(measuredSamplings);
350 }
351 }
352 }
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
#define ATH_MSG_VERBOSE(x)
bool msgLvl(const MSG::Level lvl) const
std::atomic_int m_totalCoreCellsEM
std::atomic_int m_totalSelectedTile
std::atomic_int m_totalCoreCellsHEC
std::atomic_int m_totalCoreCellsTile
std::atomic_int m_totalSelectedEM
std::atomic_int m_totalSelectedHEC
ToolHandle< IMuidCaloEnergyParam > m_caloParamTool
int samplingID(const CaloCell *cell, int iSubCalo) const
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[