Commit 6745e41e authored by Pascal Raisig's avatar Pascal Raisig Committed by Pierre-Alain Loizeau
Browse files

Finally fully add rich in a hopefully working state

parent 01d262f3
......@@ -83,9 +83,8 @@ void run_unpack_tsa(std::string infile = "test.tsa", UInt_t runid = 0, const cha
// ---- RICH ----
auto richconfig = std::make_shared<CbmRichUnpackConfig>("", runid);
// psdconfig->SetDebugState();
// richconfig->SetDebugState();
richconfig->SetDoWriteOutput();
// psdconfig->SetDoWriteOptOutA("CbmPsdDsp");
std::string parfilesbasepathRich = Form("%s/macro/beamtime/mcbm2021/", srcDir.Data());
richconfig->SetParFilesBasePath(parfilesbasepathRich);
// -------------
......
......@@ -11,6 +11,8 @@
#include <Rtypes.h>
#include <RtypesCore.h>
#include <cstdint>
CbmRichUnpackAlgo::CbmRichUnpackAlgo() : CbmRecoUnpackAlgo(fgkFlesSubsystemIdTrdR, "CbmRichUnpackAlgo") {}
......@@ -90,6 +92,9 @@ bool CbmRichUnpackAlgo::unpack(const fles::Timeslice* ts, std::uint16_t icomp, U
CbmRichUnpackAlgoMicrosliceReader reader;
reader.SetData(mv.content(), msDesc.size);
auto mstime = msDesc.idx;
fMsRefTime = mstime - fTsStartTime;
// There are a lot of MS with 8 bytes size
// Does one need these MS?
if (reader.GetSize() <= 8) return true;
......@@ -394,8 +399,8 @@ void CbmRichUnpackAlgo::writeOutputDigi(Int_t fpgaID, Int_t channel, Double_t ti
Double_t ToTcorr = fbDoToTCorr ? fUnpackPar.GetToTshift(fpgaID, channel) : 0.;
Int_t pixelUID = this->getPixelUID(fpgaID, channel);
//check ordering
// Double_t finalTime = time + (Double_t) msRefTS - fSystemTimeoffset;
Double_t finalTime = time - fSystemTimeoffset - fTsStartTime;
Double_t finalTime = time + (Double_t) fMsRefTime - fSystemTimeoffset;
// Double_t finalTime = time - fSystemTimeoffset - fTsStartTime;
Double_t lastTime = 0.;
......
......@@ -319,6 +319,8 @@ protected:
double fMbsPrevTimeCh0 = 0.;
double fMbsPrevTimeCh1 = 0.;
size_t fMsRefTime = 0;
double fToTMin = -20.;
double fToTMax = 100.;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment