205{
206
208 if (!cluster) {
209 return StatusCode::SUCCESS;
210 }
211 if (cluster->
size() == 0) {
212 return StatusCode::SUCCESS;
213 }
214
215 const float clusterEta = cluster->
eta();
216
217
220
221
222 if (etaSize == 0 && phiSize == 0) {
224 etaSize = 3;
225 phiSize = 7;
226 }
227 else {
228 etaSize = 5;
229 phiSize = 5;
230 }
231 }
232
233 unsigned int iflag =
eg.OQ();
234
235
236 const double absEnergyGeV = std::abs(cluster->
e() * (1. / Gaudi::Units::GeV));
237 maskIflagIf(
238 iflag,
241
242
243 double totE = 0;
244 double badE = 0;
245 double energyCellMax = 0;
246
247 Identifier cellCentrId;
248 bool foundCentralCell = findCentralCell(cluster, cellCentrId);
249 if (foundCentralCell) {
250
251 std::vector<IdentifierHash> neighbourList =
253
254 SG::ReadCondHandle<LArBadChannelCont> larBadChanHdl{
m_bcContKey, ctx };
256
257
260 for (; cellIter != cellIterEnd; cellIter++) {
261 const CaloCell*
cell = (*cellIter);
262 if (!cell) {
263 continue;
264 }
265
266 if (
cell->caloDDE()->is_tile()) {
267 continue;
268 }
269
271
273 const bool isHighQ =
qual >= 4000;
275
276 const bool isMissing = ((
cell->provenance() & 0x0A00) == 0x0A00);
277 const bool isMasked = ((
cell->provenance() & 0x0A00) == 0x0800);
278 const bool isPresampler = (
layer == CaloSampling::PreSamplerB ||
279 layer == CaloSampling::PreSamplerE);
280 const bool isL1 =
281 (
layer == CaloSampling::EMB1 ||
layer == CaloSampling::EME1);
282 const bool isL2 =
283 (
layer == CaloSampling::EMB2 ||
layer == CaloSampling::EME2);
284 const bool isL3 =
285 (
layer == CaloSampling::EMB3 ||
layer == CaloSampling::EME3);
286
287
288 if ((
cell->provenance() & 0x2000) && !(
cell->provenance() & 0x0800)) {
290 if (
cell->e() > energyCellMax) {
291 energyCellMax =
cell->e();
292 }
295 }
296 }
298
299 bool isStripCoreCell = false;
300 if ((layer == CaloSampling::EMB1 || layer == CaloSampling::EME1) &&
301 std::abs(
eta - clusterEta) < 0.025 / 2.) {
302 isStripCoreCell = true;
303 }
304
305
306 if (layer >= CaloSampling::HEC0 && layer <= CaloSampling::HEC3 &&
309 }
310
311
313 const bool isAffected =
318
319 const bool isSporadicNoise =
321
322 if (isACoreCell) {
323 coreCellHelper(isMissing, isMasked, isSporadicNoise, isAffected,
324 isHighQ, iflag);
325 }
326 else {
327 if (isMissing) {
328 missingHelper(isPresampler, isL1, isStripCoreCell, isL2, isL3, iflag);
329 }
330 if (isMasked) {
331 maskedHelper(isPresampler, isL1, isStripCoreCell, isL2, isL3, iflag);
332 }
333 if (isAffected) {
334 affectedHelper(isPresampler, isL1, isL2, isL3, iflag);
335 }
336
339 }
340 }
341
342
343 double egammaLArQCleaning = 0;
344 if (totE != 0) {
345 egammaLArQCleaning = badE / totE;
346 }
347 maskIflagIf(
348 iflag,
351
352
353 double ratioCell = 0;
354 if (totE != 0) {
355 ratioCell = energyCellMax / totE;
356 }
357 maskIflagIf(
358 iflag,
361 }
362
363
364 float deta = 0;
365 float dphi = 0;
366
367
368 SG::ReadCondHandle<CaloAffectedRegionInfoVec> affHdl{
m_affKey, ctx };
370 if (!affCont) {
371 ATH_MSG_WARNING(
"Do not have affected regions info, is this expected ?");
372 }
373
374
375 deta = 0.5 * 0.025 * etaSize;
376 dphi = 0.5 * 0.025 * phiSize;
377
378 bool isNonNominalHVPS = chainIsAffected(
380 cluster,
381 affCont,
382 deta,
383 dphi,
384 1,
385 CaloSampling::PreSamplerE,
386 CaloSampling::PreSamplerB);
388 bool isDeadHVPS = chainIsAffected(
390 cluster,
391 affCont,
392 deta,
393 dphi,
394 2,
395 CaloSampling::PreSamplerE,
396 CaloSampling::PreSamplerB);
398
399
400 deta = 0.5 * 0.025 * 3.;
401 dphi = 0.5 * 0.025 * 3.;
402 bool isDeadHVS2Core = chainIsAffected(
404 cluster,
405 affCont,
406 deta,
407 dphi,
408 2,
409 CaloSampling::EMB2,
410 CaloSampling::EME2);
412
413
414 deta = 0.5 * 0.025 * etaSize;
415 dphi = 0.5 * 0.025 * phiSize;
416
417 bool isNonNominalHVS1S2S3 = chainIsAffected(
419 cluster,
420 affCont,
421 deta,
422 dphi,
423 1,
424 CaloSampling::EMB1,
425 CaloSampling::EMB2,
426 CaloSampling::EMB3,
427 CaloSampling::EME1,
428 CaloSampling::EME2,
429 CaloSampling::EME3);
431
432 bool isDeadHVS1S2S3Edge = chainIsAffected(
434 cluster,
435 affCont,
436 deta,
437 dphi,
438 2,
439 CaloSampling::EMB1,
440 CaloSampling::EMB2,
441 CaloSampling::EMB3,
442 CaloSampling::EME1,
443 CaloSampling::EME2,
444 CaloSampling::EME3);
446
449 return StatusCode::SUCCESS;
450}
Scalar eta() const
pseudorapidity method
#define ATH_MSG_WARNING(x)
std::vector< CaloAffectedRegionInfo > CaloAffectedRegionInfoVec
LArBadXCont< LArBadChannel > LArBadChannelCont
bool shortProblem() const
bool unstableNoiseMG() const
bool unstableNoiseHG() const
bool peculiarCalibrationLine() const
bool unstableNoiseLG() const
bool sporadicBurstNoise() const
LArBC_t offlineStatus(const Identifier id) const
Query the status of a particular channel by offline ID This is the main client access method.
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
Handle to bad-channel CDO.
Gaudi::Property< double > m_QCellCut
Gaudi::Property< double > m_LArQCut
Gaudi::Property< double > m_TCutVsE
Gaudi::Property< double > m_TCut
ToolHandle< ICaloAffectedTool > m_affectedTool
Gaudi::Property< double > m_QCellSporCut
Gaudi::Property< double > m_QCellHECCut
Gaudi::Property< double > m_RcellCut
SG::ReadCondHandleKey< CaloAffectedRegionInfoVec > m_affKey
flt_t time() const
Access cluster time.
virtual double eta() const
The pseudorapidity ( ) of the particle.
size_t size() const
size method (forwarded from CaloClusterCellLink obj)
unsigned int getClusterEtaSize() const
Get eta size from cluster size.
virtual double e() const
The total energy of the particle.
CaloClusterCellLink::const_iterator const_cell_iterator
Iterator of the underlying CaloClusterCellLink (explicitly const version)
const_cell_iterator cell_end() const
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
unsigned int getClusterPhiSize() const
Get phi size from cluster size.
bool isBarrel(const xAOD::Egamma *eg)
return true if the cluster is in the barrel
@ HECHighQ
High quality factor cell in the HEC.
@ HighRcell
High R_cell ----> Energy of the most energetic cell / total energy of the cluster.
@ NonNominalHVS1S2S3
Non Nominal High Voltage in the EM strips, middle and back.
@ DeadHVPS
Dead High Voltage in the EM Presampler.
@ DeadHVS1S2S3Edge
Dead High Voltage in the EM strips, middle and back affecting the edge of the cluster.
@ SporadicNoiseLowQEdge
Sporadic noisy cell in the edge of the cluster.
@ OutTime
Out of time cell.
@ HighQEdge
High quality factor cell in the edge of the cluster.
@ NonNominalHVPS
Non Nominal High Voltage in the EM Presampler.
@ LArQCleaning
Cleaning based on LArQ factor--> sum[ E(Q>4000)/E].
@ DeadHVS1S2S3Core
Dead High Voltage in the EM strips, middle and back affecting the core of the cluster.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.