From ab1588ccb5816941dbe1762c9e3d645727ad5acb Mon Sep 17 00:00:00 2001 From: Nikolay Karpushkin <karpushkin@inr.ru> Date: Wed, 23 Jun 2021 14:57:27 +0300 Subject: [PATCH] apply clang --- core/data/psd/CbmPsdDigi.cxx | 22 +++--- core/data/psd/CbmPsdDigi.h | 37 +++++---- core/data/raw/PsdGbtReader-v1.00.cxx | 28 +++---- core/data/raw/PsdGbtReader-v1.00.h | 4 +- .../monitor/CbmMcbm2018MonitorAlgoPsd.cxx | 53 +++++++------ .../unpacker/CbmMcbm2018UnpackerAlgoPsd.cxx | 79 ++++++++++--------- 6 files changed, 109 insertions(+), 114 deletions(-) diff --git a/core/data/psd/CbmPsdDigi.cxx b/core/data/psd/CbmPsdDigi.cxx index 16f6668fdc..490424835a 100644 --- a/core/data/psd/CbmPsdDigi.cxx +++ b/core/data/psd/CbmPsdDigi.cxx @@ -22,7 +22,7 @@ CbmPsdDigi::CbmPsdDigi() {} // --- Constructor with assignment -CbmPsdDigi::CbmPsdDigi(UInt_t address, Double_t time, Double_t edep) : fuAddress(address), fdTime(time), fdEdep(edep){} +CbmPsdDigi::CbmPsdDigi(UInt_t address, Double_t time, Double_t edep) : fuAddress(address), fdTime(time), fdEdep(edep) {} // --- Constructor with module and section number @@ -98,10 +98,10 @@ CbmPsdDigi& CbmPsdDigi::operator=(const CbmPsdDigi& other) fdAmpl = other.fdAmpl; fuTimeMax = other.fuTimeMax; - fdFitAmpl = other.fdFitAmpl; - fdFitZL = other.fdFitZL; - fdFitEdep = other.fdFitEdep; - fdFitR2 = other.fdFitR2; + fdFitAmpl = other.fdFitAmpl; + fdFitZL = other.fdFitZL; + fdFitEdep = other.fdFitEdep; + fdFitR2 = other.fdFitR2; fdFitTimeMax = other.fdFitTimeMax; } return *this; @@ -123,10 +123,10 @@ CbmPsdDigi& CbmPsdDigi::operator=(CbmPsdDigi&& other) fdAmpl = other.fdAmpl; fuTimeMax = other.fuTimeMax; - fdFitAmpl = other.fdFitAmpl; - fdFitZL = other.fdFitZL; - fdFitEdep = other.fdFitEdep; - fdFitR2 = other.fdFitR2; + fdFitAmpl = other.fdFitAmpl; + fdFitZL = other.fdFitZL; + fdFitEdep = other.fdFitEdep; + fdFitR2 = other.fdFitR2; fdFitTimeMax = other.fdFitTimeMax; } return *this; @@ -182,7 +182,7 @@ void CbmPsdDigi::Streamer(TBuffer& R__b) R__b >> fdTime; R__b >> fdEdep; R__b >> fuZL; - R__b >> fdAccum; + R__b >> fdAccum; R__b >> fdAdcTime; R__b >> fdEdepWfm; @@ -233,7 +233,7 @@ void CbmPsdDigi::Streamer(TBuffer& R__b) R__b << fdTime; R__b << fdEdep; R__b << fuZL; - R__b << fdAccum; + R__b << fdAccum; R__b << fdAdcTime; R__b << fdEdepWfm; diff --git a/core/data/psd/CbmPsdDigi.h b/core/data/psd/CbmPsdDigi.h index f511e00cb0..07dc9d1dd1 100644 --- a/core/data/psd/CbmPsdDigi.h +++ b/core/data/psd/CbmPsdDigi.h @@ -139,34 +139,33 @@ public: std::string ToString() const; - UInt_t fuAddress = 0; /// Unique channel address - Double_t fdTime = -1.; /// Time of measurement [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 - Double_t fdAdcTime = -1.; /// Adc time of measurement + UInt_t fuAddress = 0; /// Unique channel address + Double_t fdTime = -1.; /// Time of measurement [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 + Double_t fdAdcTime = -1.; /// Adc time of measurement - Double_t fdEdepWfm = 0.; /// Energy deposition from waveform [MeV] - Double_t fdAmpl = 0.; /// Amplitude from waveform [mV] - UInt_t fuTimeMax = 0; /// Time of maximum in waveform [adc samples] + Double_t fdEdepWfm = 0.; /// Energy deposition from waveform [MeV] + Double_t fdAmpl = 0.; /// Amplitude from waveform [mV] + UInt_t fuTimeMax = 0; /// Time of maximum in waveform [adc samples] - Double_t fdFitAmpl = 0.; /// Amplitude from fit of waveform [mV] - Double_t fdFitZL = 0.; /// ZeroLevel from fit of waveform [adc counts] - Double_t fdFitEdep = 0.; /// Energy deposition from fit of waveform [MeV] - Double_t fdFitR2 = 999.; /// Quality of waveform fit [] -- good near 0 - Double_t fdFitTimeMax = -1.; /// Time of maximum in fit of waveform [adc samples] + Double_t fdFitAmpl = 0.; /// Amplitude from fit of waveform [mV] + Double_t fdFitZL = 0.; /// ZeroLevel from fit of waveform [adc counts] + Double_t fdFitEdep = 0.; /// Energy deposition from fit of waveform [MeV] + Double_t fdFitR2 = 999.; /// Quality of waveform fit [] -- good near 0 + Double_t fdFitTimeMax = -1.; /// Time of maximum in fit of waveform [adc samples] //LEGACY Float_t ffFitHarmonic1 = 0.; Float_t ffFitHarmonic2 = 0.; - Float_t ffFitR2 = 999.; - Float_t ffFitEdep = 0.; - UInt_t fuAmpl = 0; + Float_t ffFitR2 = 999.; + Float_t ffFitEdep = 0.; + UInt_t fuAmpl = 0; private: - /// BOOST serialization interface friend class boost::serialization::access; template<class Archive> @@ -176,7 +175,7 @@ private: ar& fdTime; ar& fdEdep; ar& fuZL; - ar& fdAccum; + ar& fdAccum; ar& fdAdcTime; ar& fdEdepWfm; diff --git a/core/data/raw/PsdGbtReader-v1.00.cxx b/core/data/raw/PsdGbtReader-v1.00.cxx index ed10df9f90..8d1af6217c 100644 --- a/core/data/raw/PsdGbtReader-v1.00.cxx +++ b/core/data/raw/PsdGbtReader-v1.00.cxx @@ -24,9 +24,8 @@ namespace PsdDataV100 void PsdGbtReader::ReadMsHeader() { MsHdr.clear(); - save_buffer<<std::hex - <<std::setfill('0')<<std::setw(16)<<buffer[word_index]<<std::endl - <<std::setfill('0')<<std::setw(16)<<buffer[word_index+1]<<std::endl; + save_buffer << std::hex << std::setfill('0') << std::setw(16) << buffer[word_index] << std::endl + << std::setfill('0') << std::setw(16) << buffer[word_index + 1] << std::endl; MsHdr.uMagicWord = (buffer[word_index] >> 32) & 0xff; MsHdr.ulMicroSlice = ((buffer[word_index] & 0xffffff) << 40) | (buffer[word_index + 1] & 0xffffffffff); @@ -38,9 +37,8 @@ namespace PsdDataV100 void PsdGbtReader::ReadPackHeader() { PackHdr.clear(); - save_buffer<<std::hex - <<std::setfill('0')<<std::setw(16)<<buffer[word_index]<<std::endl - <<std::setfill('0')<<std::setw(16)<<buffer[word_index+1]<<std::endl; + save_buffer << std::hex << std::setfill('0') << std::setw(16) << buffer[word_index] << std::endl + << std::setfill('0') << std::setw(16) << buffer[word_index + 1] << std::endl; buffer_shift = 0; PackHdr.uHitsNumber = (buffer[word_index] >> buffer_shift) & (((static_cast<uint16_t>(1)) << PackHdr.HNs) - 1); @@ -63,9 +61,8 @@ namespace PsdDataV100 void PsdGbtReader::ReadHitHeader() { HitHdr.clear(); - save_buffer<<std::hex - <<std::setfill('0')<<std::setw(16)<<buffer[word_index]<<std::endl - <<std::setfill('0')<<std::setw(16)<<buffer[word_index+1]<<std::endl; + save_buffer << std::hex << std::setfill('0') << std::setw(16) << buffer[word_index] << std::endl + << std::setfill('0') << std::setw(16) << buffer[word_index + 1] << std::endl; buffer_shift = 8; HitHdr.uFeeAccum = (buffer[word_index] >> buffer_shift) & (((static_cast<uint32_t>(1)) << HitHdr.FAs) - 1); @@ -86,9 +83,8 @@ namespace PsdDataV100 void PsdGbtReader::ReadHitData() { - save_buffer<<std::hex - <<std::setfill('0')<<std::setw(16)<<buffer[word_index]<<std::endl - <<std::setfill('0')<<std::setw(16)<<buffer[word_index+1]<<std::endl; + save_buffer << std::hex << std::setfill('0') << std::setw(16) << buffer[word_index] << std::endl + << std::setfill('0') << std::setw(16) << buffer[word_index + 1] << std::endl; uint16_t wfm_point = 0; wfm_point = ((buffer[word_index] >> 8) & 0xffff); @@ -106,8 +102,7 @@ namespace PsdDataV100 void PsdGbtReader::ReadMsTrailer() { - save_buffer<<std::hex - <<std::setfill('0')<<std::setw(16)<<buffer[word_index]<<std::endl; + save_buffer << std::hex << std::setfill('0') << std::setw(16) << buffer[word_index] << std::endl; MsTrlr.uEmpty0 = buffer[word_index]; word_index++; @@ -169,10 +164,7 @@ namespace PsdDataV100 } - void PsdGbtReader::PrintSaveBuff() - { - printf("%s\n", save_buffer.str().c_str()); - } + void PsdGbtReader::PrintSaveBuff() { printf("%s\n", save_buffer.str().c_str()); } void PsdGbtReader::PrintOut() { diff --git a/core/data/raw/PsdGbtReader-v1.00.h b/core/data/raw/PsdGbtReader-v1.00.h index 9d463d5159..5d7ed091aa 100644 --- a/core/data/raw/PsdGbtReader-v1.00.h +++ b/core/data/raw/PsdGbtReader-v1.00.h @@ -9,10 +9,10 @@ #define PSD_GBT_READER_V100_H #include <cstdint> // for uint16_t, uint64_t, uint32_t +#include <iomanip> // for setw, setfill +#include <sstream> // for sstream #include <string> // for string #include <vector> // for vector -#include <sstream> // for sstream -#include <iomanip> // for setw, setfill #include <stdint.h> // for uint64_t, uint32_t diff --git a/fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoPsd.cxx b/fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoPsd.cxx index bd9f56e525..f725506e2d 100644 --- a/fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoPsd.cxx +++ b/fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoPsd.cxx @@ -366,7 +366,7 @@ Bool_t CbmMcbm2018MonitorAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t uM } switch (fuRawDataVersion) { -// -------------------------------------------------------------------------------------------------- + // -------------------------------------------------------------------------------------------------- case 100: { PsdDataV100::PsdGbtReader PsdReader(pInBuff); @@ -388,7 +388,7 @@ Bool_t CbmMcbm2018MonitorAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t uM break; } - uint16_t uHitChannel = PsdReader.VectHitHdr.at(hit_iter).uHitChannel; + uint16_t uHitChannel = PsdReader.VectHitHdr.at(hit_iter).uHitChannel; //uint8_t uLinkIndex = PsdReader.VectPackHdr.at(hit_iter).uLinkIndex; uint32_t uSignalCharge = PsdReader.VectHitHdr.at(hit_iter).uSignalCharge; uint16_t uZeroLevel = PsdReader.VectHitHdr.at(hit_iter).uZeroLevel; @@ -413,8 +413,8 @@ Bool_t CbmMcbm2018MonitorAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t uM if (fbMonitorChanMode) { fvhHitChargeChan[uHitChannel]->Fill(uSignalCharge); fvhHitZeroLevelChan[uHitChannel]->Fill(uZeroLevel); - fvhHitZLChanEvo[uHitChannel]->Fill(fdMsTime - fdStartTime, uZeroLevel); - fvhHitFAChanEvo[uHitChannel]->Fill(fdMsTime - fdStartTime, uAccum); + fvhHitZLChanEvo[uHitChannel]->Fill(fdMsTime - fdStartTime, uZeroLevel); + fvhHitFAChanEvo[uHitChannel]->Fill(fdMsTime - fdStartTime, uAccum); //Hit data int32_t iHitAmlpitude = 0; @@ -435,7 +435,7 @@ Bool_t CbmMcbm2018MonitorAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t uM fvhHitChargeByWfmChan[uHitChannel]->Fill(iHitChargeWfm); if (fbMonitorWfmMode) { - fvhHitLPChanEvo[uHitChannel]->Fill(fdMsTime - fdStartTime, uWfm.back()); + fvhHitLPChanEvo[uHitChannel]->Fill(fdMsTime - fdStartTime, uWfm.back()); for (UInt_t wfm_iter = 0; wfm_iter < uWfm.size(); wfm_iter++) fvhHitWfmChan[uHitChannel]->Fill(wfm_iter, uWfm.at(wfm_iter)); fvhHitWfmChan[uHitChannel]->SetTitle( @@ -487,10 +487,9 @@ Bool_t CbmMcbm2018MonitorAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t uM std::vector<uint16_t> uFitWfm = Pfitter.GetFitWfm(); for (UInt_t wfm_iter = 0; wfm_iter < uFitWfm.size(); wfm_iter++) fvhHitFitWfmChan[uHitChannel]->Fill(wfm_iter, uFitWfm.at(wfm_iter)); - fvhHitWfmChan[uHitChannel]->SetTitle( - Form("Waveform channel %03u charge %0u zero level %0u R2 %.5f; " - "Time [adc counts]; Amplitude [adc counts]", - uHitChannel, uSignalCharge, uZeroLevel, fit_R2)); + fvhHitWfmChan[uHitChannel]->SetTitle(Form("Waveform channel %03u charge %0u zero level %0u R2 %.5f; " + "Time [adc counts]; Amplitude [adc counts]", + uHitChannel, uSignalCharge, uZeroLevel, fit_R2)); fvhFitQaChan[uHitChannel]->Fill(fit_integral, fit_R2); @@ -557,8 +556,8 @@ Bool_t CbmMcbm2018MonitorAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t uM break; } // case 1 -// -------------------------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------------------------- + // -------------------------------------------------------------------------------------------------- + // -------------------------------------------------------------------------------------------------- case 000: { PsdDataV000::PsdGbtReader PsdReader(pInBuff); @@ -672,10 +671,9 @@ Bool_t CbmMcbm2018MonitorAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t uM std::vector<uint16_t> uFitWfm = Pfitter.GetFitWfm(); for (UInt_t wfm_iter = 0; wfm_iter < uFitWfm.size(); wfm_iter++) fvhHitFitWfmChan[uHitChannel]->Fill(wfm_iter, uFitWfm.at(wfm_iter)); - fvhHitWfmChan[uHitChannel]->SetTitle( - Form("Waveform channel %03u charge %0u zero level %0u R2 %.5f; " - "Time [adc counts]; Amplitude [adc counts]", - uHitChannel, uSignalCharge, uZeroLevel, fit_R2)); + fvhHitWfmChan[uHitChannel]->SetTitle(Form("Waveform channel %03u charge %0u zero level %0u R2 %.5f; " + "Time [adc counts]; Amplitude [adc counts]", + uHitChannel, uSignalCharge, uZeroLevel, fit_R2)); fvhFitQaChan[uHitChannel]->Fill(fit_integral, fit_R2); @@ -747,7 +745,7 @@ Bool_t CbmMcbm2018MonitorAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t uM break; } // case 0 -// -------------------------------------------------------------------------------------------------- + // -------------------------------------------------------------------------------------------------- } // switch @@ -821,17 +819,20 @@ Bool_t CbmMcbm2018MonitorAlgoPsd::CreateHistograms() for (UInt_t uChan = 0; uChan < kuNbChanPsd; ++uChan) { - fvhHitZLChanEvo[uChan] = new TH2I(Form("hHitZLChanEvo%03u", uChan), - Form("Hits ZeroLevel evolution for channel %03u; ZeroLevel [adc counts]", uChan), - fuHistoryHistoSize, 0, fuHistoryHistoSize, fviHistoZLArgs.at(0), fviHistoZLArgs.at(1), fviHistoZLArgs.at(2)); + fvhHitZLChanEvo[uChan] = + new TH2I(Form("hHitZLChanEvo%03u", uChan), + Form("Hits ZeroLevel evolution for channel %03u; ZeroLevel [adc counts]", uChan), fuHistoryHistoSize, + 0, fuHistoryHistoSize, fviHistoZLArgs.at(0), fviHistoZLArgs.at(1), fviHistoZLArgs.at(2)); fvhHitZLChanEvo[uChan]->SetMarkerColor(kRed); - fvhHitLPChanEvo[uChan] = new TH2I(Form("hHitLPChanEvo%03u", uChan), - Form("Hits LastPoint evolution for channel %03u; ZeroLevel [adc counts]", uChan), - fuHistoryHistoSize, 0, fuHistoryHistoSize, fviHistoZLArgs.at(0), fviHistoZLArgs.at(1), fviHistoZLArgs.at(2)); + fvhHitLPChanEvo[uChan] = + new TH2I(Form("hHitLPChanEvo%03u", uChan), + Form("Hits LastPoint evolution for channel %03u; ZeroLevel [adc counts]", uChan), fuHistoryHistoSize, + 0, fuHistoryHistoSize, fviHistoZLArgs.at(0), fviHistoZLArgs.at(1), fviHistoZLArgs.at(2)); fvhHitLPChanEvo[uChan]->SetMarkerColor(kBlue); - fvhHitFAChanEvo[uChan] = new TH2I(Form("hHitFAChanEvo%03u", uChan), - Form("Hits FeeAccumulator evolution for channel %03u; ZeroLevel [adc counts]", uChan), - fuHistoryHistoSize, 0, fuHistoryHistoSize, fviHistoZLArgs.at(0), fviHistoZLArgs.at(1), fviHistoZLArgs.at(2)); + fvhHitFAChanEvo[uChan] = new TH2I( + Form("hHitFAChanEvo%03u", uChan), + Form("Hits FeeAccumulator evolution for channel %03u; ZeroLevel [adc counts]", uChan), fuHistoryHistoSize, 0, + fuHistoryHistoSize, fviHistoZLArgs.at(0), fviHistoZLArgs.at(1), fviHistoZLArgs.at(2)); fvhHitFAChanEvo[uChan]->SetMarkerColor(kOrange); @@ -1008,7 +1009,7 @@ Bool_t CbmMcbm2018MonitorAlgoPsd::CreateHistograms() /*******************************************************************/ /// ZL evo all channels - fcZLevo= new TCanvas("cZLevo", "ZeroLevel evolaution in all channels", w, h); + fcZLevo = new TCanvas("cZLevo", "ZeroLevel evolaution in all channels", w, h); fcZLevo->DivideSquare(kuNbChanPsd); for (UInt_t uChan = 0; uChan < kuNbChanPsd; uChan++) { diff --git a/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoPsd.cxx b/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoPsd.cxx index fdbaa4054c..db12509864 100644 --- a/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoPsd.cxx +++ b/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoPsd.cxx @@ -220,13 +220,13 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessTs(const fles::Timeslice& ts) } // for( fuMsIndex = 0; fuMsIndex < uNbMsLoop; fuMsIndex ++ ) -for (auto &elem : fDigiVect) -{ - - if ( elem.GetSectionID() <10 && elem.fuZL < 100) { printf("NOWW %s %u %f %f\n", elem.ToString().c_str(), elem.fuZL, elem.fdAmpl, elem.ffFitEdep ); /*PsdReader.PrintSaveBuff();*/ } - + for (auto& elem : fDigiVect) { -} + if (elem.GetSectionID() < 10 && elem.fuZL < 100) { + printf("NOWW %s %u %f %f\n", elem.ToString().c_str(), elem.fuZL, elem.fdAmpl, + elem.ffFitEdep); /*PsdReader.PrintSaveBuff();*/ + } + } /// Sort the buffers of hits due to the time offsets applied @@ -304,7 +304,7 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u // Prepare variables for the loop on contents const uint64_t* pInBuff = reinterpret_cast<const uint64_t*>(msContent); -/* + /* if (uSize != 0) { printf("%u = %u 64bit messages\n", uSize, uNbMessages); for(uint32_t line_iter = 0; line_iter<uNbMessages; line_iter++){ @@ -313,21 +313,22 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u } */ - if ((fair::Logger::Logging(fair::Severity::debug)) && (uNbMessages > 1)){ + if ((fair::Logger::Logging(fair::Severity::debug)) && (uNbMessages > 1)) { printf("%u = %u 64bit messages\n", uSize, uNbMessages); - for(uint32_t line_iter = 0; line_iter<uNbMessages-2; line_iter+=2){ - printf("%010lx", (pInBuff[line_iter] &0xffffffffff)); - printf("%010lx", (pInBuff[line_iter+1]&0xffffffffff)); - printf(" %u - %u", line_iter+1, line_iter+2); printf("\n"); + for (uint32_t line_iter = 0; line_iter < uNbMessages - 2; line_iter += 2) { + printf("%010lx", (pInBuff[line_iter] & 0xffffffffff)); + printf("%010lx", (pInBuff[line_iter + 1] & 0xffffffffff)); + printf(" %u - %u", line_iter + 1, line_iter + 2); + printf("\n"); } - printf("%020lx %u\n", pInBuff[uNbMessages-1], uNbMessages); + printf("%020lx %u\n", pInBuff[uNbMessages - 1], uNbMessages); } // every 80bit gbt word is decomposed into two 64bit words if (uNbMessages > 1) { //more than one 64 bit word switch (fuRawDataVersion) { -// -------------------------------------------------------------------------------------------------- + // -------------------------------------------------------------------------------------------------- case 100: { PsdDataV100::PsdGbtReader PsdReader(pInBuff); @@ -335,10 +336,13 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u while (PsdReader.GetTotalGbtWordsRead() < uNbMessages) { int ReadResult = PsdReader.ReadMs(); - if (fair::Logger::Logging(fair::Severity::debug)) { printf("\n"); PsdReader.PrintOut(); /*PsdReader.PrintSaveBuff();*/ } + if (fair::Logger::Logging(fair::Severity::debug)) { + printf("\n"); + PsdReader.PrintOut(); /*PsdReader.PrintSaveBuff();*/ + } if (ReadResult == 0) { - double prev_hit_time = (double) fulCurrentMsIdx + PsdReader.VectPackHdr.at(0).uAdcTime * 12.5; //in ns + double prev_hit_time = (double) fulCurrentMsIdx + PsdReader.VectPackHdr.at(0).uAdcTime * 12.5; //in ns //hit loop for (uint64_t hit_iter = 0; hit_iter < PsdReader.VectHitHdr.size(); hit_iter++) { if (PsdReader.VectPackHdr.size() != PsdReader.VectHitHdr.size()) { @@ -348,7 +352,7 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u break; } - uint8_t uHitChannel = PsdReader.VectHitHdr.at(hit_iter).uHitChannel; + uint8_t uHitChannel = PsdReader.VectHitHdr.at(hit_iter).uHitChannel; //uint8_t uLinkIndex = PsdReader.VectPackHdr.at(hit_iter).uLinkIndex; uint32_t uSignalCharge = PsdReader.VectHitHdr.at(hit_iter).uSignalCharge; uint16_t uZeroLevel = PsdReader.VectHitHdr.at(hit_iter).uZeroLevel; @@ -358,7 +362,7 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u int32_t iHitAmlpitude = 0; int32_t iHitChargeWfm = 0; - uint8_t uHitTimeMax = 0; + uint8_t uHitTimeMax = 0; if (!uWfm.empty()) { iHitChargeWfm = std::accumulate(uWfm.begin(), uWfm.end(), 0); iHitChargeWfm -= uZeroLevel * uWfm.size(); @@ -367,7 +371,7 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u assert(max_iter != uWfm.end()); if (max_iter == uWfm.end()) break; - uHitTimeMax = std::distance(uWfm.begin(), max_iter); + uHitTimeMax = std::distance(uWfm.begin(), max_iter); iHitAmlpitude = *max_iter - uZeroLevel; } @@ -383,17 +387,17 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u double dEdep = (double) uSignalCharge / fUnpackPar->GetMipCalibration(uHitChannel); // ->now in MeV double dEdepWfm = (double) iHitChargeWfm / fUnpackPar->GetMipCalibration(uHitChannel); // ->now in MeV - double dAmpl = (double) iHitAmlpitude / 16.5; // -> now in mV + double dAmpl = (double) iHitAmlpitude / 16.5; // -> now in mV CbmPsdDigi digi; digi.fuAddress = uChanUId; - digi.fdTime = dHitTime; - digi.fdEdep = dEdep; - digi.fuZL = uZeroLevel; - digi.fdAccum = (double) PsdReader.VectHitHdr.at(hit_iter).uFeeAccum; + digi.fdTime = dHitTime; + digi.fdEdep = dEdep; + digi.fuZL = uZeroLevel; + digi.fdAccum = (double) PsdReader.VectHitHdr.at(hit_iter).uFeeAccum; digi.fdAdcTime = (double) PsdReader.VectPackHdr.at(hit_iter).uAdcTime; digi.fdEdepWfm = dEdepWfm; - digi.fdAmpl = dAmpl; + digi.fdAmpl = dAmpl; digi.fuTimeMax = uHitTimeMax; digi.fdFitEdep = uWfm.back(); @@ -401,10 +405,10 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u //DEBUG - if( dHitTime < prev_hit_time ) printf("negative time!\n"); + if (dHitTime < prev_hit_time) printf("negative time!\n"); //DEBUG END prev_hit_time = dHitTime; - //DEBUG + //DEBUG } // for(int hit_iter = 0; hit_iter < PsdReader.EvHdrAb.uHitsNumber; hit_iter++) } @@ -434,9 +438,9 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u << "\n"; break; - } // case 100 -// -------------------------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------------------------- + } // case 100 + // -------------------------------------------------------------------------------------------------- + // -------------------------------------------------------------------------------------------------- case 000: { PsdDataV000::PsdGbtReader PsdReader(pInBuff); @@ -487,11 +491,11 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u CbmPsdDigi digi; digi.fuAddress = uChanUId; - digi.fdTime = dAdcTime; - digi.fdEdep = (double) uSignalCharge; - digi.fuAmpl = uHitAmlpitude; + digi.fdTime = dAdcTime; + digi.fdEdep = (double) uSignalCharge; + digi.fuAmpl = uHitAmlpitude; digi.fdEdepWfm = (double) uHitChargeWfm; - digi.fuZL = uZeroLevel; + digi.fuZL = uZeroLevel; fDigiVect.emplace_back(digi); @@ -528,15 +532,14 @@ Bool_t CbmMcbm2018UnpackerAlgoPsd::ProcessMs(const fles::Timeslice& ts, size_t u << " in microslice " << fulCurrentMsIdx << " by PsdReader " << PsdReader.EvHdrAb.ulMicroSlice << "\n"; break; - }//case 000 -// -------------------------------------------------------------------------------------------------- + } //case 000 + // -------------------------------------------------------------------------------------------------- - } // switch + } // switch } //if(uNbMessages > 1) - return kTRUE; } -- GitLab