From 95598ed885e8f38a0111e5d0aa80f8ced13c27ff Mon Sep 17 00:00:00 2001
From: P-A Loizeau <p.-a.loizeau@gsi.de>
Date: Mon, 22 Mar 2021 13:21:45 +0100
Subject: [PATCH] Fix broken/undefined symbols in the MVD library

---
 mvd/CMakeLists.txt      | 36 +++++++++++-----------
 mvd/CbmMvdDetector.cxx  | 67 +++++++++++++++++++++--------------------
 mvd/CbmMvdHitfinder.cxx |  2 +-
 mvd/CbmMvdSensor.cxx    |  2 +-
 4 files changed, 54 insertions(+), 53 deletions(-)

diff --git a/mvd/CMakeLists.txt b/mvd/CMakeLists.txt
index 32b2118f49..18439a5833 100644
--- a/mvd/CMakeLists.txt
+++ b/mvd/CMakeLists.txt
@@ -1,5 +1,5 @@
 set(INCLUDE_DIRECTORIES
-  ${CMAKE_CURRENT_SOURCE_DIR} 
+  ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}/tools
   ${CMAKE_CURRENT_SOURCE_DIR}/tools/readout
   ${CMAKE_CURRENT_SOURCE_DIR}/SensorDataSheets
@@ -13,7 +13,7 @@ set(INCLUDE_DIRECTORIES
   ${CBMDATA_DIR}/sts
   ${CBMDATA_DIR}/mvd
   ${CBMDATA_DIR}/global
-  ${CBMBASE_DIR} 
+  ${CBMBASE_DIR}
 
   ${CBMROOT_SOURCE_DIR}/sim/transport/base
 )
@@ -21,7 +21,7 @@ set(INCLUDE_DIRECTORIES
 include_directories(${INCLUDE_DIRECTORIES})
 
 set(SYSTEM_INCLUDE_DIRECTORIES
-  ${BASE_INCLUDE_DIRECTORIES} 
+  ${BASE_INCLUDE_DIRECTORIES}
 )
 
 include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES})
