From c30dff1839015e5526266cb44dd7a46129b9a21f Mon Sep 17 00:00:00 2001
From: Felix Weiglhofer <weiglhofer@fias.uni-frankfurt.de>
Date: Mon, 26 Feb 2024 15:25:01 +0000
Subject: [PATCH] CbmDefs.h: Use fwd declaration of std::ostream.

---
 algo/ca/core/tracking/CaFramework.h           |  3 +++
 algo/detectors/trd/UnpackMS.cxx               |  2 +-
 .../dielectron/pi0eta/CbmKresTemperature.cxx  |  5 ++--
 core/data/CbmDefs.cxx                         |  1 +
 core/data/CbmDefs.h                           |  2 +-
 fles/cosy2019/unpacker/CbmStsCoincHodo.cxx    |  3 +--
 fles/mcbm2018/tasks/CbmMcbmCheckTimingAlgo.h  |  6 ++---
 .../rich/unpack/CbmRichUnpackAlgoBase.h       |  2 +-
 reco/detectors/trd/CbmTrdHitProducer.cxx      |  1 +
 reco/detectors/trd/CbmTrdModuleRec2D.h        | 24 +++++++++----------
 .../digis/CbmTaskBuildRawEvents.cxx           |  1 +
 reco/global/CbmRecoT0.cxx                     |  1 +
 sim/detectors/bmon/CbmBmonDigitize.cxx        |  1 +
 13 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/algo/ca/core/tracking/CaFramework.h b/algo/ca/core/tracking/CaFramework.h
index 2aa292e237..deb9b164b7 100644
--- a/algo/ca/core/tracking/CaFramework.h
+++ b/algo/ca/core/tracking/CaFramework.h
@@ -220,6 +220,9 @@ namespace cbm::algo::ca
     Parameters<fvec> fParameters;  ///< Object of Framework parameters class
     InputData fInputData;          ///< Tracking input data
 
+    Vector<unsigned char> fvHitKeyFlags{
+      "Framework::fvHitKeyFlags"};  ///< List of key flags: has been this hit or cluster already used
+
     TrackingMonitorData fMonitorData{};  ///< Tracking monitor data (statistics per call)
 
     int fNofThreads = 1;  ///< Number of threads to execute the track-finder
diff --git a/algo/detectors/trd/UnpackMS.cxx b/algo/detectors/trd/UnpackMS.cxx
index 1ae1f29bf2..01cdbdc102 100644
--- a/algo/detectors/trd/UnpackMS.cxx
+++ b/algo/detectors/trd/UnpackMS.cxx
@@ -336,7 +336,7 @@ namespace cbm::algo::trd
       return Spadic::MsInfoType::kMIS;
     }
     else {
-      // TODO: track this error
+      // TODO: Track this error!
       L_(error) << "UnpackMS::GetInfoType] unknown type!";
       return Spadic::MsInfoType::kMSB;
     }
diff --git a/analysis/PWGDIL/dielectron/pi0eta/CbmKresTemperature.cxx b/analysis/PWGDIL/dielectron/pi0eta/CbmKresTemperature.cxx
index 9c09509388..b54caef7fb 100644
--- a/analysis/PWGDIL/dielectron/pi0eta/CbmKresTemperature.cxx
+++ b/analysis/PWGDIL/dielectron/pi0eta/CbmKresTemperature.cxx
@@ -10,7 +10,7 @@
  *    modified 30.01.2020
  *
  *
- *    Class is based only on MCtrue information. 
+ *    Class is based only on MCtrue information.
  *    Loop over all MCtrue tracks and plot the temperature spectrum distribution of all produced particles of interest (pions, kaons, photons, protons).
  *    These spectra show the expectations of temperature from temperature analysis. -> one needs to fit them at the end
  *
@@ -21,12 +21,11 @@
 #include "CbmGlobalTrack.h"
 #include "CbmMCTrack.h"
 #include "CbmStsTrack.h"
-
 #include "FairRootManager.h"
-
 #include "TH1.h"
 #include "TH1D.h"
 
