From bd531a5c95ea7744009f06df066061acd27d385f Mon Sep 17 00:00:00 2001
From: Pascal Raisig <praisig@ikf.uni-frankfurt.de>
Date: Fri, 16 Jul 2021 19:09:59 +0200
Subject: [PATCH] Fix warning message of sts

---
 reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx    | 7 ++++---
 reco/detectors/sts/unpack/CbmStsUnpackMonitor.cxx | 8 ++++----
 reco/detectors/trd/unpack/CbmTrdUnpackMonitor.cxx | 1 -
 reco/detectors/trd/unpack/CbmTrdUnpackMonitor.h   | 1 +
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx
index 84b9c426ea..75a4282f6b 100644
--- a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx
+++ b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx
@@ -11,6 +11,7 @@
 #include <RtypesCore.h>
 
 #include <cstdint>
+#include <iomanip>
 
 // FIXME
 // #include "StsXyterFinalHit.h"
@@ -27,7 +28,7 @@ uint32_t CbmStsUnpackAlgo::getAsicIndex(uint32_t dpbidx, uint32_t crobidx, uint1
 
   uint32_t asicidx      = 0;
   const int32_t uFebIdx = fElinkIdxToFebIdxVec.at(elinkidx);
-  uint32_t febtype      = fviFebType[fuCurrDpbIdx][crobidx][uFebIdx];
+  uint32_t febtype      = fviFebType[dpbidx][crobidx][uFebIdx];
   // Feb type a
   if (febtype == 0) asicidx = fElinkIdxToAsicIdxVec.at(elinkidx).first;
   //   Feb type b
@@ -35,7 +36,7 @@ uint32_t CbmStsUnpackAlgo::getAsicIndex(uint32_t dpbidx, uint32_t crobidx, uint1
   // else would be inactive feb, this was not handled in the previous implementation, this I expect it should not happen
 
 
-  uint32_t uAsicIdx = (fuCurrDpbIdx * fNrCrobPerDpb + crobidx) * fNrAsicsPerCrob + asicidx;
+  uint32_t uAsicIdx = (dpbidx * fNrCrobPerDpb + crobidx) * fNrAsicsPerCrob + asicidx;
   return uAsicIdx;
 }
 
@@ -693,7 +694,7 @@ bool CbmStsUnpackAlgo::unpack(const fles::Timeslice* ts, std::uint16_t icomp, UI
       LOG(info) << "---------------------------------------------------------------";
       // Had to remove this line otherwise we would get circle dependencies in the current stage of cbmroot, since we still have Unpackers in the fles folders, which require the reco folders
       // LOG(info) << FormatMsHeaderPrintout(msDescriptor);
-      LOG(warning) << fName << "unpack(...)::Could not find the sDPB index for AFCK id 0x" << std::hex << uCurrDpbId
+      LOG(warning) << fName << "::unpack(...)::Could not find the sDPB index for AFCK id 0x" << std::hex << uCurrDpbId
                    << std::dec << " in timeslice " << fNrProcessedTs << " in microslice " << imslice << " component "
                    << icomp << "\n"
                    << "If valid this index has to be added in the STS "
diff --git a/reco/detectors/sts/unpack/CbmStsUnpackMonitor.cxx b/reco/detectors/sts/unpack/CbmStsUnpackMonitor.cxx
index a42c5a2c58..adbb6d3540 100644
--- a/reco/detectors/sts/unpack/CbmStsUnpackMonitor.cxx
+++ b/reco/detectors/sts/unpack/CbmStsUnpackMonitor.cxx
@@ -290,13 +290,13 @@ void CbmStsUnpackMonitor::DrawCanvases()
 Bool_t CbmStsUnpackMonitor::CreateMsComponentSizeHistos(UInt_t component)
 {
   if (nullptr == fvhMsSize[component]) {
-    TString sMsSizeName  = Form("MsSize_link_%02lu", component);
-    TString sMsSizeTitle = Form("Size of MS for nDPB of link %02lu; Ms Size [bytes]", component);
+    TString sMsSizeName  = Form("MsSize_link_%02u", component);
+    TString sMsSizeTitle = Form("Size of MS for nDPB of link %02u; Ms Size [bytes]", component);
     fvhMsSize[component] = new TH1F(sMsSizeName.Data(), sMsSizeTitle.Data(), 30000, 0., 30000.);
     fvhMsSize[component]->SetCanExtend(TH2::kAllAxes);
 
-    sMsSizeName              = Form("MsSizeTime_link_%02lu", component);
-    sMsSizeTitle             = Form("Size of MS vs time for gDPB of link %02lu; Time[s] ; Ms Size [bytes]", component);
+    sMsSizeName              = Form("MsSizeTime_link_%02u", component);
+    sMsSizeTitle             = Form("Size of MS vs time for gDPB of link %02u; Time[s] ; Ms Size [bytes]", component);
     fvhMsSizeTime[component] = new TProfile(sMsSizeName.Data(), sMsSizeTitle.Data(), 15000, 0., 300.);
     fvhMsSizeTime[component]->SetCanExtend(TH2::kAllAxes);
 
diff --git a/reco/detectors/trd/unpack/CbmTrdUnpackMonitor.cxx b/reco/detectors/trd/unpack/CbmTrdUnpackMonitor.cxx
index d5ff730b3f..a710f23ced 100644
--- a/reco/detectors/trd/unpack/CbmTrdUnpackMonitor.cxx
+++ b/reco/detectors/trd/unpack/CbmTrdUnpackMonitor.cxx
@@ -89,7 +89,6 @@ void CbmTrdUnpackMonitor::Finish()
     TDirectory* oldDir = gDirectory;
 
     /// (Re-)Create ROOT file to store the histos
-    // std::unique_ptr<TFile> histofile(new TFile(fOutfilename.data(), "RECREATE"));
     TFile histofile(fOutfilename.data(), "RECREATE");
 
     nhistos += writeHistosToFile(&fDigiHistoMap, &histofile);
diff --git a/reco/detectors/trd/unpack/CbmTrdUnpackMonitor.h b/reco/detectors/trd/unpack/CbmTrdUnpackMonitor.h
index 99767b260d..aa171224b6 100644
--- a/reco/detectors/trd/unpack/CbmTrdUnpackMonitor.h
+++ b/reco/detectors/trd/unpack/CbmTrdUnpackMonitor.h
@@ -35,6 +35,7 @@
 
 #include <Rtypes.h>  // for types
 #include <RtypesCore.h>
+#include <TFile.h>
 #include <TH1.h>
 #include <THttpServer.h>  // for histogram server
 
-- 
GitLab