Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
1bedd81
Sync to head
cortesep Jan 13, 2021
f6cb19e
Merging
cortesep Feb 22, 2021
da160fb
Correct assignment of trigger bits in Digitizer.cxx
cortesep Feb 22, 2021
e0a1729
Cleanup
cortesep Feb 22, 2021
b9a1e6e
Correcting data type
cortesep Feb 23, 2021
0157327
Correcting assignment bug
cortesep Feb 23, 2021
45420be
Raw creation with new digits format
cortesep Feb 23, 2021
3cc485d
Clang format
cortesep Feb 23, 2021
4f720b8
Clang format
cortesep Feb 23, 2021
5e146ce
First raw 2 digit
cortesep Feb 25, 2021
dafeb54
Revert "First raw 2 digit"
cortesep Feb 25, 2021
b653204
First raw 2 digit
cortesep Feb 25, 2021
9dba341
First raw 2 digit
cortesep Feb 25, 2021
97cb370
Writing convert digits to file (first attempt)
cortesep Feb 25, 2021
f3530ae
Corrected consistency checks
cortesep Feb 25, 2021
3c2e6f7
Corrected IR
cortesep Feb 25, 2021
a516e4d
Clang format
cortesep Mar 1, 2021
64fce0d
Remove UInt_t
cortesep Mar 1, 2021
e112970
Remove Int_t
cortesep Mar 1, 2021
7eec83d
Remove Int_t
cortesep Mar 1, 2021
b75ddf4
Remove Double_t Float_t
cortesep Mar 1, 2021
fde5d01
Remove Float_t
cortesep Mar 1, 2021
1042c69
Remove root types
cortesep Mar 1, 2021
5f0b74c
Removing unused variable
cortesep Mar 1, 2021
211ff60
Correct typo
cortesep Mar 1, 2021
dbeb4a5
Renaming raw2digits workflow
cortesep Mar 1, 2021
5789bc6
Correcting conflicting option
cortesep Mar 1, 2021
62aa5dd
Correcting ref and updating printout
cortesep Mar 2, 2021
cbde199
Updating printout
cortesep Mar 2, 2021
ca9e501
Simplify inheritance
cortesep Mar 2, 2021
bd7474c
Simplify inheritance
cortesep Mar 2, 2021
b09cd72
Clang format
cortesep Mar 2, 2021
ed4a5a3
Simplify inheritance
cortesep Mar 2, 2021
4fae68b
Dump digits
cortesep Mar 2, 2021
3552ddd
Clang format
cortesep Mar 2, 2021
083360b
ccdb-url as command line option
cortesep Mar 2, 2021
bf783d9
fixes, eliminate unneeded ZDCWorkflow
shahor02 Mar 2, 2021
53d190f
call mRawReader.setModuleConfig amd setTriggerMask only once for thr …
shahor02 Mar 2, 2021
3ffa399
Move RawReaderZDC from workflow/ to raw/
shahor02 Mar 2, 2021
1a71d26
Merge pull request #5 from shahor02/fix_ZDCrs
cortesep Mar 3, 2021
1066ecc
Sync to head
cortesep Jan 13, 2021
f687b25
Correct assignment of trigger bits in Digitizer.cxx
cortesep Feb 22, 2021
53584de
Cleanup
cortesep Feb 22, 2021
2834e0f
Correcting data type
cortesep Feb 23, 2021
35267ea
Correcting assignment bug
cortesep Feb 23, 2021
884c471
Raw creation with new digits format
cortesep Feb 23, 2021
55ffc46
Clang format
cortesep Feb 23, 2021
00603f1
Clang format
cortesep Feb 23, 2021
e07b92a
First raw 2 digit
cortesep Feb 25, 2021
581c07f
Revert "First raw 2 digit"
cortesep Feb 25, 2021
2df75d2
First raw 2 digit
cortesep Feb 25, 2021
40a9f26
First raw 2 digit
cortesep Feb 25, 2021
335b419
Writing convert digits to file (first attempt)
cortesep Feb 25, 2021
f7c51d3
Corrected consistency checks
cortesep Feb 25, 2021
b436c0a
Corrected IR
cortesep Feb 25, 2021
1f4ee7c
Clang format
cortesep Mar 1, 2021
160c1bd
Remove UInt_t
cortesep Mar 1, 2021
0140b02
Remove Int_t
cortesep Mar 1, 2021
3ea1475
Remove Int_t
cortesep Mar 1, 2021
205ea6b
Remove Double_t Float_t
cortesep Mar 1, 2021
e7ed5c4
Remove Float_t
cortesep Mar 1, 2021
aeb256d
Remove root types
cortesep Mar 1, 2021
0223e9d
Removing unused variable
cortesep Mar 1, 2021
6756563
Correct typo
cortesep Mar 1, 2021
3605180
Renaming raw2digits workflow
cortesep Mar 1, 2021
38911c0
Correcting conflicting option
cortesep Mar 1, 2021
a80df2c
Correcting ref and updating printout
cortesep Mar 2, 2021
9508288
Updating printout
cortesep Mar 2, 2021
fe06e8b
Simplify inheritance
cortesep Mar 2, 2021
e433626
Simplify inheritance
cortesep Mar 2, 2021
0d26826
Clang format
cortesep Mar 2, 2021
d0ff070
Simplify inheritance
cortesep Mar 2, 2021
1ec2ec6
Dump digits
cortesep Mar 2, 2021
87dc200
Clang format
cortesep Mar 2, 2021
3860632
ccdb-url as command line option
cortesep Mar 2, 2021
b3f2de3
fixes, eliminate unneeded ZDCWorkflow
shahor02 Mar 2, 2021
9e9f402
call mRawReader.setModuleConfig amd setTriggerMask only once for thr …
shahor02 Mar 2, 2021
5971c9a
Move RawReaderZDC from workflow/ to raw/
shahor02 Mar 2, 2021
55440c0
Clang format
cortesep Mar 3, 2021
31ae8d0
Fixing conflicts
cortesep Mar 3, 2021
3840f40
Clang format
cortesep Mar 3, 2021
8024ec5
Clang format
cortesep Mar 3, 2021
ce1ec4b
Clang format
cortesep Mar 3, 2021
51b361f
By default remove empty orbits and bc that don't satisfy trigger cond…
cortesep Mar 3, 2021
8481abc
Mask of trigger bits during digitization to be coherent with HW + fixes
cortesep Mar 3, 2021
6796623
Clang format
cortesep Mar 3, 2021
dd0324a
Scaler data from raw to digits
cortesep Mar 3, 2021
81ce2a1
Scaler data during digitization (limited to triggering channels)
cortesep Mar 3, 2021
80cb413
Renaming class PedestalData to OrbitData
cortesep Mar 4, 2021
ffb47fe
Renaming ZDCDigitPed to ZDCDigitOrbit
cortesep Mar 4, 2021
5f394fb
Disable MC labels
cortesep Mar 4, 2021
091eb58
Clang format
cortesep Mar 4, 2021
d99f406
Corrected use of --disable-mc
cortesep Mar 4, 2021
696bf55
Correct formatting and one bug
cortesep Mar 4, 2021
2e7d409
Clang format
cortesep Mar 4, 2021
831d16f
Remove ZDCDigitWriterSpec
cortesep Mar 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DataFormats/Detectors/ZDC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

