Skip to content
Snippets Groups Projects
Commit 9b4208cf authored by de Séréville Nicolas's avatar de Séréville Nicolas
Browse files

+ Add GetSpectra() method in VDetector & DetectorManager

parent 18e34cf4
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......@@ -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
......
......@@ -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
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment