Project
Loading...
Searching...
No Matches
RawEventData.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11// DataFormats/Detectors/ZDC/src/RawEventData.cxx
13
14using namespace o2::zdc;
15
16// ClassImp(EventData);
17
18//______________________________________________________________________________
20{
21 static constexpr int payloadSize = NWPerGBTW * sizeof(UInt_t);
22 memset((void*)&w[0][0], 0, payloadSize);
23}
24
25//______________________________________________________________________________
26void EventData::print() const
27{
28 for (Int_t im = 0; im < o2::zdc::NModules; im++) {
29 for (Int_t ic = 0; ic < o2::zdc::NChPerModule; ic++) {
30 if (data[im][ic].f.fixed_0 == Id_w0 && data[im][ic].f.fixed_1 == Id_w1 && data[im][ic].f.fixed_2 == Id_w2) {
31 // Not empty event
32 auto f = data[im][ic].f;
33 // Word 0
34 printf("%04x %08x %08x ", data[im][ic].w[0][2], data[im][ic].w[0][1], data[im][ic].w[0][0]);
35 printf("orbit %-9u bc %-4u hits %-4u offset %+6i Board %2u Ch %1u\n", f.orbit, f.bc, f.hits, f.offset - 32768, f.ch, f.board);
36 // Word 1
37 printf("%04x %08x %08x ", data[im][ic].w[1][2], data[im][ic].w[1][1], data[im][ic].w[1][0]);
38 printf(" %s %s %s %s 0-5 ", f.Alice_0 ? "A0" : " ", f.Alice_1 ? "A1" : " ", f.Alice_2 ? "A2" : " ", f.Alice_3 ? "A3" : " ");
39 printf(" %5d %5d %5d %5d %5d %5d EC=%u\n", f.s00, f.s01, f.s02, f.s03, f.s04, f.s05, f.error);
40 // Word 2
41 printf("%04x %08x %08x ", data[im][ic].w[2][2], data[im][ic].w[2][1], data[im][ic].w[2][0]);
42 printf("%s %s %s %s %s %s 6-b ", f.Hit ? "H" : " ", f.Auto_m ? "TM" : " ", f.Auto_0 ? "T0" : " ", f.Auto_1 ? "T1" : " ", f.Auto_2 ? "T2" : " ", f.Auto_3 ? "T3" : " ");
43 printf(" %5d %5d %5d %5d %5d %5d\n", f.s06, f.s07, f.s08, f.s09, f.s10, f.s11);
44 } else if (data[im][ic].f.fixed_0 == 0 && data[im][ic].f.fixed_1 == 0 && data[im][ic].f.fixed_2 == 0) {
45 // Empty channel
46 } else {
47 // Wrong data format. Insert warning.
48 }
49 }
50 }
51}
52
53//______________________________________________________________________________
55{
56 static constexpr int payloadSize = NModules * NChPerModule * NWPerGBTW * sizeof(UInt_t);
57 memset((void*)&data[0][0], 0, payloadSize);
58}
Container of ZDC raw data.
GLdouble f
Definition glcorearb.h:310
GLboolean * data
Definition glcorearb.h:298
GLubyte GLubyte GLubyte GLubyte w
Definition glcorearb.h:852
constexpr int NModules
Definition Constants.h:68
constexpr int NChPerModule
Definition Constants.h:69
constexpr int NWPerGBTW
constexpr unsigned short Id_w1
constexpr unsigned short Id_w2
constexpr unsigned short Id_w0