Skip to content

Commit fcffd99

Browse files
authored
ZDC Workflow to inspect raw data (#5092)
* Moving raw-parser.cxx * Simple checks on raw data * Missing file * Plot appearance * clang-format * clang-format * Correct return values * Corrections after code review * clang-format
1 parent 9cb10c0 commit fcffd99

File tree

13 files changed

+372
-11
lines changed

13 files changed

+372
-11
lines changed

DataFormats/Detectors/ZDC/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# submit itself to any jurisdiction.
1010

1111
o2_add_library(DataFormatsZDC
12-
SOURCES src/ChannelData.cxx src/BCData.cxx src/RecEvent.cxx
12+
SOURCES src/ChannelData.cxx src/BCData.cxx src/RecEvent.cxx src/RawEventData.cxx
1313
src/OrbitRawData.cxx src/OrbitRecData.cxx
1414
PUBLIC_LINK_LIBRARIES O2::CommonConstants O2::CommonDataFormat
1515
O2::ZDCBase ROOT::MathCore FairRoot::Base
@@ -18,4 +18,4 @@ o2_add_library(DataFormatsZDC
1818
o2_target_root_dictionary(DataFormatsZDC
1919
HEADERS include/DataFormatsZDC/BCData.h include/DataFormatsZDC/ChannelData.h
2020
include/DataFormatsZDC/RecEvent.h include/DataFormatsZDC/OrbitRawData.h
21-
include/DataFormatsZDC/OrbitRecData.h)
21+
include/DataFormatsZDC/OrbitRecData.h include/DataFormatsZDC/RawEventData.h)

DataFormats/Detectors/ZDC/include/DataFormatsZDC/RawEventData.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ namespace zdc
3131
constexpr unsigned short Id_w0 = 0x0;
3232
constexpr unsigned short Id_w1 = 0x1;
3333
constexpr unsigned short Id_w2 = 0x2;
34+
constexpr unsigned short Id_wn = 0x3;
3435
constexpr int NWPerGBTW = 4;
3536

3637
struct __attribute__((__packed__)) ChannelDataV0 {
@@ -79,11 +80,14 @@ struct __attribute__((__packed__)) ChannelDataV0 {
7980
unsigned empty_5 : 32;
8081
};
8182

83+
union EventChData {
84+
UInt_t w[NWPerBc][NWPerGBTW];
85+
struct ChannelDataV0 f;
86+
void reset();
87+
};
88+
8289
struct EventData {
83-
union {
84-
UInt_t w[NWPerBc][NWPerGBTW];
85-
struct ChannelDataV0 f;
86-
} data[NModules][NChPerModule] = {0};
90+
EventChData data[NModules][NChPerModule] = {0};
8791
void print() const;
8892
void reset();
8993
ClassDefNV(EventData, 1);

DataFormats/Detectors/ZDC/src/RawEventData.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ using namespace o2::zdc;
1414

1515
//ClassImp(EventData);
1616

17+
//______________________________________________________________________________
18+
void EventChData::reset()
19+
{
20+
static constexpr int payloadSize = NWPerGBTW * sizeof(UInt_t);
21+
memset((void*)&w[0][0], 0, payloadSize);
22+
}
23+
1724
//______________________________________________________________________________
1825
void EventData::print() const
1926
{

Detectors/ZDC/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
add_subdirectory(base)
1212
add_subdirectory(simulation)
1313
add_subdirectory(macro)
14+
add_subdirectory(raw)

Detectors/ZDC/base/src/ModuleConfig.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
using namespace o2::zdc;
1616

17+
//______________________________________________________________________________
1718
void Module::printCh() const
1819
{
1920
printf("Module %d [ChID/FEEID R:T ]", id);
@@ -23,6 +24,7 @@ void Module::printCh() const
2324
printf("\n");
2425
}
2526

27+
//______________________________________________________________________________
2628
void Module::printTrig() const
2729
{
2830
printf("Trigger conf %d: ", id);
@@ -37,6 +39,7 @@ void Module::printTrig() const
3739
printf("\n");
3840
}
3941

42+
//______________________________________________________________________________
4043
void Module::print() const
4144
{
4245
printCh();
@@ -58,13 +61,15 @@ void ModuleConfig::print() const
5861
}
5962
}
6063

64+
//______________________________________________________________________________
6165
void ModuleConfig::check() const
6266
{
6367
for (const auto& md : modules) {
6468
md.check();
6569
}
6670
}
6771

72+
//______________________________________________________________________________
6873
void Module::check() const
6974
{
7075
// make sure that the channel has <= 2 triggers
@@ -78,6 +83,7 @@ void Module::check() const
7883
}
7984
}
8085

86+
//______________________________________________________________________________
8187
void Module::setChannel(int slot, int8_t chID, int16_t fID, bool read, bool trig, int tF, int tL, int tS, int tT)
8288
{
8389
if (slot < 0 || slot >= MaxChannels || chID < 0 || chID > NChannels) {

Detectors/ZDC/raw/CMakeLists.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright CERN and copyright holders of ALICE O2. This software is distributed
2+
# under the terms of the GNU General Public License v3 (GPL Version 3), copied
3+
# 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 or
9+
# submit itself to any jurisdiction.
10+
11+
o2_add_library(ZDCRaw
12+
SOURCES src/DumpRaw.cxx src/raw-parser.cxx
13+
PUBLIC_LINK_LIBRARIES O2::SimulationDataFormat O2::ZDCBase O2::ZDCSimulation
14+
O2::DataFormatsZDC O2::CCDB O2::SimConfig O2::DPLUtils
15+
O2::DetectorsRaw O2::Headers)
16+
17+
18+
o2_target_root_dictionary(ZDCRaw
19+
HEADERS include/ZDCRaw/DumpRaw.h)
20+
21+
o2_add_executable(raw-parser
22+
COMPONENT_NAME zdc
23+
SOURCES src/raw-parser.cxx
24+
PUBLIC_LINK_LIBRARIES O2::Framework
25+
O2::DPLUtils
26+
O2::ZDCSimulation
27+
O2::ZDCRaw
28+
O2::DetectorsRaw
29+
O2::DetectorsCommonDataFormats
30+
O2::CommonUtils)
31+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#include <TH1.h>
2+
#include <TH2.h>
3+
#include "ZDCBase/Constants.h"
4+
#include "ZDCSimulation/ZDCSimParam.h"
5+
#include "DataFormatsZDC/RawEventData.h"
6+
#ifndef ALICEO2_ZDC_DUMPRAW_H_
7+
#define ALICEO2_ZDC_DUMPRAW_H_
8+
namespace o2
9+
{
10+
namespace zdc
11+
{
12+
class DumpRaw
13+
{
14+
public:
15+
DumpRaw() = default;
16+
void init();
17+
int process(const EventData& ev);
18+
int process(const EventChData& ch);
19+
int processWord(const UInt_t* word);
20+
int getHPos(uint32_t board, uint32_t ch);
21+
void write();
22+
void setVerbosity(int v)
23+
{
24+
mVerbosity = v;
25+
}
26+
int getVerbosity() const { return mVerbosity; }
27+
28+
private:
29+
void setStat(TH1* h);
30+
int mVerbosity = 1;
31+
TH1* mBaseline[NDigiChannels] = {0};
32+
TH1* mCounts[NDigiChannels] = {0};
33+
TH2* mSignal[NDigiChannels] = {0};
34+
TH2* mBunch[NDigiChannels] = {0};
35+
EventChData mCh;
36+
};
37+
} // namespace zdc
38+
} // namespace o2
39+
40+
#endif

0 commit comments

Comments
 (0)