From 64638b88d330ed26a91e22152332126ebad02f73 Mon Sep 17 00:00:00 2001 From: Nikolay Karpushkin <karpushkin@inr.ru> Date: Wed, 14 Jul 2021 16:37:06 +0200 Subject: [PATCH] time_fix --- core/data/psd/CbmPsdDsp.cxx | 7 +++++++ core/data/psd/CbmPsdDsp.h | 12 ++++++++++-- fles/mcbm2018/tasks/CbmMcbmCheckTimingAlgo.cxx | 5 ----- .../unpacker/CbmMcbm2018UnpackerAlgoPsd.cxx | 14 +++++++------- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/core/data/psd/CbmPsdDsp.cxx b/core/data/psd/CbmPsdDsp.cxx index 29d5b1b916..ee02009d3e 100644 --- a/core/data/psd/CbmPsdDsp.cxx +++ b/core/data/psd/CbmPsdDsp.cxx @@ -21,6 +21,7 @@ CbmPsdDsp::CbmPsdDsp() : fuAddress() , fdTime() + , fdTsTime() , fdEdep() , fuZL() , fdAccum() @@ -45,6 +46,7 @@ CbmPsdDsp::CbmPsdDsp() // --- Constructor with assignment CbmPsdDsp::CbmPsdDsp(UInt_t address, Double_t time, + Double_t ts_time, Double_t edep, UInt_t zl, Double_t accum, @@ -65,6 +67,7 @@ CbmPsdDsp::CbmPsdDsp(UInt_t address, : fuAddress(address) , fdTime(time) + , fdTsTime(ts_time) , fdEdep(edep) , fuZL(zl) , fdAccum(accum) @@ -90,6 +93,7 @@ CbmPsdDsp::CbmPsdDsp(UInt_t address, CbmPsdDsp::CbmPsdDsp(const CbmPsdDsp& other) : fuAddress(other.fuAddress) , fdTime(other.fdTime) + , fdTsTime(other.fdTsTime) , fdEdep(other.fdEdep) , fuZL(other.fuZL) , fdAccum(other.fdAccum) @@ -115,6 +119,7 @@ CbmPsdDsp::CbmPsdDsp(const CbmPsdDsp& other) CbmPsdDsp::CbmPsdDsp(CbmPsdDsp&& other) : fuAddress(other.fuAddress) , fdTime(other.fdTime) + , fdTsTime(other.fdTsTime) , fdEdep(other.fdEdep) , fuZL(other.fuZL) , fdAccum(other.fdAccum) @@ -150,6 +155,7 @@ CbmPsdDsp& CbmPsdDsp::operator=(const CbmPsdDsp& other) if (this != &other) { fuAddress = other.fuAddress; fdTime = other.fdTime; + fdTsTime = other.fdTsTime; fdEdep = other.fdEdep; fuZL = other.fuZL; fdAccum = other.fdAccum; @@ -178,6 +184,7 @@ CbmPsdDsp& CbmPsdDsp::operator=(CbmPsdDsp&& other) if (this != &other) { fuAddress = other.fuAddress; fdTime = other.fdTime; + fdTsTime = other.fdTsTime; fdEdep = other.fdEdep; fuZL = other.fuZL; fdAccum = other.fdAccum; diff --git a/core/data/psd/CbmPsdDsp.h b/core/data/psd/CbmPsdDsp.h index 67f166dfab..0e34123976 100644 --- a/core/data/psd/CbmPsdDsp.h +++ b/core/data/psd/CbmPsdDsp.h @@ -37,7 +37,7 @@ public: /** @brief Constructor with detailed assignment. **/ - CbmPsdDsp(UInt_t address, Double_t time, Double_t edep, UInt_t zl, Double_t accum, Double_t adc_time, + CbmPsdDsp(UInt_t address, Double_t time, Double_t ts_time, Double_t edep, UInt_t zl, Double_t accum, Double_t adc_time, Double_t edep_wfm, Double_t ampl, UInt_t minimum, UInt_t time_max, std::vector<std::uint16_t> wfm, Double_t fit_ampl, Double_t fit_zl, Double_t fit_edep, Double_t fit_r2, Double_t fit_time_max, std::vector<std::uint16_t> fit_wfm); @@ -81,6 +81,12 @@ public: Double_t GetTime() const { return fdTime; }; + /** @brief TsTime + ** @return TsTime [ns] + **/ + Double_t GetTsTime() const { return fdTsTime; }; + + /** @brief Energy deposit ** @return Energy deposit **/ @@ -112,7 +118,8 @@ public: void SetEdep(Double_t edep) { fdEdep = edep; } UInt_t fuAddress = 0; /// Unique channel address - Double_t fdTime = -1.; /// Time of measurement [ns] + Double_t fdTime = -1.; /// Time of measurement relative to TS [ns] + Double_t fdTsTime = -1.; /// Time of TimeSlice of measurement. Relative to first TS [ns] Double_t fdEdep = 0.; /// Energy deposition from FPGA [MeV] UInt_t fuZL = 0; /// ZeroLevel from waveform [adc counts] Double_t fdAccum = 0; /// FPGA FEE Accumulator @@ -136,6 +143,7 @@ public: { ar& fuAddress; ar& fdTime; + ar& fdTsTime; ar& fdEdep; ar& fuZL; ar& fdAccum; diff --git a/fles/mcbm2018/tasks/CbmMcbmCheckTimingAlgo.cxx b/fles/mcbm2018/tasks/CbmMcbmCheckTimingAlgo.cxx index ffd7ec3eb1..37c751e957 100644 --- a/fles/mcbm2018/tasks/CbmMcbmCheckTimingAlgo.cxx +++ b/fles/mcbm2018/tasks/CbmMcbmCheckTimingAlgo.cxx @@ -255,11 +255,6 @@ void CbmMcbmCheckTimingAlgo::CheckInterSystemOffset() dRefTime = fpT0DigiVec->at(uDigi).GetTime(); dRefCharge = fpT0DigiVec->at(uDigi).GetCharge(); } // if( ECbmModuleId::kT0 == fRefDet.detId ) - if (ECbmModuleId::kPsd == fRefDet.detId) { - dRefTime = fDigiMan->Get<DigiRef>(uDigi)->GetTime(); - dRefCharge = fDigiMan->Get<DigiRef>(uDigi)->GetCharge(); - uRefAddress = fDigiMan->Get<DigiRef>(uDigi)->GetAddress(); - } // if( ECbmModuleId::kT0 == fRefDet.detId ) else { dRefTime = fDigiMan->Get<DigiRef>(uDigi)->GetTime(); dRefCharge = fDigiMan->Get<DigiRef>(uDigi)->GetCharge(); diff --git a/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoPsd.cxx b/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoPsd.cxx index ec08fe3820..0a65c05f55 100644 --- a/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoPsd.cxx +++ b/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoPsd.cxx @@ -218,7 +218,7 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u uint32_t uSize = msDescriptor.size; fulCurrentMsIdx = msDescriptor.idx; - fdMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx); + fdMsTime = static_cast<double>(fulCurrentMsIdx); LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex << fuCurrentEquipmentId << std::dec << " has size: " << uSize; @@ -263,7 +263,7 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u /// Save start time of first valid MS ) if (fdStartTime < 0) fdStartTime = fdMsTime; - Double_t dMsRelativeTime = fdMsTime - fdStartTime; + Double_t dMsRelativeTime = fdMsTime - fdTsStartTime; // If MS time is less than start time print error and return if (fdMsTime - fdStartTime < 0) { @@ -316,7 +316,7 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u } if (ReadResult == 0) { - double prev_hit_time = + double prev_hit_time = dMsRelativeTime + (double) PsdReader.VectPackHdr.at(0).uAdcTime * 12.5 - fdTimeOffsetNs; //in ns //hit loop @@ -338,8 +338,8 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u UInt_t uChanUId = fviPsdChUId[uHitChannel]; //unique ID UInt_t fuAddress = uChanUId; /// Unique channel address - Double_t fdTime = dMsRelativeTime + (double) PsdReader.VectPackHdr.at(hit_iter).uAdcTime * 12.5 - - fdTimeOffsetNs; /// Time of measurement [ns] + Double_t fdTime = dMsRelativeTime + (double) PsdReader.VectPackHdr.at(hit_iter).uAdcTime * 12.5 - fdTimeOffsetNs; /// Time of measurement relative to TS [ns] + Double_t fdTsTime = fdTsStartTime - fdStartTime; /// Time of TimeSlice of measurement. Relative to first TS [ns] Double_t fdEdep = (double) PsdReader.VectHitHdr.at(hit_iter).uSignalCharge / fUnpackPar->GetMipCalibration(uHitChannel); /// Energy deposition from FPGA [MeV] UInt_t fuZL = PsdReader.VectHitHdr.at(hit_iter).uZeroLevel; /// ZeroLevel from waveform [adc counts] @@ -399,7 +399,7 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u fuFitWfm = Pfitter.GetFitWfm(); } - CbmPsdDsp dsp = CbmPsdDsp(fuAddress, fdTime, fdEdep, fuZL, fdAccum, fdAdcTime, + CbmPsdDsp dsp = CbmPsdDsp(fuAddress, fdTime, fdTsTime, fdEdep, fuZL, fdAccum, fdAdcTime, fdEdepWfm, fdAmpl, fuMinimum, fuTimeMax, fuWfm, @@ -560,7 +560,7 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::SetDspOutputPointer(std::vector<CbmPsdDsp>* c std::unique_ptr<CbmPsdDigi> CbmMcbm2018UnpackerAlgoPsd::MakeDigi(CbmPsdDsp dsp) { - std::unique_ptr<CbmPsdDigi> digi(new CbmPsdDigi(dsp.GetAddress(), dsp.GetTime(), dsp.GetEdep())); + std::unique_ptr<CbmPsdDigi> digi(new CbmPsdDigi( dsp.GetAddress(), dsp.GetTime(), dsp.fdFitEdep )); return digi; } -- GitLab