ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCnv
LArTPCnv
src
LArRawChannelCnv_p2.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArRawEvent/LArRawChannel.h
"
6
#include "
CaloIdentifier/CaloGain.h
"
7
#include "
LArTPCnv/LArRawChannelCnv_p2.h
"
8
#include <cstdint>
9
// LArRawChannelCnv_p2, used for T/P separation
10
// author G.Unal
11
12
namespace
{
13
14
constexpr
uint32_t
qualityMask = 0x0000ffffu;
15
constexpr
uint32_t
provenanceMask = 0x3fff0000u;
16
constexpr
uint32_t
gainMask = 0xc0000000u;
17
18
uint32_t
19
packQualityProvenance(
const
uint16_t quality,
const
uint16_t provenance) {
20
return
static_cast<
uint32_t
>
(quality) |
21
((
static_cast<
uint32_t
>
(provenance) << 16) & provenanceMask);
22
}
23
24
uint16_t
25
unpackQuality(
const
uint32_t packed) {
26
return
static_cast<
uint16_t
>
(
packed
& qualityMask);
27
}
28
29
uint16_t
30
unpackProvenance(
const
uint32_t packed) {
31
return
static_cast<
uint16_t
>
((
packed
& provenanceMask) >> 16);
32
}
33
34
}
35
36
void
37
LArRawChannelCnv_p2::transToPers
(
const
LArRawChannel
*
trans
,
38
LArRawChannel_p2
* pers,
39
MsgStream&
/*log*/
)
const
40
{
41
pers->
m_channelID
=
trans
->identify().get_identifier32().get_compact();
42
pers->
m_energy
=
trans
->energy();
43
pers->
m_time
=
trans
->time();
44
45
const
uint32_t qualityProvenance =
46
packQualityProvenance(
trans
->quality(),
trans
->provenance());
47
48
const
uint32_t gain =
49
static_cast<
uint32_t
>
(
trans
->gain() & 0x3) << 30;
50
51
pers->
m_qualityandgain
=
static_cast<
int
>
(qualityProvenance | gain);
52
}
53
54
void
55
LArRawChannelCnv_p2::persToTrans
(
const
LArRawChannel_p2
* pers,
56
LArRawChannel
*
trans
,
57
MsgStream&
/*log*/
)
const
58
{
59
const
uint32_t qualityAndGain =
60
static_cast<
uint32_t
>
(pers->
m_qualityandgain
);
61
62
*
trans
=
LArRawChannel
{
63
HWIdentifier
{
Identifier32
{pers->
m_channelID
}},
64
pers->
m_energy
,
65
pers->
m_time
,
66
unpackQuality(qualityAndGain),
67
unpackProvenance(qualityAndGain),
68
static_cast<
CaloGain::CaloGain
>
((qualityAndGain & gainMask) >> 30)
69
};
70
}
CaloGain.h
LArRawChannelCnv_p2.h
LArRawChannel.h
HWIdentifier
Definition
HWIdentifier.h:13
Identifier32
Definition
Identifier32.h:28
LArRawChannelCnv_p2::transToPers
virtual void transToPers(const LArRawChannel *trans, LArRawChannel_p2 *pers, MsgStream &log) const override
Definition
LArRawChannelCnv_p2.cxx:37
LArRawChannelCnv_p2::persToTrans
virtual void persToTrans(const LArRawChannel_p2 *pers, LArRawChannel *trans, MsgStream &log) const override
Definition
LArRawChannelCnv_p2.cxx:55
LArRawChannel_p2
persistent class for LArRawChannel, version p2.
Definition
LArRawChannel_p2.h:14
LArRawChannel_p2::m_energy
int m_energy
Definition
LArRawChannel_p2.h:31
LArRawChannel_p2::m_channelID
unsigned int m_channelID
Definition
LArRawChannel_p2.h:30
LArRawChannel_p2::m_time
int m_time
Definition
LArRawChannel_p2.h:32
LArRawChannel_p2::m_qualityandgain
unsigned int m_qualityandgain
Definition
LArRawChannel_p2.h:34
LArRawChannel
Liquid Argon ROD output object base class.
Definition
LArRawChannel.h:40
trans
TH1F * trans(TH1F *h, bool t=false)
Definition
comparitor.cxx:199
CaloGain::CaloGain
CaloGain
Definition
CaloGain.h:11
H5Utils::internal::packed
H5::CompType packed(H5::CompType in)
Definition
WriterCommon.cxx:16
xAOD::uint16_t
setWord1 uint16_t
Definition
eFexEMRoI_v1.cxx:93
xAOD::uint32_t
setEventNumber uint32_t
Definition
EventInfo_v1.cxx:127
Generated on
for ATLAS Offline Software by
1.17.0