ATLAS Offline Software
BCM_RawData.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // BCM_RawData.h
7 // Header file for class BCM_RawData
9 // (c) ATLAS Detector software
11 // Class to define BCM raw data objects
13 // Version 1.0 13/08/2002 Veronique Boisvert
14 // Version 1.1 19/03/2008 Daniel Dobos for BCM
15 // Version 1.2 14/05/2008 Daniel Dobos
16 // Version 1.3 23/05/2008 Dominique Tardif
17 // Version 1.4 03/02/2009 Daniel Dobos
19 
21 // Coding of the RDO
22 // Channel : word1 : 0x0000000F : 4-bit
23 // Pulse1Position : word1 : 0x000003F0 : 6-bit
24 // Pulse1Width : word1 : 0x00007C00 : 5-bit
25 // Pulse2Position : word1 : 0x001F8000 : 6-bit
26 // Pulse2Width : word1 : 0x03E00000 : 5-bit
27 // LVL1A : word1 : 0xFC000000 : 6-bit
28 // BCID : word2 : 0x00000FFF : 12-bit
29 // LVL1ID : word2 : 0x0FFFF000 : 16-bit
30 // Error : word2 : 0xF0000000 : 4-bit
32 
33 #ifndef INDETBCM_RAWDATA_BCM_RAWDATA_H
34 #define INDETBCM_RAWDATA_BCM_RAWDATA_H
35 
36 class BCM_RawData {
37 
38 public:
39  //'Rule of 5' : Default c'tor
40  BCM_RawData() = default;
41  //copy c'tor
42  BCM_RawData(const BCM_RawData &) = default;
43  //move c'tor
44  BCM_RawData(BCM_RawData &&) = default;
45  //assign
46  BCM_RawData & operator=(const BCM_RawData &) = default;
47  //move assign
49  //d'tor
50  ~BCM_RawData() = default;
51 
52  // constructor with parameters: word1, word2
53  BCM_RawData(const unsigned int word1, const unsigned int word2);
54 
55  // constructor with parameter list: Channel, Pulse1Position, Pulse1Width, Pulse2Position, Pulse2Width, LVL1A, BCID, LVL1ID
56  BCM_RawData(const unsigned int Channel,
57  const unsigned int Pulse1Position,
58  const unsigned int Pulse1Width,
59  const unsigned int Pulse2Position,
60  const unsigned int Pulse2Width,
61  const unsigned int LVL1A,
62  const unsigned int BCID,
63  const unsigned int LVL1ID);
64 
65  // constructor with full parameter list: Channel, Pulse1Position, Pulse1Width, Pulse2Position, Pulse2Width, LVL1A, BCID, LVL1ID, Error
66  BCM_RawData(const unsigned int Channel,
67  const unsigned int Pulse1Position,
68  const unsigned int Pulse1Width,
69  const unsigned int Pulse2Position,
70  const unsigned int Pulse2Width,
71  const unsigned int LVL1A,
72  const unsigned int BCID,
73  const unsigned int LVL1ID,
74  const unsigned int Error);
75 
76 
77  // virtual methods
78  int getWord1() const { return m_word1; }
79  int getWord2() const { return m_word2; }
80  int getChannel() const { return (m_word1 & 0xF); } // Channel identifier 0-15
81  int getPulse1Position() const { return ((m_word1>>4) & 0x3F); } // Position of first pulse 0-63
82  int getPulse1Width() const { return ((m_word1>>10) & 0x1F); } // Width of first pulse 0-31
83  int getPulse2Position() const { return ((m_word1>>15) & 0x3F); } // Position of second pulse 0-63
84  int getPulse2Width() const { return ((m_word1>>21) & 0x1F); } // Width of second pulse 0-31
85  int getLVL1A() const { return ((m_word1>>26) & 0x3F); } // Level 1 accept, 0-63
86  int getBCID() const { return (m_word2 & 0xFFF); } // Bunch Crossing ID 0-4096
87  int getLVL1ID() const { return ((m_word2>>12) & 0xFFFF); } // Level 1 ID 0-65535
88  int getError() const { return ((m_word2>>28) & 0xF); } // Error 0-15
89 
90 private:
91 
92  unsigned int m_word1=0;
93  unsigned int m_word2=0;
94 
95 };
96 
97 #endif // INDETBCM_RAWDATA_BCM_RAWDATA_H
BCM_RawData::getPulse2Width
int getPulse2Width() const
Definition: BCM_RawData.h:84
xAOD::word1
word1
Definition: eFexEMRoI_v1.cxx:82
BCM_RawData::~BCM_RawData
~BCM_RawData()=default
LArBadChanBlobUtils::Channel
Identifier32::value_type Channel
Definition: LArBadChanBlobUtils.h:24
BCM_RawData::operator=
BCM_RawData & operator=(const BCM_RawData &)=default
BCM_RawData::m_word1
unsigned int m_word1
Definition: BCM_RawData.h:92
BCM_RawData::getLVL1ID
int getLVL1ID() const
Definition: BCM_RawData.h:87
BCM_RawData::m_word2
unsigned int m_word2
Definition: BCM_RawData.h:93
BCM_RawData::getChannel
int getChannel() const
Definition: BCM_RawData.h:80
PixelByteStreamErrors::BCID
@ BCID
Definition: PixelByteStreamErrors.h:13
BCM_RawData::getError
int getError() const
Definition: BCM_RawData.h:88
BCM_RawData::BCM_RawData
BCM_RawData()=default
BCM_RawData::getPulse1Position
int getPulse1Position() const
Definition: BCM_RawData.h:81
BCM_RawData::getWord2
int getWord2() const
Definition: BCM_RawData.h:79
BCM_RawData
Definition: BCM_RawData.h:36
BCM_RawData::BCM_RawData
BCM_RawData(const BCM_RawData &)=default
BCM_RawData::getPulse2Position
int getPulse2Position() const
Definition: BCM_RawData.h:83
BCM_RawData::getPulse1Width
int getPulse1Width() const
Definition: BCM_RawData.h:82
BCM_RawData::getWord1
int getWord1() const
Definition: BCM_RawData.h:78
BCM_RawData::getLVL1A
int getLVL1A() const
Definition: BCM_RawData.h:85
BCM_RawData::operator=
BCM_RawData & operator=(BCM_RawData &&)=default
L1Topo::Error
Error
The different types of error that can be flagged in the L1TopoRDO.
Definition: Error.h:16
BCM_RawData::getBCID
int getBCID() const
Definition: BCM_RawData.h:86
BCM_RawData::BCM_RawData
BCM_RawData(BCM_RawData &&)=default
PixelByteStreamErrors::LVL1ID
@ LVL1ID
Definition: PixelByteStreamErrors.h:13