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
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,21 @@ class LookUpTable
ClassDefNV(LookUpTable, 2);
};

//Singleton for LookUpTable
class SingleLUT : public LookUpTable
{
private:
SingleLUT() : LookUpTable(LookUpTable::readTable()) {}
SingleLUT(const SingleLUT&) = delete;
SingleLUT& operator=(SingleLUT&) = delete;

public:
static SingleLUT& Instance()
{
static SingleLUT instanceLUT;
return instanceLUT;
}
};
} // namespace ft0
} // namespace o2
#endif
7 changes: 2 additions & 5 deletions Detectors/FIT/FT0/raw/include/FT0Raw/DigitBlockFT0.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,14 @@ class DigitBlockFT0 : public DigitBlockBase<DigitBlockFT0>
void setIntRec(o2::InteractionRecord intRec) { mDigit.mIntRecord = intRec; }
Digit mDigit;
std::vector<ChannelData> mVecChannelData;
static o2::ft0::LookUpTable sLookupTable;
static int sEventID;

template <class DataBlockType>
void processDigits(DataBlockType& dataBlock, int linkID)
{
if constexpr (std::is_same<DataBlockType, DataBlockPM>::value) { //Filling data from PM
for (int iEventData = 0; iEventData < dataBlock.DataBlockWrapper<RawDataPM>::mNelements; iEventData++) {
mVecChannelData.emplace_back(uint8_t(sLookupTable.getChannel(linkID, dataBlock.DataBlockWrapper<RawDataPM>::mData[iEventData].channelID)),
mVecChannelData.emplace_back(uint8_t(o2::ft0::SingleLUT::Instance().getChannel(linkID, dataBlock.DataBlockWrapper<RawDataPM>::mData[iEventData].channelID)),
int(dataBlock.DataBlockWrapper<RawDataPM>::mData[iEventData].time),
int(dataBlock.DataBlockWrapper<RawDataPM>::mData[iEventData].charge),
dataBlock.DataBlockWrapper<RawDataPM>::mData[iEventData].getFlagWord());
Expand Down Expand Up @@ -141,16 +140,14 @@ class DigitBlockFT0ext : public DigitBlockBase<DigitBlockFT0ext>
DigitExt mDigit;
std::vector<ChannelData> mVecChannelData;
std::vector<TriggersExt> mVecTriggersExt;

static o2::ft0::LookUpTable sLookupTable;
static int sEventID;

template <class DataBlockType>
void processDigits(DataBlockType& dataBlock, int linkID)
{
if constexpr (std::is_same<DataBlockType, DataBlockPM>::value) { //Filling data from PM
for (int iEventData = 0; iEventData < dataBlock.DataBlockWrapper<RawDataPM>::mNelements; iEventData++) {
mVecChannelData.emplace_back(uint8_t(sLookupTable.getChannel(linkID, dataBlock.DataBlockWrapper<RawDataPM>::mData[iEventData].channelID)),
mVecChannelData.emplace_back(uint8_t(o2::ft0::SingleLUT::Instance().getChannel(linkID, dataBlock.DataBlockWrapper<RawDataPM>::mData[iEventData].channelID)),
int(dataBlock.DataBlockWrapper<RawDataPM>::mData[iEventData].time),
int(dataBlock.DataBlockWrapper<RawDataPM>::mData[iEventData].charge),
dataBlock.DataBlockWrapper<RawDataPM>::mData[iEventData].getFlagWord());
Expand Down
2 changes: 0 additions & 2 deletions Detectors/FIT/FT0/raw/src/DigitBlockFT0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@
using namespace o2::ft0;

int DigitBlockFT0::sEventID = 0;
o2::ft0::LookUpTable DigitBlockFT0::sLookupTable = o2::ft0::LookUpTable::readTable();
int DigitBlockFT0ext::sEventID = 0;
o2::ft0::LookUpTable DigitBlockFT0ext::sLookupTable = o2::ft0::LookUpTable::readTable();