|
ATLAS Offline Software
|
Go to the documentation of this file.
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 =
142 unsigned int nchans = chans_per_collection[icoll];
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 =
171 unsigned int nchans = chans_per_collection[icoll];
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. This class is a factory for creating comp...
S.Oda, Oct 2018 replace unsigned int by unsigned short for for the presampling samples for Overlay MC...
virtual void persToTrans(const SCT3_RawData_p4 *persObj, SCT3_RawData *transObj, MsgStream &log)
void setIdentifier(Identifier id)
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,...
std::vector< InDetRawDataCollection_p1 > m_collections
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
virtual void transToPers(const SCT1_RawData *transObj, InDetRawData_p2 *persObj, MsgStream &log)
virtual Identifier identify() const override final
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
void reserve(unsigned int size)
Set the desired capacity.
IdentifierHash::value_type m_hashId
virtual void persToTrans(const InDetRawData_p2 *persObj, SCT1_RawData *transObj, MsgStream &log)
value_type get_compact() const
Get the compact id.
Identifier32::value_type m_id
virtual IdentifierHash identifyHash() const override final
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
virtual SCT_RDO_Container * createTransient(const SCT_RawDataContainer_p4 *persObj, MsgStream &log)
virtual size_t numberOfCollections() const override final
return number of collections
void prepareToAdd(unsigned int size)
Prepare to add cached elements.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual void transToPers(const SCT3_RawData *transObj, SCT3_RawData_p4 *persObj, MsgStream &log)
const_iterator end() const
return const_iterator for end of container
const_iterator begin() const
return const_iterator for first entry
std::vector< InDetRawData_p2 > m_rawdata
void clear()
Erase all the elements in the collection.
virtual void persToTrans(const SCT_RawDataContainer_p4 *persCont, SCT_RDO_Container *transCont, MsgStream &log)
void resize(size_type sz)
Resizes the collection to the specified number of elements.
size_type wafer_hash_max(void) const
std::vector< SCT3_RawData_p4 > m_sct3data
InDetRawDataContainer< InDetRawDataCollection< SCT_RDORawData > > SCT_RDO_Container
Persistent represenation of an SCT_RawDataContainer.
virtual void transToPers(const SCT_RDO_Container *transCont, SCT_RawDataContainer_p4 *persCont, MsgStream &log)
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
size_type size() const noexcept
Returns the number of elements in the collection.
void setWaferId(const Identifier waferId)