Commit bd46b0ec authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Move Analysis and Algorithm into corryvreckan namespace

parent 9be371f3
......@@ -6,7 +6,7 @@
#include "TStopwatch.h"
#include "Clipboard.h"
#include "Parameters.h"
#include "Tee.h"
#include "config/Configuration.hpp"
//-------------------------------------------------------------------------------
// The algorithm class is the base class that all user algorithms are built on. It
......@@ -16,46 +16,46 @@
// algorithm name) and the stopwatch for timing measurements.
//-------------------------------------------------------------------------------
enum StatusCode {
Success,
NoData,
Failure,
} ;
class Algorithm{
public:
// Constructors and destructors
Algorithm(){}
Algorithm(string name){
m_name = name;
m_stopwatch = new TStopwatch();
tcout.m_algorithmName = m_name;
}
virtual ~Algorithm(){}
// Three main functions - initialise, run and finalise. Called for every algorithm
virtual void initialise(Parameters*){}
virtual StatusCode run(Clipboard*){}
virtual void finalise(){}
// Methods to get member variables
string getName(){return m_name;}
TStopwatch* getStopwatch(){return m_stopwatch;}
// Simple cout replacement
tee tcout;
bool debug;
protected:
// Member variables
Parameters* parameters;
TStopwatch* m_stopwatch;
string m_name;
};
namespace corryvreckan {
enum StatusCode {
Success,
NoData,
Failure,
} ;
class Algorithm {
public:
// Constructors and destructors
Algorithm(){}
Algorithm(Configuration config, Clipboard* clipboard){
m_name = config.getName();
m_config = config;
m_clipboard = clipboard;
m_stopwatch = new TStopwatch();
}
virtual ~Algorithm(){}
// Three main functions - initialise, run and finalise. Called for every algorithm
virtual void initialise(Parameters*){}
virtual StatusCode run(Clipboard*){}
virtual void finalise(){}
// Methods to get member variables
string getName(){return m_name;}
TStopwatch* getStopwatch(){return m_stopwatch;}
protected:
// Member variables
Parameters* parameters;
TStopwatch* m_stopwatch;
string m_name;
Configuration m_config;
Clipboard* m_clipboard;
};
}
#endif
......@@ -23,39 +23,41 @@
// processing will stop.
//-------------------------------------------------------------------------------
class Analysis {
namespace corryvreckan {
class Analysis {
public:
public:
// Constructors and destructors
Analysis(std::string config_file_name);
virtual ~Analysis(){};
// Constructors and destructors
Analysis(std::string config_file_name);
virtual ~Analysis(){};
// Member functions
void add(Algorithm*);
void load();
// Member functions
void add(Algorithm*);
void load();
void run();
void timing();
void initialiseAll();
void finaliseAll();
void run();
void timing();
void initialiseAll();
void finaliseAll();
void reset() {};
void reset() {};
TBrowser* browser;
TBrowser* browser;
protected:
Algorithm* create_algorithm(void* library, corryvreckan::Configuration config, Clipboard* clipboard);
protected:
Algorithm* create_algorithm(void* library, corryvreckan::Configuration config, Clipboard* clipboard);
// Member variables
Parameters* m_parameters;
std::unique_ptr<corryvreckan::ConfigManager> conf_mgr_;
Clipboard* m_clipboard;
vector<Algorithm*> m_algorithms;
TFile* m_histogramFile;
TDirectory* m_directory;
std::map<std::string, void*> loaded_libraries_;
int m_events;
};
// Member variables
Parameters* m_parameters;
std::unique_ptr<corryvreckan::ConfigManager> conf_mgr_;
Clipboard* m_clipboard;
vector<Algorithm*> m_algorithms;
TFile* m_histogramFile;
TDirectory* m_directory;
std::map<std::string, void*> loaded_libraries_;
int m_events;
};
}
#endif // ANALYSIS_H
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment