ATLAS Offline Software
LArRawChannelCnv_p2.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
9 // LArRawChannelCnv_p2, used for T/P separation
10 // author G.Unal
11 
12 void LArRawChannelCnv_p2::transToPers(const LArRawChannel* trans, LArRawChannel_p2* pers, MsgStream &/*log*/) const
13 {
14  union {
15  int m_quality ;
16  uint16_t m_qualProv[2];
17  } qprov{};
18 
19  pers->m_channelID = trans->identify().get_identifier32().get_compact();
20  pers->m_energy = trans->energy();
21  pers->m_time = trans->time();
22 
23  qprov.m_qualProv[0] = trans->quality();
24  qprov.m_qualProv[1] = trans->provenance();
25 
26  int tmpqual=qprov.m_quality & 0x3FFFFFFF;
27  int tmpgain=trans->gain() & 0x3;
28  tmpgain<<=30;
29  pers->m_qualityandgain = tmpqual | tmpgain;
30 }
31 
32 void LArRawChannelCnv_p2::persToTrans(const LArRawChannel_p2* pers, LArRawChannel* trans, MsgStream &/*log*/) const
33 {
34  union {
35  int m_quality ;
36  uint16_t m_qualProv[2];
37  } qprov{};
38 
39  qprov.m_quality = pers->m_qualityandgain & 0x3FFFFFFF;
40 
42  pers->m_energy,
43  pers->m_time,
44  qprov.m_qualProv[0], // quality
45  qprov.m_qualProv[1], // provenance
46  (CaloGain::CaloGain)((pers->m_qualityandgain>>30)&0x3)
47  );
48 }
49 
LArRawChannel_p2::m_energy
int m_energy
Definition: LArRawChannel_p2.h:31
LArRawChannelCnv_p2.h
Identifier32
Definition: Identifier32.h:25
LArRawChannel_p2::m_qualityandgain
unsigned int m_qualityandgain
Definition: LArRawChannel_p2.h:34
LArRawChannel::identify
HWIdentifier identify() const
Definition: LArRawChannel.h:154
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
LArRawChannel::quality
uint16_t quality() const
Definition: LArRawChannel.h:174
HWIdentifier
Definition: HWIdentifier.h:13
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
LArRawChannelCnv_p2::transToPers
virtual void transToPers(const LArRawChannel *trans, LArRawChannel_p2 *pers, MsgStream &log) const override
Definition: LArRawChannelCnv_p2.cxx:12
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
LArRawChannel
Liquid Argon ROD output object base class.
Definition: LArRawChannel.h:40
LArRawChannel_p2::m_channelID
unsigned int m_channelID
Definition: LArRawChannel_p2.h:30
LArRawChannel.h
LArRawChannel_p2
persistent class for LArRawChannel, version p2.
Definition: LArRawChannel_p2.h:14
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
LArRawChannel::time
int time() const
Definition: LArRawChannel.h:170
LArRawChannel::energy
int energy() const
Definition: LArRawChannel.h:166
LArRawChannelCnv_p2::persToTrans
virtual void persToTrans(const LArRawChannel_p2 *pers, LArRawChannel *trans, MsgStream &log) const override
Definition: LArRawChannelCnv_p2.cxx:32
LArRawChannel::gain
CaloGain::CaloGain gain() const
Definition: LArRawChannel.h:186
CaloGain.h
LArRawChannel_p2::m_time
int m_time
Definition: LArRawChannel_p2.h:32
LArRawChannel::provenance
uint16_t provenance() const
Definition: LArRawChannel.h:178