o2_add_library(DataFormatsZDC
SOURCES src/ChannelData.cxx src/BCData.cxx src/RecEvent.cxx src/RawEventData.cxx
src/OrbitRawData.cxx src/OrbitRecData.cxx src/PedestalData.cxx
src/OrbitRawData.cxx src/OrbitRecData.cxx src/OrbitData.cxx
src/CTF.cxx
PUBLIC_LINK_LIBRARIES O2::CommonConstants O2::CommonDataFormat
O2::ZDCBase ROOT::MathCore FairRoot::Base
Expand All @@ -20,6 +20,6 @@ o2_add_library(DataFormatsZDC
o2_target_root_dictionary(DataFormatsZDC
HEADERS include/DataFormatsZDC/Hit.h include/DataFormatsZDC/MCLabel.h
include/DataFormatsZDC/BCData.h include/DataFormatsZDC/ChannelData.h
include/DataFormatsZDC/PedestalData.h include/DataFormatsZDC/CTF.h
include/DataFormatsZDC/OrbitData.h include/DataFormatsZDC/CTF.h
include/DataFormatsZDC/RecEvent.h include/DataFormatsZDC/OrbitRawData.h
include/DataFormatsZDC/OrbitRecData.h include/DataFormatsZDC/RawEventData.h)
21 changes: 20 additions & 1 deletion DataFormats/Detectors/ZDC/include/DataFormatsZDC/BCData.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ namespace zdc
{
class ChannelData;

struct __attribute__((__packed__)) ModuleTriggerMap {
unsigned Alice_0 : 1;
unsigned Alice_1 : 1;
unsigned Alice_2 : 1;
unsigned Alice_3 : 1;
unsigned Auto_m : 1;
unsigned Auto_0 : 1;
unsigned Auto_1 : 1;
unsigned Auto_2 : 1;
unsigned Auto_3 : 1;
unsigned empty : 7;
};

union ModuleTriggerMapData {
uint16_t w;
struct ModuleTriggerMap f;
void reset();
};

struct BCData {
/// we are going to refer to at most 26 channels, so 5 bits for the NChannels and 27 for the reference
o2::dataformats::RangeRefComp<5> ref;
Expand All @@ -48,7 +67,7 @@ struct BCData {
}

gsl::span<const ChannelData> getBunchChannelData(const gsl::span<const ChannelData> tfdata) const;
void print() const;
void print(uint32_t triggerMask = 0, int diff = 0) const;

ClassDefNV(BCData, 2);
};
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/Detectors/ZDC/include/DataFormatsZDC/CTF.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "DetectorsCommonDataFormats/EncodedBlocks.h"
#include "DataFormatsZDC/ChannelData.h"
#include "DataFormatsZDC/BCData.h"
#include "DataFormatsZDC/PedestalData.h"
#include "DataFormatsZDC/OrbitData.h"

namespace o2
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ namespace o2
namespace zdc
{

struct PedestalData {
struct OrbitData {
o2::InteractionRecord ir;
std::array<int16_t, NChannels> data{};
std::array<uint16_t, NChannels> scaler{};

float asFloat(int i) const { return data[i] / 8.; }
void print() const;

ClassDefNV(PedestalData, 1);
ClassDefNV(OrbitData, 1);
};
} // namespace zdc
} // namespace o2
Expand Down
55 changes: 41 additions & 14 deletions DataFormats/Detectors/ZDC/src/BCData.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@

using namespace o2::zdc;

void BCData::print() const
void BCData::print(uint32_t triggerMask, int diff) const
{
printf("Orbit %9u bc %4u nch %2d pos %d\n", ir.orbit, ir.bc, ref.getEntries(), ref.getFirstEntry());
if (diff == 0) {
printf("Orbit %9u bc %4u nch %2d pos %d\n", ir.orbit, ir.bc, ref.getEntries(), ref.getFirstEntry());
} else {
printf("%9u.%04u ", ir.orbit, ir.bc);
}
printf("Read:");
for (int ic = 0; ic < NDigiChannels; ic++) {
if (ic % NChPerModule == 0) {
Expand All @@ -32,16 +36,11 @@ void BCData::print() const
printf(" ");
}
}
printf("]\nTrigs:");
for (int i = 0; i < NChannels; i++) {
std::bitset<10> bb(moduleTriggers[i]);
printf("[%2d: %s]", i, bb.to_string().c_str());
if (i % (NChannels / 3) == 0 && i) {
printf("\n");
}
printf("]\n");
if (diff) {
printf("%9u.%04u ", ir.orbit, ir.bc);
}

printf("]\nHits:");
printf("Hits:");
for (int ic = 0; ic < NDigiChannels; ic++) {
if (ic % NChPerModule == 0) {
if (ic == 0) {
Expand All @@ -50,13 +49,41 @@ void BCData::print() const
printf("] %d[", ic / NChPerModule);
}
}
if (triggers & (0x1 << ic)) {
printf("H");
bool is_hit = triggers & (0x1 << ic);
bool is_trig = triggerMask & (0x1 << ic);
if (is_trig) {
if (is_hit) {
printf("T");
} else {
printf(".");
}
} else {
printf(" ");
if (is_hit) {
printf("H");
} else {
printf(" ");
}
}
}
printf("]\n");
if (diff) {
printf("%9u.%04u ", ir.orbit, ir.bc);
}
printf("AUTO:");
for (int i = 0; i < NModules; i++) {
std::bitset<10> bb(moduleTriggers[i]);
printf(" %d %s%s%s%s%s", i, bb[8] ? "3" : "-", bb[7] ? "2" : "-", bb[6] ? "1" : "-", bb[5] ? "0" : "-", bb[4] ? "M" : "-");
}
printf("\n");
if (diff) {
printf("%9u.%04u ", ir.orbit, ir.bc);
}
printf("ALIT:");
for (int i = 0; i < NModules; i++) {
std::bitset<10> bb(moduleTriggers[i]);
printf(" %d %s%s%s%s ", i, bb[3] ? "3" : "-", bb[2] ? "2" : "-", bb[1] ? "1" : "-", bb[0] ? "0" : "-");
}
printf("\n");
}

gsl::span<const ChannelData> BCData::getBunchChannelData(const gsl::span<const ChannelData> tfdata) const
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/Detectors/ZDC/src/DataFormatsZDCLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

#pragma link C++ class o2::zdc::ChannelData + ;
#pragma link C++ class o2::zdc::BCData + ;
#pragma link C++ class o2::zdc::PedestalData + ;
#pragma link C++ class o2::zdc::OrbitData + ;
#pragma link C++ class std::vector < o2::zdc::ChannelData> + ;
#pragma link C++ class std::vector < o2::zdc::BCData> + ;
#pragma link C++ class std::vector < o2::zdc::PedestalData> + ;
#pragma link C++ class std::vector < o2::zdc::OrbitData> + ;

#pragma link C++ class std::vector < o2::zdc::RecEvent> + ;
#pragma link C++ class std::vector < o2::zdc::OrbitRawData> + ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include "DataFormatsZDC/PedestalData.h"
#include "DataFormatsZDC/OrbitData.h"
#include "ZDCBase/Constants.h"

using namespace o2::zdc;

void PedestalData::print() const
void OrbitData::print() const
{
printf("Orbit %9u bc %4u\n", ir.orbit, ir.bc);
for (int i = 0; i < NChannels; i++) {
printf("channel %2d : %9.3f\n", i, asFloat(i));
printf("%2d %s: %9.3f cnt: %4u\n", i, ChannelNames[i].data(), asFloat(i), scaler[i]);
}
}
10 changes: 5 additions & 5 deletions Detectors/CTF/test/test_ctf_io_zdc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ BOOST_AUTO_TEST_CASE(CTFTest)
{
std::vector<BCData> bcdata;
std::vector<ChannelData> chandata;
std::vector<PedestalData> pedsdata;
std::vector<OrbitData> pedsdata;
// RS: don't understand why, but this library is not loaded automatically, although the dependencies are clearly
// indicated. What it more weird is that for similar tests of other detectors the library is loaded!
// Absence of the library leads to complains about the StreamerInfo and eventually segm.faul when appending the
Expand Down Expand Up @@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE(CTFTest)
}
}

// PedestalData
// OrbitData
const auto &irFirst = bcdata.front().ir, irLast = bcdata.back().ir;
o2::InteractionRecord irPed(o2::constants::lhc::LHCMaxBunches - 1, irFirst.orbit);
int norbits = irLast.orbit - irFirst.orbit + 1;
Expand Down Expand Up @@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE(CTFTest)

std::vector<BCData> bcdataD;
std::vector<ChannelData> chandataD;
std::vector<PedestalData> pedsdataD;
std::vector<OrbitData> pedsdataD;

sw.Start();
const auto ctfImage = o2::zdc::CTF::getImage(vec.data());
Expand Down Expand Up @@ -153,12 +153,12 @@ BOOST_AUTO_TEST_CASE(CTFTest)
BOOST_CHECK(cmpChData);
}

LOG(INFO) << "Testing PedestalData: BOOST_CHECK(pedsdataD.size() " << pedsdataD.size() << " pedsdata.size()) " << pedsdata.size();
LOG(INFO) << "Testing OrbitData: BOOST_CHECK(pedsdataD.size() " << pedsdataD.size() << " pedsdata.size()) " << pedsdata.size();
BOOST_CHECK(pedsdataD.size() == pedsdata.size());
for (size_t i = 0; i < pedsdata.size(); i++) {
bool cmpPdData = pedsdata[i].ir == pedsdataD[i].ir && pedsdata[i].data == pedsdataD[i].data;
if (!cmpPdData) {
LOG(ERROR) << "Mismatch in PedestalData " << i;
LOG(ERROR) << "Mismatch in OrbitData " << i;
pedsdata[i].print();
pedsdataD[i].print();
}
Expand Down
6 changes: 3 additions & 3 deletions Detectors/ZDC/base/include/ZDCBase/Geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class Geometry
static constexpr double ZEMPOSITION[3] = {9.69, 0., 760.};

private:
static Int_t getDetector(const Int_t det);
static Int_t getSector(const Int_t tow);
static Int_t getVolumeId(const Int_t* vol);
static int32_t getDetector(const int32_t det);
static int32_t getSector(const int32_t tow);
static int32_t getVolumeId(const int32_t* vol);

ClassDefNV(Geometry, 1);
};
Expand Down
5 changes: 3 additions & 2 deletions Detectors/ZDC/raw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
# submit itself to any jurisdiction.

o2_add_library(ZDCRaw
SOURCES src/DumpRaw.cxx src/raw-parser.cxx
SOURCES src/DumpRaw.cxx
src/raw-parser.cxx
src/RawReaderZDC.cxx
PUBLIC_LINK_LIBRARIES O2::SimulationDataFormat O2::ZDCBase O2::ZDCSimulation
O2::DataFormatsZDC O2::CCDB O2::SimConfig O2::DPLUtils
O2::DetectorsRaw O2::Headers)
Expand All @@ -28,4 +30,3 @@ o2_add_executable(raw-parser
O2::DetectorsRaw
O2::DetectorsCommonDataFormats
O2::CommonUtils)

2 changes: 1 addition & 1 deletion Detectors/ZDC/raw/include/ZDCRaw/DumpRaw.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DumpRaw
void init();
int process(const EventData& ev);
int process(const EventChData& ch);
int processWord(const UInt_t* word);
int processWord(const uint32_t* word);
int getHPos(uint32_t board, uint32_t ch);
void write();
void setVerbosity(int v)
Expand Down
94 changes: 94 additions & 0 deletions Detectors/ZDC/raw/include/ZDCRaw/RawReaderZDC.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
//
//file RawReaderZDC.h class for RAW data reading

#ifndef ALICEO2_RAWREADERZDC_H_
#define ALICEO2_RAWREADERZDC_H_
#include <iostream>
#include <vector>
#include <Rtypes.h>
#include <CommonDataFormat/InteractionRecord.h>
#include <Framework/Logger.h>
#include "Headers/RAWDataHeader.h"
#include "DataFormatsZDC/RawEventData.h"
#include "DataFormatsZDC/ChannelData.h"
#include "DataFormatsZDC/BCData.h"
#include "DataFormatsZDC/OrbitData.h"
#include "ZDCSimulation/Digits2Raw.h"
#include "ZDCBase/ModuleConfig.h"
#include "Framework/ProcessingContext.h"
#include "Framework/DataAllocator.h"
#include "Framework/OutputSpec.h"
#include "Framework/Lifetime.h"
#include <gsl/span>

namespace o2
{
namespace zdc
{
class RawReaderZDC
{
public:
RawReaderZDC(bool dumpData) : mDumpData(dumpData) {}
RawReaderZDC(const RawReaderZDC&) = default;

RawReaderZDC() = default;
~RawReaderZDC() = default;

std::map<InteractionRecord, EventData> mMapData; /// Raw data cache
const ModuleConfig* mModuleConfig = nullptr; /// Trigger/readout configuration object
void setModuleConfig(const ModuleConfig* moduleConfig) { mModuleConfig = moduleConfig; };
const ModuleConfig* getModuleConfig() { return mModuleConfig; };
uint32_t mTriggerMask = 0; // Trigger mask from ModuleConfig
void setTriggerMask();

bool mVerifyTrigger = true; // Verify trigger condition during conversion to digits

std::vector<o2::zdc::BCData> mDigitsBC;
std::vector<o2::zdc::ChannelData> mDigitsCh;
std::vector<o2::zdc::OrbitData> mOrbitData;

void clear();

//decoding binary data into data blocks
void processBinaryData(gsl::span<const uint8_t> payload, int linkID); //processing data blocks into digits
int processWord(const uint32_t* word);
EventChData mCh; // Channel data to be decoded
void process(const EventChData& ch);

void accumulateDigits()
{
getDigits(mDigitsBC, mDigitsCh, mOrbitData);
LOG(INFO) << "Number of Digits: " << mDigitsBC.size();
LOG(INFO) << "Number of ChannelData: " << mDigitsCh.size();
LOG(INFO) << "Number of OrbitData: " << mOrbitData.size();
}

int getDigits(std::vector<BCData>& digitsBC, std::vector<ChannelData>& digitsCh, std::vector<OrbitData>& orbitData);

static void prepareOutputSpec(std::vector<o2::framework::OutputSpec>& outputSpec)
{
outputSpec.emplace_back("ZDC", "DIGITSBC", 0, o2::framework::Lifetime::Timeframe);
outputSpec.emplace_back("ZDC", "DIGITSCH", 0, o2::framework::Lifetime::Timeframe);
outputSpec.emplace_back("ZDC", "DIGITSPD", 0, o2::framework::Lifetime::Timeframe);
}
void makeSnapshot(o2::framework::ProcessingContext& pc)
{
pc.outputs().snapshot(o2::framework::Output{o2::header::gDataOriginZDC, "DIGITSBC", 0, o2::framework::Lifetime::Timeframe}, mDigitsBC);
pc.outputs().snapshot(o2::framework::Output{o2::header::gDataOriginZDC, "DIGITSCH", 0, o2::framework::Lifetime::Timeframe}, mDigitsCh);
pc.outputs().snapshot(o2::framework::Output{o2::header::gDataOriginZDC, "DIGITSPD", 0, o2::framework::Lifetime::Timeframe}, mOrbitData);
}
bool mDumpData;
};
} // namespace zdc
} // namespace o2

#endif
Loading