8#include "Identifier/Identifier.h"
61 return StatusCode::SUCCESS;
84 return StatusCode::SUCCESS;
90 if (not pixelDetEleHandle.
isValid() or pixElements==
nullptr) {
92 return StatusCode::FAILURE;
97 std::make_unique<xAOD::PixelClusterAuxContainer>()) );
104 size_t nclusters = 0;
105 for (
const auto *
const clusterCollection : *inputPixelClusterContainer) {
106 if (!clusterCollection)
continue;
107 nclusters += clusterCollection->size();
110 outputPixelClusterContainer->push_new (nclusters, [&
pool](){
return pool.nextElementPtr();});
113 for (
const auto *
const clusterCollection : *inputPixelClusterContainer) {
114 if (!clusterCollection)
continue;
115 for(
const auto *
const theCluster : *clusterCollection) {
116 Identifier clusterId = theCluster->identify();
119 if ( element==
nullptr ) {
120 ATH_MSG_FATAL(
"Invalid pixel detector element for cluster identifier " << clusterId );
121 return StatusCode::FAILURE;
129 pixelLinkAcc( *pixelCl ) = pixelLink;
132 if (icluster != outputPixelClusterContainer->size()) {
133 ATH_MSG_ERROR(
"xAOD::PixelClusterContainer miscount; " << icluster <<
" versus " << outputPixelClusterContainer->size());
134 return StatusCode::FAILURE;
137 ATH_MSG_DEBUG(
"xAOD::PixelClusterContainer with size: " << outputPixelClusterContainer->size());
138 return StatusCode::SUCCESS;
144 if (not stripDetEleHandle.
isValid() or stripElements==
nullptr) {
146 return StatusCode::FAILURE;
151 std::make_unique<xAOD::StripClusterAuxContainer>()) );
156 size_t nclusters = 0;
157 for (
const auto *
const clusterCollection : *inputStripClusterContainer) {
158 if (!clusterCollection)
continue;
159 nclusters += clusterCollection->size();
162 outputStripClusterContainer->push_new (nclusters, [&
pool](){
return pool.nextElementPtr();});
166 for (
const auto *
const clusterCollection : *inputStripClusterContainer) {
167 if (!clusterCollection)
continue;
168 for(
const auto *
const theCluster : *clusterCollection) {
169 Identifier clusterId = theCluster->identify();
172 if ( element==
nullptr ) {
173 ATH_MSG_FATAL(
"Invalid strip detector element for cluster with identifier " << clusterId );
174 return StatusCode::FAILURE;
183 stripLinkAcc( *stripCl ) = stripLink;
186 if (icluster != outputStripClusterContainer->size()) {
187 ATH_MSG_ERROR(
"xAOD::StripClusterContainer miscount; " << icluster <<
" versus " << outputStripClusterContainer->size());
188 return StatusCode::FAILURE;
191 ATH_MSG_DEBUG(
"xAOD::StripClusterContainer with size: " << outputStripClusterContainer->size());
193 return StatusCode::SUCCESS;
199 if (not hgtdDetEleHandle.
isValid() or hgtdElements==
nullptr) {
201 return StatusCode::FAILURE;
205 ATH_CHECK( outputHgtdClusterContainer.
record (std::make_unique<xAOD::HGTDClusterContainer>(),
206 std::make_unique<xAOD::HGTDClusterAuxContainer>()) );
213 for (
const auto *
const clusterCollection : *inputHgtdClusterContainer) {
214 if (!clusterCollection)
continue;
215 for(
const auto *
const theCluster : *clusterCollection) {
216 Identifier clusterId = theCluster->identify();
219 if ( element==
nullptr ) {
220 ATH_MSG_FATAL(
"Invalid strip detector element for cluster with identifier " << clusterId );
221 return StatusCode::FAILURE;
225 outputHgtdClusterContainer->push_back(hgtdCl);
230 hgtdLinkAcc( *hgtdCl ) = hgtdLink;
234 ATH_MSG_DEBUG(
"xAOD::HGTDClusterContainer with size: " << outputHgtdClusterContainer->size());
235 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
An STL vector of pointers that by default owns its pointed-to elements.
Algorithm to convert InDet::PixelClusters and InDet::SCT_Clusters to xAOD::PixelClusters and xAOD::St...
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
const ServiceHandle< StoreGateSvc > & detStore() const
An algorithm that can be simultaneously executed in multiple threads.
a typed memory pool that saves time spent allocation small object.
ElementLink implementation for ROOT usage.
Class to hold the SiDetectorElement objects to be put in the detector store.
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
Class to hold geometrical description of a silicon detector element.
SG::ReadCondHandleKey< InDetDD::HGTD_DetectorElementCollection > m_HGTDDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_stripDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
virtual StatusCode initialize() override
SG::WriteHandleKey< xAOD::PixelClusterContainer > m_outputPixelClusterContainerKey
Gaudi::Property< bool > m_processStrip
StatusCode convertStripClusters(const EventContext &ctx) const
InDetToXAODClusterConversion()=delete
SG::ReadHandleKey< InDet::SCT_ClusterContainer > m_inputStripClusterContainerKey
SG::WriteHandleKey< xAOD::HGTDClusterContainer > m_outputHgtdClusterContainerKey
virtual StatusCode execute(const EventContext &ctx) const override
StatusCode convertHgtdClusters(const EventContext &ctx) const
StatusCode convertPixelClusters(const EventContext &ctx) const
SG::WriteHandleKey< xAOD::StripClusterContainer > m_outputStripClusterContainerKey
Gaudi::Property< bool > m_processHgtd
SG::ReadHandleKey<::HGTD_ClusterContainer > m_inputHgtdClusterContainerKey
Gaudi::Property< bool > m_processPixel
Gaudi::Property< bool > m_isITk
const PixelID * m_pixelID
SG::ReadHandleKey< InDet::PixelClusterContainer > m_inputPixelClusterContainerKey
SG::Accessor< T, ALLOC > Accessor
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
const HGTD_DetectorElement * getDetectorElement(const IdentifierHash &hash, const HGTD_DetectorElementCollection &coll)
DataVector< HGTD_DetectorElement > HGTD_DetectorElementCollection
@ ALWAYS_TRACK_INDICES
Always track indices, regardless of the setting of the ownership policy.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
StatusCode convertInDetToXaodCluster(const InDet::PixelCluster &indetCluster, const InDetDD::SiDetectorElement &element, xAOD::PixelCluster &xaodCluster)
StripCluster_v1 StripCluster
Define the version of the strip cluster class.
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.
HGTDCluster_v1 HGTDCluster
Define the version of the pixel cluster class.