From ae583579a1b016837c80279356d38bce217c98d9 Mon Sep 17 00:00:00 2001
From: dthisse <damien.thisse@cea.fr>
Date: Thu, 12 Dec 2024 18:19:53 +0100
Subject: [PATCH] Removed all reference from TReactionConditions from the
 physics file of Actar that were preventing it to be put in the ClassList

---
 NPLib/Detectors/Actar/TActarPhysics.cxx       | 30 ++++++++-----------
 NPLib/Detectors/Actar/TActarPhysicsReader.cxx |  9 ++----
 NPLib/Detectors/Actar/TActarPhysicsReader.h   |  5 +---
 3 files changed, 16 insertions(+), 28 deletions(-)

diff --git a/NPLib/Detectors/Actar/TActarPhysics.cxx b/NPLib/Detectors/Actar/TActarPhysics.cxx
index da9dbd291..9e8ec2d98 100644
--- a/NPLib/Detectors/Actar/TActarPhysics.cxx
+++ b/NPLib/Detectors/Actar/TActarPhysics.cxx
@@ -643,7 +643,7 @@ void TActarPhysics::ReadAnalysisConfig() {
   // Lookup table //
   bool ReadingLookupTable = false;
   string LT_FileName; 
-  if(IsSimulation()) {LT_FileName = "./configs/LT_SIMU.dat";}
+  if(IsSimulation()) {LT_FileName = "./configs/LT_simu.dat";}
   else {LT_FileName = "./configs/LT.dat";}
   ifstream LTConfigFile;
   LTConfigFile.open(LT_FileName.c_str());
@@ -764,7 +764,7 @@ void TActarPhysics::InitSpectra() {
 
 ///////////////////////////////////////////////////////////////////////////
 void TActarPhysics::SetTreeReader(TTreeReader* TreeReader) {
-  TActarPhysicsReader::r_SetTreeReader(TreeReader, fIsSimulation);
+  TActarPhysicsReader::r_SetTreeReader(TreeReader);
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -899,13 +899,9 @@ void TActarPhysics::InitializeRootOutput() {
 ////////////////////////////////////////////////////////////////////////////////
 //            Construct Method to be pass to the DetectorFactory              //
 ////////////////////////////////////////////////////////////////////////////////
-NPL::VDetector* TActarPhysics::Construct() {
-  return (NPL::VDetector*) new TActarPhysics();
-}
+NPL::VDetector* TActarPhysics::Construct() { return (NPL::VDetector*) new TActarPhysics();}
 
-NPL::VTreeReader* TActarPhysics::ConstructReader() {
-  return (NPL::VTreeReader*)new TActarPhysicsReader(); 
-}
+NPL::VTreeReader* TActarPhysics::ConstructReader() { return (NPL::VTreeReader*)new TActarPhysicsReader();}
 
 
 
@@ -913,15 +909,15 @@ NPL::VTreeReader* TActarPhysics::ConstructReader() {
 //            Registering the construct method to the factory                 //
 ////////////////////////////////////////////////////////////////////////////////
 extern "C"{
-  class proxy_Actar{
-    public:
-      proxy_Actar(){
-        NPL::DetectorFactory::getInstance()->AddToken("Actar","Actar");
-        NPL::DetectorFactory::getInstance()->AddDetector("Actar",TActarPhysics::Construct);
-        NPL::DetectorFactory::getInstance()->AddDetectorReader("Actar", TActarPhysics::ConstructReader);
+class proxy_Actar{
+  public:
+    proxy_Actar(){
+      NPL::DetectorFactory::getInstance()->AddToken("Actar","Actar");
+      NPL::DetectorFactory::getInstance()->AddDetector("Actar",TActarPhysics::Construct);
+      NPL::DetectorFactory::getInstance()->AddDetectorReader("Actar", TActarPhysics::ConstructReader);
 
-      }
-  };
+    }
+};
 
-  proxy_Actar p_Actar;
+proxy_Actar p_Actar;
 }
diff --git a/NPLib/Detectors/Actar/TActarPhysicsReader.cxx b/NPLib/Detectors/Actar/TActarPhysicsReader.cxx
index a3aca5977..4e37d15f3 100644
--- a/NPLib/Detectors/Actar/TActarPhysicsReader.cxx
+++ b/NPLib/Detectors/Actar/TActarPhysicsReader.cxx
@@ -30,11 +30,6 @@ TActarPhysicsReader::TActarPhysicsReader()
 {
 };
 
-void TActarPhysicsReader::r_SetTreeReader(TTreeReader* TreeReader, bool is_simulation){
-    r_ReaderEventData = new TTreeReaderValue<MEventReduced>(*TreeReader, "data");
-    if (is_simulation)
-    {
-        r_ReaderReactionCondition = new TTreeReaderValue<TReactionConditions>(*TreeReader, "ReactionConditions");
-    }
-    
+void TActarPhysicsReader::r_SetTreeReader(TTreeReader* TreeReader){
+    r_ReaderEventData = new TTreeReaderValue<MEventReduced>(*TreeReader, "data");    
 }; 
\ No newline at end of file
diff --git a/NPLib/Detectors/Actar/TActarPhysicsReader.h b/NPLib/Detectors/Actar/TActarPhysicsReader.h
index 60d8904ce..1607109f5 100644
--- a/NPLib/Detectors/Actar/TActarPhysicsReader.h
+++ b/NPLib/Detectors/Actar/TActarPhysicsReader.h
@@ -35,8 +35,6 @@
 #include "RootOutput.h"
 #include "TTree.h"
 #include "NPVTreeReader.h"
-#include "TReactionConditions.h"
-
 
 using namespace std;
 
@@ -46,12 +44,11 @@ public:
   ~TActarPhysicsReader(){};
   
 public:
-  void r_SetTreeReader(TTreeReader* TreeReader, bool is_simulation);
+  void r_SetTreeReader(TTreeReader* TreeReader);
 private:
   TTreeReader *dummy = new TTreeReader();
 public:
   TTreeReaderValue<MEventReduced>* r_ReaderEventData = new TTreeReaderValue<MEventReduced>(*dummy,"");
-  TTreeReaderValue<TReactionConditions>* r_ReaderReactionCondition= new TTreeReaderValue<TReactionConditions>(*dummy,"");
 
 public:
   ClassDef(TActarPhysicsReader,0);
-- 
GitLab