ATLAS Offline Software
TileDigitsCnv_p2.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // TileDigitsCnv_p2.cxx
8 // Implementation file for class TileDigitsCnv_p2
9 // Author: Alexander Solodkov <Sanya.Solodkov@cern.ch>
10 // Date: June 2009
12 
13 #include "TileEvent/TileDigits.h"
15 
16 
17 void
18 TileDigitsCnv_p2::persToTrans(const TileDigits_p2* persObj, TileDigits* transObj, MsgStream &/*log*/) const
19 {
20  *transObj = TileDigits (HWIdentifier(Identifier32(persObj->m_channelID)),
21  persObj->m_digits);
22 }
23 
24 
25 void
26 TileDigitsCnv_p2::transToPers(const TileDigits* transObj, TileDigits_p2* persObj, MsgStream &/*log*/) const
27 {
28  persObj->m_channelID = transObj->adc_HWID().get_identifier32().get_compact();
29 
30  persObj->m_digits.reserve(transObj->nsamples());
31  for (float d : transObj->samples()) {
32  short val = (short)(std::min(d,32767.F));
33  persObj->m_digits.push_back( val );
34  }
35 }
Identifier32
Definition: Identifier32.h:25
xAOD::short
short
Definition: Vertex_v1.cxx:165
hist_file_dump.d
d
Definition: hist_file_dump.py:137
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
TileDigits::nsamples
int nsamples() const
Definition: TileDigits.h:55
TileDigitsCnv_p2::persToTrans
virtual void persToTrans(const TileDigits_p2 *persObj, TileDigits *transObj, MsgStream &log) const override
Method creating the transient representation TileDigits from its persistent representation TileDigits...
Definition: TileDigitsCnv_p2.cxx:18
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
TileDigitsCnv_p2.h
TileRawData::adc_HWID
HWIdentifier adc_HWID(void) const
Definition: TileRawData.h:53
HWIdentifier
Definition: HWIdentifier.h:13
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
TileDigitsCnv_p2::transToPers
virtual void transToPers(const TileDigits *transObj, TileDigits_p2 *persObj, MsgStream &log) const override
Method creating the persistent representation TileDigits_p2 from its transient representation TileDig...
Definition: TileDigitsCnv_p2.cxx:26
TileDigits_p2::m_channelID
unsigned int m_channelID
Definition: TileDigits_p2.h:33
TileDigits_p2::m_digits
std::vector< short > m_digits
Definition: TileDigits_p2.h:34
TileDigits::samples
const std::vector< float > & samples() const
Definition: TileDigits.h:58
TileDigits
Definition: TileDigits.h:30
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
F
#define F(x, y, z)
Definition: MD5.cxx:112
TileDigits_p2
Definition: TileDigits_p2.h:20
TileDigits.h