11#include "CaloGeoHelpers/CaloSampling.h"
38 const std::string &name,
39 const ::IInterface *parent)
43 declareInterface<ICaloRingsBuilder>(
this);
52 const double eta2 = std::fabs(cluster.
etaBE(2));
53 const double energy = cluster.
e();
56 const double cosheta = std::cosh(eta2);
57 et = (cosheta != 0.) ? energy / cosheta : 0.;
67 return StatusCode::SUCCESS;
74 double et = particle.pt();
82 ATH_MSG_DEBUG(
"Skipping particle with low energy (" <<
et <<
" MeV) .");
83 return StatusCode::SUCCESS;
93 ATH_MSG_DEBUG(
"Entering executeTemp with input eta=" << input.eta()
94 <<
" phi=" << input.phi());
105 <<
" phi=" << input.phi());
114 unsigned int nSubRings =
rawConf.nRings / 5;
117 <<
" subrings=" << nSubRings);
119 std::vector<AtlasGeoPoint> seeds;
127 <<
" phi=" << centralSeed.
phi());
129 seeds.push_back(centralSeed);
133 for (
size_t i = 0; i < seeds.size(); ++i)
136 const unsigned int offset = i * nSubRings;
145 if (msgLevel() <= MSG::DEBUG)
147 std::ostringstream
str;
152 return StatusCode::SUCCESS;
158 std::vector<AtlasGeoPoint> &cornerSeeds)
167 AtlasGeoPoint top_right, top_left, bottom_right, bottom_left;
169 top_right.
setEta(seed.eta() + deltaEta);
172 top_left.
setEta(seed.eta() + deltaEta);
175 bottom_right.
setEta(seed.eta() - deltaEta);
178 bottom_left.
setEta(seed.eta() - deltaEta);
187 cornerSeeds.push_back(top_right);
188 cornerSeeds.push_back(top_left);
189 cornerSeeds.push_back(bottom_left);
190 cornerSeeds.push_back(bottom_right);
192 return StatusCode::SUCCESS;
199 const unsigned int offset,
200 const unsigned int nSubRings)
212 for (
const int layer :
rawConf.layers)
222 unsigned int ringNumber(0);
224 const float deltaEta = std::abs((cell->eta() - seed.eta())) /
rawConf.etaWidth;
227 const float deltaGreater = std::max(deltaEta,
deltaPhi);
229 ringNumber =
static_cast<unsigned int>(std::floor(deltaGreater + .5));
231 if (ringNumber < nSubRings)
233 ringNumber += offset;
235 float energyToAdd = 0;
239 energyToAdd = cell->energy() / std::cosh(cell->eta());
243 energyToAdd = cell->energy();
246 rs->at(ringNumber) += energyToAdd;
253 return StatusCode::SUCCESS;
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
#define ATH_CHECK
Evaluate an expression and check for errors.
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
float et(const xAOD::jFexSRJetRoI *j)
void setEta(const float eta)
void setPhi(const float phi)
Data object for each calorimeter readout cell.
This class provides the client interface for accessing the detector description information common to...
static double diff(double phi1, double phi2)
simple phi1 - phi2 calculation, but result is fixed to respect range.
ElementLink implementation for ROOT usage.
bool toContainedElement(BaseConstReference container, ElementType element)
Set link to point to given element (slowest).
StatusCode getCornerRingsSeeds(const xAOD::RingSetConf::RawConf &rawConf, const AtlasGeoPoint ¢ralSeed, std::vector< AtlasGeoPoint > &cornerSeeds)
Get the seeds for the corner rings (top-left, etc).
Gaudi::Property< int > m_cornerShift
Number of cells to shift for corner seeds (top-left, etc).
virtual StatusCode execute(const xAOD::CaloCluster &cluster, ElementLink< xAOD::CaloRingsContainer > &clRings) override
Tool main methods:
virtual StatusCode buildRingSet(const xAOD::RingSetConf::RawConf &rawConf, const AtlasGeoPoint &seed, xAOD::RingSet *rs, const unsigned int offset, const unsigned int nSubRings)
CaloCornerRingsBuilder(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
StatusCode executeTemp(const T &input, ElementLink< xAOD::CaloRingsContainer > &crEL)
Tool private methods:
~CaloCornerRingsBuilder()
Destructor.
CaloRingsBuilder(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
const xAOD::RingSetConf::RawConfCollection & rawConf() override
Extra methods:
xAOD::RingSetConf::RawConfCollection m_rsRawConfCol
holds each RingSet configuration (filled at initialize)
StatusCode getRingSetSeed(const xAOD::RingSetConf::RawConf &conf, const xAOD::CaloCluster &cluster, AtlasGeoPoint &seed)
Fill RingSet seed for CaloCluster.
Gaudi::Property< float > m_minEnergy
Minimum particle energy to build rings (GeV).
Gaudi::Property< bool > m_doTransverseEnergy
Switch to use raw cell energy instead ET.
Gaudi::Property< float > m_cellMaxDEtaDist
Maximum cell distance in eta to seed.
xAOD::RingSetContainer * m_rsCont
Tool props (non configurables):
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
xAOD::CaloRingsContainer * m_crCont
Create and hold CaloRingsContainer for each event.
SG::ReadHandleKey< CaloCellContainer > m_cellsContName
Name of CaloCellContainer.
AtlasGeoPoint m_lastValidSeed
last valid RingSet seed
Gaudi::Property< bool > m_useShowShapeBarycenter
Switch to use shower barycenter seed for each RingSets.
Gaudi::Property< float > m_cellMaxDPhiDist
Maximum cell distance in phi to seed.
const_pointer_type ptr()
Dereference the pointer.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual double e() const
The total energy of the particle.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
void print(std::ostream &stream) const
Print-out methods:
void addRingSetEL(const ElementLink< RingSetContainer_v1 > &rsEL)
Add ElementLink to holden vector.
Class providing the definition of the 4-vector interface.
Namespace dedicated for Ringer utilities.
RingSet_v1 RingSet
Definition of the current "RingSet version".
CaloRings_v1 CaloRings
Definition of the current "CaloRings version".
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Extra patterns decribing particle interation process.