ATLAS Offline Software
Loading...
Searching...
No Matches
MM_RawDataCnv_p3.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
5
7{
8 // Not much point calling this!
9}
10
11void Muon::MM_RawDataCnv_p3::transToPers( const Muon::MM_RawData *transObj, Muon::MM_RawData_p3 *persObj, MsgStream & )
12{
13 persObj->m_id = transObj->m_id.get_identifier32().get_compact();
14 persObj->m_channel = transObj->channel();
15 persObj->m_time = transObj->time();
16 persObj->m_charge = transObj->charge();
17 // explanation on magic relBCID by pscholer, March 2022:
18 // In order to know if the charge and the time are given in physical units or ADC counts, the transient MM_RawDataClass has a corresponding bolean.
19 // To save disk space, the persistent version does not have this bolean but uses the relBCID as flag. In detector data the relBCID has a range of 0-7,
20 // therefore a relBCID of 9 indicates that charge and time are in physical units while smaller values of the relBCID indicate that they are in counts.
21 // In case of the time being in nano seconds, the relBCID is anyhow not meaningfull while if the time is in counts it is decomposed into the tdo (time) and the relBCID.
22 if (transObj->timeAndChargeInCounts()){
23 persObj->m_relBcid = transObj->relBcid();
24 } else {
25 persObj->m_relBcid = 9;
26 }
27}
28
30{
31 // explanation on magic relBCID by pscholer, March 2022:
32 // In order to know if the charge and the time are given in physical units or ADC counts, the transient MM_RawDataClass has a corresponding bolean.
33 // To save disk space, the persistent version does not have this bolean but uses the relBCID as flag. In detector data the relBCID has a range of 0-7,
34 // therefore a relBCID of 9 indicates that charge and time are in physical units while smaller values of the relBCID indicate that they are in counts.
35 // In case of the time being in nano seconds, the relBCID is anyhow not meaningfull while if the time is in counts it is decomposed into the tdo (time) and the relBCID.
36 bool timeAndChargeInCounts = ((persObj->m_relBcid) != 9);
37 Muon::MM_RawData* trans = new MM_RawData( Identifier (persObj->m_id),
38 persObj->m_channel,
39 persObj->m_time,
40 persObj->m_charge,
41 persObj->m_relBcid,
42 timeAndChargeInCounts);
43
44 return trans;
45}
46
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
virtual MM_RawData * createTransient(const MM_RawData_p3 *persObj, MsgStream &log) override final
void persToTrans(const MM_RawData_p3 *persObj, MM_RawData *transObj, MsgStream &log) override final
void transToPers(const MM_RawData *transObj, MM_RawData_p3 *persObj, MsgStream &log) override final
unsigned int m_id
FIXME!
int m_channel
writing out channel id, time and charge
Temporary class to hold the MM RDO.
Definition MM_RawData.h:20
int time() const
Definition MM_RawData.h:62
int channel() const
Definition MM_RawData.h:61
Identifier m_id
Definition MM_RawData.h:29
uint16_t relBcid() const
Definition MM_RawData.h:63
bool timeAndChargeInCounts() const
Definition MM_RawData.h:65
int charge() const
Definition MM_RawData.h:64