ATLAS Offline Software
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 
7 NAME: egammaCheckEnergyDepositTool
8 PACKAGE: offline/Reconstruction/egamma/egammaTools
9 
10 AUTHORS: F. Derue
11 CREATED: July 3, 2009
12 
13 PURPOSE: 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 
18 UPDATED :
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) :
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 }
egammaCheckEnergyDepositTool::initialize
virtual StatusCode initialize() override final
initialize method
Definition: egammaCheckEnergyDepositTool.cxx:36
egammaCheckEnergyDepositTool::egammaCheckEnergyDepositTool
egammaCheckEnergyDepositTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition: egammaCheckEnergyDepositTool.cxx:27
egammaCheckEnergyDepositTool::m_thrF1max
Gaudi::Property< double > m_thrF1max
Threshold on maximum fraction of energy reconstructed in 1st sampling.
Definition: egammaCheckEnergyDepositTool.h:50
egammaEnergyPositionAllSamples::e1
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
egammaCheckEnergyDepositTool::m_thrE2min
Gaudi::Property< double > m_thrE2min
Threshold on minimum energy reconstructed in 2nd sampling.
Definition: egammaCheckEnergyDepositTool.h:42
egammaCheckEnergyDepositTool::m_thrF2max
Gaudi::Property< double > m_thrF2max
Threshold on maximum fraction of energy reconstructed in 2nd sampling.
Definition: egammaCheckEnergyDepositTool.h:54
egammaCheckEnergyDepositTool::m_thrF0max
Gaudi::Property< double > m_thrF0max
Threshold on maximum fraction of energy reconstructed in presampler.
Definition: egammaCheckEnergyDepositTool.h:46
read_hist_ntuple.f2
f2
Definition: read_hist_ntuple.py:20
xAOD::EgammaParameters::f3
@ f3
fraction of energy reconstructed in 3rd sampling
Definition: EgammaEnums.h:54
Egamma.h
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
CaloCluster.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
egammaCheckEnergyDepositTool::finalize
virtual StatusCode finalize() override final
finalize method
Definition: egammaCheckEnergyDepositTool.cxx:44
egammaCheckEnergyDepositTool.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
egammaCheckEnergyDepositTool::checkFractioninSamplingCluster
virtual bool checkFractioninSamplingCluster(const xAOD::CaloCluster *cluster) const override final
execute method
Definition: egammaCheckEnergyDepositTool.cxx:49
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::CaloCluster_v1::energyBE
float energyBE(const unsigned layer) const
Get the energy in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:630
egammaEnergyPositionAllSamples::e0
double e0(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in pre-sampler
AthAlgTool
Definition: AthAlgTool.h:26
egammaCheckEnergyDepositTool::m_thrF3max
Gaudi::Property< double > m_thrF3max
Threshold on maximum fraction of energy reconstructed in 3rd sampling.
Definition: egammaCheckEnergyDepositTool.h:58
read_hist_ntuple.f1
f1
Definition: read_hist_ntuple.py:4