+#include <iostream>
 
 using namespace std;
 
diff --git a/core/data/CbmDefs.cxx b/core/data/CbmDefs.cxx
index 81049a899b..bd4d9a0082 100644
--- a/core/data/CbmDefs.cxx
+++ b/core/data/CbmDefs.cxx
@@ -7,6 +7,7 @@
 #include <algorithm>
 #include <array>
 #include <cctype>
+#include <ostream>
 #include <stdexcept>  // for out_of_range
 
 // operator ++ for ECbmModuleId for convenient usage in loops
diff --git a/core/data/CbmDefs.h b/core/data/CbmDefs.h
index 20121e1491..09b9994427 100644
--- a/core/data/CbmDefs.h
+++ b/core/data/CbmDefs.h
@@ -12,7 +12,7 @@
 #ifndef CBMDEFS_H
 #define CBMDEFS_H 1
 
-#include <iostream>  // for ostream
+#include <iosfwd>  // for ostream
 #include <string>
 #include <type_traits>  // for underlying_type
 
diff --git a/fles/cosy2019/unpacker/CbmStsCoincHodo.cxx b/fles/cosy2019/unpacker/CbmStsCoincHodo.cxx
index 1716143ea1..9067d508e6 100644
--- a/fles/cosy2019/unpacker/CbmStsCoincHodo.cxx
+++ b/fles/cosy2019/unpacker/CbmStsCoincHodo.cxx
@@ -7,11 +7,9 @@
 #include "CbmStsCluster.h"
 #include "CbmStsDigi.h"
 #include "CbmStsHit.h"
-
 #include "FairRootManager.h"
 #include "FairRunOnline.h"
 #include "Logger.h"
-
 #include "TClonesArray.h"
 #include "TFile.h"
 #include "TH1.h"
@@ -20,6 +18,7 @@
 #include "THttpServer.h"
 
 #include <iomanip>
+#include <iostream>
 using std::fixed;
 using std::setprecision;
 
diff --git a/fles/mcbm2018/tasks/CbmMcbmCheckTimingAlgo.h b/fles/mcbm2018/tasks/CbmMcbmCheckTimingAlgo.h
index cb837ccb66..13e4c0b52a 100644
--- a/fles/mcbm2018/tasks/CbmMcbmCheckTimingAlgo.h
+++ b/fles/mcbm2018/tasks/CbmMcbmCheckTimingAlgo.h
@@ -115,15 +115,15 @@ private:
    * @return size of vector
    */
   template<class Digi>
-  uint GetDigiInfo(UInt_t iDigi, std::vector<std::tuple<double, double, uint>>* vec,
-                   ECbmModuleId detId = ECbmModuleId::kNotExist);
+  UInt_t GetDigiInfo(UInt_t iDigi, std::vector<std::tuple<double, double, UInt_t>>* vec,
+                     ECbmModuleId detId = ECbmModuleId::kNotExist);
   /** @brief Retrieve the detector view corresponding to the digi data (@see CheckTimingDetector::vName)
    * @param det detector definitions
    * @param info tuple of digi info (time, charge address)
    * @return the view index for the curent data or -1 if there is none
    */
   template<class Digi>
-  int GetViewId(CheckTimingDetector det, std::tuple<double, double, uint> info);
+  int GetViewId(CheckTimingDetector det, std::tuple<double, double, UInt_t> info);
 
   /** Input array from previous already existing data level **/
   CbmDigiManager* fDigiMan = nullptr;  //!
diff --git a/reco/detectors/rich/unpack/CbmRichUnpackAlgoBase.h b/reco/detectors/rich/unpack/CbmRichUnpackAlgoBase.h
index 439e27e2f7..4c55585a5f 100644
--- a/reco/detectors/rich/unpack/CbmRichUnpackAlgoBase.h
+++ b/reco/detectors/rich/unpack/CbmRichUnpackAlgoBase.h
@@ -25,7 +25,6 @@
 #include "CbmRecoUnpackAlgo.tmpl"
 #include "CbmRichDigi.h"
 #include "CbmRichUnpackMonitor.h"
