ATLAS Offline Software
CaloCellLinkContainerCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
10 
11 
13  CaloCellLinkContainer* trans,
14  const std::string& /*key*/,
15  MsgStream &log) const
16 {
17  trans->reserve(pers->m_links.size());
18  for (const CaloCellLinkContainer_p1::CellLink& l : pers->m_links) {
19  auto lnk = std::make_unique<CaloCellLink>();
20  m_converter.persToTrans (l, *lnk, log);
21  trans->push_back (std::move (lnk));
22  }
23 }
24 
25 
28  const std::string& /*key*/,
29  MsgStream &log) const
30 {
31  pers->m_links.resize(trans->size());
32  const SG::ThinningCache* cache = SG::getThinningCache();
33  std::vector<CaloCellLinkContainer_p1::CellLink>::size_type i=0;
34  for (const CaloCellLink* l : *trans) {
35  m_converter.transToPers (*l, pers->m_links[i], cache, log);
36  ++i;
37  }
38 }
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
Navigable_p1< unsigned int, float >
CaloCellLinkContainerCnv_p1::m_converter
NavigableCnv_p1< Navigable< CaloCellContainer, double >, float > m_converter
Definition: CaloCellLinkContainerCnv_p1.h:39
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
NavigableCnv_p1::persToTrans
void persToTrans(const PersNavigable_t &pers, Navigable_t &trans, MsgStream &log) const
CaloCellLinkContainerCnv_p1::transToPersWithKey
virtual void transToPersWithKey(const CaloCellLinkContainer *, CaloCellLinkContainer_p1 *, const std::string &key, MsgStream &log) const override
Definition: CaloCellLinkContainerCnv_p1.cxx:26
lumiFormat.i
int i
Definition: lumiFormat.py:92
getThinningCache.h
Helpers to retrieve the current thinning cache from the event context.
CaloCellLinkContainerCnv_p1::persToTransWithKey
virtual void persToTransWithKey(const CaloCellLinkContainer_p1 *, CaloCellLinkContainer *, const std::string &key, MsgStream &log) const override
Definition: CaloCellLinkContainerCnv_p1.cxx:12
SG::getThinningCache
const SG::ThinningCache * getThinningCache(const EventContext &ctx)
Retrieve the current thinning cache from the event context.
Definition: getThinningCache.cxx:28
CaloCellLinkContainerCnv_p1.h
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
NavigableCnv_p1::transToPers
void transToPers(const Navigable_t &trans, PersNavigable_t &pers, const SG::ThinningCache *cache, MsgStream &log) const
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SG::ThinningCache
Cache thinning decisions for converters.
Definition: ThinningCache.h:48
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.