From 5e5fcebb122c24dff116236827fdae208f72d306 Mon Sep 17 00:00:00 2001 From: Alexandru Bercuci <abercuci@niham.nipne.ro> Date: Wed, 16 Feb 2022 11:07:41 +0200 Subject: [PATCH] fix Trd2d FEE to GEO mapping --- core/detectors/trd/CbmTrdParFasp.cxx | 21 ++- core/detectors/trd/CbmTrdParFasp.h | 13 +- macro/run/run_unpack_tsa.C | 2 +- .../trd/unpack/CbmTrdUnpackAlgoFasp2D.cxx | 165 ++++++++++-------- .../trd/unpack/CbmTrdUnpackAlgoFasp2D.h | 13 +- .../trd/unpack/CbmTrdUnpackConfigFasp2D.cxx | 24 ++- .../trd/unpack/CbmTrdUnpackConfigFasp2D.h | 16 +- 7 files changed, 158 insertions(+), 96 deletions(-) diff --git a/core/detectors/trd/CbmTrdParFasp.cxx b/core/detectors/trd/CbmTrdParFasp.cxx index 4844b1241b..ec4cef4048 100644 --- a/core/detectors/trd/CbmTrdParFasp.cxx +++ b/core/detectors/trd/CbmTrdParFasp.cxx @@ -24,20 +24,29 @@ CbmTrdParFasp::CbmTrdParFasp(Int_t address, Int_t FebGrouping, Double_t x, Doubl } //___________________________________________________________________ -const CbmTrdParFaspChannel* CbmTrdParFasp::GetChannel(Int_t address, UChar_t pairing) const +const CbmTrdParFaspChannel* CbmTrdParFasp::GetChannel(Int_t pad_address, UChar_t pairing) const { - Int_t id = QueryChannel(2 * address + pairing); + Int_t id = QueryChannel(2 * pad_address + pairing); if (id < 0) return nullptr; return &fCalib[id]; } +//___________________________________________________________________ +const CbmTrdParFaspChannel* CbmTrdParFasp::GetChannel(Int_t ch_address) const +{ + if (ch_address < 0 || ch_address >= NFASPCH) return nullptr; + return &fCalib[ch_address]; +} + //___________________________________________________________________ void CbmTrdParFasp::LoadParams(FairParamList* l) { + printf("CbmTrdParFasp::LoadParams(FairParamList*)\n"); TArrayI value(NFASPCH); if (l->fill(Form("%dCHS", fAddress), &value)) { for (Int_t ich(0); ich < NFASPCH; ich++) { Int_t pair = ich % 2; + printf(" ch[%2d] pair[%d] value[%d] ChAddress=%d\n", ich, pair, value[ich], 2 * value[ich] + pair); SetChannelAddress(2 * value[ich] + pair); fCalib[ich].SetPairing(pair); } @@ -54,14 +63,14 @@ void CbmTrdParFasp::LoadParams(FairParamList* l) } void CbmTrdParFasp::LoadParams(TArrayI& valArray, Int_t iAsic) -{ +{ // Where does the asic info start in large array Int_t offset = iAsic * (1 + NFASPCH * 4); // Int_t asicAddress = valArray[ offset++ ]; offset++; for (Int_t ich(0); ich < NFASPCH; ich++) { - Int_t pair = ich % 2; - SetChannelAddress(2 * valArray[offset++] + pair); + Int_t pair = ich % 2; // TODO pairing should be set from the external parameters + SetChannelAddress(valArray[offset++]); fCalib[ich].SetPairing(pair); } for (Int_t ich(0); ich < NFASPCH; ich++) { @@ -124,7 +133,7 @@ CbmTrdParFaspChannel::CbmTrdParFaspChannel(Int_t pup, Int_t ft, Int_t thr, Int_t //___________________________________________________________________ void CbmTrdParFaspChannel::Print(Option_t* /*opt*/) const { - printf("[%c]; CALIB { PUT[ns]=%3d FT[clk]=%2d THR[ADC]=%4d MDS[ADC]=%4d }\n", (HasPairing(kTRUE) ? 'R' : 'T'), + printf("[%c]; CALIB { PUT[ns]=%3d FT[clk]=%2d THR[ADC]=%4d MDS[ADC]=%4d }\n", (HasPairingR() ? 'R' : 'T'), fPileUpTime, fFlatTop, fThreshold, fMinDelaySignal); } diff --git a/core/detectors/trd/CbmTrdParFasp.h b/core/detectors/trd/CbmTrdParFasp.h index 338dfaef50..25e48258e7 100644 --- a/core/detectors/trd/CbmTrdParFasp.h +++ b/core/detectors/trd/CbmTrdParFasp.h @@ -5,6 +5,7 @@ #ifndef CBMTRDPARFASP_H #define CBMTRDPARFASP_H +#define NFASPMOD 30 #define NFASPCH 16 #include "CbmTrdParAsic.h" // for CbmTrdParAsic @@ -38,13 +39,10 @@ public: Int_t GetPileUpTime() const { return fPileUpTime; } Int_t GetThreshold() const { return fThreshold; } - /** \brief Query pad pairing type. - *\param[in] rect if rect=kTRUE rectangular pairing; tilt otherwise - */ - Bool_t HasPairing(Bool_t rect) const - { - return (rect && TESTBIT(fConfig, kPair)) || (!rect && !TESTBIT(fConfig, kPair)); - } + /** \brief Query pad pairing type.*/ + Bool_t HasPairingR() const { return TESTBIT(fConfig, kPair); } + Bool_t HasPairingT() const { return !TESTBIT(fConfig, kPair); } + void Print(Option_t* opt = "") const; /** \brief Specify pad pairing type. *\param[in] rect if rect=kTRUE rectangular pairing; tilt otherwise @@ -73,6 +71,7 @@ public: CbmTrdParFasp(Int_t address = 0, Int_t FebGrouping = -1, Double_t x = 0, Double_t y = 0, Double_t z = 0); virtual ~CbmTrdParFasp() { ; } const CbmTrdParFaspChannel* GetChannel(Int_t pad_address, UChar_t pair) const; + const CbmTrdParFaspChannel* GetChannel(Int_t ch_address) const; virtual Int_t GetNchannels() const { return NFASPCH; }; Int_t GetChannelAddress(Int_t ich) const diff --git a/macro/run/run_unpack_tsa.C b/macro/run/run_unpack_tsa.C index 679d9feefd..4e48bc995c 100644 --- a/macro/run/run_unpack_tsa.C +++ b/macro/run/run_unpack_tsa.C @@ -221,7 +221,7 @@ void run_unpack_tsa(std::vector<std::string> infile = {"test.tsa"}, UInt_t runid // trdfasp2dconfig->SetDebugState(); trdfasp2dconfig->SetDoWriteOutput(); // Activate the line below to write Trd1D digis to a separate "TrdFaspDigi" branch. Can be used to separate between Fasp and Spadic digis - trdfasp2dconfig->SetOutputBranchName("TrdFaspDigi"); + // trdfasp2dconfig->SetOutputBranchName("TrdFaspDigi"); std::string parfilesbasepathTrdfasp2d = Form("%s/parameters/trd", srcDir.Data()); trdfasp2dconfig->SetParFilesBasePath(parfilesbasepathTrdfasp2d); trdfasp2dconfig->SetSystemTimeOffset(-1800); // [ns] value to be updated diff --git a/reco/detectors/trd/unpack/CbmTrdUnpackAlgoFasp2D.cxx b/reco/detectors/trd/unpack/CbmTrdUnpackAlgoFasp2D.cxx index 17bdefc87a..8911b55957 100644 --- a/reco/detectors/trd/unpack/CbmTrdUnpackAlgoFasp2D.cxx +++ b/reco/detectors/trd/unpack/CbmTrdUnpackAlgoFasp2D.cxx @@ -29,11 +29,10 @@ using namespace std; -CbmTrdUnpackAlgoFasp2D::CbmTrdUnpackAlgoFasp2D() +CbmTrdUnpackAlgoFasp2D::CbmTrdUnpackAlgoFasp2D() : CbmRecoUnpackAlgo("CbmTrdUnpackAlgoFasp2D") , fModuleId() , fAsicPar() - , fDigiSet(nullptr) { memset(fTime, 0, NCRI * sizeof(ULong64_t)); } @@ -118,6 +117,31 @@ CbmTrdUnpackAlgoFasp2D::GetParContainerRequest(std::string geoTag, std::uint32_t return &fParContVec; } +//_________________________________________________________________________________ +void CbmTrdUnpackAlgoFasp2D::SetAsicMapping(const std::map<uint32_t, uint8_t[NFASPMOD]> &asicMap) +{ + if(!fFaspMap) fFaspMap = new std::map<uint32_t, uint8_t[NFASPMOD]>(asicMap); + else (*fFaspMap) = asicMap; +} + +//_________________________________________________________________________________ +void CbmTrdUnpackAlgoFasp2D::PrintAsicMapping() +{ + if (!fFaspMap) { + LOG(info) << GetName() << "No asic mapping loaded."; + return; + } + LOG(info) << GetName() << "Fasp Asic mapping on modules:"; + for(auto imod : (*fFaspMap)) { + printf("Mod [%6d] : ", imod.first); + for(int ifasp(0); ifasp<NFASPMOD; ifasp++) { + int jfasp = imod.second[ifasp]; + printf("%2d ", (jfasp == 0xff ?-1:jfasp)); + } + printf("\n"); + } +} + //_________________________________________________________________________________ CbmTrdUnpackAlgoFasp2D::CbmTrdFaspMessageType CbmTrdUnpackAlgoFasp2D::mess_type(uint32_t wd) { @@ -161,7 +185,7 @@ void CbmTrdUnpackAlgoFasp2D::mess_readEW(uint32_t w, CbmTrdFaspContent* mess) //_________________________________________________________________________________ void CbmTrdUnpackAlgoFasp2D::mess_prt(CbmTrdFaspContent* mess) { - if (mess->type == kData) + if (mess->type == kData) cout << boost::format(" DATA : fasp_id=%02d ch_id=%02d tclk=%03d data=%4d\n") % static_cast<unsigned int>(mess->fasp) % static_cast<unsigned int>(mess->ch) % static_cast<unsigned int>(mess->tlab) % static_cast<unsigned int>(mess->data); @@ -172,97 +196,85 @@ void CbmTrdUnpackAlgoFasp2D::mess_prt(CbmTrdFaspContent* mess) //_________________________________________________________________________________ bool CbmTrdUnpackAlgoFasp2D::pushDigis( - std::map<UChar_t, std::vector<CbmTrdUnpackAlgoFasp2D::CbmTrdFaspContent*>> messes) + std::vector<CbmTrdUnpackAlgoFasp2D::CbmTrdFaspContent*> messes) { - bool use(false), kRowInverted(false); UChar_t lFasp(0xff); UShort_t lchR, lchT; Double_t r, t; - Int_t dt, dtime, pad, row; + Int_t dt, dtime, ch, pad, row; ULong64_t tlab; CbmTrdParFasp* faspPar(nullptr); + const CbmTrdParFaspChannel* chCalib(nullptr); CbmTrdParModDigi* digiPar(nullptr); vector<CbmTrdDigi*> digis; - for (Int_t col(0); col < NCOLS; col++) { - if (!messes[col].size()) continue; - vector<CbmTrdFaspContent*>::iterator i = messes[col].begin(); + for (auto imess : messes) { if (lFasp == 0xff) { - lFasp = messes[col][0]->fasp; + lFasp = messes[0]->fasp; // link data to the position on the padplane - if (!(faspPar = (CbmTrdParFasp*) fAsicPar.GetAsicPar((*i)->cri * 1000 + lFasp))) { - LOG(error) << GetName() << "::pushDigis - Par for FASP " << (int) lFasp << " in module " << (*i)->cri + if (!(faspPar = (CbmTrdParFasp*) fAsicPar.GetAsicPar(imess->cri * 1000 + lFasp))) { + LOG(error) << GetName() << "::pushDigis - Par for FASP " << (int) lFasp << " in module " << imess->cri << " missing. Skip."; return false; } - if (!(digiPar = (CbmTrdParModDigi*) fDigiSet->GetModulePar((*i)->cri))) { - LOG(error) << GetName() << "::pushDigis - DIGI par for module " << (*i)->cri << " missing. Skip."; + if (!(digiPar = (CbmTrdParModDigi*) fDigiSet->GetModulePar(imess->cri))) { + LOG(error) << GetName() << "::pushDigis - DIGI par for module " << imess->cri << " missing. Skip."; return false; } - pad = faspPar->GetChannelAddress(0); - row = digiPar->GetPadRow(pad); - - // determine the HW direction in which the FASP channels are ordered - if (row % 2 == 0) { // valid only for mCBM-07.2021 TRD-2D - kRowInverted = kTRUE; - pad = faspPar->GetChannelAddress(15 - (*i)->ch); - } + if(VERBOSE) faspPar->Print(); + pad = faspPar->GetChannelAddress(imess->ch); + chCalib = faspPar->GetChannel(imess->ch); + ch = 2 * pad + chCalib->HasPairingR(); + row = digiPar->GetPadRow(pad); + if(VERBOSE) printf("fasp[%2d] ch[%4d / %2d] pad[%4d] row[%2d] col[%2d] tilt[%d]\n", lFasp, ch, imess->ch, pad, row, digiPar->GetPadColumn(pad), chCalib->HasPairingT()); } - for (; i != messes[col].end(); i++) { - if (VERBOSE) mess_prt((*i)); - - lchR = 0; - lchT = 0; - use = false; - if ((*i)->ch % 2 != 0) { - if (!kRowInverted) lchR = (*i)->data; - else - lchT = (*i)->data; - } - else { - if (!kRowInverted) lchT = (*i)->data; - else - lchR = (*i)->data; - } - for (vector<CbmTrdDigi*>::iterator id = digis.begin(); id != digis.end(); id++) { - dtime = (*id)->GetTimeDAQ() - (*i)->tlab; - if (TMath::Abs(dtime) < 5) { - r = (*id)->GetCharge(t, dt); - if (lchR && !int(r)) { - (*id)->SetCharge(t, lchR, -dtime); - use = true; - break; - } - else if (lchT && !int(t)) { - tlab = (*id)->GetTimeDAQ(); - (*id)->SetCharge(lchT, r, +dtime); - (*id)->SetTimeDAQ(ULong64_t(tlab - dtime)); - use = true; - break; - } + if (VERBOSE) mess_prt(imess); + + lchR = 0; + lchT = 0; + chCalib = faspPar->GetChannel(imess->ch); + if(chCalib->HasPairingR()) lchR = imess->data; + else lchT = imess->data; + pad = faspPar->GetChannelAddress(imess->ch); + + bool use(false); + for (auto id : digis) { + if (id->GetAddressChannel() != pad) continue; + dtime = id->GetTimeDAQ() - imess->tlab; + if (TMath::Abs(dtime) < 5) { + r = id->GetCharge(t, dt); + if (lchR && !int(r)) { + id->SetCharge(t, lchR, -dtime); + use = true; + break; + } + else if (lchT && !int(t)) { + tlab = id->GetTimeDAQ(); + id->SetCharge(lchT, r, +dtime); + id->SetTimeDAQ(ULong64_t(tlab - dtime)); + use = true; + break; } } - - if (!use) { - pad = faspPar->GetChannelAddress(kRowInverted ? (15 - (*i)->ch) : (*i)->ch); - CbmTrdDigi* digi = new CbmTrdDigi(pad, lchT, lchR, (*i)->tlab); - digi->SetAddressModule((*i)->cri); - digis.push_back(digi); - } - delete (*i); } - // push finalized digits to the next level - for (vector<CbmTrdDigi*>::iterator id = digis.begin(); id != digis.end(); id++) { - (*id)->SetTimeDAQ(fTime[0] + (*id)->GetTimeDAQ()); - fOutputVec.emplace_back(*std::move(*id)); - if (VERBOSE) cout << (*id)->ToString(); + if (!use) { + CbmTrdDigi* digi = new CbmTrdDigi(pad, lchT, lchR, imess->tlab); + digi->SetAddressModule(imess->cri); + digis.push_back(digi); } + delete imess; + } - digis.clear(); - messes[col].clear(); + // push finalized digits to the next level + for (vector<CbmTrdDigi*>::iterator id = digis.begin(); id != digis.end(); id++) { + (*id)->SetTimeDAQ(fTime[0] + (*id)->GetTimeDAQ()); + fOutputVec.emplace_back(*std::move(*id)); + if (VERBOSE) cout << (*id)->ToString(); } + digis.clear(); + messes.clear(); return true; } @@ -273,6 +285,7 @@ bool CbmTrdUnpackAlgoFasp2D::unpack(const fles::Timeslice* ts, std::uint16_t ico if (VERBOSE) printf("CbmTrdUnpackAlgoFasp2D::unpack 0x%04x %d\n", icomp, imslice); //LOG(info) << "Component " << icomp << " connected to config CbmTrdUnpackConfig2D. Slice "<<imslice; + uint32_t mod_id = 5; bool unpackOk = true; //Double_t fdMsSizeInNs = 1.28e6; @@ -296,8 +309,8 @@ bool CbmTrdUnpackAlgoFasp2D::unpack(const fles::Timeslice* ts, std::uint16_t ico const uint32_t* wd = reinterpret_cast<const uint32_t*>(mscontent); - UChar_t lFaspOld(0xff), col; - map<UChar_t, vector<CbmTrdFaspContent*>> vDigi; + UChar_t lFaspOld(0xff); + vector<CbmTrdFaspContent*> vDigi; CbmTrdFaspContent* mess(nullptr); for (uint64_t j = 0; j < nwords; j++, wd++) { // // Select the appropriate conversion type of the word according to the message type @@ -309,7 +322,6 @@ bool CbmTrdUnpackAlgoFasp2D::unpack(const fles::Timeslice* ts, std::uint16_t ico // mess_readEW(*wd, &mess); // break; // } - //if(VERBOSE) mess_prt(&mess); uint32_t w = *wd; uint8_t ch_id = w & 0xf; uint8_t isaux = (w >> 4) & 0x1; @@ -317,7 +329,7 @@ bool CbmTrdUnpackAlgoFasp2D::unpack(const fles::Timeslice* ts, std::uint16_t ico uint16_t data = (w >> 12) & 0x3fff; uint32_t epoch = (w >> 5) & 0x1fffff; uint8_t fasp_id = (w >> 26) & 0x3f; - // out<<"fasp_id="<<static_cast<unsigned int>(fasp_id)<<" ch_id="<<static_cast<unsigned int>(ch_id)<<" isaux="<<static_cast<unsigned int>(isaux)<<std::endl; + // std::cout<<"fasp_id="<<static_cast<unsigned int>(fasp_id)<<" ch_id="<<static_cast<unsigned int>(ch_id)<<" isaux="<<static_cast<unsigned int>(isaux)<<std::endl; if (isaux) { if (!ch_id) { if (VERBOSE) @@ -335,6 +347,8 @@ bool CbmTrdUnpackAlgoFasp2D::unpack(const fles::Timeslice* ts, std::uint16_t ico } } else { + if (fFaspMap) fasp_id = ((*fFaspMap)[mod_id])[fasp_id]; + if (lFaspOld != fasp_id) { // push if (vDigi.size()) { pushDigis(vDigi); } @@ -359,9 +373,8 @@ bool CbmTrdUnpackAlgoFasp2D::unpack(const fles::Timeslice* ts, std::uint16_t ico mess->tlab = slice; mess->data = data >> 1; mess->fasp = lFaspOld; - mess->cri = 5; - col = ch_id >> 1; - vDigi[col].push_back(mess); + mess->cri = mod_id; + vDigi.push_back(mess); } //prt_wd(*wd); } diff --git a/reco/detectors/trd/unpack/CbmTrdUnpackAlgoFasp2D.h b/reco/detectors/trd/unpack/CbmTrdUnpackAlgoFasp2D.h index 7abae638e8..31456b9bf0 100644 --- a/reco/detectors/trd/unpack/CbmTrdUnpackAlgoFasp2D.h +++ b/reco/detectors/trd/unpack/CbmTrdUnpackAlgoFasp2D.h @@ -25,6 +25,7 @@ #include "CbmRecoUnpackAlgo.tmpl" #include "CbmTrdDigi.h" #include "CbmTrdParSetAsic.h" +#include "CbmTrdParFasp.h" #include "Timeslice.hpp" // timeslice @@ -108,6 +109,12 @@ public: virtual std::vector<std::pair<std::string, std::shared_ptr<FairParGenericSet>>>* GetParContainerRequest(std::string geoTag, std::uint32_t runId); + /** + * @brief Introduce fasp index mapping + */ + void SetAsicMapping(const std::map<uint32_t, uint8_t[NFASPMOD]> &map); + void PrintAsicMapping(); + protected: /** @brief Get message type from the FASP word */ CbmTrdFaspMessageType mess_type(uint32_t wd); @@ -117,7 +124,7 @@ protected: void mess_readEW(uint32_t wd, CbmTrdFaspContent* mess); /** @brief Print FASP message */ void mess_prt(CbmTrdFaspContent* mess); - bool pushDigis(std::map<UChar_t, std::vector<CbmTrdUnpackAlgoFasp2D::CbmTrdFaspContent*>> digis); + bool pushDigis(std::vector<CbmTrdUnpackAlgoFasp2D::CbmTrdFaspContent*> digis); ULong64_t fTime[NCRI]; /** @brief Finish function for this algorithm base clase */ @@ -173,10 +180,10 @@ protected: private: void prt_wd(uint32_t w); - + std::map<uint32_t, uint8_t[NFASPMOD]> *fFaspMap = nullptr; std::vector<Int_t> fModuleId; CbmTrdParSetAsic fAsicPar; - CbmTrdParSetDigi* fDigiSet; + CbmTrdParSetDigi* fDigiSet = nullptr; ClassDef(CbmTrdUnpackAlgoFasp2D, 2) // unpack FASP read-out detectors }; diff --git a/reco/detectors/trd/unpack/CbmTrdUnpackConfigFasp2D.cxx b/reco/detectors/trd/unpack/CbmTrdUnpackConfigFasp2D.cxx index 2fe94bfb04..503d1cbd75 100644 --- a/reco/detectors/trd/unpack/CbmTrdUnpackConfigFasp2D.cxx +++ b/reco/detectors/trd/unpack/CbmTrdUnpackConfigFasp2D.cxx @@ -4,8 +4,9 @@ #include "CbmTrdUnpackConfigFasp2D.h" -#include "CbmTrdUnpackAlgoFasp2D.h" - +// #include "CbmTrdUnpackAlgoFasp2D.h" +// #include "CbmTrdParFasp.h" +/* #include <Logger.h> #include <Rtypes.h> @@ -13,9 +14,11 @@ #include <memory> #include <vector> +#include <map>*/ CbmTrdUnpackConfigFasp2D::CbmTrdUnpackConfigFasp2D(std::string detGeoSetupTag, UInt_t runid) : CbmRecoUnpackConfig("CbmTrdUnpackConfigFasp2D", detGeoSetupTag, runid) + , fFaspMap() { } @@ -39,5 +42,22 @@ std::shared_ptr<CbmTrdUnpackAlgoFasp2D> CbmTrdUnpackConfigFasp2D::chooseAlgo() return nullptr; } +//_____________________________________________________________________ +void CbmTrdUnpackConfigFasp2D::InitAlgo() +{ + if (fDoLog) LOG(info) << fName << "::InitAlgo - SetFaspMapping"; + fAlgo->SetAsicMapping(fFaspMap); + //if (fDoLog) + fAlgo->PrintAsicMapping(); + + // Now we have all information required to initialise the algorithm + fAlgo->Init(); +} + +//_____________________________________________________________________ +void CbmTrdUnpackConfigFasp2D::SetFaspMapping(int modAddress, uint8_t faspMap[NFASPMOD]) +{ + memcpy(fFaspMap[modAddress], faspMap, NFASPMOD*sizeof(uint8_t)); +} ClassImp(CbmTrdUnpackConfigFasp2D) diff --git a/reco/detectors/trd/unpack/CbmTrdUnpackConfigFasp2D.h b/reco/detectors/trd/unpack/CbmTrdUnpackConfigFasp2D.h index 79c15828e2..38c95b9ef9 100644 --- a/reco/detectors/trd/unpack/CbmTrdUnpackConfigFasp2D.h +++ b/reco/detectors/trd/unpack/CbmTrdUnpackConfigFasp2D.h @@ -22,6 +22,7 @@ #include "CbmRecoUnpackConfig.tmpl" #include "CbmTrdDigi.h" #include "CbmTrdUnpackAlgoFasp2D.h" +#include "CbmTrdParFasp.h" #include <FairLogger.h> #include <Logger.h> @@ -33,6 +34,7 @@ #include <cstdint> #include <memory> #include <vector> +#include <map> class CbmTrdUnpackConfigFasp2D : public CbmRecoUnpackConfig<CbmTrdUnpackAlgoFasp2D, CbmTrdDigi> { @@ -58,6 +60,16 @@ public: /** @brief Assignment operator - not implemented **/ CbmTrdUnpackConfigFasp2D& operator=(const CbmTrdUnpackConfigFasp2D&) = delete; + /** + * @brief Initialize the algorithm, include all calibration for Trd FASP. + */ + void InitAlgo(); + + /** @brief define fasp mapping for each module + * @param modAddress module address according to geometry + * @param faspMap mapped ids of FASP ASICs for module + */ + void SetFaspMapping(int modAddress, uint8_t faspMap[NFASPMOD]); protected: /** * @brief Choose the derived unpacker algorithm to be used for the DAQ output to Digi translation. If algo was already set manually by the user this algorithm is used. @@ -67,7 +79,9 @@ protected: virtual std::shared_ptr<CbmTrdUnpackAlgoFasp2D> chooseAlgo(); private: - ClassDef(CbmTrdUnpackConfigFasp2D, 3) + std::map<uint32_t, uint8_t[NFASPMOD]> fFaspMap; ///> DAQ packing of FASP id + + ClassDef(CbmTrdUnpackConfigFasp2D, 4) }; #endif // CbmTrdUnpackConfigFasp2D_H -- GitLab