ATLAS Offline Software
Loading...
Searching...
No Matches
egammaCheckEnergyDepositTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5/********************************************************************
6
7NAME: egammaCheckEnergyDepositTool
8PACKAGE: offline/Reconstruction/egamma/egammaTools
9
10AUTHORS: F. Derue
11CREATED: July 3, 2009
12
13PURPOSE: Check in each sampling that the fraction of energy
14 reconstructed is not greater than a certain threshold.
15 Also make sure there is some minimal energy in the 2nd
16 sampling.
17
18UPDATED :
19 Dec. 29, 2009 (FD) protection against bad pointers
20********************************************************************/
21
23#include "xAODEgamma/Egamma.h"
25
26
28 const std::string& name,
29 const IInterface* parent) :
30 AthAlgTool(type, name, parent)
31{
32 declareInterface<IegammaCheckEnergyDepositTool>(this);
33
34}
35
37{
38
39 ATH_MSG_DEBUG("Initializing " << name() << "...");
40
41 return StatusCode::SUCCESS;
42}
43
45{
46 return StatusCode::SUCCESS;
47}
48
50{
51
52 // retrieve associated cluster
53 if (cluster==nullptr) return false;
54
55 // Retrieve energy in all samplings
56 double e0 = cluster->energyBE(0);
57 double e1 = cluster->energyBE(1);
58 double e2 = cluster->energyBE(2);
59 double e3 = cluster->energyBE(3);
60
61 if (e2<m_thrE2min){
62 return false;
63 }
64 // sum of energy in all samplings
65 const double eallsamples = e0+e1+e2+e3;
66
67 if (eallsamples!=0.) {
68 const double inv_eallsamples = 1. / eallsamples;
69
70 // check fraction of energy reconstructed in presampler
71 double f0 = e0 * inv_eallsamples;
72 if (f0 > m_thrF0max) return false;
73
74 // check fraction of energy reconstructed in first sampling
75 double f1 = e1 * inv_eallsamples;
76 if (f1 > m_thrF1max) return false;
77
78 // check fraction of energy reconstructed in second sampling
79 double f2 = e2 * inv_eallsamples;
80 if (f2 > m_thrF2max) return false;
81
82 // check fraction of energy reconstructed in third sampling
83 double f3 = e3 * inv_eallsamples;
84 if (f3 > m_thrF3max) return false;
85 }
86
87 return true;
88}
#define ATH_MSG_DEBUG(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Gaudi::Property< double > m_thrF2max
Threshold on maximum fraction of energy reconstructed in 2nd sampling.
virtual bool checkFractioninSamplingCluster(const xAOD::CaloCluster *cluster) const override final
execute method
Gaudi::Property< double > m_thrF1max
Threshold on maximum fraction of energy reconstructed in 1st sampling.
Gaudi::Property< double > m_thrE2min
Threshold on minimum energy reconstructed in 2nd sampling.
egammaCheckEnergyDepositTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Gaudi::Property< double > m_thrF3max
Threshold on maximum fraction of energy reconstructed in 3rd sampling.
virtual StatusCode finalize() override final
finalize method
Gaudi::Property< double > m_thrF0max
Threshold on maximum fraction of energy reconstructed in presampler.
virtual StatusCode initialize() override final
initialize method
float energyBE(const unsigned layer) const
Get the energy in one layer of the EM Calo.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.