diff --git a/NPLib/VDetector/DetectorManager.cxx b/NPLib/VDetector/DetectorManager.cxx index 86bbd6a2ee7de4751c31069cfd276d01c1c52c66..232ffd148336e6bb4402c48faa1b6b8579c86d07 100644 --- a/NPLib/VDetector/DetectorManager.cxx +++ b/NPLib/VDetector/DetectorManager.cxx @@ -748,3 +748,16 @@ void DetectorManager::InitSpectra(){ it->second->InitSpectra(); } +///////////////////////////////////////////////////////////////////////////////////////////////// +vector< map< vector<TString>, TH1* > > DetectorManager::GetSpectra() +{ + vector< map< vector<TString>, TH1* > > myVector; + + map<string,VDetector*>::iterator it; + // loop on detectors + for (it = m_Detector.begin(); it != m_Detector.end(); ++it) { + myVector.push_back(it->second->GetSpectra()); + } + + return myVector; +} diff --git a/NPLib/VDetector/DetectorManager.h b/NPLib/VDetector/DetectorManager.h index cb3d7488a3efa84441e6bdee5fffae969fbbf180..137bc7539710284710ad7fca60ad02b21ae922ef 100644 --- a/NPLib/VDetector/DetectorManager.h +++ b/NPLib/VDetector/DetectorManager.h @@ -23,11 +23,15 @@ // NPL #include "VDetector.h" +// ROOT +#include "TH1.h" +#include "TString.h" + // STL #include <string> #include <map> - using namespace std ; + using namespace NPA ; // This class manage a map of virtual detector @@ -49,6 +53,7 @@ namespace NPA{ void ClearEventPhysics(); void ClearEventData(); void InitSpectra(); + vector< map< vector<TString>, TH1* > > GetSpectra(); private: // The map containning all detectors diff --git a/NPLib/VDetector/VDetector.h b/NPLib/VDetector/VDetector.h index eaf1876dfc83b48efba5fd02d63541a5def8668c..6d36b74b11e354f5b1401c5e4f86d5b9bde31681 100644 --- a/NPLib/VDetector/VDetector.h +++ b/NPLib/VDetector/VDetector.h @@ -25,8 +25,14 @@ * * * Adding Fill Spectra Method to fill control Histogramm * *****************************************************************************/ + +// ROOT headers +#include "TH1.h" + // STL header #include <string> +#include <vector> +#include <map> using namespace std; namespace NPA { @@ -76,6 +82,8 @@ namespace NPA { virtual void CheckSpectra() {}; // Used for Online only, clear all the spectra hold by the Spectra class virtual void ClearSpectra() {}; + // Used for Online only, get all the spectra hold by the Spectra class + virtual map< vector<TString> , TH1*> GetSpectra() {map< vector<TString>, TH1* > x; return x;}; private: // The list below is here to help you building your own detector /*