ATLAS Offline Software
InDetBSErrContainerCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
8 (const InDetBSErrContainer* transCont, InDetBSErrContainer_p1* persCont, MsgStream& /*log*/)
9 {
11  InDetBSErrContainer::const_iterator itEnd = transCont->end();
12  (persCont->m_bsErrs).reserve(transCont->size());
13 
14  for (; it != itEnd; ++it) {
15  // FIXME: Should change type of m_bsErrs, but don't want to cause possible
16  // back-compatibility problems.
17  std::pair<IdentifierHash, int>* ptr ATLAS_THREAD_SAFE = const_cast<std::pair<IdentifierHash, int>*> (*it);
18  (persCont->m_bsErrs).push_back(ptr);
19  }
20  }
21 
22 void InDetBSErrContainerCnv_p1::persToTrans(const InDetBSErrContainer_p1* persCont, InDetBSErrContainer* transCont, MsgStream& /*log*/)
23 {
24  std::vector<std::pair<IdentifierHash, int>* >::const_iterator it = (persCont->m_bsErrs).begin();
25  std::vector<std::pair<IdentifierHash, int>* >::const_iterator itEnd = (persCont->m_bsErrs).end();
26  transCont->reserve((persCont->m_bsErrs).size());
27 
28  for (; it != itEnd; ++it) {
29  transCont->push_back(*it);
30  }
31 
32 }
33 
34 //================================================================
36  std::unique_ptr<InDetBSErrContainer> trans(std::make_unique<InDetBSErrContainer>());
37  persToTrans(persObj, trans.get(), log);
38  return(trans.release());
39 }
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
InDetBSErrContainerCnv_p1::persToTrans
virtual void persToTrans(const InDetBSErrContainer_p1 *persCont, InDetBSErrContainer *transCont, MsgStream &log)
Definition: InDetBSErrContainerCnv_p1.cxx:22
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:396
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
InDetBSErrContainerCnv_p1::transToPers
virtual void transToPers(const InDetBSErrContainer *transCont, InDetBSErrContainer_p1 *persCont, MsgStream &log)
Definition: InDetBSErrContainerCnv_p1.cxx:8
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
DataVector< std::pair< IdentifierHash, int > >
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
InDetBSErrContainer_p1::m_bsErrs
std::vector< std::pair< IdentifierHash, int32_t > * > m_bsErrs
Definition: InDetBSErrContainer_p1.h:22
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
InDetBSErrContainerCnv_p1.h
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
InDetBSErrContainerCnv_p1::createTransient
virtual InDetBSErrContainer * createTransient(const InDetBSErrContainer_p1 *persObj, MsgStream &log)
Definition: InDetBSErrContainerCnv_p1.cxx:35
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
InDetBSErrContainer_p1
Definition: InDetBSErrContainer_p1.h:16
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.