|
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "CaloGeoHelpers/CaloSampling.h"
40 const std::string&
name,
41 const ::IInterface*
parent)
47 declareInterface<ICaloRingsBuilder>(
this);
63 for (
size_t rsConfIdx = 0; rsConfIdx <
m_nRingSets; ++rsConfIdx) {
65 const auto rsNLayers =
m_nLayers[rsConfIdx];
67 auto end_itr = itr + rsNLayers;
69 const auto& caloSampleItr =
reinterpret_cast<
72 const auto& caloSampleEndItr =
reinterpret_cast<
76 std::vector<CaloSampling::CaloSample> rsLayers( caloSampleItr ,
98 }
catch (
const std::runtime_error &
e) {
99 ATH_MSG_ERROR(
"Could not add collection bounderies due to: " <<
e.what() );
101 std::ostringstream
str;
104 return StatusCode::FAILURE;
109 std::ostringstream
str;
121 return StatusCode::SUCCESS;
127 return StatusCode::SUCCESS;
133 , std::size_t nReserve )
135 if ( crCont && rsCont ){
139 ATH_MSG_ERROR(
"Attempted to set CaloRingsContainer and/or RingSetContainer to invalid pointers");
140 return StatusCode::FAILURE;
151 return StatusCode::SUCCESS;
159 const double eta2 = std::fabs(cluster.
etaBE(2));
160 const double energy = cluster.
e();
162 const double cosheta = std::cosh(
eta2);
163 et = (cosheta != 0.) ?
energy /cosheta : 0.;
169 ATH_MSG_DEBUG(
"Skipping cluster with low energy (" <<
et <<
" MeV) .");
170 return StatusCode::SUCCESS;
184 ATH_MSG_DEBUG(
"Skipping particle with low energy (" <<
et <<
" MeV) .");
185 return StatusCode::SUCCESS;
236 std::ostringstream
str;
241 return StatusCode::SUCCESS;
252 seed.setEta( cluster.
eta() );
253 seed.setPhi( cluster.
phi() );
255 return StatusCode::SUCCESS;
259 bool foundValid =
false, foundMultipleValid =
false;
269 ") seedCandidate is: (" <<
270 seedCandidate.
eta() <<
"," <<
271 seedCandidate.
phi() <<
")" );
273 if ( seedCandidate.
isValid() ){
276 foundMultipleValid =
true;
283 if ( foundMultipleValid ){
284 ATH_MSG_WARNING(
"Found multiple valid seeds. Set to last valid candidate.");
286 return StatusCode::SUCCESS;
297 seed.setEta(
part.eta() );
298 seed.setPhi(
part.phi() );
300 return StatusCode::SUCCESS;
310 const auto nRings =
rawConf.nRings;
317 return StatusCode::FAILURE;
331 unsigned int ringNumber(0);
335 (
cell->eta() - seed.eta())
346 ringNumber =
static_cast<unsigned int>(std::floor(deltaGreater + .5));
347 if ( ringNumber < nRings ){
349 rs->
at(ringNumber) +=
cell->energy()/cosh(
cell->eta());
351 rs->
at(ringNumber) +=
cell->energy();
357 return StatusCode::SUCCESS;
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
JetConstituentVector::iterator iterator
virtual double phi() const
The azimuthal angle ( ) of the particle.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
~CaloRingsBuilder()
Destructor.
virtual StatusCode finalize() override
finalize method
static void print(const RawConf &raw, std::ostream &stream)
Prints rawConf.
Extra patterns decribing particle interation process.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
StatusCode getRingSetSeed(const xAOD::RingSetConf::RawConf &conf, const xAOD::CaloCluster &cluster, AtlasGeoPoint &seed)
Fill RingSet seed for CaloCluster.
bool toContainedElement(BaseConstReference data, ElementType element, IProxyDict *sg=0)
Set from element pointer and a reference to the container (storable)
virtual StatusCode initialize() override
Tool main methods:
Gaudi::Property< std::vector< float > > m_etaWidth
Width of the ring in eta.
xAOD::CaloRingsContainer * m_crCont
Create and hold CaloRingsContainer for each event.
Gaudi::Property< float > m_cellMaxDPhiDist
Maximum cell distance in phi to seed.
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
SG::WriteHandleKey< xAOD::RingSetContainer > m_rsContName
Name of RingSetContainer on Event StoreGate.
const xAOD::RingSetConf::RawConfCollection & rawConf() override
Extra methods:
float & at(const unsigned int i)
Get/set ring Et at ith position.
Gaudi::Property< std::vector< float > > m_phiWidth
Width of the ring in phi.
Class holding a set of rings.
SG::ReadHandleKey< CaloCellContainer > m_cellsContName
Name of CaloCellContainer.
const std::string & key() const
Return the StoreGate ID for the referenced object.
Class providing the definition of the 4-vector interface.
virtual StatusCode buildRingSet(const xAOD::RingSetConf::RawConf &rawConf, const AtlasGeoPoint &seed, xAOD::RingSet *rs)
main method where the RingSets are built.
Gaudi::Property< bool > m_doTransverseEnergy
Switch to use raw cell energy instead ET.
static Ringer::CalJointLayer whichLayer(const std::vector< CaloSampling::CaloSample > &layers)
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
StatusCode executeTemp(const T &input, ElementLink< xAOD::CaloRingsContainer > &crEL)
Tool protected methods:
Description of a calorimeter cluster.
Gaudi::Property< std::vector< int > > m_layers
Calorimeter layers in each ringset.
CaloRingsBuilder(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
virtual double eta() const
The pseudorapidity ( ) of the particle.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< std::vector< unsigned int > > m_nLayers
Number of calorimeter layers in each ringset.
Gaudi::Property< float > m_cellMaxDEtaDist
Maximum cell distance in eta to seed.
void addRingSetEL(const ElementLink< RingSetContainer_v1 > &rsEL)
Add ElementLink to holden vector.
static void addRawConfColBounderies(RawConfCollection &clRingsConf)
Add to RawConfCollection its JointLayer/JointSection bounderies.
void print(std::ostream &stream) const
Print-out methods:
AtlasGeoPoint m_lastValidSeed
last valid RingSet seed
#define CHECK(...)
Evaluate an expression and check for errors.
Class summarizing the particle interaction throughout the Calorimeter (its shower shape).
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ElementLink implementation for ROOT usage.
Helpers for checking error return status codes and reporting errors.
Gaudi::Property< float > m_minEnergy
Minimum particle energy to build rings (GeV)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
size_t m_nRingSets
hold the number of RingSets we are building for each CaloRings
xAOD::RingSetContainer * m_rsCont
Tool props (non configurables):
const_pointer_type ptr()
Dereference the pointer.
xAOD::RingSetConf::RawConfCollection m_rsRawConfCol
holds each RingSet configuration (filled at initialize)
This class provides the client interface for accessing the detector description information common to...
Data object for each calorimeter readout cell.
virtual StatusCode preExecute(xAOD::CaloRingsContainer *crCont, xAOD::RingSetContainer *rsCont, const std::size_t nReserve=0) override
method for working on containers
#define ATH_MSG_WARNING(x)
CaloRings_v1 CaloRings
Definition of the current "CaloRings version".
SG::WriteHandleKey< xAOD::CaloRingsContainer > m_crContName
Tool props (python configurables):
virtual StatusCode execute(const xAOD::IParticle &particle, ElementLink< xAOD::CaloRingsContainer > &clRingsLink) override
build CaloRings for IParticle
static std::string getSamplingName(CaloSample theSample)
Returns a string (name) for each CaloSampling.
Gaudi::Property< std::vector< unsigned int > > m_nRings
Number of rings in a ringset.
static Ringer::CalJointSection whichSection(const std::vector< CaloSampling::CaloSample > &layers)
Gaudi::Property< bool > m_useShowShapeBarycenter
Switch to use shower barycenter seed for each RingSets.
virtual double e() const
The total energy of the particle.
RingSet_v1 RingSet
Definition of the current "RingSet version".
static double diff(double phi1, double phi2)
simple phi1 - phi2 calculation, but result is fixed to respect range.
Namespace dedicated for Ringer utilities.