 |
ATLAS Offline Software
|
Go to the documentation of this file.
28 ATH_MSG_FATAL(
"No e-gamma collection provided for thinning. At least one "
29 "egamma collection (photons/electrons) must be provided!");
30 return StatusCode::FAILURE;
58 return StatusCode::SUCCESS;
67 std::vector<SG::WriteDecorHandle<xAOD::EgammaContainer, char>> decon;
68 std::vector<SG::WriteDecorHandle<xAOD::EgammaContainer, float>> decoE;
73 if (!m_SGKey_photons.key().empty()) {
75 for (
int i = 0;
i < 2;
i++) {
76 decon.emplace_back(m_SGKey_photons_decorations[
i * 2], ctx);
77 decoE.emplace_back(m_SGKey_photons_decorations[
i * 2 + 1], ctx);
86 for (
int i = 0;
i < 2;
i++) {
87 decon[
i](*photon) =
res.nCells[
i];
88 decoE[
i](*photon) =
res.eCells[
i];
94 if (!m_SGKey_electrons.key().empty()) {
96 decon.clear(); decon.reserve(2);
97 decoE.clear(); decoE.reserve(2);
99 for (
int i = 0;
i < 2;
i++) {
100 decon.emplace_back(m_SGKey_electrons_decorations[
i * 2], ctx);
101 decoE.emplace_back(m_SGKey_electrons_decorations[
i * 2 + 1], ctx);
111 for (
int i = 0;
i < 2;
i++) {
112 decon[
i](*electron) =
res.nCells[
i];
113 decoE[
i](*electron) =
res.eCells[
i];
118 return StatusCode::SUCCESS;
139 double etamax = -999., phimax = -999.;
140 if (findMaxECell(clus,etamax,phimax).isFailure()) {
145 info.etamax = etamax;
146 info.phimax = phimax;
147 if (m_egammaCellRecoveryTool->execute(*clus,
info).isFailure()) {
160 return StatusCode::FAILURE;
168 return StatusCode::FAILURE;
175 return StatusCode::FAILURE;
179 it_cell_e = cellLinks->
end();
183 std::pair<const CaloCell*,double> maxcell{
nullptr,0};
184 for(; it_cell != it_cell_e; ++it_cell) {
187 if (!
cell->caloDDE()) {
189 <<
cell->eta() <<
" phi = " <<
cell->phi());
192 int layer =
cell->caloDDE()->getSampling();
195 double eCell =
cell->energy();
196 if (m_UseWeightForMaxCell) eCell *=
w;
199 maxcell.first =
cell;
207 etamax = maxcell.first->caloDDE()->eta_raw();
208 phimax = maxcell.first->caloDDE()->phi_raw();
211 double etaAmax = clus->
etamax(sam);
212 double phiAmax = clus->
phimax(sam);
215 <<
" maximum layer 2 energy cell, E = " << maxcell.first->energy()
216 <<
" check E = " << vemax
217 <<
" w = " << maxcell.second <<
"\n"
218 <<
" in calo frame, eta = " << etamax <<
" phi = " << phimax <<
"\n"
219 <<
" in ATLAS frame, eta = " << etaAmax <<
" phi = " << phiAmax);
222 ATH_MSG_WARNING(
"No layer 2 cell with positive energy ! Should never happen");
223 return StatusCode::FAILURE;
225 return StatusCode::SUCCESS;
float phimax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
xAOD::ElectronContainer * electronContainer
virtual double pt() const
transverse momentum
const ID_type & dataID() const
Get the key that we reference, as a string.
SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > m_SGKey_electrons_decorations
const_iterator begin() const
const begin method
#define ATH_MSG_VERBOSE(x)
IegammaCellRecoveryTool::Info decorateObject(const xAOD::Egamma *&egamma) const
SG::ReadHandleKey< CaloCellContainer > m_SGKey_CaloCells
float etamax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
weight_t weight() const
Accessor for weight associated to this cell.
const DataLink< CaloCellContainer > & getCellContainerLink() const
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
Description of a calorimeter cluster.
const CaloCellContainer * getCellContainer() const
Method to access underlying cell container.
SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > m_SGKey_photons_decorations
float energy_max(const CaloSample sampling) const
Retrieve maximum cell energy in given sampling.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::pair< std::vector< unsigned int >, bool > res
virtual double phi() const
phi in [-pi,pi[
virtual double eta() const
pseudo rapidity
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
xAOD::PhotonContainer * photonContainer
ToolHandle< IegammaCellRecoveryTool > m_egammaCellRecoveryTool
Pointer to the egammaCellRecoveryTool.
virtual StatusCode addBranches(const EventContext &ctx) const override final
Container class for CaloCell.
const_iterator end() const
const end method
Data object for each calorimeter readout cell.
#define ATH_MSG_WARNING(x)
StatusCode findMaxECell(const xAOD::CaloCluster *clus, double &etamax, double &phimax) const
float energyBE(const unsigned layer) const
Get the energy in one layer of the EM Calo.
SG::ReadHandleKey< xAOD::EgammaContainer > m_SGKey_photons
virtual StatusCode initialize() override final
const_iterator to loop over cells belonging to a cluster
SG::ReadHandleKey< xAOD::EgammaContainer > m_SGKey_electrons