ATLAS Offline Software
egammaIso.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 #include "egammaIso.h"
8 #include "CaloGeoHelpers/CaloSampling.h"
10 #include <cmath>
11 
12 namespace{
13  const double size = 0.12;
14  const std::vector<CaloCell_ID::SUBCALO> theVecCalo = {
16 }
17 
18 egammaIso::egammaIso(const std::string& type,
19  const std::string& name,
20  const IInterface* parent)
22  // declare Interface
23  declareInterface<IegammaIso>(this);
24  }
25 
27  ATH_MSG_DEBUG(" Initializing egammaIso");
28  return StatusCode::SUCCESS;
29 }
31  return StatusCode::SUCCESS;
32 }
33 
35  const CaloDetDescrManager& cmgr,
36  const CaloCellContainer& cellcoll,
37  Info& info) const {
38  const double eta = cluster.eta();
39  const double phi = cluster.phi();
40  double egap=0.;
41  double ehad=0.;
42  // define a new Calo Cell list corresponding to HAD Calo
43  // retrieve the corresponding CaloCell_ID for LarHec and TILE
44  // define a new Calo Cell list
45  CaloCellList HADCellList(&cmgr,&cellcoll, theVecCalo);
46  // increase window size a bit to avoid problems due to 4cm shift.
47  // considering that in the tile the granularity is 0.1, the value
48  // choosen below is safe. All hadrons in 0.2X0.2
49  HADCellList.select(eta,phi,size,size);
50  ehad +=HADCellList.energy();
51  info.nBadT0 += HADCellList.nBadT(0);
52  info.nBadT12 += HADCellList.nBadT(1);
53 
55  egap +=HADCellList.energy();
56 
57  HADCellList.select(eta,phi,size,size,CaloSampling::HEC0);
58  info.ehad1 +=HADCellList.energy();
59 
61  info.ehad1 +=HADCellList.energy();
62 
63  // Fix had leakage in crack (TileGap1 and TileGap2 missing before 14.2)
65  info.ehad1 +=HADCellList.energy();
67  info.ehad1 +=HADCellList.energy();
68 
70  info.ehad1 +=HADCellList.energy();
71 
72  const double eta2 = cluster.etaBE(2);
73  if (eta2==-999.) {
74  info.ethad1 = -999;
75  info.ethad = -999;
76  } else {
77  const double cheta2 = cosh(eta2);
78  info.ethad1 = cheta2!=0. ? info.ehad1/cheta2 : 0.;
79  // substract scintillator energy from ehad!
80  info.ethad = cheta2!=0. ? (ehad-egap)/cheta2 : 0.;
81  }
82  return StatusCode::SUCCESS;
83 }
84 
85 
grepfile.info
info
Definition: grepfile.py:38
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: CaloCluster_v1.cxx:256
CaloCellList
Definition: CaloCellList.h:40
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
CaloCellList::select
void select(double eta, double phi, double deta, double dphi)
Definition: CaloCellList.cxx:67
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
egammaIso::finalize
StatusCode finalize() override
finalize method
Definition: egammaIso.cxx:30
CaloCellList.h
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
CaloCell_Base_ID::LARHEC
@ LARHEC
Definition: CaloCell_Base_ID.h:46
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition: FastCaloSim_CaloCell_ID.h:36
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
xAOD::CaloCluster_v1::etaBE
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:644
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
CaloCellList::nBadT
unsigned short nBadT(int i) const
Definition: CaloCellList.h:117
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
CaloCluster.h
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
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
CaloCell_ID_FCS::TileGap2
@ TileGap2
Definition: FastCaloSim_CaloCell_ID.h:35
CaloCellList::energy
double energy() const
Definition: CaloCellList.h:99
egammaIso::execute
virtual StatusCode execute(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &cmgr, const CaloCellContainer &cellcoll, Info &info) const override final
Method to just calculate hadronic leakage.
Definition: egammaIso.cxx:34
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCell_Base_ID::TILE
@ TILE
Definition: CaloCell_Base_ID.h:46
CaloCell_ID_FCS::TileGap1
@ TileGap1
Definition: FastCaloSim_CaloCell_ID.h:34
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
egammaIso::egammaIso
egammaIso(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
Definition: egammaIso.cxx:18
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
egammaIso.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
egammaIso::initialize
StatusCode initialize() override
initialize method
Definition: egammaIso.cxx:26
IegammaIso::Info
Definition: IegammaIso.h:39
AthAlgTool
Definition: AthAlgTool.h:26