From 4c5513d329133dd33a41ac32257c1b17fedc2968 Mon Sep 17 00:00:00 2001
From: Felix Weiglhofer <weiglhofer@fias.uni-frankfurt.de>
Date: Tue, 14 Mar 2023 12:55:39 +0000
Subject: [PATCH] TrdCluster: Add missing copy assignment-operator to fix
 compiler warning.

---
 core/data/trd/CbmTrdCluster.cxx | 14 +++++++++++++-
 core/data/trd/CbmTrdCluster.h   | 18 ++++++++++--------
 2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/core/data/trd/CbmTrdCluster.cxx b/core/data/trd/CbmTrdCluster.cxx
index 3def998b2b..81ec353356 100644
--- a/core/data/trd/CbmTrdCluster.cxx
+++ b/core/data/trd/CbmTrdCluster.cxx
@@ -49,10 +49,22 @@ CbmTrdCluster::CbmTrdCluster(int32_t address, int32_t idx, int32_t ch, int32_t r
 //____________________________________________________________________
 CbmTrdCluster::~CbmTrdCluster() {}
 
+CbmTrdCluster& CbmTrdCluster::operator=(const CbmTrdCluster& ref)
+{
+  if (this != &ref) {
+    CbmCluster::operator=(ref);
+    fNCols              = ref.fNCols;
+    fNRows              = ref.fNRows;
+    fStartCh            = ref.fStartCh;
+    fStartTime          = ref.fStartTime;
+  }
+  return *this;
+}
+
 //____________________________________________________________________
 bool CbmTrdCluster::AddDigi(int32_t idx, int32_t channel, int32_t terminator, int32_t dt)
 {
-  /** Extend basic functionality of CbmCluster::AddDigi(). 
+  /** Extend basic functionality of CbmCluster::AddDigi().
  * If channel>=0 add this info to channel map.
  */
 
diff --git a/core/data/trd/CbmTrdCluster.h b/core/data/trd/CbmTrdCluster.h
index 0ce0b3dc41..e69726722e 100644
--- a/core/data/trd/CbmTrdCluster.h
+++ b/core/data/trd/CbmTrdCluster.h
@@ -42,11 +42,11 @@ public:
   CbmTrdCluster(const std::vector<int32_t>& indices, int32_t address);
   /**
    * \brief Constructor starting from first digit.
-   * \param[in] address global module address 
+   * \param[in] address global module address
    * \param[in] idx global digi index in the TClonesArray
-   * \param[in] ch RO channel address within the module 
-   * \param[in] r module row for the RO channel 
-   * \param[in] time relative buffer DAQ time 
+   * \param[in] ch RO channel address within the module
+   * \param[in] r module row for the RO channel
+   * \param[in] time relative buffer DAQ time
    */
   CbmTrdCluster(int32_t address, int32_t idx, int32_t ch, int32_t r, int32_t time);
   /**
@@ -54,10 +54,12 @@ public:
    */
   virtual ~CbmTrdCluster();
 
+  CbmTrdCluster& operator=(const CbmTrdCluster& ref);
+
   /** \brief Append digi to cluster
    * \param[in] idx index of digi in TClonesArray
    * \param[in] channel RO channel for digi
-   * \param[in] terminator state of digi for triangular pads: 0 if complete, -/+ if T/R misses 
+   * \param[in] terminator state of digi for triangular pads: 0 if complete, -/+ if T/R misses
    * \param[in] dt update start time of cluster if current digi is prompt
    * \return true if successful
    */
@@ -76,14 +78,14 @@ public:
   bool HasOpenStart() const { return TESTBIT(fNRows, kProfileStart); }
   bool HasOpenStop() const { return TESTBIT(fNRows, kProfileStop); }
 
-  /** \brief Query on RO channel list 
+  /** \brief Query on RO channel list
    * \param[in] channel RO channel for digi
    * \return -1 before range; 0 in range; 1 after range; -2 cluster empty of digits
    */
   int32_t IsChannelInRange(int32_t ch) const;
-  /** \brief Merge current cluster with info from second 
+  /** \brief Merge current cluster with info from second
    * \param[in] second cluster to be added
-   * \param[in] typ the type of pad-plane of the source chamber; true if Trd2d 
+   * \param[in] typ the type of pad-plane of the source chamber; true if Trd2d
    * \return success or fail
    */
   bool Merge(CbmTrdCluster* second, bool typ = true);
-- 
GitLab