ATLAS Offline Software
Loading...
Searching...
No Matches
SCT3_RawDataCnv_p4.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include "MsgUtil.h"
8
12
13#include <vector>
14
15void
16SCT3_RawDataCnv_p4::persToTrans(const SCT3_RawData_p4* persObj, SCT3_RawData* transObj, MsgStream& log)
17{
18 MSG_DEBUG(log, "SCT3_RawDataCnv_p4::persToTrans called");
19
20 // Convert unsigned short to unsigned int
21 // P: Bits 0-10 for group size, Bits 11-13 for time bin
22 // T: Bits 0-10 for group size, Bits 22-24 for time bin
23 unsigned int word = static_cast<unsigned int>(persObj->m_word);
24 word = ((word & 0x7FF) | (((word >> 11) & 0x7) << 22));
25
26 // Convert row and strip numbers to strip Identifeir using wafer Identifer
27 Identifier stripId = m_sctId->strip_id(m_waferId,
28 persObj->getRow(),
29 persObj->getStrip());
30
31 *transObj = SCT3_RawData(stripId, word, std::vector<int>());
32}
33
34void
35SCT3_RawDataCnv_p4::transToPers(const SCT3_RawData* transObj, SCT3_RawData_p4* persObj, MsgStream& log)
36{
37 MSG_DEBUG(log, "SCT3_RawDataCnv_p4::transToPers called");
38
39 // Set row and strip numbers
40 persObj->setRowStrip(m_sctId->row(transObj->identify()), m_sctId->strip(transObj->identify()));
41
42 // Convert unsigned int to unsigned short
43 // T: Bits 0-10 for group size, Bits 22-24 for time bin
44 // P: Bits 0-10 for group size, Bits 11-13 for time bin
45 unsigned int word = transObj->getWord();
46 word = ((word & 0x7FF) | (((word >> 22) & 0x7) << 11));
47 persObj->m_word = static_cast<unsigned short>(word);
48}
#define MSG_DEBUG(log, x)
Definition MsgUtil.h:15
This is an Identifier helper class for the SCT subdetector.
virtual Identifier identify() const override final
unsigned int getWord() const
virtual void transToPers(const SCT3_RawData *transObj, SCT3_RawData_p4 *persObj, MsgStream &log)
virtual void persToTrans(const SCT3_RawData_p4 *persObj, SCT3_RawData *transObj, MsgStream &log)
S.Oda, Oct 2018 replace unsigned int by unsigned short for for the presampling samples for Overlay MC...
int getStrip() const
void setRowStrip(const int row, const int strip)
int getRow() const
unsigned short m_word