-
 #include "Timeslice.hpp"  // timeslice
 
 #include <Rtypes.h>  // for types
@@ -34,6 +33,7 @@
 #include <cstddef>
 #include <cstdint>
 #include <iomanip>
+#include <iostream>
 #include <memory>
 #include <utility>
 
diff --git a/reco/detectors/trd/CbmTrdHitProducer.cxx b/reco/detectors/trd/CbmTrdHitProducer.cxx
index 8ab1405b1a..16e55d6e30 100644
--- a/reco/detectors/trd/CbmTrdHitProducer.cxx
+++ b/reco/detectors/trd/CbmTrdHitProducer.cxx
@@ -35,6 +35,7 @@
 #include <TVector3.h>
 
 #include <iomanip>
+#include <iostream>
 #include <map>
 
 using std::fixed;
diff --git a/reco/detectors/trd/CbmTrdModuleRec2D.h b/reco/detectors/trd/CbmTrdModuleRec2D.h
index e3c1b2317d..440270cee6 100644
--- a/reco/detectors/trd/CbmTrdModuleRec2D.h
+++ b/reco/detectors/trd/CbmTrdModuleRec2D.h
@@ -22,7 +22,7 @@ class CbmTrdDigiRec;
 class CbmTrdParFaspChannel;
 class TF1;
 /** @class CbmTrdModuleRec2D
- ** @brief Cluster finding and hit reconstruction algorithms for the TRD(2D) module. 
+ ** @brief Cluster finding and hit reconstruction algorithms for the TRD(2D) module.
  ** @author Alexandru Bercucic <abercuci@niham.nipne.ro>
  ** @since 01.02.2019
  ** @date 01.10.2021
@@ -68,13 +68,13 @@ public:
   virtual CbmTrdHit* MakeHit(Int_t cId, const CbmTrdCluster* c, std::vector<const CbmTrdDigi*>* digis);
   /** \brief Load RAW digis into working array of RECO digis
    * \param[in] din list of RAW digis in increasing order of column no
-   * \param[in] cid cluster index in the cluster array 
+   * \param[in] cid cluster index in the cluster array
    * \return no of digis loaded
    */
   Int_t LoadDigis(vector<const CbmTrdDigi*>* din, Int_t cid);
   Int_t ProjectDigis(Int_t cid, Int_t cjd = -1);
   /** \brief Implement topologic cuts for hit merging
-   * \return index of anode wire wrt to boundary or 0 if check fails 
+   * \return index of anode wire wrt to boundary or 0 if check fails
    */
   Int_t CheckMerge(Int_t cid, Int_t cjd);
   /** \brief Algorithm for hit merging
@@ -94,7 +94,7 @@ public:
   Double_t GetXcorr(Double_t dx, Int_t typ, Int_t cls = 0) const;
   /** \brief y position correction based on LUT
    * \param[in] dy offset computed on charge sharing expressed in [ph]
-   * \param[in] cls correction class 
+   * \param[in] cls correction class
    * \return correction expresed in [cm]
    */
   Double_t GetYcorr(Double_t dy, Int_t cls = 0) const;
@@ -115,14 +115,14 @@ public:
    */
   Int_t GetHitRcClass(Int_t a0) const;
 
-  /** @brief Steer usage of helper graphs for computing time and energy per hit. 
-   * A cost wrt the additional  performance vs. CPU has to be performed. 
+  /** @brief Steer usage of helper graphs for computing time and energy per hit.
+   * A cost wrt the additional  performance vs. CPU has to be performed.
    */
   void SetUseHelpers(bool use = true)
   {
     use ? SETBIT(fConfigMap, ECbmTrdModuleRec2D::kHelpers) : CLRBIT(fConfigMap, ECbmTrdModuleRec2D::kHelpers);
   }
-  /** \brief Time offset to synchronize TRD2D hits to the rest of detectors 
+  /** \brief Time offset to synchronize TRD2D hits to the rest of detectors
    * \param dt offset in [ns]
    */
   void SetHitTimeOffset(int dt) { fHitTimeOff = dt; }