@@ -35,7 +35,7 @@ set(LINK_DIRECTORIES
 link_directories(${LINK_DIRECTORIES})
 
 set(SRCS
-  plugins/tasks/CbmMvdSensorTask.cxx 
+  plugins/tasks/CbmMvdSensorTask.cxx
   plugins/tasks/CbmMvdSensorDigitizerTask.cxx
   plugins/tasks/CbmMvdSensorDigitizerTBTask.cxx
 
@@ -52,30 +52,30 @@ set(SRCS
   SensorDataSheets/CbmMvdMimosa26AHR.cxx
   SensorDataSheets/CbmMvdMimosa34.cxx
   SensorDataSheets/CbmMvdMimosis.cxx
-  SensorDataSheets/CbmMvdSensorDataSheet.cxx  
+  SensorDataSheets/CbmMvdSensorDataSheet.cxx
 
   tools/CbmMvdGeoHandler.cxx
   tools/CbmMvdHelper.h
   tools/readout/CbmMvdReadoutSimple.cxx
   tools/readout/CbmMvdReadoutCluster.cxx
 
-  qa/CbmMvdQa.cxx 
+  qa/CbmMvdQa.cxx
+
+  CbmMvd.cxx
 
-  CbmMvd.cxx 
- 
   CbmMvdDigitizer.cxx
-  CbmMvdPileupManager.cxx  
+  CbmMvdPileupManager.cxx
   CbmMvdPixelCharge.cxx
   CbmMvdHitfinder.cxx  #OLD
-  CbmMvdStationPar.cxx 
+  CbmMvdStationPar.cxx
   CbmMvdDetector.cxx
-  CbmMvdSensor.cxx 
+  CbmMvdSensor.cxx
   CbmMvdDigiToHit.cxx
-  CbmMvdDigiToHitTB.cxx 
+  CbmMvdDigiToHitTB.cxx
 
 #OLD
   CbmMvdClusterfinder.cxx
-  CbmMvdClusterfinderTB.cxx 
+  CbmMvdClusterfinderTB.cxx
 ####
   CbmMvdReadout.cxx
 )
@@ -85,19 +85,19 @@ set(SRCS
 set(LINKDEF CbmMvdLinkDef.h)
 set(LIBRARY_NAME CbmMvd)
 set(DEPENDENCIES
-    CbmBase CbmData Base
+    CbmSimBase CbmBase CbmData Base
 )
 
 GENERATE_LIBRARY()
 
-Install(FILES tools/CbmMvdHelper.h 
+Install(FILES tools/CbmMvdHelper.h
               tools/CbmMvdGeoHandler.h
         DESTINATION include/mvd/tools
        )
-Install(FILES plugins/CbmMvdSensorPlugin.h 
+Install(FILES plugins/CbmMvdSensorPlugin.h
         DESTINATION include/mvd/plugins
        )
-Install(FILES SensorDataSheets/CbmMvdMimosa26AHR.h 
+Install(FILES SensorDataSheets/CbmMvdMimosa26AHR.h
               SensorDataSheets/CbmMvdSensorDataSheet.h
               SensorDataSheets/CbmMvdMimosa34.h
               SensorDataSheets/CbmMvdMimosis.h
@@ -112,7 +112,7 @@ Install(FILES plugins/tasks/CbmMvdSensorClusterfinderTask.h
               plugins/tasks/CbmMvdSensorDigitizerTask.h
               plugins/tasks/CbmMvdSensorDigitizerTBTask.h
               plugins/tasks/CbmMvdSensorDigiToHitTask.h
-              plugins/tasks/CbmMvdSensorFindHitTask.h
+#              plugins/tasks/CbmMvdSensorFindHitTask.h
               plugins/tasks/CbmMvdSensorHitfinderTask.h
               plugins/tasks/CbmMvdSensorTask.h
         DESTINATION include/mvd/plugins/tasks
diff --git a/mvd/CbmMvdDetector.cxx b/mvd/CbmMvdDetector.cxx
index 29c5a23234..589fb35608 100644
--- a/mvd/CbmMvdDetector.cxx
+++ b/mvd/CbmMvdDetector.cxx
@@ -16,7 +16,7 @@
 #include "plugins/tasks/CbmMvdSensorDigiToHitTask.h"
 #include "plugins/tasks/CbmMvdSensorDigitizerTBTask.h"
 #include "plugins/tasks/CbmMvdSensorDigitizerTask.h"
-#include "plugins/tasks/CbmMvdSensorFindHitTask.h"
+//#include "plugins/tasks/CbmMvdSensorFindHitTask.h"
 #include "plugins/tasks/CbmMvdSensorHitfinderTask.h"  //khun
 #include "plugins/tasks/CbmMvdSensorTask.h"
 #include "tools/CbmMvdGeoHandler.h"
@@ -137,9 +137,9 @@ void CbmMvdDetector::AddSensor(TString clearName,
                                Double_t sensorStartTime,
                                Int_t stationNr) {
   /**
-   * 
-   * new sensor is registered in sensor array 
-   * 
+   *
+   * new sensor is registered in sensor array
+   *
    * **/
 
   TString myname;
@@ -185,7 +185,7 @@ void CbmMvdDetector::AddSensor(TString clearName,
 //-----------------------------------------------------------------------
 void CbmMvdDetector::AddPlugin(CbmMvdSensorPlugin* plugin) {
   /**
- * if there is a new buffer or task typ you have to insert it here 
+ * if there is a new buffer or task typ you have to insert it here
  * or you can't use it.
  */
   fSensorArrayFilled = kTRUE;
@@ -194,7 +194,7 @@ void CbmMvdDetector::AddPlugin(CbmMvdSensorPlugin* plugin) {
   Int_t nSensors                = fSensorArray->GetEntriesFast();
   const TString digitizername   = "CbmMvdSensorDigitizerTask";
   const TString digitizerTBname = "CbmMvdSensorDigitizerTBTask";
-  const TString findername      = "CbmMvdSensorFindHitTask";
+//  const TString findername      = "CbmMvdSensorFindHitTask";
   //const TString framename = "CbmMvdSensorFrameBuffer";
   //const TString trackingname = "CbmMvdSensorTrackingBuffer";
   const TString clustername   = "CbmMvdSensorClusterfinderTask";  //khun
@@ -222,12 +222,13 @@ void CbmMvdDetector::AddPlugin(CbmMvdSensorPlugin* plugin) {
         sensor->SetDigiPlugin(fPluginCount);
 
         //cout <<  "Adding Task CbmMvdSensorDigitizerTask at Sensor " << sensor->GetName() << endl;
-      } else if (plugin->ClassName() == findername) {
+/*      } else if (plugin->ClassName() == findername) {
         CbmMvdSensorFindHitTask* findTask = new CbmMvdSensorFindHitTask();
         sensor                            = (CbmMvdSensor*) fSensorArray->At(i);
         sensor->AddPlugin(findTask);
         sensor->SetHitPlugin(fPluginCount);
         // cout <<  "Adding Task CbmMvdSensorFindHitTask at Sensor " << sensor->GetName() << endl;
+*/
       }
 
       //Re-enable cluster and hit finder in addition to khun
@@ -278,9 +279,9 @@ void CbmMvdDetector::AddPlugin(CbmMvdSensorPlugin* plugin) {
 void CbmMvdDetector::Init() {
 
   /**
-   * 
+   *
    * Initialisation method
-   * 
+   *
    * **/
 
 
@@ -337,12 +338,12 @@ void CbmMvdDetector::SetProduceNoise() {
 //-----------------------------------------------------------------------
 void CbmMvdDetector::SendInput(TClonesArray* input) {
   /**
-   * 
-   * Sending event to sensors, 
+   *
+   * Sending event to sensors,
    * each sensor gets only his own points
-   * 
    *
-   * 
+   *
+   *
    * **/
 
 
@@ -372,12 +373,12 @@ void CbmMvdDetector::SendInput(TClonesArray* input) {
 //-----------------------------------------------------------------------
 void CbmMvdDetector::SendInputDigis(CbmDigiManager* digiMan) {
   /**
-   * 
-   * Sending event to sensors, 
+   *
+   * Sending event to sensors,
    * each sensor gets only his own points
-   * 
-   * 
-   * 
+   *
+   *
+   *
    * **/
   assert(digiMan);
   assert(digiMan->IsPresent(ECbmModuleId::kMvd));
@@ -437,12 +438,12 @@ void CbmMvdDetector::SendInputDigis(TClonesArray* digis) {
 //-----------------------------------------------------------------------
 void CbmMvdDetector::SendInputDigisToHits(TClonesArray* digis) {
   /**
-   * 
-   * Sending event to sensors, 
+   *
+   * Sending event to sensors,
    * each sensor gets only his own points
-   * 
+   *
    * Version for DigiToHit
-   * 
+   *
    * **/
 
 
@@ -469,12 +470,12 @@ void CbmMvdDetector::SendInputDigisToHits(TClonesArray* digis) {
 void CbmMvdDetector::SendInputCluster(TClonesArray* clusters) {
 
   /**
-   * 
-   * Sending event to sensors, 
+   *
+   * Sending event to sensors,
    * each sensor gets only his own points
-   * 
-   * 
-   * 
+   *
+   *
+   *
    * **/
   CbmMvdCluster* cluster;
   Int_t nEntries = clusters->GetEntriesFast();
@@ -498,9 +499,9 @@ void CbmMvdDetector::SendInputCluster(TClonesArray* clusters) {
 //-----------------------------------------------------------------------
 void CbmMvdDetector::ExecChain() {
   /**
-   * 
+   *
    * method to execute plugin chain on sensors
-   * 
+   *
    * **/
 
   foutput->Clear();
@@ -526,9 +527,9 @@ void CbmMvdDetector::ExecChain() {
 //-----------------------------------------------------------------------
 void CbmMvdDetector::Exec(UInt_t nLevel) {
   /**
-   * 
+   *
    * execute spezific plugin on all sensors
-   * 
+   *
    * **/
 
   foutput->Clear();
@@ -552,9 +553,9 @@ void CbmMvdDetector::Exec(UInt_t nLevel) {
 void CbmMvdDetector::ExecFrom(UInt_t nLevel) {
 
   /**
-   * 
+   *
    * execute chain from a spezific plugin on all sensors
-   * 
+   *
    * **/
   foutput->Clear();
   fcurrentEvent->Clear();
diff --git a/mvd/CbmMvdHitfinder.cxx b/mvd/CbmMvdHitfinder.cxx
index a2c099e80c..11bead2073 100644
--- a/mvd/CbmMvdHitfinder.cxx
+++ b/mvd/CbmMvdHitfinder.cxx
@@ -6,7 +6,7 @@
 #include "CbmMvdHitfinder.h"
 #include "CbmMvdPoint.h"
 #include "SensorDataSheets/CbmMvdMimosa26AHR.h"
-#include "plugins/tasks/CbmMvdSensorFindHitTask.h"
+//#include "plugins/tasks/CbmMvdSensorFindHitTask.h"
 #include "plugins/tasks/CbmMvdSensorHitfinderTask.h"
 #include "tools/CbmMvdGeoHandler.h"
 
diff --git a/mvd/CbmMvdSensor.cxx b/mvd/CbmMvdSensor.cxx
index 0d91522eb1..532fa49572 100644
--- a/mvd/CbmMvdSensor.cxx
+++ b/mvd/CbmMvdSensor.cxx
@@ -12,7 +12,7 @@
 #include "plugins/tasks/CbmMvdSensorDigiToHitTask.h"
 #include "plugins/tasks/CbmMvdSensorDigitizerTBTask.h"
 #include "plugins/tasks/CbmMvdSensorDigitizerTask.h"
-#include "plugins/tasks/CbmMvdSensorFindHitTask.h"
+//#include "plugins/tasks/CbmMvdSensorFindHitTask.h"
 #include "plugins/tasks/CbmMvdSensorHitfinderTask.h"  //not needed khun
 //---Plugins
 
-- 
GitLab