44 TRANS::const_iterator it_Coll = transCont->
begin();
45 TRANS::const_iterator it_CollEnd = transCont->
end();
46 unsigned int collIndex;
47 unsigned int chanBegin = 0;
48 unsigned int chanEnd = 0;
55 for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
59 chanEnd += collection.
size();
63 pcollection.
m_begin = chanBegin;
64 pcollection.
m_end = chanEnd;
68 for (
unsigned int i = 0; i < collection.
size(); ++i) {
71 if (
nullptr == chan)
throw std::runtime_error(
"SCT_RawDataContainerCnv_p4::transToPers: *** UNABLE TO DYNAMIC CAST TO SCT1_RawData");
76 for (
unsigned int i = 0; i < collection.
size(); ++i) {
79 if (
nullptr == chan)
throw std::runtime_error(
"SCT_RawDataContainerCnv_p4::transToPers: *** UNABLE TO DYNAMIC CAST TO SCT3_RawData");
107 <<
"The collection has mixed SCT1 and SCT3 elements, this is not "
118 const size_t numCollections = persCont->
m_collections.size();
119 std::vector<size_t> chans_per_collection{};
120 chans_per_collection.reserve(numCollections);
121 size_t totalChannels = 0;
122 for (
unsigned int icoll = 0; icoll < numCollections; ++icoll) {
125 chans_per_collection.push_back(nchans);
126 totalChannels += nchans;
131 dataItems.
reserve(totalChannels);
132 for (
unsigned int icoll = 0; icoll < numCollections; ++icoll) {
138 std::unique_ptr<SCT_RDO_Collection> coll =
140 coll->setIdentifier(collID);
142 unsigned int nchans = chans_per_collection[icoll];
143 coll->resize(nchans);
145 for (
unsigned int ichan = 0; ichan < nchans; ++ichan) {
150 (*coll)[ichan] = chan;
153 if (
sc.isFailure()) {
154 throw std::runtime_error(
"Failed to add collection to ID Container");
161 for (
unsigned int icoll = 0; icoll < numCollections; ++icoll) {
167 std::unique_ptr<SCT_RDO_Collection> coll =
169 coll->setIdentifier(collID);
171 unsigned int nchans = chans_per_collection[icoll];
172 coll->resize(nchans);
174 for (
unsigned int ichan = 0; ichan < nchans; ++ichan) {
179 (*coll)[ichan] = chan;
182 if (
sc.isFailure()) {
183 throw std::runtime_error(
"Failed to add collection to ID Container");
191 std::unique_ptr<SCT_RDO_Container> trans(std::make_unique<SCT_RDO_Container>(
m_sctId->wafer_hash_max()));
193 return trans.release();
This is an Identifier helper class for the SCT subdetector.
InDetRawDataCollection< SCT_RDORawData > SCT_RDO_Collection
InDetRawDataContainer< InDetRawDataCollection< SCT_RDORawData > > SCT_RDO_Container
a typed memory pool that saves time spent allocation small object.
void reserve(unsigned int size)
Set the desired capacity.
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.
size_type size() const noexcept
const_iterator end() const
return const_iterator for end of container
virtual size_t numberOfCollections() const override final
return number of collections
virtual StatusCode addCollection(const T *coll, IdentifierHash hashId) override final
insert collection into container with id hash if IDC should not take ownership of collection,...
const_iterator begin() const
return const_iterator for first entry
value_type get_compact() const
Get the compact id.
This is a "hash" representation of an Identifier.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Identifier32::value_type m_id
IdentifierHash::value_type m_hashId
virtual Identifier identify() const override final
virtual IdentifierHash identifyHash() const override final
virtual void transToPers(const SCT1_RawData *transObj, InDetRawData_p2 *persObj, MsgStream &log)
virtual void persToTrans(const InDetRawData_p2 *persObj, SCT1_RawData *transObj, MsgStream &log)
void setWaferId(const Identifier waferId)
virtual void transToPers(const SCT3_RawData *transObj, SCT3_RawData_p4 *persObj, MsgStream &log)
virtual void persToTrans(const SCT3_RawData_p4 *persObj, SCT3_RawData *transObj, MsgStream &log)
S.Oda, Oct 2018 replace unsigned int by unsigned short for for the presampling samples for Overlay MC...
virtual void transToPers(const SCT_RDO_Container *transCont, SCT_RawDataContainer_p4 *persCont, MsgStream &log)
virtual SCT_RDO_Container * createTransient(const SCT_RawDataContainer_p4 *persObj, MsgStream &log)
virtual void persToTrans(const SCT_RawDataContainer_p4 *persCont, SCT_RDO_Container *transCont, MsgStream &log)
Persistent represenation of an SCT_RawDataContainer.
std::vector< InDetRawDataCollection_p1 > m_collections
std::vector< InDetRawData_p2 > m_rawdata
std::vector< SCT3_RawData_p4 > m_sct3data
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts