|
| 1 | +// Copyright CERN and copyright holders of ALICE O2. This software is |
| 2 | +// distributed under the terms of the GNU General Public License v3 (GPL |
| 3 | +// Version 3), copied verbatim in the file "COPYING". |
| 4 | +// |
| 5 | +// See http://alice-o2.web.cern.ch/license for full licensing information. |
| 6 | +// |
| 7 | +// In applying this license CERN does not waive the privileges and immunities |
| 8 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 9 | +// or submit itself to any jurisdiction. |
| 10 | +// DataFormats/Detectors/ZDC/src/RawEventData.cxx |
| 11 | +#include "DataFormatsZDC/RawEventData.h" |
| 12 | + |
| 13 | +using namespace o2::zdc; |
| 14 | + |
| 15 | +//ClassImp(EventData); |
| 16 | + |
| 17 | +//______________________________________________________________________________ |
| 18 | +void EventData::print() const |
| 19 | +{ |
| 20 | + for (Int_t im = 0; im < o2::zdc::NModules; im++) { |
| 21 | + for (Int_t ic = 0; ic < o2::zdc::NChPerModule; ic++) { |
| 22 | + 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) { |
| 23 | + // Not empty event |
| 24 | + auto f = data[im][ic].f; |
| 25 | + // Word 0 |
| 26 | + printf("%04x %08x %08x ", data[im][ic].w[0][2], data[im][ic].w[0][1], data[im][ic].w[0][0]); |
| 27 | + printf("orbit %-9u bc %-4u hits %-4u offset %+6i Board %2u Ch %1u\n", f.orbit, f.bc, f.hits, f.offset, f.ch, f.board); |
| 28 | + // Word 1 |
| 29 | + printf("%04x %08x %08x ", data[im][ic].w[1][2], data[im][ic].w[1][1], data[im][ic].w[1][0]); |
| 30 | + printf(" %s %s %s %s 0-5 ", f.Alice_0 ? "A0" : " ", f.Alice_1 ? "A1" : " ", f.Alice_2 ? "A2" : " ", f.Alice_3 ? "A3" : " "); |
| 31 | + printf(" %5d %5d %5d %5d %5d %5d EC=%u\n", f.s00, f.s01, f.s02, f.s03, f.s04, f.s05, f.error); |
| 32 | + // Word 2 |
| 33 | + printf("%04x %08x %08x ", data[im][ic].w[2][2], data[im][ic].w[2][1], data[im][ic].w[2][0]); |
| 34 | + 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" : " "); |
| 35 | + printf(" %5d %5d %5d %5d %5d %5d\n", f.s06, f.s07, f.s08, f.s09, f.s10, f.s11); |
| 36 | + } else if (data[im][ic].f.fixed_0 == 0 && data[im][ic].f.fixed_1 == 0 && data[im][ic].f.fixed_2 == 0) { |
| 37 | + // Empty channel |
| 38 | + } else { |
| 39 | + // Wrong data format. Insert warning. |
| 40 | + } |
| 41 | + } |
| 42 | + } |
| 43 | +} |
| 44 | + |
| 45 | +//______________________________________________________________________________ |
| 46 | +void EventData::reset() |
| 47 | +{ |
| 48 | + static constexpr int payloadSize = NModules * NChPerModule * NWPerGBTW * sizeof(UInt_t); |
| 49 | + memset((void*)&data[0][0], 0, payloadSize); |
| 50 | +} |
0 commit comments