ATLAS Offline Software
STGC_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 
12 {
13  persObj->m_id = transObj->m_id.get_identifier32().get_compact();
14  persObj->m_time = transObj->tdo();
15  persObj->m_charge = transObj->charge();
16  persObj->m_isDead = transObj->isDead();
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_bcTag = transObj->bcTag();
24  } else {
25  persObj->m_bcTag = 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 bcTag has a maximum range of 0-7,
34  // therefore a bcTag 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 bcTag is anyhow not meaningfull while if the time is in counts it is decomposed into the tdo (time) and the bcTag.
36  bool timeAndChargeInCounts = ((persObj->m_bcTag) != 9);
37  Muon::STGC_RawData* trans = new STGC_RawData( Identifier (persObj->m_id),
38  persObj->m_bcTag,
39  static_cast<float>(persObj->m_time),// place holder for tdo->time from calibration
40  persObj->m_time,
41  persObj->m_charge,
42  persObj->m_isDead,
43  timeAndChargeInCounts);
44 
45  return trans;
46 }
47 
Muon::STGC_RawData_p3::m_time
unsigned int m_time
Definition: STGC_RawData_p3.h:18
STGC_RawDataCnv_p3.h
Muon::STGC_RawDataCnv_p3::persToTrans
void persToTrans(const STGC_RawData_p3 *persObj, STGC_RawData *transObj, MsgStream &log) override final
Definition: STGC_RawDataCnv_p3.cxx:6
Muon::STGC_RawDataCnv_p3::createTransient
virtual STGC_RawData * createTransient(const STGC_RawData_p3 *persObj, MsgStream &log) override final
Definition: STGC_RawDataCnv_p3.cxx:29
Muon::STGC_RawData_p3::m_isDead
bool m_isDead
Definition: STGC_RawData_p3.h:24
Identifier32::get_compact
value_type get_compact(void) const
Get the compact id.
Definition: Identifier32.h:171
Muon::STGC_RawData
Definition: STGC_RawData.h:14
Muon::STGC_RawData::tdo
unsigned int tdo() const
Definition: STGC_RawData.h:56
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
Muon::STGC_RawData_p3::m_charge
unsigned int m_charge
Definition: STGC_RawData_p3.h:20
Muon::STGC_RawDataCnv_p3::transToPers
void transToPers(const STGC_RawData *transObj, STGC_RawData_p3 *persObj, MsgStream &log) override final
Definition: STGC_RawDataCnv_p3.cxx:11
Muon::STGC_RawData::isDead
bool isDead() const
Definition: STGC_RawData.h:60
Muon::STGC_RawData_p3::m_id
unsigned int m_id
FIXME! Remove this eventually.
Definition: STGC_RawData_p3.h:16
Muon::STGC_RawData_p3
Definition: STGC_RawData_p3.h:12
Muon::STGC_RawData::m_id
Identifier m_id
Definition: STGC_RawData.h:22
Muon::STGC_RawData::charge
unsigned int charge() const
Definition: STGC_RawData.h:57
Identifier::get_identifier32
Identifier32 get_identifier32(void) const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Muon::STGC_RawData::bcTag
uint16_t bcTag() const
Definition: STGC_RawData.h:58
Muon::STGC_RawData_p3::m_bcTag
uint16_t m_bcTag
Definition: STGC_RawData_p3.h:22
Muon::STGC_RawData::timeAndChargeInCounts
bool timeAndChargeInCounts() const
Definition: STGC_RawData.h:61