From 4de88730b46e2c619d45bad53fd90529c736005e Mon Sep 17 00:00:00 2001
From: adrien-matta <a.matta@surrey.ac.uk>
Date: Thu, 21 Nov 2013 17:37:07 +0100
Subject: [PATCH] * Fixing bug in TMust2Spectra

---
 NPLib/MUST2/TMust2Physics.cxx |  7 +++++++
 NPLib/MUST2/TMust2Spectra.cxx |  6 +++---
 NPLib/MUST2/TMust2Spectra.h   | 10 +++-------
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/NPLib/MUST2/TMust2Physics.cxx b/NPLib/MUST2/TMust2Physics.cxx
index 931366732..c9b4a7fa7 100644
--- a/NPLib/MUST2/TMust2Physics.cxx
+++ b/NPLib/MUST2/TMust2Physics.cxx
@@ -303,6 +303,13 @@ void TMust2Physics::BuildPhysicalEvent(){
       
         }
       }
+
+
+  // Fill the control Histo if requested by user
+  if(NPOptionManager::getInstance()->GetGenerateHistoOption()){
+   m_Spectra -> FillRawSpectra(m_EventData);
+   m_Spectra -> FillPreTreatedSpectra(m_PreTreatedData);
+  }
   
   return;
   
diff --git a/NPLib/MUST2/TMust2Spectra.cxx b/NPLib/MUST2/TMust2Spectra.cxx
index 7ce345894..2441e66f5 100644
--- a/NPLib/MUST2/TMust2Spectra.cxx
+++ b/NPLib/MUST2/TMust2Spectra.cxx
@@ -259,7 +259,7 @@ void TMust2Spectra::FillPreTreatedSpectra(TMust2Data* PreTreatedData){
   // STRX_E
   for (Int_t i = 0; i < PreTreatedData->GetMMStripXEMult(); i++) {
     name = Form("MM%d_STRX_E_CAL", PreTreatedData->GetMMStripXEDetectorNbr(i) );
-    family = "MUST2/CAL/STRIPXE";
+    family = "MUST2/CAL/STRXE";
 
     GetHisto(family,name)
       -> Fill(PreTreatedData->GetMMStripXEStripNbr(i), 
@@ -295,7 +295,7 @@ void TMust2Spectra::FillPreTreatedSpectra(TMust2Data* PreTreatedData){
   // SILI_E
   for (Int_t i = 0; i < PreTreatedData->GetMMSiLiEMult(); i++) {
     name = Form("MM%d_SILI_E_CAL", PreTreatedData->GetMMSiLiEDetectorNbr(i) );
-    family = "MUST2/CAL/SILIET";
+    family = "MUST2/CAL/SILIE";
 
     GetHisto(family,name)
       -> Fill(PreTreatedData->GetMMSiLiEPadNbr(i), 
@@ -365,7 +365,7 @@ TH1* TMust2Spectra::GetHisto(TString family, TString name){
   vector<TString> index ;
   index.push_back(family);
   index.push_back(name);
-
+  
   // fill map
   return fMapHisto.at(index);
 }
diff --git a/NPLib/MUST2/TMust2Spectra.h b/NPLib/MUST2/TMust2Spectra.h
index 406f71496..cceeb8385 100644
--- a/NPLib/MUST2/TMust2Spectra.h
+++ b/NPLib/MUST2/TMust2Spectra.h
@@ -52,12 +52,11 @@ class TMust2Spectra {
     // Initialization methods
     void InitRawSpectra();
     void InitPreTreatedSpectra();
-    void InitPhysicsSpectra();
 
     // Filling methods
-   void FillRawSpectra(TMust2Data*);
-   void FillPreTreatedSpectra(TMust2Data*);
-                            
+    void FillRawSpectra(TMust2Data*);
+    void FillPreTreatedSpectra(TMust2Data*);
+
     // get map histo which will be used for GSpectra in GUser
     map< vector<TString>, TH1* > GetMapHisto() const {return fMapHisto;}
     TH1* GetHisto(TString family,TString name);    
@@ -72,9 +71,6 @@ class TMust2Spectra {
   private:
     // map holding histo pointers and their family names
     map< vector<TString>, TH1* > fMapHisto;
-
-
-//  ClassDef(TMust2Spectra,1)  // Must2Spectra structure
 };
 
 #endif
-- 
GitLab