ATLAS Offline Software
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 
5 #include "SCT3_RawDataCnv_p4.h"
6 
7 #include "MsgUtil.h"
8 
10 #include "InDetIdentifier/SCT_ID.h"
12 
13 #include <vector>
14 
15 void
16 SCT3_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
28  persObj->getRow(),
29  persObj->getStrip());
30 
31  *transObj = SCT3_RawData(stripId, word, std::vector<int>());
32 }
33 
34 void
35 SCT3_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 }
SCT3_RawDataCnv_p4::m_sctId
const SCT_ID * m_sctId
Definition: SCT3_RawDataCnv_p4.h:29
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
SCT3_RawDataCnv_p4.h
SCT3_RawData_p4
S.Oda, Oct 2018 replace unsigned int by unsigned short for for the presampling samples for Overlay MC...
Definition: SCT3_RawData_p4.h:14
SCT3_RawDataCnv_p4::persToTrans
virtual void persToTrans(const SCT3_RawData_p4 *persObj, SCT3_RawData *transObj, MsgStream &log)
Definition: SCT3_RawDataCnv_p4.cxx:16
SCT3_RawData_p4::getRow
int getRow() const
Definition: SCT3_RawData_p4.h:28
SCT3_RawData.h
SCT3_RawData
Definition: SCT3_RawData.h:24
SCT_ID::row
int row(const Identifier &id) const
Definition: SCT_ID.h:758
SCT3_RawData_p4::m_word
unsigned short m_word
Definition: SCT3_RawData_p4.h:21
SCT3_RawDataCnv_p4::transToPers
virtual void transToPers(const SCT3_RawData *transObj, SCT3_RawData_p4 *persObj, MsgStream &log)
Definition: SCT3_RawDataCnv_p4.cxx:35
SCT3_RawData_p4::getStrip
int getStrip() const
Definition: SCT3_RawData_p4.h:32
InDetRawData::getWord
unsigned int getWord() const
Definition: InDetRawData.h:47
SCT_ID::strip
int strip(const Identifier &id) const
Definition: SCT_ID.h:764
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MSG_DEBUG
#define MSG_DEBUG(log, x)
Definition: MsgUtil.h:15
SCT3_RawDataCnv_p4::m_waferId
Identifier m_waferId
Definition: SCT3_RawDataCnv_p4.h:30
InDetRawData::identify
virtual Identifier identify() const override final
Definition: InDetRawData.h:41
SCT3_RawData_p4.h
SCT3_RawData_p4::setRowStrip
void setRowStrip(const int row, const int strip)
Definition: SCT3_RawData_p4.h:23
SCT_ID::strip_id
Identifier strip_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
For an individual strip.
Definition: SCT_ID.h:535
Identifier
Definition: IdentifierFieldParser.cxx:14
MsgUtil.h