ATLAS Offline Software
ZdcDigitsCollection_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "GaudiKernel/MsgStream.h"
7 
8 static const ZdcDigitsCnv_p1 digitConv;
9 
10 void ZdcDigitsCollectionCnv_p1::transToPers(const ZdcDigitsCollection* transObj, ZdcDigitsCollection_p1* persObj, MsgStream& log) const {
11 
12  persObj->resize(transObj->size());
13 
14  for (unsigned int i=0; i<transObj->size(); ++i) {
15 
16  ZdcDigits_p1& digit = (*persObj)[i];
17 
18  digitConv.transToPers((*transObj)[i], &digit, log);
19  }
20 }
21 
22 void ZdcDigitsCollectionCnv_p1::persToTrans(const ZdcDigitsCollection_p1* persObj, ZdcDigitsCollection* transObj, MsgStream& log) const {
23 
24  //log << MSG::INFO << " size = " << persObj->size() << endmsg;
25 
26  transObj->reserve(persObj->size());
27 
28  for (unsigned int i=0; i<persObj->size(); ++i) {
29 
30  //log << MSG::INFO << " i = " << i << endmsg;
31  const ZdcDigits_p1* digit = &((*persObj)[i]);
32 
33  transObj->push_back(digitConv.createTransientConst(digit, log));
34  }
35 }
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
ZdcDigits_p1
Definition: ZdcDigits_p1.h:20
ZdcDigitsCollectionCnv_p1::persToTrans
virtual void persToTrans(const ZdcDigitsCollection_p1 *persObj, ZdcDigitsCollection *transObj, MsgStream &log) const override
Definition: ZdcDigitsCollection_p1.cxx:22
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
ZdcDigitsCollectionCnv_p1.h
ZdcDigitsCollection_p1
Definition: ZdcDigitsCollection_p1.h:19
lumiFormat.i
int i
Definition: lumiFormat.py:85
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ZdcDigitsCnv_p1
Definition: ZdcDigitsCnv_p1.h:26
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
ZdcDigitsCollection
Definition: ZdcDigitsCollection.h:20
ZdcDigitsCollectionCnv_p1::transToPers
virtual void transToPers(const ZdcDigitsCollection *transObj, ZdcDigitsCollection_p1 *persObj, MsgStream &log) const override
Definition: ZdcDigitsCollection_p1.cxx:10
ZdcDigitsCnv_p1::transToPers
virtual void transToPers(const ZdcDigits *transObj, ZdcDigits_p1 *persObj, MsgStream &log) const override
Method creating the persistent representation ZdcDigits_p1 from its transient representation ZdcDigit...
Definition: ZdcDigitsCnv_p1.cxx:38
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TPConverterConstBase::createTransientConst
virtual TRANS * createTransientConst(const PERS *persObj, MsgStream &log) const