27 DataPool<Pixel1RawData>& pixel;
28 DataPool<SCT3_RawData>& sct3;
29 DataPool<SCT1_RawData>& sct1;
51 if (
const auto* rdo3 =
dynamic_cast<const SCT3_RawData*
>(rdo)) {
55 }
else if (
const auto* rdo1 =
dynamic_cast<const SCT1_RawData*
>(rdo)) {
60 throw std::runtime_error(
"TrackOverlayRoISiRDOMergerAlg: unknown SCT RDO type");
68StatusCode fillContainer(
const CONT& sig,
const CONT& merged,
const std::vector<bool>& inRoI, CONT& out, RDOPools& pools) {
69 for (
const auto& [hash, coll] :
sig.GetAllHashPtrPair()) {
70 if (hash < inRoI.size() && inRoI[hash])
continue;
71 if (
out.addOrDelete(
copyCollection(*coll, pools), hash).isFailure())
return StatusCode::FAILURE;
73 for (
size_t i = 0;
i < inRoI.size(); ++
i) {
74 if (!inRoI[i])
continue;
76 if (
const auto* coll = merged.indexFindPtr(hash)) {
77 if (
out.addOrDelete(
copyCollection(*coll, pools), hash).isFailure())
return StatusCode::FAILURE;
80 return StatusCode::SUCCESS;
103 return StatusCode::SUCCESS;
109 if (!clusters.isValid()) {
111 return StatusCode::FAILURE;
114 std::vector<bool> pixelInRoI(
m_pixelID->wafer_hash_max(),
false);
115 std::vector<bool> sctInRoI(
m_sctID->wafer_hash_max(),
false);
116 std::vector<IdentifierHash> hashes;
117 unsigned int nRoIs = 0;
121 const double eta = cl->eta();
122 const double phi = cl->phi();
144 return StatusCode::FAILURE;
153 RDOPools pools{pixelPool, sct3Pool, sct1Pool};
157 ATH_CHECK(fillContainer(*sigPixel, *fullPixel, pixelInRoI, *outPixel, pools));
161 ATH_CHECK(fillContainer(*sigSCT, *fullSCT, sctInRoI, *outSCT, pools));
163 const unsigned long nPix = std::count(pixelInRoI.begin(), pixelInRoI.end(),
true);
164 const unsigned long nSCT = std::count(sctInRoI.begin(), sctInRoI.end(),
true);
165 ATH_MSG_DEBUG(nRoIs <<
" RoIs, " << nPix <<
" Pixel and " << nSCT <<
" SCT modules with merged RDOs");
170 return StatusCode::SUCCESS;
175 const double n = std::max<unsigned long>(
m_nEvents.load(), 1);
179 return StatusCode::SUCCESS;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_INFO(x,...)
This is an Identifier helper class for the Pixel subdetector.
InDetRawDataCollection< PixelRDORawData > PixelRDO_Collection
This is an Identifier helper class for the SCT subdetector.
InDetRawDataCollection< SCT_RDORawData > SCT_RDO_Collection
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
const ServiceHandle< StoreGateSvc > & detStore() const
Header file for AthHistogramAlgorithm.
a typed memory pool that saves time spent allocation small object.
void prepareToAdd(unsigned int size)
Prepare to add cached elements.
size_type size() const noexcept
This is a "hash" representation of an Identifier.
virtual Identifier identify() const override final
virtual IdentifierHash identifyHash() const override final
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.
ToolHandle< IRegSelTool > m_regSelPixel
SG::ReadHandleKey< SCT_RDO_Container > m_sigSCTKey
std::atomic< unsigned long > m_nPixelRoIModules
SG::ReadHandleKey< PixelRDO_Container > m_sigPixelKey
std::atomic< unsigned long > m_nEvents
virtual StatusCode execute(const EventContext &ctx) const override
SG::WriteHandleKey< SCT_RDO_Container > m_outSCTKey
Gaudi::Property< float > m_phiHalfWidth
Gaudi::Property< float > m_etaHalfWidth
ToolHandle< IRegSelTool > m_regSelSCT
SG::WriteHandleKey< PixelRDO_Container > m_outPixelKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterKey
std::atomic< unsigned long > m_nRoIs
Gaudi::Property< float > m_minClusterEt
std::atomic< unsigned long > m_nSCTRoIModules
Gaudi::Property< float > m_zHalfWidth
SG::ReadHandleKey< SCT_RDO_Container > m_fullSCTKey
SG::ReadHandleKey< PixelRDO_Container > m_fullPixelKey
virtual StatusCode finalize() override
virtual StatusCode initialize() override
const PixelID * m_pixelID
nope - should be used for standalone also, perhaps need to protect the class def bits ifndef XAOD_ANA...
::StatusCode StatusCode
StatusCode definition for legacy code.
std::unique_ptr< HGTD_RDO_Collection > copyCollection(const IdentifierHash &hashId, const HGTD_RDO_Collection *collection)
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.