From 9cc1ff2411b9920081a65abe069ddece529b2318 Mon Sep 17 00:00:00 2001
From: mugast <mugast@ganp505.ganil.local>
Date: Thu, 13 Dec 2018 10:24:06 +0100
Subject: [PATCH] Adding new ModularLeaf for online spectra and offline
 analysis

---
 .../ModularLeaf/TModularLeafPhysics.cxx       | 142 ++++++++-----
 .../ModularLeaf/TModularLeafPhysics.h         |  44 ++--
 .../ModularLeaf/TModularLeafSpectra.cxx       | 191 ++++++++++++++++++
 .../ModularLeaf/TModularLeafSpectra.h         |  68 +++++++
 4 files changed, 387 insertions(+), 58 deletions(-)
 create mode 100644 NPLib/Detectors/ModularLeaf/TModularLeafSpectra.cxx
 create mode 100644 NPLib/Detectors/ModularLeaf/TModularLeafSpectra.h

diff --git a/NPLib/Detectors/ModularLeaf/TModularLeafPhysics.cxx b/NPLib/Detectors/ModularLeaf/TModularLeafPhysics.cxx
index 67d19448a..860e40c68 100644
--- a/NPLib/Detectors/ModularLeaf/TModularLeafPhysics.cxx
+++ b/NPLib/Detectors/ModularLeaf/TModularLeafPhysics.cxx
@@ -45,31 +45,30 @@ string itoa(int value){
   return buffer;
 }
 
-ClassImp(TModularLeafPhysics)
+ClassImp(TModularLeafPhysics);
   ///////////////////////////////////////////////////////////////////////////
-TModularLeafPhysics::TModularLeafPhysics(){      
-  NumberOfDetector = 0 ;
-  //EventData = new TModularLeafData ;
-  EventPhysics = this ;
-}
+  TModularLeafPhysics::TModularLeafPhysics(){      
+    m_NumberOfDetector = 0 ;
+    m_EventPhysics = this ;
+  }
 
 ///////////////////////////////////////////////////////////////////////////
 TModularLeafPhysics::~TModularLeafPhysics(){
-  }
+}
 
 ///////////////////////////////////////////////////////////////////////////
 void TModularLeafPhysics::Clear() {
- std::map<std::string,double>::iterator it ;
- for( it=m_CalibratedData.begin();it!=m_CalibratedData.end();it++){
-   it->second=m_DefaultValue; 
-   }
+  std::map<std::string,double>::iterator it ;
+  for( it=m_CalibratedData.begin();it!=m_CalibratedData.end();it++){
+    it->second=m_DefaultValue; 
+  }
 }
-///////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
 void TModularLeafPhysics::ClearEventData() {
- std::map<std::string,short>::iterator it ;
- for( it=m_RawData.begin();it!=m_RawData.end();it++){
-   it->second=m_DefaultValue; 
-   }
+  std::map<std::string,short>::iterator it ;
+  for( it=m_RawData.begin();it!=m_RawData.end();it++){
+    it->second=m_DefaultValue; 
+  }
 }
 
 
