ATLAS Offline Software
Loading...
Searching...
No Matches
egammaCaloClusterSelector Class Reference

A tool which specifies whether a cluster passes a selection. More...

#include <egammaCaloClusterSelector.h>

Inheritance diagram for egammaCaloClusterSelector:
Collaboration diagram for egammaCaloClusterSelector:

Public Member Functions

 egammaCaloClusterSelector (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override final
virtual StatusCode finalize () override final
bool passSelection (const xAOD::CaloCluster *cluster, const CaloDetDescrManager &cmgr) const override final
 pass the selection described in the class egammaCaloClusterSelector

Private Attributes

SG::ReadHandleKey< CaloCellContainerm_cellsKey
 Name of the cluster intput collection.
ToolHandle< IegammaCheckEnergyDepositToolm_egammaCheckEnergyDepositTool
 Pointer to the egammaCheckEnergyDepositTool.
ToolHandle< IegammaIsom_HadronicLeakageTool
 Tool for hadronic leakage calculation; onlud used if cuts needing are defined.
Gaudi::Property< double > m_ClusterEtCut
Gaudi::Property< double > m_EMEtCut
Gaudi::Property< double > m_EMEtSplittingFraction
Gaudi::Property< double > m_EMFCut
Gaudi::Property< double > m_RetaCut
Gaudi::Property< double > m_HadLeakCut
bool m_doReta {false}
bool m_doHadLeak {false}

Static Private Attributes

static constexpr double RETA_DEFAULT_NO_CUT = 0.0
static constexpr double HAD_LEAK_DEFAULT_NO_CUT = 999.

Detailed Description

A tool which specifies whether a cluster passes a selection.

The tool implements the IegammaCaloClusterSelector interface which provides the passSelection method. It selects xAOD::CaloCluster based on their properties in this order:

  • minimum et
  • cut on the fraction of the energy in the layers, by default using egammaCheckEnergyDepositTool (e.g. minimum energy fraction in 2nd layer, maximum fraction in PS, ...)
  • having a second sampling (CaloSampling::EMB2 or CaloSampling::EME2)
  • |eta| in the second layer not above 10
  • energy in the second layer not below 50 MeV
  • minimum transverse EM energy (considering rescaling, EM energy -> EM energy / EMEtSplittingFraction, for cluster in the crack; usually the rescaling increase the EM energy so loosing the cut, see ATLASRECTS-4772)
  • minimum EM fraction
  • maximum Reta
  • maximum hadronic fraction: ethad / EMEt (ethad1 is used outside 0.8-1.37 eta2)

Several selection can be disabled. The cut on Reta and hadronic fraction are done if cut values are specified. The cut on the fraction of the energy is done only if egammaCheckEnergyDepositTool is spefified. See ATLASRECTS-5765.

The tool is generic, but it is used in egamma reconstruction by CaloClusterROI_Selector and egammaSelectedTrackCopy

Definition at line 47 of file egammaCaloClusterSelector.h.

Constructor & Destructor Documentation

◆ egammaCaloClusterSelector()

egammaCaloClusterSelector::egammaCaloClusterSelector ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 15 of file egammaCaloClusterSelector.cxx.

17 :
18 base_class(type, name, parent)
19{
20}

Member Function Documentation

◆ finalize()

StatusCode egammaCaloClusterSelector::finalize ( )
finaloverridevirtual

Definition at line 45 of file egammaCaloClusterSelector.cxx.

46{
47 return StatusCode::SUCCESS;
48}

◆ initialize()

StatusCode egammaCaloClusterSelector::initialize ( )
finaloverridevirtual

Definition at line 22 of file egammaCaloClusterSelector.cxx.

23{
24 if (!m_egammaCheckEnergyDepositTool.empty()) {
26 } else {
28 }
29
30 //Shower Shape tools
31 //Initialize tools when non-default values are given
35
36 if (m_doHadLeak) {
38 } else {
39 m_HadronicLeakageTool.disable();
40 }
41
42 return StatusCode::SUCCESS;
43}
#define ATH_CHECK
Evaluate an expression and check for errors.
ToolHandle< IegammaIso > m_HadronicLeakageTool
Tool for hadronic leakage calculation; onlud used if cuts needing are defined.
Gaudi::Property< double > m_RetaCut
Gaudi::Property< double > m_HadLeakCut
SG::ReadHandleKey< CaloCellContainer > m_cellsKey
Name of the cluster intput collection.
static constexpr double HAD_LEAK_DEFAULT_NO_CUT
ToolHandle< IegammaCheckEnergyDepositTool > m_egammaCheckEnergyDepositTool
Pointer to the egammaCheckEnergyDepositTool.
static constexpr double RETA_DEFAULT_NO_CUT

◆ passSelection()

bool egammaCaloClusterSelector::passSelection ( const xAOD::CaloCluster * cluster,
const CaloDetDescrManager & cmgr ) const
finaloverride

pass the selection described in the class egammaCaloClusterSelector

Definition at line 50 of file egammaCaloClusterSelector.cxx.

51 {
52
53 // Minimum Cluster energy
54 if (cluster->et() < m_ClusterEtCut) {
55 ATH_MSG_DEBUG("Cluster failed Energy Cut: dont make ROI");
56 return false;
57 }
58
59 // Accept all clusters in the FCAL
60 if (xAOD::EgammaHelpers::isFCAL(cluster)){
61 return true;
62 }
63
64 // Sanity check to catch extreme eta values
65 const double eta2 = std::abs(cluster->etaBE(2));
66 if (eta2 > 10) {
67 return false;
68 }
69
70 // Check energy deposit if requested
71 if (!m_egammaCheckEnergyDepositTool.empty() &&
72 !m_egammaCheckEnergyDepositTool->checkFractioninSamplingCluster(cluster)) {
73 ATH_MSG_DEBUG("Cluster failed sample check: dont make ROI");
74 return false;
75 }
76
77 // Check second sampling is present
78 if (!cluster->hasSampling(CaloSampling::EMB2) && !cluster->hasSampling(CaloSampling::EME2)){
79 return false;
80 }
81 // minimum energy reconstructed in 2nd sampling
82 constexpr double EM2ENERGY_CUT = 50 * MeV;
83 if (cluster->energyBE(2) < EM2ENERGY_CUT){
84 return false;
85 }
86 // use the egamma definition of EMFrac
87 // (includes presampler and TileGap3/E4, helps with eff in the crack)
88 static const SG::AuxElement::ConstAccessor<float> acc("EMFraction");
89 const double emFrac = acc.isAvailable(*cluster) ? acc(*cluster) : 0.;
90 const double EMEnergy = cluster->e() * emFrac;
91 double EMEt = EMEnergy / std::cosh(eta2);
92 // cluster is in crack region
93 // if at least one clustered cell in EMB and EMEC
94 if (cluster->inBarrel() && cluster->inEndcap()) {
95 EMEt /= m_EMEtSplittingFraction; // rescale EMEt for clusters in the crack
96 }
97
98 // EMEt cut
99 if (EMEt < m_EMEtCut) {
100 ATH_MSG_DEBUG("Cluster failed EMEt cut: don't make ROI");
101 return false;
102 }
103
104 // EM fraction cut
105 if (emFrac < m_EMFCut) {
106 ATH_MSG_DEBUG("Cluster failed EM Fraction cut: don't make ROI");
107 return false;
108 }
109
110 // Reta and Rhad cuts
111 if (m_doReta || m_doHadLeak) {
112 // retrieve the cell containers
113 SG::ReadHandle<CaloCellContainer> cellcoll(m_cellsKey);
114 if (m_doReta) {
115 egammaMiddleShape::Info info;
116 StatusCode sc =
117 egammaMiddleShape::execute(*cluster, cmgr, *cellcoll, info, true);
118 if (sc.isFailure()) {
119 ATH_MSG_WARNING("call to Middle shape returns failure for execute");
120 return false;
121 }
122 if (info.e277<0 || info.e237<0) {
123 ATH_MSG_DEBUG("Negative e277 or e237: dont make ROI");
124 return false;
125 }
126 if (info.e277 != 0. && info.e237/info.e277 < m_RetaCut) {
127 ATH_MSG_DEBUG("Cluster failed Reta test: dont make ROI");
128 return false;
129 }
130 }
131
132 if (m_doHadLeak) {
133 // calculate information concerning just the hadronic leakage
134 IegammaIso::Info info;
135 StatusCode sc = m_HadronicLeakageTool->execute(*cluster, cmgr, *cellcoll, info);
136 if ( sc.isFailure() ) {
137 ATH_MSG_WARNING("call to Iso returns failure for execute");
138 return false;
139 }
140 const double ethad1 = info.ethad1;
141 const double ethad = info.ethad;
142 const double raphad1 = EMEt != 0. ? ethad1 / EMEt : 0.;
143 const double raphad = EMEt != 0. ? ethad / EMEt : 0.;
144 if (eta2 >= 0.8 && eta2 < 1.37) {
145 if (raphad > m_HadLeakCut) {
146 ATH_MSG_DEBUG("Cluster failed Hadronic Leakage test: dont make ROI");
147 return false;
148 }
149 }
150 else if (raphad1 > m_HadLeakCut){
151 ATH_MSG_DEBUG("Cluster failed Hadronic Leakage test: dont make ROI");
152 return false;
153 }
154 }
155 }
156
157 return true;
158}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
Gaudi::Property< double > m_EMEtSplittingFraction
Gaudi::Property< double > m_EMEtCut
Gaudi::Property< double > m_EMFCut
Gaudi::Property< double > m_ClusterEtCut
virtual double e() const
The total energy of the particle.
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
float energyBE(const unsigned layer) const
Get the energy in one layer of the EM Calo.
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool isFCAL(const xAOD::CaloCluster *cluster)
return true if the cluster (or the majority of its energy) is in the FCAL0
@ ethad1
transverse energy in the first sampling of the hadronic calorimeters behind the cluster calculated fr...
Definition EgammaEnums.h:43
@ ethad
ET leakage into hadronic calorimeter with exclusion of energy in CaloSampling::TileGap3.
Definition EgammaEnums.h:46
static StatusCode execute(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &cmgr, const CaloCellContainer &cell_container, Info &info, bool doRetaOnly=false)

Member Data Documentation

◆ HAD_LEAK_DEFAULT_NO_CUT

double egammaCaloClusterSelector::HAD_LEAK_DEFAULT_NO_CUT = 999.
staticconstexprprivate

Definition at line 90 of file egammaCaloClusterSelector.h.

◆ m_cellsKey

SG::ReadHandleKey<CaloCellContainer> egammaCaloClusterSelector::m_cellsKey
private
Initial value:
{this,
"CellContainerName", "AllCalo",
"Names of containers which contain cells"}

Name of the cluster intput collection.

Definition at line 60 of file egammaCaloClusterSelector.h.

60 {this,
61 "CellContainerName", "AllCalo",
62 "Names of containers which contain cells"};

◆ m_ClusterEtCut

Gaudi::Property<double> egammaCaloClusterSelector::m_ClusterEtCut
private
Initial value:
{this,
"ClusterEtCut", 0.0, "Cut on cluster EM+Had Et"}

Definition at line 74 of file egammaCaloClusterSelector.h.

74 {this,
75 "ClusterEtCut", 0.0, "Cut on cluster EM+Had Et"};

◆ m_doHadLeak

bool egammaCaloClusterSelector::m_doHadLeak {false}
private

Definition at line 96 of file egammaCaloClusterSelector.h.

96{false};

◆ m_doReta

bool egammaCaloClusterSelector::m_doReta {false}
private

Definition at line 95 of file egammaCaloClusterSelector.h.

95{false};

◆ m_egammaCheckEnergyDepositTool

ToolHandle<IegammaCheckEnergyDepositTool> egammaCaloClusterSelector::m_egammaCheckEnergyDepositTool
private
Initial value:
{this,
"egammaCheckEnergyDepositTool", "",
"Optional tool that performs basic checks of viability of cluster"}

Pointer to the egammaCheckEnergyDepositTool.

Definition at line 65 of file egammaCaloClusterSelector.h.

65 {this,
66 "egammaCheckEnergyDepositTool", "",
67 "Optional tool that performs basic checks of viability of cluster"};

◆ m_EMEtCut

Gaudi::Property<double> egammaCaloClusterSelector::m_EMEtCut
private
Initial value:
{this,
"EMEtCut", 0.0, "EM Et cut"}

Definition at line 77 of file egammaCaloClusterSelector.h.

77 {this,
78 "EMEtCut", 0.0, "EM Et cut"};

◆ m_EMEtSplittingFraction

Gaudi::Property<double> egammaCaloClusterSelector::m_EMEtSplittingFraction
private
Initial value:
{this,
"EMEtSplittingFraction", 1.0, "Apply only fraction of EMEt cut for crack region"}

Definition at line 80 of file egammaCaloClusterSelector.h.

80 {this,
81 "EMEtSplittingFraction", 1.0, "Apply only fraction of EMEt cut for crack region"};

◆ m_EMFCut

Gaudi::Property<double> egammaCaloClusterSelector::m_EMFCut
private
Initial value:
{this,
"EMFCut", 0.0, "Cut on cluster EM fraction"}

Definition at line 83 of file egammaCaloClusterSelector.h.

83 {this,
84 "EMFCut", 0.0, "Cut on cluster EM fraction"};

◆ m_HadLeakCut

Gaudi::Property<double> egammaCaloClusterSelector::m_HadLeakCut
private
Initial value:
{this,
"HadLeakCut", HAD_LEAK_DEFAULT_NO_CUT, "Cut on cluster Hadronic Leakage"}

Definition at line 91 of file egammaCaloClusterSelector.h.

91 {this,
92 "HadLeakCut", HAD_LEAK_DEFAULT_NO_CUT, "Cut on cluster Hadronic Leakage"};

◆ m_HadronicLeakageTool

ToolHandle<IegammaIso> egammaCaloClusterSelector::m_HadronicLeakageTool
private
Initial value:
{this,
"HadronicLeakageTool", "egammaIso",
"Handle of the EMCaloIsolationTool for Hadronic leakage"}

Tool for hadronic leakage calculation; onlud used if cuts needing are defined.

Definition at line 70 of file egammaCaloClusterSelector.h.

70 {this,
71 "HadronicLeakageTool", "egammaIso",
72 "Handle of the EMCaloIsolationTool for Hadronic leakage"};

◆ m_RetaCut

Gaudi::Property<double> egammaCaloClusterSelector::m_RetaCut
private
Initial value:
{this,
"RetaCut", RETA_DEFAULT_NO_CUT, "Cut on cluster Reta"}

Definition at line 87 of file egammaCaloClusterSelector.h.

87 {this,
88 "RetaCut", RETA_DEFAULT_NO_CUT, "Cut on cluster Reta"};

◆ RETA_DEFAULT_NO_CUT

double egammaCaloClusterSelector::RETA_DEFAULT_NO_CUT = 0.0
staticconstexprprivate

Definition at line 86 of file egammaCaloClusterSelector.h.


The documentation for this class was generated from the following files: