diff --git a/NPLib/Detectors/Sofia/CMakeLists.txt b/NPLib/Detectors/Sofia/CMakeLists.txt
index 5669724d43fb231d151c6d86c7fa75fe33187cc8..10ce558b9212cb0f6a69dc28c96d7d485c039d58 100644
--- a/NPLib/Detectors/Sofia/CMakeLists.txt
+++ b/NPLib/Detectors/Sofia/CMakeLists.txt
@@ -1,6 +1,20 @@
-add_custom_command(OUTPUT TSofiaPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofiaPhysics.h TSofiaPhysicsDict.cxx TSofiaPhysics.rootmap libNPSofia.dylib DEPENDS TSofiaPhysics.h)
-add_custom_command(OUTPUT TSofiaDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofiaData.h TSofiaDataDict.cxx TSofiaData.rootmap libNPSofia.dylib DEPENDS TSofiaData.h)
-add_library(NPSofia SHARED TSofiaSpectra.cxx TSofiaData.cxx TSofiaPhysics.cxx TSofiaDataDict.cxx TSofiaPhysicsDict.cxx )
-target_link_libraries(NPSofia ${ROOT_LIBRARIES} NPCore) 
-install(FILES TSofiaData.h TSofiaPhysics.h TSofiaSpectra.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
+add_custom_command(OUTPUT TSofSciDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofSciData.h TSofSciDataDict.cxx TSofSciData.rootmap libNPSofia.dylib DEPENDS TSofSciData.h)
+
+add_custom_command(OUTPUT TSofTofWDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofTofWData.h TSofTofWDataDict.cxx TSofTofWData.rootmap libNPSofia.dylib DEPENDS TSofTofWData.h)
+add_custom_command(OUTPUT TSofTofWPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofTofWPhysics.h TSofTofWPhysicsDict.cxx TSofTofWPhysics.rootmap libNPSofia.dylib DEPENDS TSofTofWPhysics.h)
+
+add_custom_command(OUTPUT TSofMwpcDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofMwpcData.h TSofMwpcDataDict.cxx TSofMwpcData.rootmap libNPSofia.dylib DEPENDS TSofMwpcData.h)
+
+add_custom_command(OUTPUT TSofAtDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofAtData.h TSofAtDataDict.cxx TSofAtData.rootmap libNPSofia.dylib DEPENDS TSofAtData.h)
+
+add_custom_command(OUTPUT TSofTrimDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofTrimData.h TSofTrimDataDict.cxx TSofTrimData.rootmap libNPSofia.dylib DEPENDS TSofTrimData.h)
+add_custom_command(OUTPUT TSofTrimPhysicsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofTrimPhysics.h TSofTrimPhysicsDict.cxx TSofTrimPhysics.rootmap libNPSofia.dylib DEPENDS TSofTrimPhysics.h)
+
+add_custom_command(OUTPUT TSofTwimDataDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TSofTwimData.h TSofTwimDataDict.cxx TSofTwimData.rootmap libNPSofia.dylib DEPENDS TSofTwimData.h)
+
+add_library(NPSofia SHARED TSofSciData.cxx TSofSciDataDict.cxx TSofMwpcData.cxx TSofMwpcDataDict.cxx TSofAtData.cxx TSofAtDataDict.cxx TSofTrimData.cxx TSofTrimDataDict.cxx TSofTrimPhysics.cxx TSofTrimPhysicsDict.cxx TSofTwimData.cxx TSofTwimDataDict.cxx TSofTofWData.cxx TSofTofWDataDict.cxx TSofTofWPhysics.cxx TSofTofWPhysicsDict.cxx)
+
+target_link_libraries(NPSofia ${ROOT_LIBRARIES} NPCore NPPhysics)
+
+install(FILES TSofSciData.h TSofMwpcData.h TSofAtData.h TSofTrimData.h TSofTrimPhysics.h TSofTwimData.h TSofTofWData.h TSofTofWPhysics.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
 
diff --git a/NPLib/Detectors/Sofia/TSofAtData.cxx b/NPLib/Detectors/Sofia/TSofAtData.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..545411bc821182b968616ef85723b44e21e4c2ff
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofAtData.cxx
@@ -0,0 +1,64 @@
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ * Creation Date  : May 2021                                           *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold SofAt Raw data                                    *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+#include "TSofAtData.h"
+
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <string>
+using namespace std; 
+
+ClassImp(TSofAtData)
+
+
+//////////////////////////////////////////////////////////////////////
+TSofAtData::TSofAtData() {
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+TSofAtData::~TSofAtData() {
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+void TSofAtData::Clear() {
+  fAT_AnodeNbr.clear();
+  fAT_Energy.clear();
+  fAT_Time.clear();
+  fAT_PileUp.clear();
+  fAT_Overflow.clear();
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+void TSofAtData::Dump() const {
+  // This method is very useful for debuging and worth the dev.
+  cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event [TSofAtData::Dump()] XXXXXXXXXXXXXXXXX" << endl;
+
+  // Energy
+  size_t mysize = fAT_AnodeNbr.size();
+  cout << "AT_Mult: " << GetMultiplicity() << endl;
+ 
+}
diff --git a/NPLib/Detectors/Sofia/TSofAtData.h b/NPLib/Detectors/Sofia/TSofAtData.h
new file mode 100644
index 0000000000000000000000000000000000000000..cb9fae883ba051c1628606c0c2ffa1aa56da81c2
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofAtData.h
@@ -0,0 +1,84 @@
+#ifndef __SofAtDATA__
+#define __SofAtDATA__
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ *                                                                           *
+ * Creation Date  : May 2021                                                 *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold SofAt Raw data                                    *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+
+// STL
+#include <vector>
+using namespace std;
+
+// ROOT
+#include "TObject.h"
+
+class TSofAtData : public TObject {
+  //////////////////////////////////////////////////////////////
+  // data members are hold into vectors in order 
+  // to allow multiplicity treatment
+  private: 
+    vector<int>      fAT_AnodeNbr;
+    vector<double>   fAT_Energy;
+    vector<double>   fAT_Time;
+    vector<bool>     fAT_PileUp;
+    vector<bool>     fAT_Overflow;
+
+  //////////////////////////////////////////////////////////////
+  // Constructor and destructor
+  public: 
+    TSofAtData();
+    ~TSofAtData();
+    
+
+  //////////////////////////////////////////////////////////////
+  // Inherited from TObject and overriden to avoid warnings
+  public:
+    void Clear();
+    void Clear(const Option_t*) {};
+    void Dump() const;
+
+
+  //////////////////////////////////////////////////////////////
+  // Getters and Setters
+  // Prefer inline declaration to avoid unnecessary called of 
+  // frequently used methods
+  // add //! to avoid ROOT creating dictionnary for the methods
+  public:
+    //////////////////////    SETTERS    ////////////////////////
+    inline void SetAnodeNbr(int det){fAT_AnodeNbr.push_back(det);};//!
+    inline void SetEnergy(double Energy){fAT_Energy.push_back(Energy);};//!
+    inline void SetTime(double Time){fAT_Time.push_back(Time);};//!
+    inline void SetPileUp(bool ispileup){fAT_PileUp.push_back(ispileup);};//!
+    inline void SetOverflow(bool isoverflow){fAT_Overflow.push_back(isoverflow);};//!
+
+    //////////////////////    GETTERS    ////////////////////////
+    inline int GetMultiplicity() const {return fAT_AnodeNbr.size();}//!
+    inline int GetAnodeNbr(const unsigned int &i) const {return fAT_AnodeNbr[i];}//! 
+    inline double GetEnergy(const unsigned int &i) const {return fAT_Energy[i];}//!     
+    inline double GetTime(const unsigned int &i) const {return fAT_Time[i];}//!     
+    inline bool GetPileUp(const unsigned int &i) const {return fAT_PileUp[i];}//!     
+    inline bool GetOverflow(const unsigned int &i) const {return fAT_Overflow[i];}//!     
+
+  //////////////////////////////////////////////////////////////
+  // Required for ROOT dictionnary
+  ClassDef(TSofAtData,1)  // SofAtData structure
+};
+
+#endif
diff --git a/NPLib/Detectors/Sofia/TSofMwpcData.cxx b/NPLib/Detectors/Sofia/TSofMwpcData.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..b293dab00ecf4d07177b0ae7a687993204dca697
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofMwpcData.cxx
@@ -0,0 +1,63 @@
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ * Creation Date  : May 2021                                           *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold SofMwpc Raw data                                    *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+#include "TSofMwpcData.h"
+
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <string>
+using namespace std; 
+
+ClassImp(TSofMwpcData)
+
+
+//////////////////////////////////////////////////////////////////////
+TSofMwpcData::TSofMwpcData() {
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+TSofMwpcData::~TSofMwpcData() {
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+void TSofMwpcData::Clear() {
+  fMwpc_DetNbr.clear();
+  fMwpc_Plane.clear();
+  fMwpc_Pad.clear();
+  fMwpc_Charge.clear();
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+void TSofMwpcData::Dump() const {
+  // This method is very useful for debuging and worth the dev.
+  cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event [TSofMwpcData::Dump()] XXXXXXXXXXXXXXXXX" << endl;
+
+  // Energy
+  size_t mysize = fMwpc_Charge.size();
+  cout << "MWPC_Mult: " << GetMultiplicity() << endl;
+ 
+}
diff --git a/NPLib/Detectors/Sofia/TSofMwpcData.h b/NPLib/Detectors/Sofia/TSofMwpcData.h
new file mode 100644
index 0000000000000000000000000000000000000000..d5de7eeadc858fc95b491eb77257f371940ff4f5
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofMwpcData.h
@@ -0,0 +1,81 @@
+#ifndef __SofMwpcDATA__
+#define __SofMwpcDATA__
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ *                                                                           *
+ * Creation Date  : May 2021                                                 *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold SofMwpc Raw data                                    *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+
+// STL
+#include <vector>
+using namespace std;
+
+// ROOT
+#include "TObject.h"
+
+class TSofMwpcData : public TObject {
+  //////////////////////////////////////////////////////////////
+  // data members are hold into vectors in order 
+  // to allow multiplicity treatment
+  private: 
+    vector<int> fMwpc_DetNbr;
+    vector<int> fMwpc_Plane;
+    vector<int> fMwpc_Pad;
+    vector<int> fMwpc_Charge;
+
+    //////////////////////////////////////////////////////////////
+    // Constructor and destructor
+  public: 
+    TSofMwpcData();
+    ~TSofMwpcData();
+
+
+    //////////////////////////////////////////////////////////////
+    // Inherited from TObject and overriden to avoid warnings
+  public:
+    void Clear();
+    void Clear(const Option_t*) {};
+    void Dump() const;
+
+
+    //////////////////////////////////////////////////////////////
+    // Getters and Setters
+    // Prefer inline declaration to avoid unnecessary called of 
+    // frequently used methods
+    // add //! to avoid ROOT creating dictionnary for the methods
+  public:
+    //////////////////////    SETTERS    ////////////////////////
+    inline void SetDetectorNbr(int det){fMwpc_DetNbr.push_back(det);};//!
+    inline void SetPlane(int p){fMwpc_Plane.push_back(p);};//!
+    inline void SetPad(int p){fMwpc_Pad.push_back(p);};//!
+    inline void SetCharge(int q){fMwpc_Charge.push_back(q);};//!
+
+    //////////////////////    GETTERS    ////////////////////////
+    inline int GetMultiplicity() const {return fMwpc_DetNbr.size();}//!
+    inline int GetDetectorNbr(const unsigned int &i) const {return fMwpc_DetNbr[i];}//! 
+    inline int GetPlane(const unsigned int &i) const {return fMwpc_Plane[i];}//! 
+    inline int GetPad(const unsigned int &i) const {return fMwpc_Pad[i];}//! 
+    inline int GetCharge(const unsigned int &i) const {return fMwpc_Charge[i];}//! 
+
+    //////////////////////////////////////////////////////////////
+    // Required for ROOT dictionnary
+    ClassDef(TSofMwpcData,1)  // SofMwpcData structure
+};
+
+#endif
diff --git a/NPLib/Detectors/Sofia/TSofSciData.cxx b/NPLib/Detectors/Sofia/TSofSciData.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..428412e249224d7943487214a7844768402a5f75
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofSciData.cxx
@@ -0,0 +1,63 @@
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ * Creation Date  : May 2021                                           *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold SofSci Raw data                                    *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+#include "TSofSciData.h"
+
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <string>
+using namespace std; 
+
+ClassImp(TSofSciData)
+
+
+//////////////////////////////////////////////////////////////////////
+TSofSciData::TSofSciData() {
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+TSofSciData::~TSofSciData() {
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+void TSofSciData::Clear() {
+  fSofSci_DetNbr.clear();
+  fSofSci_Pmt.clear();
+  fSofSci_CT.clear();
+  fSofSci_FT.clear();
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+void TSofSciData::Dump() const {
+  // This method is very useful for debuging and worth the dev.
+  cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event [TSofSciData::Dump()] XXXXXXXXXXXXXXXXX" << endl;
+
+  // Energy
+  size_t mysize = fSofSci_DetNbr.size();
+  cout << "SofSci_Mult: " << GetMultiplicity() << endl;
+ 
+}
diff --git a/NPLib/Detectors/Sofia/TSofSciData.h b/NPLib/Detectors/Sofia/TSofSciData.h
new file mode 100644
index 0000000000000000000000000000000000000000..460e11ab92b86f1aff073ae747a1bdec83db23fa
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofSciData.h
@@ -0,0 +1,81 @@
+#ifndef __SofSciDATA__
+#define __SofSciDATA__
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ *                                                                           *
+ * Creation Date  : May 2021                                                 *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold SofSci Raw data                                    *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+
+// STL
+#include <vector>
+using namespace std;
+
+// ROOT
+#include "TObject.h"
+
+class TSofSciData : public TObject {
+  //////////////////////////////////////////////////////////////
+  // data members are hold into vectors in order 
+  // to allow multiplicity treatment
+  private: 
+    vector<int>     fSofSci_DetNbr;
+    vector<int>     fSofSci_Pmt;
+    vector<double>  fSofSci_CT;
+    vector<double>  fSofSci_FT;
+
+  //////////////////////////////////////////////////////////////
+  // Constructor and destructor
+  public: 
+    TSofSciData();
+    ~TSofSciData();
+    
+
+  //////////////////////////////////////////////////////////////
+  // Inherited from TObject and overriden to avoid warnings
+  public:
+    void Clear();
+    void Clear(const Option_t*) {};
+    void Dump() const;
+
+
+  //////////////////////////////////////////////////////////////
+  // Getters and Setters
+  // Prefer inline declaration to avoid unnecessary called of 
+  // frequently used methods
+  // add //! to avoid ROOT creating dictionnary for the methods
+  public:
+    //////////////////////    SETTERS    ////////////////////////
+    inline void SetDetectorNbr(int det){fSofSci_DetNbr.push_back(det);};//!
+    inline void SetPmt(int pmt){fSofSci_Pmt.push_back(pmt);};//!
+    inline void SetCoarseTime(double Time){fSofSci_CT.push_back(Time);};//!
+    inline void SetFineTime(double Time){fSofSci_FT.push_back(Time);};//!
+
+    //////////////////////    GETTERS    ////////////////////////
+    inline int GetMultiplicity() const {return fSofSci_DetNbr.size();}//!
+    inline int GetDetectorNbr(const unsigned int &i) const {return fSofSci_DetNbr[i];}//! 
+    inline int GetPmt(const unsigned int &i) const {return fSofSci_Pmt[i];}//! 
+    inline double GetCoarseTime(const unsigned int &i) const {return fSofSci_CT[i];}//!     
+    inline double GetFineTime(const unsigned int &i) const {return fSofSci_FT[i];}//!     
+
+  //////////////////////////////////////////////////////////////
+  // Required for ROOT dictionnary
+  ClassDef(TSofSciData,1)  // SofSciData structure
+};
+
+#endif
diff --git a/NPLib/Detectors/Sofia/TSofTofWData.cxx b/NPLib/Detectors/Sofia/TSofTofWData.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..0d261b8032f74988f5418f94ceea770db8a9a725
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofTofWData.cxx
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ *                                                                           *
+ * Creation Date  : November 2020                                           *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold Sofia Raw data                                    *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+#include "TSofTofWData.h"
+
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <string>
+using namespace std; 
+
+ClassImp(TSofTofWData)
+
+
+//////////////////////////////////////////////////////////////////////
+TSofTofWData::TSofTofWData() {
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+TSofTofWData::~TSofTofWData() {
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+void TSofTofWData::Clear() {
+  fTOF_PlasticNbr.clear();
+  fTOF_Pmt.clear();
+  fTOF_Energy.clear();
+  fTOF_CT.clear();
+  fTOF_FT.clear();
+  fTOF_WhichFlag.clear();
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+void TSofTofWData::Dump() const {
+  // This method is very useful for debuging and worth the dev.
+  cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event [TSofTofWData::Dump()] XXXXXXXXXXXXXXXXX" << endl;
+
+  // Energy
+  size_t mysize = fTOF_PlasticNbr.size();
+  cout << "TOF_Mult: " << mysize << endl;
+ 
+}
diff --git a/NPLib/Detectors/Sofia/TSofTofWData.h b/NPLib/Detectors/Sofia/TSofTofWData.h
new file mode 100644
index 0000000000000000000000000000000000000000..c663ef319d3d8a22db1bf465797fb929833ff6a8
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofTofWData.h
@@ -0,0 +1,88 @@
+#ifndef __SofTofWDATA__
+#define __SofTofWDATA__
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ *                                                                           *
+ * Creation Date  : November 2020                                           *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold SofTofW Raw data                                    *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+
+// STL
+#include <vector>
+using namespace std;
+
+// ROOT
+#include "TObject.h"
+
+class TSofTofWData : public TObject {
+  //////////////////////////////////////////////////////////////
+  // data members are hold into vectors in order 
+  // to allow multiplicity treatment
+  private: 
+    vector<int>      fTOF_PlasticNbr;
+    vector<int>      fTOF_Pmt;
+    vector<double>   fTOF_Energy;
+    vector<double>   fTOF_CT;
+    vector<double>   fTOF_FT;
+    vector<bool>     fTOF_WhichFlag;
+
+
+    //////////////////////////////////////////////////////////////
+    // Constructor and destructor
+  public: 
+    TSofTofWData();
+    ~TSofTofWData();
+
+
+    //////////////////////////////////////////////////////////////
+    // Inherited from TObject and overriden to avoid warnings
+  public:
+    void Clear();
+    void Clear(const Option_t*) {};
+    void Dump() const;
+
+
+    //////////////////////////////////////////////////////////////
+    // Getters and Setters
+    // Prefer inline declaration to avoid unnecessary called of 
+    // frequently used methods
+    // add //! to avoid ROOT creating dictionnary for the methods
+  public:
+    //////////////////////    SETTERS    ////////////////////////
+    inline void SetPlasticNbr(int plastic){fTOF_PlasticNbr.push_back(plastic);};//!
+    inline void SetPmt(int pmt){fTOF_Pmt.push_back(pmt);};//!
+    inline void SetEnergy(double Energy){fTOF_Energy.push_back(Energy);};//!
+    inline void SetCoarseTime(double Time){fTOF_CT.push_back(Time);};//!
+    inline void SetFineTime(double Time){fTOF_FT.push_back(Time);};//!
+    inline void SetWhichFlag(bool flag){fTOF_WhichFlag.push_back(flag);};//!
+
+    //////////////////////    GETTERS    ////////////////////////
+    inline int GetMultiplicity() const {return fTOF_PlasticNbr.size();}//!
+    inline int GetPlasticNbr(const unsigned int &i) const {return fTOF_PlasticNbr[i];}//!     
+    inline int GetPmt(const unsigned int &i) const {return fTOF_Pmt[i];}//!     
+    inline double GetEnergy(const unsigned int &i) const {return fTOF_Energy[i];}//!     
+    inline double GetCoarseTime(const unsigned int &i) const {return fTOF_CT[i];}//!     
+    inline double GetFineTime(const unsigned int &i) const {return fTOF_FT[i];}//!     
+    inline bool GetWhichFlag(const unsigned int &i) const {return fTOF_WhichFlag[i];}//!     
+
+    //////////////////////////////////////////////////////////////
+    // Required for ROOT dictionnary
+    ClassDef(TSofTofWData,1)  // SofTofWData structure
+};
+
+#endif
diff --git a/NPLib/Detectors/Sofia/TSofTofWPhysics.cxx b/NPLib/Detectors/Sofia/TSofTofWPhysics.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..f4d85066fe9e855bb7369548797805e1edf72765
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofTofWPhysics.cxx
@@ -0,0 +1,284 @@
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ *                                                                           *
+ * Creation Date  : November 2020                                           *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold SofTofW Treated  data                               *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+
+#include "TSofTofWPhysics.h"
+
+//   STL
+#include <sstream>
+#include <iostream>
+#include <cmath>
+#include <stdlib.h>
+#include <limits>
+using namespace std;
+
+//   NPL
+#include "RootInput.h"
+#include "RootOutput.h"
+#include "NPDetectorFactory.h"
+#include "NPOptionManager.h"
+
+//   ROOT
+#include "TChain.h"
+
+ClassImp(TSofTofWPhysics)
+
+
+///////////////////////////////////////////////////////////////////////////
+TSofTofWPhysics::TSofTofWPhysics()
+   : m_EventData(new TSofTofWData),
+     m_PreTreatedData(new TSofTofWData),
+     m_EventPhysics(this),
+     m_E_RAW_Threshold(0), // adc channels
+     m_E_Threshold(0),     // MeV
+     m_NumberOfDetectors(0) {
+}
+
+///////////////////////////////////////////////////////////////////////////
+/// A usefull method to bundle all operation to add a detector
+void TSofTofWPhysics::AddDetector(TVector3 ){
+  // In That simple case nothing is done
+  // Typically for more complex detector one would calculate the relevant 
+  // positions (stripped silicon) or angles (gamma array)
+  m_NumberOfDetectors++;
+} 
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTofWPhysics::AddDetector(double R, double Theta, double Phi){
+  // Compute the TVector3 corresponding
+  TVector3 Pos(R*sin(Theta)*cos(Phi),R*sin(Theta)*sin(Phi),R*cos(Theta));
+  // Call the cartesian method
+  AddDetector(Pos);
+} 
+  
+///////////////////////////////////////////////////////////////////////////
+void TSofTofWPhysics::BuildSimplePhysicalEvent() {
+  BuildPhysicalEvent();
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTofWPhysics::BuildPhysicalEvent() {
+  // apply thresholds and calibration
+  PreTreat();
+
+  // match energy and time together
+  unsigned int mysizeE = m_PreTreatedData->GetMultiplicity();
+  for (UShort_t e = 0; e < mysizeE ; e++) {
+    PlasticNumber.push_back(m_PreTreatedData->GetPlasticNbr(e));
+    Energy.push_back(m_PreTreatedData->GetEnergy(e));
+  }
+}
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTofWPhysics::PreTreat() {
+  // This method typically applies thresholds and calibrations
+  // Might test for disabled channels for more complex detector
+
+  // clear pre-treated object
+  ClearPreTreatedData();
+
+  // instantiate CalibrationManager
+  static CalibrationManager* Cal = CalibrationManager::getInstance();
+
+  // Energy
+  unsigned int mysize = m_EventData->GetMultiplicity();
+  for (UShort_t i = 0; i < mysize ; ++i) {
+    if (m_EventData->GetEnergy(i) > m_E_RAW_Threshold) {
+      Double_t Energy = Cal->ApplyCalibration("SofTofW/ENERGY"+NPL::itoa(m_EventData->GetPlasticNbr(i)),m_EventData->GetEnergy(i));
+      if (Energy > m_E_Threshold) {
+        m_PreTreatedData->SetPlasticNbr(m_EventData->GetPlasticNbr(i));
+        m_PreTreatedData->SetEnergy(Energy);
+      }
+    }
+  }
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTofWPhysics::ReadAnalysisConfig() {
+  bool ReadingStatus = false;
+
+  // path to file
+  string FileName = "./configs/ConfigSofTofW.dat";
+
+  // open analysis config file
+  ifstream AnalysisConfigFile;
+  AnalysisConfigFile.open(FileName.c_str());
+
+  if (!AnalysisConfigFile.is_open()) {
+    cout << " No ConfigSofTofW.dat found: Default parameter loaded for Analayis " << FileName << endl;
+    return;
+  }
+  cout << " Loading user parameter for Analysis from ConfigSofTofW.dat " << endl;
+
+  // Save it in a TAsciiFile
+  TAsciiFile* asciiConfig = RootOutput::getInstance()->GetAsciiFileAnalysisConfig();
+  asciiConfig->AppendLine("%%% ConfigSofTofW.dat %%%");
+  asciiConfig->Append(FileName.c_str());
+  asciiConfig->AppendLine("");
+  // read analysis config file
+  string LineBuffer,DataBuffer,whatToDo;
+  while (!AnalysisConfigFile.eof()) {
+    // Pick-up next line
+    getline(AnalysisConfigFile, LineBuffer);
+
+    // search for "header"
+    string name = "ConfigSofTofW";
+    if (LineBuffer.compare(0, name.length(), name) == 0) 
+      ReadingStatus = true;
+
+    // loop on tokens and data
+    while (ReadingStatus ) {
+      whatToDo="";
+      AnalysisConfigFile >> whatToDo;
+
+      // Search for comment symbol (%)
+      if (whatToDo.compare(0, 1, "%") == 0) {
+        AnalysisConfigFile.ignore(numeric_limits<streamsize>::max(), '\n' );
+      }
+
+      else if (whatToDo=="E_RAW_THRESHOLD") {
+        AnalysisConfigFile >> DataBuffer;
+        m_E_RAW_Threshold = atof(DataBuffer.c_str());
+        cout << whatToDo << " " << m_E_RAW_Threshold << endl;
+      }
+
+      else if (whatToDo=="E_THRESHOLD") {
+        AnalysisConfigFile >> DataBuffer;
+        m_E_Threshold = atof(DataBuffer.c_str());
+        cout << whatToDo << " " << m_E_Threshold << endl;
+      }
+
+      else {
+        ReadingStatus = false;
+      }
+    }
+  }
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTofWPhysics::Clear() {
+  PlasticNumber.clear();
+  Energy.clear();
+  Time.clear();
+  PosY.clear();
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTofWPhysics::ReadConfiguration(NPL::InputParser parser) {
+  vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("SofTofW");
+  if(NPOptionManager::getInstance()->GetVerboseLevel())
+    cout << "//// " << blocks.size() << " detectors found " << endl; 
+
+  vector<string> cart = {"POS"};
+  vector<string> sphe = {"R","Theta","Phi"};
+
+  for(unsigned int i = 0 ; i < blocks.size() ; i++){
+    if(blocks[i]->HasTokenList(cart)){
+      if(NPOptionManager::getInstance()->GetVerboseLevel())
+        cout << endl << "////  SofTofW " << i+1 <<  endl;
+    
+      TVector3 Pos = blocks[i]->GetTVector3("POS","mm");
+      AddDetector(Pos);
+    }
+    else if(blocks[i]->HasTokenList(sphe)){
+      if(NPOptionManager::getInstance()->GetVerboseLevel())
+        cout << endl << "////  SofTofW " << i+1 <<  endl;
+      double R = blocks[i]->GetDouble("R","mm");
+      double Theta = blocks[i]->GetDouble("Theta","deg");
+      double Phi = blocks[i]->GetDouble("Phi","deg");
+      AddDetector(R,Theta,Phi);
+    }
+    else{
+      cout << "ERROR: check your input file formatting " << endl;
+      exit(1);
+    }
+  }
+}
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTofWPhysics::AddParameterToCalibrationManager() {
+  CalibrationManager* Cal = CalibrationManager::getInstance();
+  for (int i = 0; i < m_NumberOfDetectors; ++i) {
+    Cal->AddParameter("SofTofW", "D"+ NPL::itoa(i+1)+"_ENERGY","SofTofW_D"+ NPL::itoa(i+1)+"_ENERGY");
+    Cal->AddParameter("SofTofW", "D"+ NPL::itoa(i+1)+"_TIME","SofTofW_D"+ NPL::itoa(i+1)+"_TIME");
+  }
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTofWPhysics::InitializeRootInputRaw() {
+  TChain* inputChain = RootInput::getInstance()->GetChain();
+  inputChain->SetBranchStatus("SofTofW",  true );
+  inputChain->SetBranchAddress("SofTofW", &m_EventData );
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTofWPhysics::InitializeRootInputPhysics() {
+  TChain* inputChain = RootInput::getInstance()->GetChain();
+  inputChain->SetBranchAddress("SofTofW", &m_EventPhysics);
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTofWPhysics::InitializeRootOutput() {
+  TTree* outputTree = RootOutput::getInstance()->GetTree();
+  outputTree->Branch("SofTofW", "TSofTofWPhysics", &m_EventPhysics);
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+//            Construct Method to be pass to the DetectorFactory              //
+////////////////////////////////////////////////////////////////////////////////
+NPL::VDetector* TSofTofWPhysics::Construct() {
+  return (NPL::VDetector*) new TSofTofWPhysics();
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+//            Registering the construct method to the factory                 //
+////////////////////////////////////////////////////////////////////////////////
+extern "C"{
+class proxy_SofTofW{
+  public:
+    proxy_SofTofW(){
+      NPL::DetectorFactory::getInstance()->AddToken("SofTofW","SofTofW");
+      NPL::DetectorFactory::getInstance()->AddDetector("SofTofW",TSofTofWPhysics::Construct);
+    }
+};
+
+proxy_SofTofW p_SofTofW;
+}
+
diff --git a/NPLib/Detectors/Sofia/TSofTofWPhysics.h b/NPLib/Detectors/Sofia/TSofTofWPhysics.h
new file mode 100644
index 0000000000000000000000000000000000000000..3b8ac0370ffe652698fc4e410614a1e4df6ed58d
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofTofWPhysics.h
@@ -0,0 +1,152 @@
+#ifndef TSofTofWPHYSICS_H
+#define TSofTofWPHYSICS_H
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ *                                                                           *
+ * Creation Date  : November 2020                                           *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold TofTofW Treated data                                *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+
+// C++ headers 
+#include <vector>
+#include <map>
+#include <string>
+using namespace std;
+
+// ROOT headers
+#include "TObject.h"
+#include "TH1.h"
+#include "TVector3.h"
+// NPTool headers
+#include "TSofTofWData.h"
+#include "NPCalibrationManager.h"
+#include "NPVDetector.h"
+#include "NPInputParser.h"
+
+
+
+class TSofTofWPhysics : public TObject, public NPL::VDetector {
+  //////////////////////////////////////////////////////////////
+  // constructor and destructor
+  public:
+    TSofTofWPhysics();
+    ~TSofTofWPhysics() {};
+
+
+  //////////////////////////////////////////////////////////////
+  // Inherited from TObject and overriden to avoid warnings
+  public: 
+    void Clear();   
+    void Clear(const Option_t*) {};
+
+
+  //////////////////////////////////////////////////////////////
+  // data obtained after BuildPhysicalEvent() and stored in
+  // output ROOT file
+  public:
+    vector<int>      PlasticNumber;
+    vector<double>   Energy;
+    vector<double>   Time;
+    vector<double>   PosY;
+
+  /// A usefull method to bundle all operation to add a detector
+  void AddDetector(TVector3 POS); 
+  void AddDetector(double R, double Theta, double Phi); 
+  
+  //////////////////////////////////////////////////////////////
+  // methods inherited from the VDetector ABC class
+  public:
+    // read stream from ConfigFile to pick-up detector parameters
+    void ReadConfiguration(NPL::InputParser);
+
+    // add parameters to the CalibrationManger
+    void AddParameterToCalibrationManager();
+
+    // method called event by event, aiming at extracting the 
+    // physical information from detector
+    void BuildPhysicalEvent();
+
+    // same as BuildPhysicalEvent() method but with a simpler
+    // treatment
+    void BuildSimplePhysicalEvent();
+
+    // same as above but for online analysis
+    void BuildOnlinePhysicalEvent()  {BuildPhysicalEvent();};
+
+    // activate raw data object and branches from input TChain
+    // in this method mother branches (Detector) AND daughter leaves 
+    // (fDetector_parameter) have to be activated
+    void InitializeRootInputRaw();
+
+    // activate physics data object and branches from input TChain
+    // in this method mother branches (Detector) AND daughter leaves 
+    // (fDetector_parameter) have to be activated
+    void InitializeRootInputPhysics();
+
+    // create branches of output ROOT file
+    void InitializeRootOutput();
+
+    // clear the raw and physical data objects event by event
+    void ClearEventPhysics() {Clear();}      
+    void ClearEventData()    {m_EventData->Clear();}   
+
+
+  //////////////////////////////////////////////////////////////
+  // specific methods to SofTofW array
+  public:
+    // remove bad channels, calibrate the data and apply thresholds
+    void PreTreat();
+
+    // clear the pre-treated object
+    void ClearPreTreatedData()   {m_PreTreatedData->Clear();}
+
+    // read the user configuration file. If no file is found, load standard one
+    void ReadAnalysisConfig();
+
+    // give and external TSofTofWData object to TSofTofWPhysics. 
+    // needed for online analysis for example
+    void SetRawDataPointer(TSofTofWData* rawDataPointer) {m_EventData = rawDataPointer;}
+    
+  // objects are not written in the TTree
+  private:
+    TSofTofWData*         m_EventData;        //!
+    TSofTofWData*         m_PreTreatedData;   //!
+    TSofTofWPhysics*      m_EventPhysics;     //!
+
+  // getters for raw and pre-treated data object
+  public:
+    TSofTofWData* GetRawData()        const {return m_EventData;}
+    TSofTofWData* GetPreTreatedData() const {return m_PreTreatedData;}
+
+  // parameters used in the analysis
+  private:
+    // thresholds
+    double m_E_RAW_Threshold; //!
+    double m_E_Threshold;     //!
+
+  // number of detectors
+  private:
+    int m_NumberOfDetectors;  //!
+
+  // Static constructor to be passed to the Detector Factory
+  public:
+    static NPL::VDetector* Construct();
+
+    ClassDef(TSofTofWPhysics,1)  // SofTofWPhysics structure
+};
+#endif
diff --git a/NPLib/Detectors/Sofia/TSofTrimData.cxx b/NPLib/Detectors/Sofia/TSofTrimData.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..b89b933f25a090118e204915358bbf38b637d381
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofTrimData.cxx
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ * Creation Date  : May 2021                                           *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold SofTrim Raw data                                    *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+#include "TSofTrimData.h"
+
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <string>
+using namespace std; 
+
+ClassImp(TSofTrimData)
+
+
+//////////////////////////////////////////////////////////////////////
+TSofTrimData::TSofTrimData() {
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+TSofTrimData::~TSofTrimData() {
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+void TSofTrimData::Clear() {
+  fTrim_SectionNbr.clear();
+  fTrim_AnodeNbr.clear();
+  fTrim_Energy.clear();
+  fTrim_DriftTime.clear();
+  fTrim_PileUp.clear();
+  fTrim_Overflow.clear();
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+void TSofTrimData::Dump() const {
+  // This method is very useful for debuging and worth the dev.
+  cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event [TSofTrimData::Dump()] XXXXXXXXXXXXXXXXX" << endl;
+
+  // Energy
+  size_t mysize = fTrim_AnodeNbr.size();
+  cout << "Trim_Mult: " << GetMultiplicity() << endl;
+ 
+}
diff --git a/NPLib/Detectors/Sofia/TSofTrimData.h b/NPLib/Detectors/Sofia/TSofTrimData.h
new file mode 100644
index 0000000000000000000000000000000000000000..761595e1a848392a9f732dd3404e7a7b2fa92a6b
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofTrimData.h
@@ -0,0 +1,87 @@
+#ifndef __SofTrimDATA__
+#define __SofTrimDATA__
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ *                                                                           *
+ * Creation Date  : May 2021                                                 *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold SofTrim Raw data                                    *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+
+// STL
+#include <vector>
+using namespace std;
+
+// ROOT
+#include "TObject.h"
+
+class TSofTrimData : public TObject {
+  //////////////////////////////////////////////////////////////
+  // data members are hold into vectors in order 
+  // to allow multiplicity treatment
+  private: 
+    vector<int>      fTrim_SectionNbr;
+    vector<int>      fTrim_AnodeNbr;
+    vector<double>   fTrim_Energy;
+    vector<double>   fTrim_DriftTime;
+    vector<bool>     fTrim_PileUp;
+    vector<bool>     fTrim_Overflow;
+
+  //////////////////////////////////////////////////////////////
+  // Constructor and destructor
+  public: 
+    TSofTrimData();
+    ~TSofTrimData();
+    
+
+  //////////////////////////////////////////////////////////////
+  // Inherited from TObject and overriden to avoid warnings
+  public:
+    void Clear();
+    void Clear(const Option_t*) {};
+    void Dump() const;
+
+
+  //////////////////////////////////////////////////////////////
+  // Getters and Setters
+  // Prefer inline declaration to avoid unnecessary called of 
+  // frequently used methods
+  // add //! to avoid ROOT creating dictionnary for the methods
+  public:
+    //////////////////////    SETTERS    ////////////////////////
+    inline void SetSectionNbr(int sec){fTrim_SectionNbr.push_back(sec);};//!
+    inline void SetAnodeNbr(int det){fTrim_AnodeNbr.push_back(det);};//!
+    inline void SetEnergy(double Energy){fTrim_Energy.push_back(Energy);};//!
+    inline void SetDriftTime(double Time){fTrim_DriftTime.push_back(Time);};//!
+    inline void SetPileUp(bool ispileup){fTrim_PileUp.push_back(ispileup);};//!
+    inline void SetOverflow(bool isoverflow){fTrim_Overflow.push_back(isoverflow);};//!
+
+    //////////////////////    GETTERS    ////////////////////////
+    inline int GetMultiplicity() const {return fTrim_AnodeNbr.size();}//!
+    inline int GetSectionNbr(const unsigned int &i) const {return fTrim_SectionNbr[i];}//! 
+    inline int GetAnodeNbr(const unsigned int &i) const {return fTrim_AnodeNbr[i];}//! 
+    inline double GetEnergy(const unsigned int &i) const {return fTrim_Energy[i];}//!     
+    inline double GetDriftTime(const unsigned int &i) const {return fTrim_DriftTime[i];}//!     
+    inline bool GetPileUp(const unsigned int &i) const {return fTrim_PileUp[i];}//!     
+    inline bool GetOverflow(const unsigned int &i) const {return fTrim_Overflow[i];}//!     
+
+  //////////////////////////////////////////////////////////////
+  // Required for ROOT dictionnary
+  ClassDef(TSofTrimData,1)  // SofTrimData structure
+};
+
+#endif
diff --git a/NPLib/Detectors/Sofia/TSofTrimPhysics.cxx b/NPLib/Detectors/Sofia/TSofTrimPhysics.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..5d55976570e598be69d8c18f5c699af326b02439
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofTrimPhysics.cxx
@@ -0,0 +1,291 @@
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ *                                                                           *
+ * Creation Date  : November 2020                                           *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold SofTrim Treated  data                               *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+
+#include "TSofTrimPhysics.h"
+
+//   STL
+#include <sstream>
+#include <iostream>
+#include <cmath>
+#include <stdlib.h>
+#include <limits>
+using namespace std;
+
+//   NPL
+#include "RootInput.h"
+#include "RootOutput.h"
+#include "NPDetectorFactory.h"
+#include "NPOptionManager.h"
+
+//   ROOT
+#include "TChain.h"
+
+ClassImp(TSofTrimPhysics)
+
+
+  ///////////////////////////////////////////////////////////////////////////
+TSofTrimPhysics::TSofTrimPhysics()
+  : m_EventData(new TSofTrimData),
+  m_PreTreatedData(new TSofTrimData),
+  m_EventPhysics(this),
+  m_NumberOfDetectors(0), 
+  m_NumberOfSections(3), 
+  m_NumberOfAnodesPerSection(6) {
+  }
+
+///////////////////////////////////////////////////////////////////////////
+/// A usefull method to bundle all operation to add a detector
+void TSofTrimPhysics::AddDetector(TVector3 ){
+  // In That simple case nothing is done
+  // Typically for more complex detector one would calculate the relevant 
+  // positions (stripped silicon) or angles (gamma array)
+  m_NumberOfDetectors++;
+} 
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTrimPhysics::AddDetector(double R, double Theta, double Phi){
+  // Compute the TVector3 corresponding
+  TVector3 Pos(R*sin(Theta)*cos(Phi),R*sin(Theta)*sin(Phi),R*cos(Theta));
+  // Call the cartesian method
+  AddDetector(Pos);
+} 
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTrimPhysics::BuildSimplePhysicalEvent() {
+  BuildPhysicalEvent();
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTrimPhysics::BuildPhysicalEvent() {
+  // apply thresholds and calibration
+  PreTreat();
+
+  // match energy and time together
+  unsigned int mysizeE = m_PreTreatedData->GetMultiplicity();
+  for (UShort_t e = 0; e < mysizeE ; e++) {
+    //to do 
+  }
+}
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTrimPhysics::PreTreat() {
+  // This method typically applies thresholds and calibrations
+  // Might test for disabled channels for more complex detector
+
+  // clear pre-treated object
+  ClearPreTreatedData();
+
+  // instantiate CalibrationManager
+  static CalibrationManager* Cal = CalibrationManager::getInstance();
+
+  unsigned int mysize = m_EventData->GetMultiplicity();
+  for (unsigned int i = 0; i < mysize ; ++i) {
+    Double_t Energy = Cal->ApplyCalibration("SofTrim/ENERGY_SEC"+NPL::itoa(m_EventData->GetSectionNbr(i))+"_ANODE"+NPL::itoa(m_EventData->GetAnodeNbr(i))+"_ENERGY",m_EventData->GetEnergy(i));
+    Double_t Time = Cal->ApplyCalibration("SofTrim/TIME_SEC"+NPL::itoa(m_EventData->GetSectionNbr(i))+"_ANODE"+NPL::itoa(m_EventData->GetAnodeNbr(i))+"_TIME",m_EventData->GetDriftTime(i));
+
+    m_PreTreatedData->SetSectionNbr(m_EventData->GetSectionNbr(i));
+    m_PreTreatedData->SetAnodeNbr(m_EventData->GetAnodeNbr(i));
+    m_PreTreatedData->SetEnergy(Energy);
+    m_PreTreatedData->SetDriftTime(Time);
+    m_PreTreatedData->SetPileUp(m_EventData->GetPileUp(i));
+    m_PreTreatedData->SetOverflow(m_EventData->GetOverflow(i));
+  }
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTrimPhysics::ReadAnalysisConfig() {
+  bool ReadingStatus = false;
+
+  // path to file
+  string FileName = "./configs/ConfigSofTrim.dat";
+
+  // open analysis config file
+  ifstream AnalysisConfigFile;
+  AnalysisConfigFile.open(FileName.c_str());
+
+  if (!AnalysisConfigFile.is_open()) {
+    cout << " No ConfigSofTrim.dat found: Default parameter loaded for Analayis " << FileName << endl;
+    return;
+  }
+  cout << " Loading user parameter for Analysis from ConfigSofTrim.dat " << endl;
+
+  // Save it in a TAsciiFile
+  TAsciiFile* asciiConfig = RootOutput::getInstance()->GetAsciiFileAnalysisConfig();
+  asciiConfig->AppendLine("%%% ConfigSofTrim.dat %%%");
+  asciiConfig->Append(FileName.c_str());
+  asciiConfig->AppendLine("");
+  // read analysis config file
+  string LineBuffer,DataBuffer,whatToDo;
+  while (!AnalysisConfigFile.eof()) {
+    // Pick-up next line
+    getline(AnalysisConfigFile, LineBuffer);
+
+    // search for "header"
+    string name = "ConfigSofTrim";
+    if (LineBuffer.compare(0, name.length(), name) == 0) 
+      ReadingStatus = true;
+
+    // loop on tokens and data
+    while (ReadingStatus ) {
+      whatToDo="";
+      AnalysisConfigFile >> whatToDo;
+
+      // Search for comment symbol (%)
+      if (whatToDo.compare(0, 1, "%") == 0) {
+        AnalysisConfigFile.ignore(numeric_limits<streamsize>::max(), '\n' );
+      }
+
+      /*else if (whatToDo=="E_RAW_THRESHOLD") {
+        AnalysisConfigFile >> DataBuffer;
+        m_E_RAW_Threshold = atof(DataBuffer.c_str());
+        cout << whatToDo << " " << m_E_RAW_Threshold << endl;
+        }
+
+        else if (whatToDo=="E_THRESHOLD") {
+        AnalysisConfigFile >> DataBuffer;
+        m_E_Threshold = atof(DataBuffer.c_str());
+        cout << whatToDo << " " << m_E_Threshold << endl;
+        }*/
+
+      else {
+        ReadingStatus = false;
+      }
+    }
+  }
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTrimPhysics::Clear() {
+  SectionNbr.clear();
+  EnergyPair1.clear();
+  EnergyPair2.clear();
+  EnergyPair2.clear();
+  DriftTimePair1.clear();
+  DriftTimePair2.clear();
+  DriftTimePair3.clear();
+  EnergySum.clear();
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTrimPhysics::ReadConfiguration(NPL::InputParser parser) {
+  vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("SofTrim");
+  if(NPOptionManager::getInstance()->GetVerboseLevel())
+    cout << "//// " << blocks.size() << " detectors found " << endl; 
+
+  vector<string> cart = {"POS"};
+  vector<string> sphe = {"R","Theta","Phi"};
+
+  for(unsigned int i = 0 ; i < blocks.size() ; i++){
+    if(blocks[i]->HasTokenList(cart)){
+      if(NPOptionManager::getInstance()->GetVerboseLevel())
+        cout << endl << "////  SofTrim " << i+1 <<  endl;
+
+      TVector3 Pos = blocks[i]->GetTVector3("POS","mm");
+      AddDetector(Pos);
+    }
+    else if(blocks[i]->HasTokenList(sphe)){
+      if(NPOptionManager::getInstance()->GetVerboseLevel())
+        cout << endl << "////  SofTrim " << i+1 <<  endl;
+      double R = blocks[i]->GetDouble("R","mm");
+      double Theta = blocks[i]->GetDouble("Theta","deg");
+      double Phi = blocks[i]->GetDouble("Phi","deg");
+      AddDetector(R,Theta,Phi);
+    }
+    else{
+      cout << "ERROR: check your input file formatting " << endl;
+      exit(1);
+    }
+  }
+}
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTrimPhysics::AddParameterToCalibrationManager() {
+  CalibrationManager* Cal = CalibrationManager::getInstance();
+  for(int sec = 0; sec < m_NumberOfSections; sec++){
+    for(int anode = 0; anode < m_NumberOfAnodesPerSection; anode++){
+      Cal->AddParameter("SofTrim","SEC"+NPL::itoa(sec+1)+"_ANODE"+NPL::itoa(anode+1)+"_ENERGY","SofTrim_SEC"+NPL::itoa(sec+1)+"_ANODE"+NPL::itoa(anode+1)+"_ENERGY");
+      Cal->AddParameter("SofTrim","SEC"+NPL::itoa(sec+1)+"_ANODE"+NPL::itoa(anode+1)+"_TIME","SofTrim_SEC"+NPL::itoa(sec+1)+"_ANODE"+NPL::itoa(anode+1)+"_TIME");
+
+    }
+  }
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTrimPhysics::InitializeRootInputRaw() {
+  TChain* inputChain = RootInput::getInstance()->GetChain();
+  inputChain->SetBranchStatus("SofTrim",  true );
+  inputChain->SetBranchAddress("SofTrim", &m_EventData );
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTrimPhysics::InitializeRootInputPhysics() {
+  TChain* inputChain = RootInput::getInstance()->GetChain();
+  inputChain->SetBranchAddress("SofTrim", &m_EventPhysics);
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+void TSofTrimPhysics::InitializeRootOutput() {
+  TTree* outputTree = RootOutput::getInstance()->GetTree();
+  outputTree->Branch("SofTrim", "TSofTrimPhysics", &m_EventPhysics);
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+//            Construct Method to be pass to the DetectorFactory              //
+////////////////////////////////////////////////////////////////////////////////
+NPL::VDetector* TSofTrimPhysics::Construct() {
+  return (NPL::VDetector*) new TSofTrimPhysics();
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+//            Registering the construct method to the factory                 //
+////////////////////////////////////////////////////////////////////////////////
+extern "C"{
+  class proxy_SofTrim{
+    public:
+      proxy_SofTrim(){
+        NPL::DetectorFactory::getInstance()->AddToken("SofTrim","SofTrim");
+        NPL::DetectorFactory::getInstance()->AddDetector("SofTrim",TSofTrimPhysics::Construct);
+      }
+  };
+
+  proxy_SofTrim p_SofTrim;
+}
+
diff --git a/NPLib/Detectors/Sofia/TSofTrimPhysics.h b/NPLib/Detectors/Sofia/TSofTrimPhysics.h
new file mode 100644
index 0000000000000000000000000000000000000000..759fff86d56b500de3f6766655701e592e2da0ce
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofTrimPhysics.h
@@ -0,0 +1,157 @@
+#ifndef TSofTrimPHYSICS_H
+#define TSofTrimPHYSICS_H
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ *                                                                           *
+ * Creation Date  : November 2020                                           *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold TofTofW Treated data                                *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+
+// C++ headers 
+#include <vector>
+#include <map>
+#include <string>
+using namespace std;
+
+// ROOT headers
+#include "TObject.h"
+#include "TH1.h"
+#include "TVector3.h"
+// NPTool headers
+#include "TSofTrimData.h"
+#include "NPCalibrationManager.h"
+#include "NPVDetector.h"
+#include "NPInputParser.h"
+
+
+
+class TSofTrimPhysics : public TObject, public NPL::VDetector {
+  //////////////////////////////////////////////////////////////
+  // constructor and destructor
+  public:
+    TSofTrimPhysics();
+    ~TSofTrimPhysics() {};
+
+
+  //////////////////////////////////////////////////////////////
+  // Inherited from TObject and overriden to avoid warnings
+  public: 
+    void Clear();   
+    void Clear(const Option_t*) {};
+
+
+  //////////////////////////////////////////////////////////////
+  // data obtained after BuildPhysicalEvent() and stored in
+  // output ROOT file
+  public:
+    vector<int>      SectionNbr;
+    vector<double>   EnergyPair1;
+    vector<double>   EnergyPair2;
+    vector<double>   EnergyPair3;
+    vector<double>   DriftTimePair1;
+    vector<double>   DriftTimePair2;
+    vector<double>   DriftTimePair3;
+    vector<double>   EnergySum;
+
+  /// A usefull method to bundle all operation to add a detector
+  void AddDetector(TVector3 POS); 
+  void AddDetector(double R, double Theta, double Phi); 
+  
+  //////////////////////////////////////////////////////////////
+  // methods inherited from the VDetector ABC class
+  public:
+    // read stream from ConfigFile to pick-up detector parameters
+    void ReadConfiguration(NPL::InputParser);
+
+    // add parameters to the CalibrationManger
+    void AddParameterToCalibrationManager();
+
+    // method called event by event, aiming at extracting the 
+    // physical information from detector
+    void BuildPhysicalEvent();
+
+    // same as BuildPhysicalEvent() method but with a simpler
+    // treatment
+    void BuildSimplePhysicalEvent();
+
+    // same as above but for online analysis
+    void BuildOnlinePhysicalEvent()  {BuildPhysicalEvent();};
+
+    // activate raw data object and branches from input TChain
+    // in this method mother branches (Detector) AND daughter leaves 
+    // (fDetector_parameter) have to be activated
+    void InitializeRootInputRaw();
+
+    // activate physics data object and branches from input TChain
+    // in this method mother branches (Detector) AND daughter leaves 
+    // (fDetector_parameter) have to be activated
+    void InitializeRootInputPhysics();
+
+    // create branches of output ROOT file
+    void InitializeRootOutput();
+
+    // clear the raw and physical data objects event by event
+    void ClearEventPhysics() {Clear();}      
+    void ClearEventData()    {m_EventData->Clear();}   
+
+
+  //////////////////////////////////////////////////////////////
+  // specific methods to SofTrim array
+  public:
+    // remove bad channels, calibrate the data and apply thresholds
+    void PreTreat();
+
+    // clear the pre-treated object
+    void ClearPreTreatedData()   {m_PreTreatedData->Clear();}
+
+    // read the user configuration file. If no file is found, load standard one
+    void ReadAnalysisConfig();
+
+    // give and external TSofTrimData object to TSofTrimPhysics. 
+    // needed for online analysis for example
+    void SetRawDataPointer(TSofTrimData* rawDataPointer) {m_EventData = rawDataPointer;}
+    
+  // objects are not written in the TTree
+  private:
+    TSofTrimData*         m_EventData;        //!
+    TSofTrimData*         m_PreTreatedData;   //!
+    TSofTrimPhysics*      m_EventPhysics;     //!
+
+  // getters for raw and pre-treated data object
+  public:
+    TSofTrimData* GetRawData()        const {return m_EventData;}
+    TSofTrimData* GetPreTreatedData() const {return m_PreTreatedData;}
+
+  // parameters used in the analysis
+  private:
+    // thresholds
+    double m_E_Threshold;     //!
+
+  // number of detectors
+  private:
+    int m_NumberOfDetectors;  //!
+    int m_NumberOfSections;  //!
+    int m_NumberOfAnodesPerSection;  //!
+
+  // Static constructor to be passed to the Detector Factory
+  public:
+    static NPL::VDetector* Construct();
+
+    ClassDef(TSofTrimPhysics,1)  // SofTrimPhysics structure
+};
+#endif
diff --git a/NPLib/Detectors/Sofia/TSofTwimData.cxx b/NPLib/Detectors/Sofia/TSofTwimData.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..5b2f302751d3d314f1f4d44f382188bc8fc02277
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofTwimData.cxx
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ * Creation Date  : May 2021                                           *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold SofTwim Raw data                                    *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+#include "TSofTwimData.h"
+
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <string>
+using namespace std; 
+
+ClassImp(TSofTwimData)
+
+
+//////////////////////////////////////////////////////////////////////
+TSofTwimData::TSofTwimData() {
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+TSofTwimData::~TSofTwimData() {
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+void TSofTwimData::Clear() {
+  fTwim_SectionNbr.clear();
+  fTwim_AnodeNbr.clear();
+  fTwim_Energy.clear();
+  fTwim_DriftTime.clear();
+  fTwim_PileUp.clear();
+  fTwim_Overflow.clear();
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+void TSofTwimData::Dump() const {
+  // This method is very useful for debuging and worth the dev.
+  cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event [TSofTwimData::Dump()] XXXXXXXXXXXXXXXXX" << endl;
+
+  // Energy
+  size_t mysize = fTwim_AnodeNbr.size();
+  cout << "Twim_Mult: " << GetMultiplicity() << endl;
+ 
+}
diff --git a/NPLib/Detectors/Sofia/TSofTwimData.h b/NPLib/Detectors/Sofia/TSofTwimData.h
new file mode 100644
index 0000000000000000000000000000000000000000..2819d658701f5e47b0f434eee7a86c946177b838
--- /dev/null
+++ b/NPLib/Detectors/Sofia/TSofTwimData.h
@@ -0,0 +1,87 @@
+#ifndef __SofTwimDATA__
+#define __SofTwimDATA__
+/*****************************************************************************
+ * Copyright (C) 2009-2020   this file is part of the NPTool Project       *
+ *                                                                           *
+ * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+ * For the list of contributors see $NPTOOL/Licence/Contributors             *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Original Author: Pierre Morfouace  contact address: pierre.morfouace2@cea.fr                        *
+ *                                                                           *
+ * Creation Date  : May 2021                                                 *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold SofTwim Raw data                                    *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+
+// STL
+#include <vector>
+using namespace std;
+
+// ROOT
+#include "TObject.h"
+
+class TSofTwimData : public TObject {
+  //////////////////////////////////////////////////////////////
+  // data members are hold into vectors in order 
+  // to allow multiplicity treatment
+  private: 
+    vector<int>      fTwim_SectionNbr;
+    vector<int>      fTwim_AnodeNbr;
+    vector<double>   fTwim_Energy;
+    vector<double>   fTwim_DriftTime;
+    vector<bool>     fTwim_PileUp;
+    vector<bool>     fTwim_Overflow;
+
+  //////////////////////////////////////////////////////////////
+  // Constructor and destructor
+  public: 
+    TSofTwimData();
+    ~TSofTwimData();
+    
+
+  //////////////////////////////////////////////////////////////
+  // Inherited from TObject and overriden to avoid warnings
+  public:
+    void Clear();
+    void Clear(const Option_t*) {};
+    void Dump() const;
+
+
+  //////////////////////////////////////////////////////////////
+  // Getters and Setters
+  // Prefer inline declaration to avoid unnecessary called of 
+  // frequently used methods
+  // add //! to avoid ROOT creating dictionnary for the methods
+  public:
+    //////////////////////    SETTERS    ////////////////////////
+    inline void SetSectionNbr(int sec){fTwim_SectionNbr.push_back(sec);};//!
+    inline void SetAnodeNbr(int det){fTwim_AnodeNbr.push_back(det);};//!
+    inline void SetEnergy(double Energy){fTwim_Energy.push_back(Energy);};//!
+    inline void SetDriftTime(double Time){fTwim_DriftTime.push_back(Time);};//!
+    inline void SetPileUp(bool ispileup){fTwim_PileUp.push_back(ispileup);};//!
+    inline void SetOverflow(bool isoverflow){fTwim_Overflow.push_back(isoverflow);};//!
+
+    //////////////////////    GETTERS    ////////////////////////
+    inline int GetMultiplicity() const {return fTwim_AnodeNbr.size();}//!
+    inline int GetSectionNbr(const unsigned int &i) const {return fTwim_SectionNbr[i];}//! 
+    inline int GetAnodeNbr(const unsigned int &i) const {return fTwim_AnodeNbr[i];}//! 
+    inline double GetEnergy(const unsigned int &i) const {return fTwim_Energy[i];}//!     
+    inline double GetDriftTime(const unsigned int &i) const {return fTwim_DriftTime[i];}//!     
+    inline bool GetPileUp(const unsigned int &i) const {return fTwim_PileUp[i];}//!     
+    inline bool GetOverflow(const unsigned int &i) const {return fTwim_Overflow[i];}//!     
+
+  //////////////////////////////////////////////////////////////
+  // Required for ROOT dictionnary
+  ClassDef(TSofTwimData,1)  // SofTwimData structure
+};
+
+#endif