CMS 3D CMS Logo

UCTAMCRawData.h
Go to the documentation of this file.
1 #ifndef UCTAMCRawData_hh
2 #define UCTAMCRawData_hh
3 
4 class UCTAMCRawData {
5 public:
6  UCTAMCRawData(const uint32_t *d) : myDataPtr(d) {}
7 
8  virtual ~UCTAMCRawData() { ; }
9 
10  // Access functions for convenience
11 
12  const uint32_t *dataPtr() const { return myDataPtr; }
13 
14  const uint32_t *header() const { return &myDataPtr[0]; }
15  const uint32_t *payload() const { return &myDataPtr[4]; }
16  const uint32_t *trailer() const { return &myDataPtr[trailerOffset()]; }
17 
18  uint32_t dataLength() const { return (myDataPtr[0] & 0x000FFFFF); }
19 
20  uint32_t BXID() { return ((myDataPtr[0] & 0xFFF00000) >> 20); }
21  uint32_t L1ID() { return (myDataPtr[1] & 0x00FFFFFF); }
22  uint32_t amcNo() { return ((myDataPtr[1] & 0x0F000000) >> 24); }
23  uint32_t layer1Phi() { return (myDataPtr[2] & 0x0000FFFF); }
24  uint32_t orbitNo() { return ((myDataPtr[2] & 0xFFFF0000) >> 16); }
25 
26  uint32_t trailerOffset() const { return (dataLength() - 1) * 2; }
27 
28  uint32_t dataLengthTrailer() { return (myDataPtr[trailerOffset()] & 0x000FFFFF); }
29  uint32_t L1IDTrailer() { return ((myDataPtr[trailerOffset()] & 0xFF000000) >> 24); }
30  uint32_t crc32() { return (myDataPtr[trailerOffset() + 1]); }
31 
32  void print() {
33  using namespace std;
34  cout << "AMC Payload Header:" << endl;
35  cout << "Data Length.. = " << dec << dataLength() << endl;
36  cout << "BXID......... = " << dec << BXID() << endl;
37  cout << "L1ID......... = " << internal << setfill('0') << setw(8) << hex << L1ID() << endl;
38  cout << "AMC No ...... = " << dec << amcNo() << endl;
39  cout << "Layer-1 Phi.. = " << dec << layer1Phi() << endl;
40  cout << "Orbit No..... = " << dec << orbitNo() << endl;
41  cout << "AMC Payload Trailer:" << endl;
42  cout << "Data Length.. = " << dec << dataLengthTrailer() << endl;
43  cout << "L1ID......... = " << internal << setfill('0') << setw(8) << hex << L1IDTrailer() << endl;
44  cout << "CRC32........ = " << internal << setfill('0') << setw(10) << hex << crc32() << endl;
45  }
46 
47 private:
48  // No copy constructor and equality operator are needed
49 
50  UCTAMCRawData(const UCTAMCRawData &) = delete;
51  const UCTAMCRawData &operator=(const UCTAMCRawData &i) = delete;
52 
53  // RawData data
54 
55  const uint32_t *myDataPtr;
56 };
57 
58 #endif
mps_fire.i
i
Definition: mps_fire.py:355
UCTAMCRawData::~UCTAMCRawData
virtual ~UCTAMCRawData()
Definition: UCTAMCRawData.h:8
gather_cfg.cout
cout
Definition: gather_cfg.py:144
UCTAMCRawData::BXID
uint32_t BXID()
Definition: UCTAMCRawData.h:20
UCTAMCRawData::orbitNo
uint32_t orbitNo()
Definition: UCTAMCRawData.h:24
UCTAMCRawData::print
void print()
Definition: UCTAMCRawData.h:32
UCTAMCRawData::header
const uint32_t * header() const
Definition: UCTAMCRawData.h:14
UCTAMCRawData::UCTAMCRawData
UCTAMCRawData(const uint32_t *d)
Definition: UCTAMCRawData.h:6
UCTAMCRawData::L1ID
uint32_t L1ID()
Definition: UCTAMCRawData.h:21
UCTAMCRawData::myDataPtr
const uint32_t * myDataPtr
Definition: UCTAMCRawData.h:55
UCTAMCRawData::operator=
const UCTAMCRawData & operator=(const UCTAMCRawData &i)=delete
UCTAMCRawData::payload
const uint32_t * payload() const
Definition: UCTAMCRawData.h:15
UCTAMCRawData::trailer
const uint32_t * trailer() const
Definition: UCTAMCRawData.h:16
UCTAMCRawData::trailerOffset
uint32_t trailerOffset() const
Definition: UCTAMCRawData.h:26
UCTAMCRawData
Definition: UCTAMCRawData.h:4
std
Definition: JetResolutionObject.h:76
UCTAMCRawData::amcNo
uint32_t amcNo()
Definition: UCTAMCRawData.h:22
UCTAMCRawData::dataLengthTrailer
uint32_t dataLengthTrailer()
Definition: UCTAMCRawData.h:28
UCTAMCRawData::L1IDTrailer
uint32_t L1IDTrailer()
Definition: UCTAMCRawData.h:29
UCTAMCRawData::crc32
uint32_t crc32()
Definition: UCTAMCRawData.h:30
UCTAMCRawData::layer1Phi
uint32_t layer1Phi()
Definition: UCTAMCRawData.h:23
UCTAMCRawData::dataPtr
const uint32_t * dataPtr() const
Definition: UCTAMCRawData.h:12
ztail.d
d
Definition: ztail.py:151
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
UCTAMCRawData::dataLength
uint32_t dataLength() const
Definition: UCTAMCRawData.h:18