@@ -148,7 +148,7 @@ private:
   Bool_t CHELPERS() const { return TESTBIT(fConfigMap, ECbmTrdModuleRec2D::kHelpers); }
 
   /** \brief Add left and right edge channels to the cluster in case this are masked channels
-   * \return no of edges added to cluster 
+   * \return no of edges added to cluster
    */
   int AddClusterEdges(CbmTrdCluster* cl);
   /** \brief Implement cuts for hit convolution definition
@@ -158,7 +158,7 @@ private:
   Bool_t CheckConvolution(CbmTrdHit* h) const;
   /** \brief Algorithm for cluster spliting
    * \param[in] h hit to be analysed.
-   * \return TRUE if succesful. The extra cluster is added to the end of the hits array 
+   * \return TRUE if succesful. The extra cluster is added to the end of the hits array
    */
   Bool_t Deconvolute(CbmTrdHit* h);
   Double_t GetXoffset(Int_t n0 = 0) const;
@@ -171,7 +171,7 @@ private:
    * \param[in] digis initial digis list shrinked for incomplete digis.
    * \param[in] vdgM list of merged digis
    * \param[in] vmask position of merged digis in the digis list
-   * \param[in] t0 prompt time of cluster 
+   * \param[in] t0 prompt time of cluster
    * \param[out] cM relative position of maximum
    * \return no of signals loaded. if detected overflow negative number
    */
@@ -217,8 +217,8 @@ private:
 
   UChar_t fConfigMap = 0;                              //! task configuration settings
   ULong64_t fT0      = 0;                              //! start time of event/time slice [clk]
-  uint fTimeLast     = 0;                              //! time of last digi processed in module [clk]
-  uint fTimeWinKeep  = 11;                             //! time interval to still keep clusters in buffer [clk]
+  UInt_t fTimeLast    = 0;                              //! time of last digi processed in module [clk]
+  UInt_t fTimeWinKeep = 11;                             //! time interval to still keep clusters in buffer [clk]
   std::map<Int_t, std::list<CbmTrdCluster*>> fBuffer;  //row-wise organized clusters
   std::map<Int_t, vector<CbmTrdDigiRec*>> fDigis;      //!cluster-wise organized calibrated digi
   // working representation of a hit on which the reconstruction is performed
diff --git a/reco/eventbuilder/digis/CbmTaskBuildRawEvents.cxx b/reco/eventbuilder/digis/CbmTaskBuildRawEvents.cxx
index f1a1bfaf80..bfae9fcfc6 100644
--- a/reco/eventbuilder/digis/CbmTaskBuildRawEvents.cxx
+++ b/reco/eventbuilder/digis/CbmTaskBuildRawEvents.cxx
@@ -24,6 +24,7 @@
 #include <TStopwatch.h>
 
 #include <iomanip>
+#include <iostream>
 
 CbmTaskBuildRawEvents::~CbmTaskBuildRawEvents()
 {
diff --git a/reco/global/CbmRecoT0.cxx b/reco/global/CbmRecoT0.cxx
index dd603697b1..fca462bb62 100644
--- a/reco/global/CbmRecoT0.cxx
+++ b/reco/global/CbmRecoT0.cxx
@@ -16,6 +16,7 @@
 
 #include <cassert>
 #include <iomanip>
+#include <iostream>
 #include <sstream>
 
 
diff --git a/sim/detectors/bmon/CbmBmonDigitize.cxx b/sim/detectors/bmon/CbmBmonDigitize.cxx
index d848b545a8..14e7bc23de 100644
--- a/sim/detectors/bmon/CbmBmonDigitize.cxx
+++ b/sim/detectors/bmon/CbmBmonDigitize.cxx
@@ -17,6 +17,7 @@
 #include <TStopwatch.h>
 
 #include <iomanip>
+#include <iostream>
 
 using std::fixed;
 using std::left;
-- 
GitLab