ATLAS Offline Software
Loading...
Searching...
No Matches
LArRawChannelCnv_p1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
8#include <cstdint>
9
10// LArRawChannelCnv_p1, used for T/P separation
11// author R.Seuster <seuster@cern.ch>
12
13void LArRawChannelCnv_p1::transToPers(const LArRawChannel* /*trans*/, LArRawChannel_p1* /*pers*/, MsgStream &/*log*/) const
14{
15 // No longer used
16}
17
18void
20 MsgStream& /*log*/) const
21{
22 static constexpr uint32_t invalidQuality = 0xFFFFU;
23 // Preserve the previous little-endian union layout explicitly:
24 // low 16 bits -> quality, high 16 bits -> provenance.
25 const uint32_t q = static_cast<uint32_t>(pers->m_qualityandgain) & 0xFFFFU;
26
27 const uint32_t qualProv = (q == invalidQuality) ? 0x00A50000U : (0x20A50000U | q);
28 *trans = LArRawChannel{
30 pers->m_energy,
31 pers->m_time,
32 static_cast<uint16_t>(qualProv & 0xFFFFU), // quality
33 static_cast<uint16_t>((qualProv >> 16) & 0xFFFFU), // provenance
34 static_cast<CaloGain::CaloGain>((pers->m_qualityandgain >> 16) & 0xF)
35 };
36}
virtual void transToPers(const LArRawChannel *trans, LArRawChannel_p1 *pers, MsgStream &log) const override
virtual void persToTrans(const LArRawChannel_p1 *pers, LArRawChannel *trans, MsgStream &log) const override
persistent class for LArRawChannel, version p1.
unsigned int m_channelID
Liquid Argon ROD output object base class.