Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Detectors/EMCAL/base/src/EMCALBaseLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#pragma link C++ class o2::emcal::Geometry + ;
#pragma link C++ class o2::emcal::Mapper + ;
#pragma link C++ class o2::emcal::MappingHandler + ;
#pragma link C++ class o2::emcal::RCUTrailer + ;

#pragma link C++ class o2::emcal::ClusterFactory < o2::emcal::Cell> + ;
#pragma link C++ class o2::emcal::ClusterFactory < o2::emcal::Digit> + ;
Expand Down
8 changes: 5 additions & 3 deletions Detectors/EMCAL/base/src/RCUTrailer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ void RCUTrailer::reset()
void RCUTrailer::constructFromRawPayload(const gsl::span<const uint32_t> payloadwords)
{
reset();
int index = payloadwords.size() - 1;
auto word = payloadwords[index];
int index = payloadwords.size();
auto word = payloadwords[--index];
if ((word >> 30) != 3)
throw Error(Error::ErrorType_t::DECODING_INVALID, "Last RCU trailer word not found!");
mFirmwareVersion = (word >> 16) & 0xFF;
Expand All @@ -49,6 +49,7 @@ void RCUTrailer::constructFromRawPayload(const gsl::span<const uint32_t> payload
throw Error(Error::ErrorType_t::SIZE_INVALID, fmt::format("Invalid trailer size found (%d bytes) !", trailerSize * 4).data());
mTrailerSize = trailerSize;

trailerSize -= 2; // Cut first and last trailer words as they are handled separately
for (; trailerSize > 0; trailerSize--) {
word = payloadwords[--index];
if ((word >> 30) != 2) {
Expand Down Expand Up @@ -153,6 +154,7 @@ void RCUTrailer::setL1Phase(double l1phase)
std::vector<uint32_t> RCUTrailer::encode() const
{
std::vector<uint32_t> encoded;
encoded.emplace_back(mPayloadSize);
encoded.emplace_back(mAltroCFG2 | 7 << 26);
encoded.emplace_back(mAltroCFG1 | 6 << 26);
encoded.emplace_back(mActiveFECsB | 5 << 26);
Expand All @@ -161,7 +163,7 @@ std::vector<uint32_t> RCUTrailer::encode() const
encoded.emplace_back(mERRREG2 | 2 << 26);
encoded.emplace_back(mFECERRB >> 7 | (mFECERRA >> 7) << 13 | 1 << 26);

uint32_t lasttrailerword = 3 << 30 | mFirmwareVersion << 16 | mRCUId << 7 | encoded.size();
uint32_t lasttrailerword = 3 << 30 | mFirmwareVersion << 16 | mRCUId << 7 | (encoded.size() + 1);
encoded.emplace_back(lasttrailerword);

return encoded;
Expand Down
9 changes: 3 additions & 6 deletions Detectors/EMCAL/reconstruction/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
# submit itself to any jurisdiction.

o2_add_library(EMCALReconstruction
SOURCES src/RawReaderFile.cxx
src/RawReaderMemory.cxx
SOURCES src/RawReaderMemory.cxx
src/RawBuffer.cxx
src/RawHeaderStream.cxx
src/RAWDataHeader.cxx
src/RawPayload.cxx
src/AltroDecoder.cxx
src/Bunch.cxx
Expand All @@ -30,17 +28,16 @@ o2_add_library(EMCALReconstruction
AliceO2::InfoLogger
O2::DataFormatsEMCAL
O2::DetectorsBase
O2::DetectorsRaw
O2::EMCALBase)

o2_target_root_dictionary(
EMCALReconstruction
HEADERS include/EMCALReconstruction/RawReaderFile.h
include/EMCALReconstruction/RawReaderMemory.h
HEADERS include/EMCALReconstruction/RawReaderMemory.h
include/EMCALReconstruction/AltroDecoder.h
include/EMCALReconstruction/RawPayload.h
include/EMCALReconstruction/Bunch.h
include/EMCALReconstruction/Channel.h
include/EMCALReconstruction/RAWDataHeader.h
include/EMCALReconstruction/CaloFitResults.h
include/EMCALReconstruction/CaloRawFitter.h
include/EMCALReconstruction/CaloRawFitterStandard.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@
#include "EMCALBase/RCUTrailer.h"
#include "EMCALReconstruction/Bunch.h"
#include "EMCALReconstruction/Channel.h"

// for template specification
#include "EMCALReconstruction/RawReaderFile.h"
#include "EMCALReconstruction/RawReaderMemory.h"
#include "EMCALReconstruction/RAWDataHeader.h"
#include "Headers/RAWDataHeader.h"

namespace o2
{
Expand Down Expand Up @@ -84,13 +79,13 @@ class AltroDecoderError : public std::exception
/// the payload, altro header and RCU trailer contents.
///
/// Based on AliAltroRawStreamV3 and AliCaloRawStreamV3 by C. Cheshkov
template <class RawReader>

class AltroDecoder
{
public:
/// \brief Constructor
/// \param reader Raw reader instance to be decoded
AltroDecoder(RawReader& reader);
AltroDecoder(RawReaderMemory& reader);

/// \brief Destructor
~AltroDecoder() = default;
Expand Down Expand Up @@ -130,20 +125,14 @@ class AltroDecoder
/// In case of failure an exception is thrown.
void checkRCUTrailer();

RawReader& mRawReader; ///< underlying raw reader
RawReaderMemory& mRawReader; ///< underlying raw reader
RCUTrailer mRCUTrailer; ///< RCU trailer
std::vector<Channel> mChannels; ///< vector of channels in the raw stream
bool mChannelsInitialized = false; ///< check whether the channels are initialized

ClassDefNV(AltroDecoder, 1);
};

// template specifications
using AltroDecoderMemoryRDHvE = AltroDecoder<RawReaderMemory<o2::emcal::RAWDataHeader>>;
using AltroDecoderMemoryRDHv4 = AltroDecoder<RawReaderMemory<o2::header::RAWDataHeaderV4>>;
using AltroDecoderFileRDHvE = AltroDecoder<RawReaderFile<o2::emcal::RAWDataHeader>>;
using AltroDecoderFileRDHv4 = AltroDecoder<RawReaderFile<o2::header::RAWDataHeaderV4>>;

} // namespace emcal

} // namespace o2
Expand Down

This file was deleted.

This file was deleted.

Loading