@@ -79,19 +78,22 @@ void TModularLeafPhysics::ReadConfiguration(NPL::InputParser parser) {
   if(NPOptionManager::getInstance()->GetVerboseLevel())
     cout << "//// " << blocks.size() << " modular leafs blocks found " << endl; 
 
-  vector<string> token = {"Leafs","DefaultValue"};
+  vector<std::string> token = {"Leafs","DefaultValue", "X", "Y"};
 
   for(unsigned int i = 0 ; i < blocks.size() ; i++){
     if(blocks[i]->HasTokenList(token)){
       if(NPOptionManager::getInstance()->GetVerboseLevel())
         cout << endl << "////  ModularLeaf " << i+1 <<  endl;
-      
-      m_DefaultValue = blocks[i]->GetDouble("DefaultValue","void");
-      std::vector<std::string> leafs = blocks[i]->GetVectorString("Leafs"); 
-      unsigned int size = leafs.size();
+
+      m_DefaultValue = blocks[i]->GetDouble("DefaultValue", "void");
+      m_leafs = blocks[i]->GetVectorString("Leafs"); 
+      m_leafs_X = blocks[i]->GetVectorString("X");
+      m_leafs_Y = blocks[i]->GetVectorString("Y");
+      unsigned int size = m_leafs.size();
+
       for(unsigned int l = 0 ; l < size ; l++){
-        m_CalibratedData[leafs[l]] = m_DefaultValue;
-        m_RawData[leafs[l]] = m_DefaultValue;
+        m_CalibratedData[m_leafs[l]] = m_DefaultValue;
+        m_RawData[m_leafs[l]] = m_DefaultValue;
       }
     }
 
@@ -105,9 +107,12 @@ void TModularLeafPhysics::ReadConfiguration(NPL::InputParser parser) {
 ///////////////////////////////////////////////////////////////////////////
 void TModularLeafPhysics::AddParameterToCalibrationManager(){
   CalibrationManager* Cal = CalibrationManager::getInstance();
-  std::map<std::string,double>::iterator it;
-  for(it = m_CalibratedData.begin() ; it!=m_CalibratedData.end() ; it++)
-      Cal->AddParameter("ModularLeaf", it->first,it->first)   ;
+  // std::map<std::string,double>::iterator it;
+  // for(it = m_CalibratedData.begin() ; it!it->first=m_CalibratedData.end() ; it++)
+  unsigned int leafs_size = m_leafs.size();
+  for(unsigned int i = 0; i < leafs_size; i++){
+    Cal->AddParameter(m_leafs[i], "", m_leafs[i]);
+  }
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -115,8 +120,9 @@ void TModularLeafPhysics::InitializeRootInputRaw() {
   TChain* inputChain = RootInput::getInstance()->GetChain();
   std::map<std::string,short>::iterator it;
   for(it = m_RawData.begin() ; it!=m_RawData.end() ; it++){
-   inputChain->SetBranchStatus ( (it->first).c_str(), true );
-   inputChain->SetBranchAddress( (it->first).c_str(), &(it->second) )  ; 
+    inputChain->SetBranchStatus ( (it->first).c_str(), true );
+    inputChain->SetBranchAddress( (it->first).c_str(), &(it->second) )  ; 
+    // cout << it->second << endl; 
   }
 }
 ///////////////////////////////////////////////////////////////////////////
@@ -124,8 +130,8 @@ void TModularLeafPhysics::InitializeRootInputPhysics(){
   TChain* inputChain = RootInput::getInstance()->GetChain();
   std::map<std::string,double>::iterator it;
   for(it = m_CalibratedData.begin() ; it!=m_CalibratedData.end() ; it++){
-   inputChain->SetBranchStatus ( (it->first).c_str(), true );
-   inputChain->SetBranchAddress( (it->first).c_str(), &(it->second) )  ; 
+    inputChain->SetBranchStatus ( (it->first).c_str(), true );
+    inputChain->SetBranchAddress( (it->first).c_str(), &(it->second) )  ; 
   }
 }
 
@@ -134,27 +140,72 @@ void TModularLeafPhysics::InitializeRootOutput(){
   TTree* outputTree = RootOutput::getInstance()->GetTree();
   std::map<std::string,double>::iterator it;
   for(it = m_CalibratedData.begin() ; it!=m_CalibratedData.end() ; it++){
-   outputTree->Branch( (it->first).c_str(),  &(m_CalibratedData[it->first]))  ; 
-   }
+    outputTree->Branch( (it->first).c_str(),  &(m_CalibratedData[it->first]))  ; 
+  }
 }
 
 ///////////////////////////////////////////////////////////////////////////
 void TModularLeafPhysics::BuildPhysicalEvent(){
+cout << 1 << endl;
   static CalibrationManager* Cal = CalibrationManager::getInstance();
+  static string name;
   std::map<std::string,short>::iterator it;
 
+cout << 2 << endl;
   for(it = m_RawData.begin() ; it != m_RawData.end() ; it++){
-    if(it->second!=m_DefaultValue){
-      static string param;
-      param="ModularLeaf/"+it->first;
-      m_CalibratedData[it->first] = Cal->ApplyCalibration(param,it->second);
-      }
+    // cout << it->first << " " << it->second << endl;
+    name = it->first + "/" +it->first; 
+    cout << name << endl;
+    if(it->second != m_DefaultValue){
+      m_CalibratedData[it->first] = Cal->ApplyCalibration(name, it->second);
     }
+  }
+cout << 3 << endl;
 }
 
 ///////////////////////////////////////////////////////////////////////////
 void TModularLeafPhysics::BuildSimplePhysicalEvent(){
+	TModularLeafPhysics::BuildPhysicalEvent();
+}
 
+/////////////////////////////////////////////////////////////////////////
+// Spectra function needed by the spectra server 
+//////////////////////////////////////////////////////////////////////////
+void TModularLeafPhysics::InitSpectra(){
+  m_Spectra = new TModularLeafSpectra(m_leafs, m_leafs_X, m_leafs_Y);
+}
+
+///////////////////////////////////////////////////////////////////////////
+void TModularLeafPhysics::FillSpectra(){
+  // cout << "TModularLeafPhysics::FillSpectra" << endl;
+  m_Spectra->FillRawSpectra(m_RawData);
+  m_Spectra->FillPreTreatedSpectra(m_CalibratedData);
+  m_Spectra->FillPhysicsSpectra(m_leafs_X, m_leafs_Y, m_CalibratedData);
+}
+///////////////////////////////////////////////////////////////////////////
+void TModularLeafPhysics::CheckSpectra(){
+  m_Spectra->CheckSpectra();
+}
+///////////////////////////////////////////////////////////////////////////
+void TModularLeafPhysics::ClearSpectra(){
+  // To be done
+}
+
+///////////////////////////////////////////////////////////////////////////
+void TModularLeafPhysics::WriteSpectra() {
+  if(m_Spectra){
+    m_Spectra->WriteSpectra();
+  }
+}
+
+///////////////////////////////////////////////////////////////////////////
+map< string , TH1*> TModularLeafPhysics::GetSpectra() {
+  if(m_Spectra)
+    return m_Spectra->GetMapHisto();
+  else{
+    map< string , TH1*> empty;
+    return empty;
+  }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -168,14 +219,15 @@ NPL::VDetector* TModularLeafPhysics::Construct(){
 //            Registering the construct method to the factory                 //
 ////////////////////////////////////////////////////////////////////////////////
 extern "C"{
-class proxy_modularleaf{
-  public:
-    proxy_modularleaf(){
-      NPL::DetectorFactory::getInstance()->AddToken("ModularLeaf","ModularLeaf");
-      NPL::DetectorFactory::getInstance()->AddDetector("ModularLeaf",TModularLeafPhysics::Construct);
-    }
-};
+  class proxy_modularleaf{
+    public:
+      proxy_modularleaf(){
+        NPL::DetectorFactory::getInstance()->AddToken("ModularLeaf","ModularLeaf");
+        NPL::DetectorFactory::getInstance()->AddDetector("ModularLeaf",TModularLeafPhysics::Construct);
+      }
+  };
+
+  proxy_modularleaf p_modularleaf;
 
-proxy_modularleaf p_modularleaf;
 }
 
diff --git a/NPLib/Detectors/ModularLeaf/TModularLeafPhysics.h b/NPLib/Detectors/ModularLeaf/TModularLeafPhysics.h
index 83093d40f..25f6f431a 100644
--- a/NPLib/Detectors/ModularLeaf/TModularLeafPhysics.h
+++ b/NPLib/Detectors/ModularLeaf/TModularLeafPhysics.h
@@ -24,16 +24,23 @@
  
 //   STL
 #include <vector>
-using namespace std ;
 
 //   ROOT
 #include "TObject.h"
+#include "TVector2.h"
+#include "TVector3.h"
 
 //   NPL
+#include "TModularLeafSpectra.h"
 #include "NPVDetector.h"
 #include "NPCalibrationManager.h"
 #include "NPInputParser.h"
 
+using namespace std ;
+
+// Forward Declaration
+class TModularLeafSpectra;
+
 class TModularLeafPhysics : public TObject, public NPL::VDetector{
    public:   //   Constructor and Destructor
       TModularLeafPhysics();
@@ -45,14 +52,13 @@ class TModularLeafPhysics : public TObject, public NPL::VDetector{
    
    private:   //   Raw and Calibrated Data
       double m_DefaultValue; // !
-      std::map<std::string,double> m_CalibratedData;
-      std::map<std::string,short> m_RawData;
-
+      std::map<std::string, double> m_CalibratedData;
+      std::map<std::string, short> m_RawData; 
+       
    public:   //   inherrited from VDetector
       //   Read stream at ConfigFile to pick-up parameters of detector (Position,...) using Token
       void ReadConfiguration(NPL::InputParser);
       
-
       //   Add Parameter to the CalibrationManger
       void AddParameterToCalibrationManager();      
 
@@ -79,22 +85,34 @@ class TModularLeafPhysics : public TObject, public NPL::VDetector{
       void BuildOnlinePhysicalEvent()  {BuildPhysicalEvent();};
 
       // Give and external TModularLeafData object to TModularLeafPhysics. Needed for online analysis for example.
-      void SetRawDataPointer(void* rawDataPointer) {}
+      // Retrieve raw and pre-treated data
 
       //   Those two method all to clear the Event Physics or Data
       void ClearEventPhysics() {Clear();}      
-      void ClearEventData() ;      
+      void ClearEventData();      
 
-   private:   // Data not writted in the tree
-      int                   NumberOfDetector ;//!
-      //TModularLeafData*         EventData ;//!
-      TModularLeafPhysics*      EventPhysics ;//!
+      // Needed for Online spectra
+      void InitSpectra();
+      void FillSpectra();
+      void CheckSpectra();
+      void ClearSpectra();
+      void WriteSpectra() ;
+      map< string , TH1*> GetSpectra() ;
 
+    private: // Spectra Class
+        TModularLeafSpectra* m_Spectra;//!
+
+   private:   // Data not writted in the tree
+      int                       m_NumberOfDetector ;//!
+      TModularLeafPhysics*      m_EventPhysics ;//!
+      std::vector<std::string>  m_leafs;//!
+      std::vector<std::string>  m_leafs_X;//!
+      std::vector<std::string>  m_leafs_Y;//!
 
    public:
-      inline short GetRawValue(std::string label){return m_RawData[label];};
-      inline double GetCalibratedValue(std::string label){return m_CalibratedData[label];};
+      inline double GetCalibratedValue(const std::string& label){return m_CalibratedData[label];};
       inline void SetModularData(const string& lbl, const Short_t& val){m_RawData[lbl] = val;};
+
    public: // Static constructor to be passed to the Detector Factory
      static NPL::VDetector* Construct();
      ClassDef(TModularLeafPhysics,1)  // ModularLeafPhysics structure
diff --git a/NPLib/Detectors/ModularLeaf/TModularLeafSpectra.cxx b/NPLib/Detectors/ModularLeaf/TModularLeafSpectra.cxx
new file mode 100644
index 000000000..81b5b97b7
--- /dev/null
+++ b/NPLib/Detectors/ModularLeaf/TModularLeafSpectra.cxx
@@ -0,0 +1,191 @@
+/*****************************************************************************
+ * Copyright (C) 2009-XYEARX   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: Valerian alcindor  contact address: girardalcindor@ganil.fr
+ *                                                      alcindor@ipno.in2p3.fr *
+ *                                                                           *
+ * Creation Date  : May 2018                                           *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold ModularLeaf Spectra                                     *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+
+// class header 
+#include "TModularLeafSpectra.h"
+
+// STL
+#include <iostream>  
+#include <string>
+using namespace std;
+
+// NPTool header
+#include "NPOptionManager.h"
+// #include "NPVSpectra.h"
+
+////////////////////////////////////////////////////////////////////////////////
+TModularLeafSpectra::TModularLeafSpectra() 
+{
+     SetName("ModularLeaf");
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TModularLeafSpectra::TModularLeafSpectra(std::vector<std::string> leafs, std::vector<string> leafs_X, std::vector <string> leafs_Y) {
+  if(NPOptionManager::getInstance()->GetVerboseLevel()>0)
+    cout << "************************************************" << endl
+      << "TModularLeafSpectra : Initalizing control spectra for " 
+      <<  leafs.size() << " Leafs" << endl
+      << "************************************************" << endl ;
+  SetName("ModularLeaf");
+  fleafs = leafs;
+  InitRawSpectra();
+  InitPreTreatedSpectra();
+  InitPhysicsSpectra(leafs_X, leafs_Y);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TModularLeafSpectra::~TModularLeafSpectra() {
+  delete f_ModularHisto;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void TModularLeafSpectra::InitRawSpectra() {
+  static string name;
+  unsigned int leafs_size = fleafs.size();
+  for (unsigned int i = 0; i < leafs_size; i++) { // loop on number of detectors
+    name = "NP_" + fleafs[i];
+    if (fleafs[i] == "GATCONFMASTER" || fleafs[i] == "GATCONFSLAVE"){
+      AddHisto1D(name, name, 8400, 0, 8400, "ModularLeaf/RAW");
+    }
+    else{
+      AddHisto1D("NP_" + fleafs[i], "NP_" + fleafs[i], 512, 0, 16384, "ModularLeaf/RAW");
+    }
+    // cout << fleafs[i] << endl;
+  } // end loop on number of detectors
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void TModularLeafSpectra::InitPreTreatedSpectra() {
+  static string name;
+  unsigned int leafs_size = fleafs.size();
+  for (unsigned int i = 0; i < leafs_size; i++) { // loop on number of detectors
+    name = "NP_" + fleafs[i]+ "_CAL";
+    char T = 'T'; char E = 'E'; char X = 'X'; 
+    if (fleafs[i].at(0) == T){
+      AddHisto1D(name, name, 10000, 0, 1000, "ModularLeaf/CAL");
+    }
+    else{
+      AddHisto1D(name, name, 1000, 0, 16000, "ModularLeaf/CAL");
+    }
+  }  // end loop on number of detectors
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void TModularLeafSpectra::InitPhysicsSpectra(std::vector <string>& leafs_X, std::vector <string>& leafs_Y) {
+  static string name;
+
+  int leafs_size;
+  if(leafs_X.size() == leafs_Y.size()){
+   leafs_size = leafs_X.size(); 
+  }
+  else{
+    cout << "ERROR X SIZE DIFFERENT OF Y SIZE" << endl;
+    return exit(1); 
+  }
+  for(int i = 0; i < leafs_size ; i++){
+    name = leafs_Y[i] + ":" + leafs_X[i];
+    if(leafs_X[i] == "T_PPT_CATS" && leafs_Y[i] == "PPT_Q"){
+    AddHisto2D(name, name, 1000, 0, 10, 10000, 0, 1000, "ModularLeaf/PHY");
+    } 
+    else{
+    AddHisto2D(name, name, 512, 0, 16384, 512, 0, 16384, "ModularLeaf/PHY");
+    }
+  }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void TModularLeafSpectra::FillRawSpectra(std::map<std::string, short>& RawData) {
+  static string name;
+  static string family;
+  short value;
+  std::map<std::string, short>::iterator it;
+  for (it = RawData.begin(); it != RawData.end(); it++){
+    name = "NP_" + it->first;
+    value = it->second;
+    family = "ModularLeaf/RAW";
+    FillSpectra(family, name, value);
+  }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void TModularLeafSpectra::FillPreTreatedSpectra(std::map<std::string, double>& CalibratedData) {
+  static string name;
+  static string family;
+  double value;
+
+  std::map<std::string, double>::iterator it;
+  for (it = CalibratedData.begin(); it != CalibratedData.end(); it++){
+    name = "NP_" + it->first + "_CAL";
+    value = it->second;
+    family = "ModularLeaf/CAL";
+    FillSpectra(family, name, value);
+  }
+
+  // // Time
+  // unsigned int sizeT = PreTreatedData->GetMultTime();
+  // for (unsigned int i = 0; i < sizeT; i++) {
+  //   name = "ModularLeaf"+NPL::itoa(PreTreatedData->GetT_DetectorNbr(i))+"_TIME_CAL";
+  //   family = "ModularLeaf/CAL";
+
+  //   GetHisto(family,name) -> Fill(PreTreatedData->Get_Time(i));
+  // }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void TModularLeafSpectra::FillPhysicsSpectra(std::vector<string>& leafs_X,
+    std::vector<string>& leafs_Y,
+    std::map<std::string, double>& CalibratedData) {
+
+  static string name;
+  static string family;
+  double x = 0.;
+  double y = 0.;
+  int leafs_size;
+  if(leafs_X.size() == leafs_Y.size()){
+   leafs_size = leafs_X.size(); 
+  }
+  else{
+    cout << "ERROR X SIZE DIFFERENT OF Y SIZE" << endl;
+    return exit(1); 
+  }
+
+  for(int i = 0; i < leafs_size ; i++){
+    std::map<std::string, double>::iterator it1;
+    for (it1 = CalibratedData.begin(); it1 != CalibratedData.end(); it1++){
+      if(it1->first == leafs_X[i]){
+        x = it1->second;
+      }
+    }
+    std::map<std::string, double>::iterator it2;
+    for (it2 = CalibratedData.begin(); it2 != CalibratedData.end(); it2++){
+      if(it2->first == leafs_Y[i]){
+        y = it2->second;
+      }
+    }
+
+    name = leafs_Y[i] + ":" + leafs_X[i];
+    family = "ModularLeaf/PHY";
+    FillSpectra(family, name, x, y);
+  }
+}
+
diff --git a/NPLib/Detectors/ModularLeaf/TModularLeafSpectra.h b/NPLib/Detectors/ModularLeaf/TModularLeafSpectra.h
new file mode 100644
index 000000000..c58717cd6
--- /dev/null
+++ b/NPLib/Detectors/ModularLeaf/TModularLeafSpectra.h
@@ -0,0 +1,68 @@
+#ifndef TModularLeafSPECTRA_H
+#define TModularLeafSPECTRA_H
+/*****************************************************************************
+ * Copyright (C) 2009-XYEARX   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: XAUTHORX  contact address: XMAILX                        *
+ *                                                                           *
+ * Creation Date  : XMONTHX XYEARX                                           *
+ * Last update    :                                                          *
+ *---------------------------------------------------------------------------*
+ * Decription:                                                               *
+ *  This class hold DETECTORNAME Spectra                                     *
+ *                                                                           *
+ *---------------------------------------------------------------------------*
+ * Comment:                                                                  *
+ *                                                                           *   
+ *                                                                           *
+ *****************************************************************************/
+
+// NPLib headers
+#include "NPVSpectra.h"
+#include "TModularLeafPhysics.h"
+
+#include <string>
+#include <vector>
+
+// Forward Declaration
+class TModularLeafPhysics;
+
+
+class TModularLeafSpectra : public VSpectra {
+  //////////////////////////////////////////////////////////////
+  // constructor and destructor
+  public:
+    TModularLeafSpectra();
+    TModularLeafSpectra(std::vector<std::string> leafs, std::vector<std::string> leafs_X, std::vector<std::string> leafs_Y);
+    ~TModularLeafSpectra();
+
+  //////////////////////////////////////////////////////////////
+  // Initialization methods
+  private:
+    void InitRawSpectra();
+    void InitPreTreatedSpectra();
+    void InitPhysicsSpectra(std::vector<std::string>& leafs_X, std::vector<std::string>& leafs_Y);
+    TH1F* f_ModularHisto;
+
+  //////////////////////////////////////////////////////////////
+  // Filling methods
+  public:
+    void FillRawSpectra(std::map<std::string,short>&);
+    void FillPreTreatedSpectra(std::map<std::string, double>&);
+    void FillPhysicsSpectra(std::vector<std::string>& leafs_X, std::vector<std::string>& leafs_Y,std::map<std::string, double>& CalibratedData);
+
+
+public:
+  //////////////////////////////////////////////////////////////
+  // Detector parameters 
+  private:
+    std::vector<std::string> fleafs;
+    
+};
+
+#endif
-- 
GitLab