23 auto outputCollection = std::make_unique<SCT_RDO_Collection>(hashId);
24 outputCollection->setIdentifier(collection->
identify());
28 outputCollection->reserve(collection->
size());
31 auto *oldDatum =
dynamic_cast<const SCT3_RawData *
>(existingDatum);
33 throw std::runtime_error(
"Dynamic cast to SCT3_RawData failed in SCTOverlay.cxx, Overlay::copyCollection");
36 (*datumCopy) =
SCT3_RawData(oldDatum->identify(), oldDatum->getWord(),
37 &oldDatum->getErrorCondensedHit());
38 outputCollection->push_back(datumCopy);
41 return outputCollection;
57 throw std::runtime_error(
"mergeCollections<SCT_RDORawData>() called by a wrong parent algorithm? Must be SCTOverlay.");
61 throw std::runtime_error(
"mergeCollections<SCT_RDO_Collection>(): collection Id mismatch");
64 outputCollection->reserve(
65 std::max(bkgCollection->
size(), signalCollection->
size()));
67 parent->get_sct_id()->wafer_id(signalCollection->
identifyHash());
77 rdo = bkgCollection->
begin();
78 rdoEnd = bkgCollection->
end();
80 rdo = signalCollection->
begin();
81 rdoEnd = signalCollection->
end();
84 for (; rdo!=rdoEnd; ++rdo) {
88 std::ostringstream os;
89 const auto& elt = **rdo;
90 os <<
"mergeCollection<SCT_RDO_Collection>(): wrong datum format. Only SCT3_RawData are produced by SCT_RodDecoder and supported by overlay."
91 <<
"For the supplied datum typeid(datum).name() = " <<
typeid(elt).name();
92 throw std::runtime_error(os.str());
100 if (timeBin & (1 << bc)) stripInfo[bc].set(
strip);
112 bool isExpandedMode = (anyNextBCHits or anyPreivousBCHits);
114 const int ERRORS = 0;
115 const std::vector<int> errvec{};
116 if (isExpandedMode) {
118 const int groupSize = 1;
124 if (stripInfo[bc][
strip]) {
128 unsigned int SCT_Word = (groupSize | (
strip << 11) | (tbin <<22) | (ERRORS << 25));
133 outputCollection->push_back(datum);
138 unsigned int groupSize = 0;
145 unsigned int firstStrip =
strip - groupSize;
146 unsigned int SCT_Word = (groupSize | (firstStrip << 11) | (tbin <<22) | (ERRORS << 25));
147 Identifier rdoId = parent->get_sct_id()->strip_id(idColl, firstStrip) ;
150 outputCollection->push_back(datum);
180 return StatusCode::FAILURE;
183 return StatusCode::SUCCESS;
197 ATH_MSG_ERROR(
"Could not get background SCT RDO container " << bkgContainer.
name() <<
" from store " << bkgContainer.
store());
198 return StatusCode::FAILURE;
200 bkgContainerPtr = bkgContainer.
cptr();
202 ATH_MSG_DEBUG(
"Found background SCT RDO container " << bkgContainer.
name() <<
" in store " << bkgContainer.
store());
207 if (!signalContainer.
isValid()) {
208 ATH_MSG_ERROR(
"Could not get signal SCT RDO container " << signalContainer.
name() <<
" from store " << signalContainer.
store());
209 return StatusCode::FAILURE;
211 ATH_MSG_DEBUG(
"Found signal SCT RDO container " << signalContainer.
name() <<
" in store " << signalContainer.
store());
218 ATH_CHECK(outputContainer.
record(std::make_unique<SCT_RDO_Container>(signalContainer->size())));
219 if (!outputContainer.
isValid()) {
220 ATH_MSG_ERROR(
"Could not record output SCT RDO container " << outputContainer.
name() <<
" to store " << outputContainer.
store());
221 return StatusCode::FAILURE;
223 ATH_MSG_DEBUG(
"Recorded output SCT RDO container " << outputContainer.
name() <<
" in store " << outputContainer.
store());
235 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
This is an Identifier helper class for the SCT subdetector.
InDetRawDataCollection< SCT_RDORawData > SCT_RDO_Collection
InDetRawDataContainer< InDetRawDataCollection< SCT_RDORawData > > SCT_RDO_Container
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
const ServiceHandle< StoreGateSvc > & detStore() const
a typed memory pool that saves time spent allocation small object.
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
void prepareToAdd(unsigned int size)
Prepare to add cached elements.
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
const_iterator begin() const noexcept
size_type size() const noexcept
IDC_OverlayBase(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode overlayContainer(const IDC_Container *bkgContainer, const IDC_Container *signalContainer, IDC_Container *outputContainer) const
This is a "hash" representation of an Identifier.
virtual Identifier identify() const override final
virtual IdentifierHash identifyHash() const override final
virtual Identifier identify() const override final
virtual int getGroupSize() const override final
SG::ReadHandleKey< SCT_RDO_Container > m_signalInputKey
SCTOverlay(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) const override final
SG::ReadHandleKey< SCT_RDO_Container > m_bkgInputKey
SG::WriteHandleKey< SCT_RDO_Container > m_outputKey
virtual StatusCode initialize() override final
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
std::string store() const
Return the name of the store holding the object we are proxying.
const std::string & name() const
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
pointer_type ptr()
Dereference the pointer.
Helpers for overlaying Identifiable Containers.
std::string debugPrint(const IDC_Container *container, unsigned numprint=25)
Diagnostic output of Identifiable Containers.
std::unique_ptr< HGTD_RDO_Collection > copyCollection(const IdentifierHash &hashId, const HGTD_RDO_Collection *collection)
void mergeCollections(SCT_RDO_Collection *bkgCollection, SCT_RDO_Collection *signalCollection, SCT_RDO_Collection *outputCollection, const IDC_OverlayBase *algorithm, DataPool< SCT3_RawData > &dataItems)
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts