ATLAS Offline Software
Loading...
Searching...
No Matches
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
12namespace{
13 const double size = 0.12;
14 const std::vector<CaloCell_ID::SUBCALO> theVecCalo = {
16}
17
18egammaIso::egammaIso(const std::string& type,
19 const std::string& name,
20 const IInterface* parent)
21 : AthAlgTool(type, name, 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
34StatusCode egammaIso::execute(const xAOD::CaloCluster& cluster,
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
54 HADCellList.select(eta,phi,size,size,CaloSampling::TileGap3);
55 egap +=HADCellList.energy();
56
57 HADCellList.select(eta,phi,size,size,CaloSampling::HEC0);
58 info.ehad1 +=HADCellList.energy();
59
60 HADCellList.select(eta,phi,size,size,CaloSampling::TileBar0);
61 info.ehad1 +=HADCellList.energy();
62
63 // Fix had leakage in crack (TileGap1 and TileGap2 missing before 14.2)
64 HADCellList.select(eta,phi,size,size,CaloSampling::TileGap1);
65 info.ehad1 +=HADCellList.energy();
66 HADCellList.select(eta,phi,size,size,CaloSampling::TileGap2);
67 info.ehad1 +=HADCellList.energy();
68
69 HADCellList.select(eta,phi,size,size,CaloSampling::TileExt0);
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
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_DEBUG(x)
Definition of CaloDetDescrManager.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Container class for CaloCell.
unsigned short nBadT(int i) const
double energy() const
void select(double eta, double phi, double deta, double dphi)
This class provides the client interface for accessing the detector description information common to...
StatusCode initialize() override
initialize method
Definition egammaIso.cxx:26
StatusCode finalize() override
finalize method
Definition egammaIso.cxx:30
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
egammaIso(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
Definition egammaIso.cxx:18
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.