21#ifndef CbmRichUnpackAlgoBase_H
22#define CbmRichUnpackAlgoBase_H
25#include "CbmRecoUnpackAlgo.tmpl"
28#include "Timeslice.hpp"
31#include <RtypesCore.h>
69 std::stringstream stream;
71 <<
" edge:" << ((
fEdge == 1) ?
"R" :
"F");
82 uint32_t tdcTimeDataMarker = (tdcWord >> 31) & 0x1;
83 uint32_t tdcMarker = (tdcWord >> 29) & 0x7;
85 if (tdcTimeDataMarker == 0x1) {
87 if (tdcMarker == 0x4 || tdcMarker == 0x5) {
105 outData.
fCoarse =
static_cast<uint32_t
>(tdcWord & 0x7ff);
106 outData.
fEdge =
static_cast<uint32_t
>((tdcWord >> 11) & 0x1);
107 outData.
fFine =
static_cast<uint32_t
>((tdcWord >> 12) & 0x3ff);
108 outData.
fChannel =
static_cast<uint32_t
>((tdcWord >> 22) & 0x7f);
111 static uint32_t
ProcessEpoch(uint32_t tdcWord) {
return static_cast<uint32_t
>(tdcWord & 0xfffffff); }
116 return static_cast<uint16_t
>(tdcWord & 0xff);
122 return static_cast<uint16_t
>(tdcWord & 0xffff);
127 LOG(debug4) <<
"ProcessDebug is not implemented. tdcWord:0x" << std::hex << tdcWord << std::dec;
162 std::stringstream stream;
163 stream <<
"0x" << std::setfill(
'0') << std::setw(
sizeof(uint32_t) * 2) << std::hex << word;
173 i = (i >> 24) | ((i << 8) & 0x00FF0000) | ((i >> 8) & 0x0000FF00) | (i << 24);
186 if (nextWord == 0xffffffff)
return true;
192 uint32_t i = ((uint32_t*) (
fData +
fOffset + 4 * subSubEventSize))[0];
193 i = (i >> 24) | ((i << 8) & 0x00ff0000) | ((i >> 8) & 0x0000ff00) | (i << 24);
194 if (i == 0x00015555)
return true;
222 virtual std::vector<std::pair<std::string, std::shared_ptr<FairParGenericSet>>>*
236 double calculateTime(uint32_t epoch, uint32_t coarse, uint32_t fine);
244 std::cout <<
"Finish Monitor" << std::endl;
251 std::shared_ptr<CbmRichUnpackMonitor>
fMonitor =
nullptr;
262 return ((fpgaID << 16) | (ch & 0x00FF));
CbmRichUnpackAlgoErrorType
CbmRichUnpackAlgoTdcWordType
Monitoring historgrams class for Rich unpacker.
static constexpr size_t size()
CbmRichUnpackAlgoBase(std::string name)
Create the Cbm Trd Unpack AlgoBase object.
bool checkMaskedDiRICH(Int_t subSubEventId)
Unpack a given microslice. To be implemented in the derived unpacker algos.
CbmMcbm2018RichPar fUnpackPar
Parameters for the unpacking.
bool setDerivedTsParameters(size_t)
Set the Derived Ts Parameters.
void SetMonitor(std::shared_ptr< CbmRichUnpackMonitor > monitor)
Set a predefined monitor.
double calculateTime(uint32_t epoch, uint32_t coarse, uint32_t fine)
Int_t getPixelUID(Int_t fpgaID, Int_t ch) const
std::shared_ptr< CbmRichUnpackMonitor > fMonitor
Potential (online) monitor for the unpacking process.
void DoTotOffsetCorrection(Bool_t activate=true)
(De-) Activate Tot offset correction of digis
virtual std::vector< std::pair< std::string, std::shared_ptr< FairParGenericSet > > > * GetParContainerRequest(std::string geoTag, std::uint32_t runId)
Get the requested parameter containers. To be defined in the derived classes! Return the required par...
std::string getLogHeader(CbmRichUnpackAlgoMicrosliceReader &reader)
Bool_t initParSet(FairParGenericSet *parset)
Handles the distribution of the hidden derived classes to their explicit functions.
Bool_t init()
Intialisation at begin of run. Special inits of the derived algos.
std::vector< Int_t > * fMaskedDiRICHes
CbmRichUnpackAlgoBase(const CbmRichUnpackAlgoBase &)=delete
Copy constructor - not implemented.
void SetMaskedDiRICHes(std::vector< Int_t > *maskedDiRICHes)
Set Addresses of DiRICH boards to be masked.
void finish()
Finish function for this algorithm base clase.
virtual ~CbmRichUnpackAlgoBase()
Destroy the Cbm Trd Unpack Task object.
virtual void finishDerived()
Function that allows special calls during Finish in the derived algos.
CbmRichUnpackAlgoBase & operator=(const CbmRichUnpackAlgoBase &)=delete
Assignment operator - not implemented.
std::string GetWordAsHexString(uint32_t word)
const uint8_t * GetData()
bool IsLastSubSubEvent(uint32_t subSubEventSize)
void SetData(const uint8_t *data, size_t size)
static CbmRichUnpackAlgoTdcWordType GetTdcWordType(uint32_t tdcWord)
static uint16_t ProcessTrailer(uint32_t tdcWord)
static void ProcessDebug(uint32_t tdcWord)
static uint16_t ProcessHeader(uint32_t tdcWord)
static void ProcessTimeData(uint32_t tdcWord, CbmRichUnpackAlgoTdcTimeData &outData)
static uint32_t ProcessEpoch(uint32_t tdcWord)