ATLAS Offline Software
ZdcRawChannelCnv_p1.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // ZdcRawChannelCnv_p1.cxx
8 // Implementation file for class ZdcRawChannelCnv_p1
9 // Author: Peter Steinberg <peter.steinberg@bnl.gov>
10 // Date: June 2009
12 
13 #include "ZdcEvent/ZdcRawChannel.h"
15 
16 
17 void
18 ZdcRawChannelCnv_p1::persToTrans(const ZdcRawChannel_p1* persObj, ZdcRawChannel* transObj, MsgStream &log) const
19 {
20  //log << MSG::INFO << "ZdcRawChannelCnv_p1::persToTrans called " << endmsg;
21  log << MSG::VERBOSE << "ZdcRawChannelCnv_p1::persToTrans called " << endmsg;
22 
23  size_t sz = persObj->m_energy.size();
24 
25  if (sz != persObj->m_time.size()) std::abort();
26  if (sz != persObj->m_chi.size()) std::abort();
27 
28  *static_cast<ZdcRawData*> (transObj) =
30 
31  transObj->setSize (sz);
32  for (size_t i = 0; i < sz; i++) {
33  transObj->setEnergy (i, persObj->m_energy[i]);
34  transObj->setTime (i, persObj->m_time[i]);
35  transObj->setChi (i, persObj->m_chi[i]);
36  }
37 }
38 
39 
40 void
41 ZdcRawChannelCnv_p1::transToPers(const ZdcRawChannel* transObj, ZdcRawChannel_p1* persObj, MsgStream &log) const
42 {
43  log << MSG::VERBOSE << "ZdcRawChannelCnv_p1::transToPers called " << endmsg;
44 
45  persObj->m_id = transObj->identify().get_identifier32().get_compact();
46 
47  size_t sz = transObj->getSize();
48  persObj->m_energy.resize(sz);
49  persObj->m_time.resize(sz);
50  persObj->m_chi.resize(sz);
51 
52  for (size_t i = 0; i < sz; i++) {
53  persObj->m_energy[i] = transObj->getEnergy(i);
54  persObj->m_time[i] = transObj->getTime(i);
55  persObj->m_chi[i] = transObj->getChi(i);
56  }
57 }
Identifier32
Definition: Identifier32.h:25
ZdcRawChannel_p1::m_id
unsigned int m_id
Definition: ZdcRawChannel_p1.h:33
ZdcRawData
Definition: ZdcRawData.h:33
fitman.sz
sz
Definition: fitman.py:527
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
ZdcRawChannel_p1
Definition: ZdcRawChannel_p1.h:20
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
ZdcRawChannel::getSize
unsigned int getSize() const
Definition: ZdcRawChannel.h:80
ZdcRawChannel::getChi
float getChi(int i) const
Definition: ZdcRawChannel.h:84
ZdcRawChannelCnv_p1::transToPers
virtual void transToPers(const ZdcRawChannel *transObj, ZdcRawChannel_p1 *persObj, MsgStream &log) const override
Method creating the persistent representation ZdcRawChannel_p1 from its transient representation ZdcR...
Definition: ZdcRawChannelCnv_p1.cxx:41
ZdcRawChannel
Definition: ZdcRawChannel.h:24
lumiFormat.i
int i
Definition: lumiFormat.py:85
ZdcRawChannelCnv_p1::persToTrans
virtual void persToTrans(const ZdcRawChannel_p1 *persObj, ZdcRawChannel *transObj, MsgStream &log) const override
Method creating the transient representation ZdcRawChannel from its persistent representation ZdcRawC...
Definition: ZdcRawChannelCnv_p1.cxx:18
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ZdcRawChannel::getEnergy
float getEnergy(int i) const
Definition: ZdcRawChannel.h:82
ZdcRawChannel_p1::m_energy
std::vector< float > m_energy
Definition: ZdcRawChannel_p1.h:34
ZdcRawChannel::setSize
void setSize(unsigned int i)
Definition: ZdcRawChannel.h:67
ZdcRawChannelCnv_p1.h
ZdcRawChannel::setTime
void setTime(int i, float t)
Definition: ZdcRawChannel.h:77
ZdcRawChannel.h
ZdcRawChannel::setChi
void setChi(int i, float c)
Definition: ZdcRawChannel.h:78
ZdcRawChannel::getTime
float getTime(int i) const
Definition: ZdcRawChannel.h:83
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
ZdcRawChannel::setEnergy
void setEnergy(int i, float e)
Definition: ZdcRawChannel.h:76
ZdcRawData::identify
Identifier identify(void) const
Definition: ZdcRawData.h:44
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
ZdcRawChannel_p1::m_time
std::vector< float > m_time
Definition: ZdcRawChannel_p1.h:35
ZdcRawChannel_p1::m_chi
std::vector< float > m_chi
Definition: ZdcRawChannel_p1.h:36
Identifier
Definition: IdentifierFieldParser.cxx:14