diff --git a/core/detectors/trd/CbmTrdParModAsic.cxx b/core/detectors/trd/CbmTrdParModAsic.cxx index ee911680b48a8bde645f0f4a227482c84c6e2dcc..fbb3ac7bd012f8e27dd8e173dfde73493479e39a 100644 --- a/core/detectors/trd/CbmTrdParModAsic.cxx +++ b/core/detectors/trd/CbmTrdParModAsic.cxx @@ -44,6 +44,26 @@ void CbmTrdParModAsic::clear() fModPar.clear(); } +//_______________________________________________________________________________ +bool CbmTrdParModAsic::GetFaspChannelPar(int pad, const CbmTrdParFaspChannel*& tilt, + const CbmTrdParFaspChannel*& rect) const +{ + if (pad < 0 || pad >= NFASPMOD * NFASPCH) return false; + for (int ich(0), ch(pad << 1); ich < 2; ich++, ch++) { + int faspAddress = GetAsicAddress(ch); + const CbmTrdParFasp* p = static_cast<const CbmTrdParFasp*>(GetAsicPar(faspAddress)); + if (!p) { + LOG(debug) << GetName() << "::GetFaspChannelPar : Could not find FASP params for address=" << faspAddress + << " @ pad=" << pad; + continue; + } + if (ich) rect = p->GetChannel(pad, ich); + else + tilt = p->GetChannel(pad, ich); + } + return true; +} + //_______________________________________________________________________________ Int_t CbmTrdParModAsic::GetAsicAddress(Int_t chAddress) const { @@ -127,7 +147,11 @@ int CbmTrdParModAsic::HasEqId(uint16_t eq) const //_______________________________________________________________________________ void CbmTrdParModAsic::Print(Option_t* opt) const { - printf(" %s Asics[%d]\n", GetName(), GetNofAsics()); + printf(" %s Asics[%d] Crobs[%lu]\n", GetName(), GetNofAsics(), fCrobAdd.size()); + printf(" "); + for (auto eqid : fCrobAdd) + printf(" %d", eqid); + printf("\n"); if (strcmp(opt, "all") == 0) { for (auto asic : fModPar) asic.second->Print(opt); diff --git a/core/detectors/trd/CbmTrdParModAsic.h b/core/detectors/trd/CbmTrdParModAsic.h index 68e8574476afbcfdc96b5246a7ca31507d94b25f..c8dee321af72a0ff2e19f170208e271f9c6614b1 100644 --- a/core/detectors/trd/CbmTrdParModAsic.h +++ b/core/detectors/trd/CbmTrdParModAsic.h @@ -15,6 +15,7 @@ #include <vector> // for vector class CbmTrdParAsic; +class CbmTrdParFaspChannel; class FairParamList; /** @@ -38,7 +39,15 @@ public: /** \brief Reset all parameters **/ virtual void clear(); - + /** \brief Access the calibration objects describing the two FASP channels allocated to a pad. FASP specific ! + * \param[in] pad Id of the pad according to position on the pad-plane + * \param[in,out] tilt Parameter for FASP channel connected to the tilt paired pads. On output it can be: + * - nullptr : if channel is not installed + * - allocated : if channel installed. It is up to the user to retrieve more info, e.g. masking + * \param[in,out] rect Parameter for FASP channel connected to the rectangular paired pads. The output follows the same convention as for the tilt parameters + * \return true if pad is correctly defined + */ + bool GetFaspChannelPar(int pad, const CbmTrdParFaspChannel*& tilt, const CbmTrdParFaspChannel*& rect) const; /** \brief Query the ASICs in the module for their DAQ address. * It applies to the list of ASICs. * Returns the list of id of the ASICs within the module. diff --git a/external/InstallParameter.cmake b/external/InstallParameter.cmake index fc5ed96a4f418eb7b60fe98d94be4591db05a9e3..00a71eacf9b6b39c6edb0f32b3e288308daeb20b 100644 --- a/external/InstallParameter.cmake +++ b/external/InstallParameter.cmake @@ -1,4 +1,4 @@ -set(PARAMETER_VERSION 7c7a7c3df40a0ca69d576986249b2976e58d5168) +set(PARAMETER_VERSION a86380731a867b048ada71d1fc20a8fd00e5cde4) set(PARAMETER_SRC_URL "https://git.cbm.gsi.de/CbmSoft/cbmroot_parameter.git") diff --git a/reco/detectors/trd/CbmTrdModuleRec2D.cxx b/reco/detectors/trd/CbmTrdModuleRec2D.cxx index ed8b845fa7268144673d1aa9f5ccf69d01ab90b6..1876e1cf6ec8de82d08d7127138bc0475731d52c 100644 --- a/reco/detectors/trd/CbmTrdModuleRec2D.cxx +++ b/reco/detectors/trd/CbmTrdModuleRec2D.cxx @@ -53,30 +53,40 @@ Bool_t CbmTrdModuleRec2D::AddDigi(const CbmTrdDigi* d, Int_t id) int pad = d->GetAddressChannel(), col, row = GetPadRowCol(pad, col), dtime; uint16_t chT = pad << 1, chR = chT + 1; - int faspAddress = fAsicPar->GetAsicAddress(chT); - const CbmTrdParFasp* p = static_cast<const CbmTrdParFasp*>(fAsicPar->GetAsicPar(faspAddress)); - if (!p) { - LOG(error) << GetName() << "::AddDigi : Could not find FASP params for address=" << faspAddress << " @ pad=" << pad; + const CbmTrdParFaspChannel *daqFaspChT(nullptr), *daqFaspChR(nullptr); + if (!fAsicPar->GetFaspChannelPar(pad, daqFaspChT, daqFaspChR)) { + LOG(warn) << GetName() << "::AddDigi: Failed to retrieve calibration for FASP channels allocated to pad " << pad; return false; } - const CbmTrdParFaspChannel* daqFaspChT = p->GetChannel(pad, 0); - const CbmTrdParFaspChannel* daqFaspChR = p->GetChannel(pad, 1); if (CWRITE(0)) { cout << "\nadd @" << id << " " << d->ToString(); - daqFaspChT->Print(); - daqFaspChR->Print(); + if (daqFaspChT) daqFaspChT->Print(); + else + cout << "\n[T] not installed."; + if (daqFaspChR) daqFaspChR->Print(); + else + cout << "\n[R] not installed."; } Double_t t, r = d->GetCharge(t, dtime); Int_t tm = d->GetTimeDAQ() - fT0; if (dtime < 0) tm += dtime; // correct for the difference between tilt and rect - if (r < 1 && !daqFaspChR->IsMasked()) chR = 0; - if (t < 1 && !daqFaspChT->IsMasked()) chT = 0; + if (r < 1) { + if (!daqFaspChR) chR = 0; // TODO implement case for not installed + else if (!daqFaspChR->IsMasked()) + chR = 0; + } + if (t < 1) { + if (!daqFaspChT) chT = 0; // TODO implement case for not installed + else if (!daqFaspChT->IsMasked()) + chT = 0; + } if (CWRITE(0)) - printf("row[%2d] col[%2d] tm[%2d] chT[%4d] chR[%4d]\n", row, col, tm, chT * (daqFaspChT->IsMasked() ? -1 : 1), - chR * (daqFaspChR->IsMasked() ? -1 : 1)); + printf("row[%2d] col[%2d] tm[%2d] chT[%4d] chR[%4d]\n", row, col, tm, + chT * (daqFaspChT && daqFaspChT->IsMasked() ? -1 : 1), + chR * (daqFaspChR && daqFaspChR->IsMasked() ? -1 : 1)); CbmTrdCluster* cl(nullptr); // get the link to saved clusters diff --git a/sim/detectors/trd/CbmTrdModuleSim2D.cxx b/sim/detectors/trd/CbmTrdModuleSim2D.cxx index 2e54acc03503dbe91455315a1968efa77270774f..7881716c5424fe6861ebd719eb56a2c487b92bd0 100644 --- a/sim/detectors/trd/CbmTrdModuleSim2D.cxx +++ b/sim/detectors/trd/CbmTrdModuleSim2D.cxx @@ -543,17 +543,20 @@ void CbmTrdModuleSim2D::AddDigi(Int_t pad, Double_t* charge, Double_t time /*, D */ // check the status of FEE for the current channels - int faspAddress = fAsicPar->GetAsicAddress((pad << 1)); - const CbmTrdParFasp* p = static_cast<const CbmTrdParFasp*>(fAsicPar->GetAsicPar(faspAddress)); - if (!p) { - LOG(debug) << GetName() << "::AddDigi : Could not find FASP params for address=" << faspAddress << " @ pad=" << pad; + const CbmTrdParFaspChannel *daqFaspChT(nullptr), *daqFaspChR(nullptr); + if (!fAsicPar->GetFaspChannelPar(pad, daqFaspChT, daqFaspChR)) { + LOG(warn) << GetName() << "::AddDigi: Failed to retrieve calibration for FASP channels allocated to pad " << pad; return; } if (charge[0] > 0) { // mask T digi - if (p->GetChannel(pad, 0)->IsMasked()) charge[0] = 0; + if (!daqFaspChT) charge[0] = 0; // Not installed read-out + else if (daqFaspChT->IsMasked()) + charge[0] = 0; } if (charge[1] > 0) { // mask R digi - if (p->GetChannel(pad, 1)->IsMasked()) charge[1] = 0; + if (!daqFaspChR) charge[1] = 0; // Not installed read-out + else if (daqFaspChR->IsMasked()) + charge[1] = 0; } // make digi