diff --git a/core/detectors/trd/CbmTrdParFasp.cxx b/core/detectors/trd/CbmTrdParFasp.cxx index 00611d5380089d80f0d5500289080f0f592ca9a2..aff68e2723088b175e4bfa52d80cae7196a31afe 100644 --- a/core/detectors/trd/CbmTrdParFasp.cxx +++ b/core/detectors/trd/CbmTrdParFasp.cxx @@ -113,7 +113,7 @@ void CbmTrdParFasp::Print(Option_t* opt) const CbmTrdParAsic::Print("TrdParFasp"); printf(" Nchannels[%2d]\n", (Int_t) fChannelAddresses.size()); for (Int_t ich(0); ich < TMath::Min((Int_t) GetNchannels(), (Int_t) fChannelAddresses.size()); ich++) { - printf(" %2d pad_addr[%4d]", ich, GetChannelAddress(ich)); + printf(" %2d pad_addr[%4d]", ich, GetPadAddress(ich)); fCalib[ich].Print(opt); } } diff --git a/core/detectors/trd/CbmTrdParFasp.h b/core/detectors/trd/CbmTrdParFasp.h index 8648992d7b81e294a1fb705d4ebf0bb8a49691ed..4d45169864929144d0e5b9c44f9ceaa2b546b26f 100644 --- a/core/detectors/trd/CbmTrdParFasp.h +++ b/core/detectors/trd/CbmTrdParFasp.h @@ -74,7 +74,7 @@ public: const CbmTrdParFaspChannel* GetChannel(Int_t ch_address) const; virtual Int_t GetNchannels() const { return NFASPCH; }; - Int_t GetChannelAddress(Int_t ich) const + Int_t GetPadAddress(Int_t ich) const { return ((ich < 0 || ich >= GetNchannels()) ? 0 : 0.5 * fChannelAddresses[ich]); } diff --git a/core/detectors/trd/CbmTrdParSetAsic.cxx b/core/detectors/trd/CbmTrdParSetAsic.cxx index b65e02c9f3d4545d577efb948411b4d451791e80..033aa06fe7f5b92ec3b77cd3620d6152175680e7 100644 --- a/core/detectors/trd/CbmTrdParSetAsic.cxx +++ b/core/detectors/trd/CbmTrdParSetAsic.cxx @@ -56,7 +56,7 @@ void CbmTrdParSetAsic::addParam(CbmTrdParMod* mod) //_______________________________________________________________________________ Bool_t CbmTrdParSetAsic::getParams(FairParamList* l) { - //LOG(info) << GetName() << "::getParams(FairParamList*)"; + // LOG(info) << GetName() << "::getParams(FairParamList*)"; if (!l) return kFALSE; if (!l->fill("NrOfModules", &fNrOfModules)) return kFALSE; TArrayI moduleId(fNrOfModules); @@ -121,7 +121,7 @@ Bool_t CbmTrdParSetAsic::getParams(FairParamList* l) void CbmTrdParSetAsic::putParams(FairParamList* l) { if (!l) return; - //LOG(info) << GetName() << "::putParams(FairParamList*)"; + // LOG(info) << GetName() << "::putParams(FairParamList*)"; Int_t idx(0); TArrayI moduleId(fNrOfModules), nAsic(fNrOfModules), typeAsic(fNrOfModules); @@ -186,20 +186,21 @@ void CbmTrdParSetAsic::putParams(FairParamList* l) for (auto iModuleIt : mod->fModuleMap) { int offset = iAsicNr * sizePerFasp; asicInfo[offset] = iModuleIt.first; - Int_t nchannels(((CbmTrdParAsic*) iModuleIt.second)->GetNchannels()); - CbmTrdParFasp* fasp = (CbmTrdParFasp*) iModuleIt.second; - for (Int_t ich(0); ich < nchannels; ich++) { - Int_t faspAddress = fasp->GetChannelAddress(ich); - asicInfo[offset + 1 + ich] = faspAddress; + CbmTrdParFasp* fasp = (CbmTrdParFasp*) iModuleIt.second; + Int_t ich(0); + for (auto chAddress : fasp->GetChannelAddresses()) { + asicInfo[offset + 1 + ich] = chAddress; const CbmTrdParFaspChannel* ch = fasp->GetChannel(ich); if (!ch) { - LOG(info) << "Missing calib for Fasp[" << offset << "] pad " << faspAddress; + LOG(info) << "Missing calib for Fasp[" << offset << "] pad " << chAddress; + ich++; continue; } asicInfo[offset + 1 + (1 * NFASPCH) + ich] = ch->GetPileUpTime(); asicInfo[offset + 1 + (2 * NFASPCH) + ich] = ch->GetThreshold(); asicInfo[offset + 1 + (3 * NFASPCH) + ich] = ch->GetMinDelaySignal(); + ich++; } iAsicNr++; }