Skip to content
Snippets Groups Projects
Commit a5b82301 authored by Alexandru Bercuci's avatar Alexandru Bercuci
Browse files

remove FASP to Module geo mapping. Moved internally to the generation of

ASIC pars. This is to propagate the correct mapping for all levels of
data processing (unpack, monitor, reco, tracking)
parent b6aee9d6
No related branches found
No related tags found
1 merge request!1179WIP : TRD2D fixes asked by the community
...@@ -48,12 +48,12 @@ bool CbmTrdParFasp::IsChannelMasked(int ch_address) const ...@@ -48,12 +48,12 @@ bool CbmTrdParFasp::IsChannelMasked(int ch_address) const
//___________________________________________________________________ //___________________________________________________________________
void CbmTrdParFasp::LoadParams(FairParamList* l) void CbmTrdParFasp::LoadParams(FairParamList* l)
{ {
printf("CbmTrdParFasp::LoadParams(FairParamList*)\n"); // printf("CbmTrdParFasp::LoadParams(FairParamList*)\n");
TArrayI value(NFASPCH); TArrayI value(NFASPCH);
if (l->fill(Form("%dCHS", fAddress), &value)) { if (l->fill(Form("%dCHS", fAddress), &value)) {
for (Int_t ich(0); ich < NFASPCH; ich++) { for (Int_t ich(0); ich < NFASPCH; ich++) {
Int_t pair = ich % 2; Int_t pair = ich % 2;
printf(" ch[%2d] pair[%d] value[%d] ChAddress=%d\n", ich, pair, value[ich], 2 * value[ich] + pair); // printf(" ch[%2d] pair[%d] value[%d] ChAddress=%d\n", ich, pair, value[ich], 2 * value[ich] + pair);
SetChannelAddress(2 * value[ich] + pair); SetChannelAddress(2 * value[ich] + pair);
fCalib[ich].SetPairing(pair); fCalib[ich].SetPairing(pair);
} }
...@@ -72,7 +72,7 @@ void CbmTrdParFasp::LoadParams(FairParamList* l) ...@@ -72,7 +72,7 @@ void CbmTrdParFasp::LoadParams(FairParamList* l)
//___________________________________________________________________ //___________________________________________________________________
void CbmTrdParFasp::LoadParams(int* valArray) void CbmTrdParFasp::LoadParams(int* valArray)
{ {
printf("CbmTrdParFasp::LoadParams(%d)\n", fAddress); // printf("CbmTrdParFasp::LoadParams(%d)\n", fAddress);
int offset(0); int offset(0);
SetChannelMask(valArray[offset++]); SetChannelMask(valArray[offset++]);
for (Int_t ich(0); ich < NFASPCH; ich++) { for (Int_t ich(0); ich < NFASPCH; ich++) {
......
...@@ -127,16 +127,6 @@ CbmTrdUnpackFaspAlgo::GetParContainerRequest(std::string geoTag, std::uint32_t r ...@@ -127,16 +127,6 @@ CbmTrdUnpackFaspAlgo::GetParContainerRequest(std::string geoTag, std::uint32_t r
return &fParContVec; return &fParContVec;
} }
//_________________________________________________________________________________
void CbmTrdUnpackFaspAlgo::SetAsicMapping(const std::map<uint32_t, uint8_t[NFASPMOD]>& asicMap)
{
if (!fFaspMap) fFaspMap = new std::map<uint32_t, uint8_t[NFASPMOD]>(asicMap);
else {
delete fFaspMap;
fFaspMap = new std::map<uint32_t, uint8_t[NFASPMOD]>(asicMap);
}
}
//_________________________________________________________________________________ //_________________________________________________________________________________
void CbmTrdUnpackFaspAlgo::SetCrobMapping(const std::map<uint32_t, uint16_t[NCROBMOD]>& map) void CbmTrdUnpackFaspAlgo::SetCrobMapping(const std::map<uint32_t, uint16_t[NCROBMOD]>& map)
{ {
...@@ -152,25 +142,6 @@ void CbmTrdUnpackFaspAlgo::SetCrobMapping(const std::map<uint32_t, uint16_t[NCRO ...@@ -152,25 +142,6 @@ void CbmTrdUnpackFaspAlgo::SetCrobMapping(const std::map<uint32_t, uint16_t[NCRO
} }
} }
//_________________________________________________________________________________
void CbmTrdUnpackFaspAlgo::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++) {
if (ifasp % 9 == 0) printf("\n");
int jfasp = imod.second[ifasp];
printf("%3d ", (jfasp == 0xff ? -1 : jfasp));
}
printf("\n");
}
}
//_________________________________________________________________________________ //_________________________________________________________________________________
CbmTrdUnpackFaspAlgo::CbmTrdFaspMessageType CbmTrdUnpackFaspAlgo::mess_type(uint32_t wd) CbmTrdUnpackFaspAlgo::CbmTrdFaspMessageType CbmTrdUnpackFaspAlgo::mess_type(uint32_t wd)
{ {
...@@ -251,6 +222,9 @@ bool CbmTrdUnpackFaspAlgo::pushDigis(std::vector<CbmTrdUnpackFaspAlgo::CbmTrdFas ...@@ -251,6 +222,9 @@ bool CbmTrdUnpackFaspAlgo::pushDigis(std::vector<CbmTrdUnpackFaspAlgo::CbmTrdFas
for (auto imess : messes) { for (auto imess : messes) {
const Int_t pad = faspPar->GetPadAddress(imess.ch); const Int_t pad = faspPar->GetPadAddress(imess.ch);
const CbmTrdParFaspChannel* chCalib = faspPar->GetChannel(imess.ch); const CbmTrdParFaspChannel* chCalib = faspPar->GetChannel(imess.ch);
if (chCalib->IsMasked()) {
LOG(warn) << GetName() << "::pushDigis - FASP par " << mod_id * 1000 + lFasp << " ch " << int(imess.ch) << " masked but have data. Masks need attention.";
}
const ULong64_t lTime = fTime + tdaqOffset + imess.tlab; const ULong64_t lTime = fTime + tdaqOffset + imess.tlab;
const UShort_t lchR = chCalib->HasPairingR() ? imess.data : 0; const UShort_t lchR = chCalib->HasPairingR() ? imess.data : 0;
const UShort_t lchT = chCalib->HasPairingR() ? 0 : imess.data; const UShort_t lchT = chCalib->HasPairingR() ? 0 : imess.data;
...@@ -449,8 +423,6 @@ bool CbmTrdUnpackFaspAlgo::unpack(const fles::Timeslice* ts, std::uint16_t icomp ...@@ -449,8 +423,6 @@ bool CbmTrdUnpackFaspAlgo::unpack(const fles::Timeslice* ts, std::uint16_t icomp
continue; continue;
} }
if (fFaspMap) fasp_id = ((*fFaspMap)[mod_id])[fasp_id];
if (lFaspOld != fasp_id) { if (lFaspOld != fasp_id) {
// push // push
if (vMess.size()) { pushDigis(vMess, mod_id); } if (vMess.size()) { pushDigis(vMess, mod_id); }
......
...@@ -100,7 +100,8 @@ public: ...@@ -100,7 +100,8 @@ public:
uint8_t crob = 0; ///< CROB id in the module uint8_t crob = 0; ///< CROB id in the module
uint8_t fasp = 0; ///< FASP id in the module uint8_t fasp = 0; ///< FASP id in the module
}; };
/** Access the asic parameter list, read-only*/
virtual const CbmTrdParSetAsic* GetAsicPar() const { return &fAsicPar; }
/** /**
* @brief Get the requested parameter containers. * @brief Get the requested parameter containers.
* Return the required parameter containers together with the paths to the ascii * Return the required parameter containers together with the paths to the ascii
...@@ -112,10 +113,7 @@ public: ...@@ -112,10 +113,7 @@ public:
*/ */
virtual std::vector<std::pair<std::string, std::shared_ptr<FairParGenericSet>>>* virtual std::vector<std::pair<std::string, std::shared_ptr<FairParGenericSet>>>*
GetParContainerRequest(std::string geoTag, std::uint32_t runId); GetParContainerRequest(std::string geoTag, std::uint32_t runId);
void PrintAsicMapping();
/** @brief Introduce fasp index mapping*/
void SetAsicMapping(const std::map<uint32_t, uint8_t[NFASPMOD]>& map);
/** @brief Initialize CROB mapping for all modules*/ /** @brief Initialize CROB mapping for all modules*/
void SetCrobMapping(const std::map<uint32_t, uint16_t[NCROBMOD]>& map); void SetCrobMapping(const std::map<uint32_t, uint16_t[NCROBMOD]>& map);
/** @brief Set a predefined monitor /** @brief Set a predefined monitor
...@@ -202,7 +200,6 @@ protected: ...@@ -202,7 +200,6 @@ protected:
private: private:
void prt_wd(uint32_t w); void prt_wd(uint32_t w);
std::map<uint32_t, uint8_t[NFASPMOD]>* fFaspMap = nullptr; ///> FASP mapping update wrt the default setting
std::map<uint16_t, std::pair<uint16_t, uint16_t>>* fCompMap = nullptr; ///> Map eq_id -> (mod_id, crob_id) std::map<uint16_t, std::pair<uint16_t, uint16_t>>* fCompMap = nullptr; ///> Map eq_id -> (mod_id, crob_id)
std::array<std::vector<CbmTrdDigi>, NFASPMOD* NFASPCH> fDigiBuffer = { std::array<std::vector<CbmTrdDigi>, NFASPMOD* NFASPCH> fDigiBuffer = {
{}}; ///> Buffered digi for each pad in CROB component {}}; ///> Buffered digi for each pad in CROB component
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
CbmTrdUnpackFaspConfig::CbmTrdUnpackFaspConfig(std::string detGeoSetupTag, UInt_t runid) CbmTrdUnpackFaspConfig::CbmTrdUnpackFaspConfig(std::string detGeoSetupTag, UInt_t runid)
: CbmRecoUnpackConfig("CbmTrdUnpackFaspConfig", detGeoSetupTag, runid) : CbmRecoUnpackConfig("CbmTrdUnpackFaspConfig", detGeoSetupTag, runid)
, fFaspMap()
{ {
} }
...@@ -43,9 +42,7 @@ void CbmTrdUnpackFaspConfig::reset() ...@@ -43,9 +42,7 @@ void CbmTrdUnpackFaspConfig::reset()
void CbmTrdUnpackFaspConfig::InitAlgo() void CbmTrdUnpackFaspConfig::InitAlgo()
{ {
if (fDoLog) LOG(info) << fName << "::InitAlgo - Setup Fasp mapping"; if (fDoLog) LOG(info) << fName << "::InitAlgo - Setup Fasp mapping";
fAlgo->SetAsicMapping(fFaspMap);
fAlgo->SetCrobMapping(fCrobMap); fAlgo->SetCrobMapping(fCrobMap);
/*if (fDoLog) */ fAlgo->PrintAsicMapping();
// If we have a monitor in the config add it to the algo // If we have a monitor in the config add it to the algo
if (fMonitor) fAlgo->SetMonitor(fMonitor); if (fMonitor) fAlgo->SetMonitor(fMonitor);
...@@ -57,15 +54,10 @@ void CbmTrdUnpackFaspConfig::InitAlgo() ...@@ -57,15 +54,10 @@ void CbmTrdUnpackFaspConfig::InitAlgo()
if (fMonitor) { if (fMonitor) {
/*if (fDoLog)*/ LOG(info) << fName << "::InitAlgo - Setup monitoring task"; /*if (fDoLog)*/ LOG(info) << fName << "::InitAlgo - Setup monitoring task";
fMonitor->Init(); fMonitor->Init();
fMonitor->MapMaskedChannels(fAlgo->GetAsicPar());
} }
} }
//_____________________________________________________________________
void CbmTrdUnpackFaspConfig::SetFaspMapping(int modAddress, uint8_t faspMap[NFASPMOD])
{
memcpy(fFaspMap[modAddress], faspMap, NFASPMOD * sizeof(uint8_t));
}
//_____________________________________________________________________ //_____________________________________________________________________
void CbmTrdUnpackFaspConfig::SetCrobMapping(int modAddress, uint16_t crobMap[NCROBMOD]) void CbmTrdUnpackFaspConfig::SetCrobMapping(int modAddress, uint16_t crobMap[NCROBMOD])
{ {
......
...@@ -64,11 +64,6 @@ public: ...@@ -64,11 +64,6 @@ public:
/** @brief Initialize the algorithm, include all calibration for Trd FASP.*/ /** @brief Initialize the algorithm, include all calibration for Trd FASP.*/
void InitAlgo(); 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]);
/** @brief define crob id mapping for each module /** @brief define crob id mapping for each module
* @param modAddress module address according to geometry * @param modAddress module address according to geometry
* @param crobMap mapped ids of CROBs eq_id for module * @param crobMap mapped ids of CROBs eq_id for module
...@@ -91,7 +86,6 @@ protected: ...@@ -91,7 +86,6 @@ protected:
virtual void reset(); virtual void reset();
private: private:
std::map<uint32_t, uint8_t[NFASPMOD]> fFaspMap; ///> Module address to FASP id mapping
std::map<uint32_t, uint16_t[NCROBMOD]> fCrobMap; ///> Module address to CROB id mapping std::map<uint32_t, uint16_t[NCROBMOD]> fCrobMap; ///> Module address to CROB id mapping
/** @brief pointer to the monitor object */ /** @brief pointer to the monitor object */
std::shared_ptr<CbmTrdUnpackFaspMonitor> fMonitor = nullptr; std::shared_ptr<CbmTrdUnpackFaspMonitor> fMonitor = nullptr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment