Commit 79f9d4cb authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Remove obsolete parameters from Parameters, add namespace std

parent 20410101
......@@ -47,7 +47,7 @@ namespace corryvreckan {
virtual void finalise() {}
// Methods to get member variables
string getName() { return m_name; }
std::string getName() { return m_name; }
Configuration getConfig() { return m_config; }
TStopwatch* getStopwatch() { return m_stopwatch; }
......@@ -55,7 +55,7 @@ namespace corryvreckan {
// Member variables
Parameters* parameters;
TStopwatch* m_stopwatch;
string m_name;
std::string m_name;
Configuration m_config;
Clipboard* m_clipboard;
};
......
......@@ -306,8 +306,8 @@ void Analysis::run() {
}
// If running the gui, don't close until the user types a command
if(m_parameters->gui)
cin.ignore();
if(m_config.get<bool>("gui", false))
std::cin.ignore();
}
void Analysis::terminate() {
......
......@@ -52,7 +52,7 @@ namespace corryvreckan {
Parameters* m_parameters;
Clipboard* m_clipboard;
Configuration m_config;
vector<Algorithm*> m_algorithms;
std::vector<Algorithm*> m_algorithms;
TFile* m_histogramFile;
TDirectory* m_directory;
std::map<std::string, void*> loaded_libraries_;
......
......@@ -25,22 +25,22 @@ public:
virtual ~Clipboard() {}
// Add objects to clipboard - with name or name + type
void put(string name, TestBeamObjects* objects) {
void put(std::string name, TestBeamObjects* objects) {
m_dataID.push_back(name);
m_data[name] = objects;
}
void put(string name, string type, TestBeamObjects* objects) {
void put(std::string name, std::string type, TestBeamObjects* objects) {
m_dataID.push_back(name + type);
m_data[name + type] = objects;
}
// Get objects from clipboard - with name or name + type
TestBeamObjects* get(string name) {
TestBeamObjects* get(std::string name) {
if(m_data.count(name) == 0)
return NULL;
return m_data[name];
}
TestBeamObjects* get(string name, string type) {
TestBeamObjects* get(std::string name, std::string type) {
if(m_data.count(name + type) == 0)
return NULL;
return m_data[name + type];
......@@ -68,8 +68,8 @@ public:
private:
// Container for data, list of all data held
map<string, TestBeamObjects*> m_data;
vector<string> m_dataID;
std::map<std::string, TestBeamObjects*> m_data;
std::vector<std::string> m_dataID;
};
#endif // CLIPBOARD_H
......@@ -7,6 +7,7 @@
#include "utils/log.h"
using namespace corryvreckan;
using namespace std;
Parameters::Parameters() {
......@@ -14,7 +15,6 @@ Parameters::Parameters() {
conditionsFile = "cond.dat";
dutMaskFile = "defaultMask.dat";
inputDirectory = "";
align = false;
produceMask = false;
currentTime = 0.; // seconds
eventLength = 0.000; // seconds (0.1 ms)
......@@ -34,19 +34,10 @@ void Parameters::readCommandLineOptions(int argc, char* argv[]) {
char temp[256];
while((option = getopt(argc, argv, "gema:d:c:n:h:t:o:f:t:p:s:")) != -1) {
switch(option) {
case 'a':
align = true;
sscanf(optarg, "%d", &alignmentMethod);
LOG(INFO) << "Alignment flagged to be run. Running method " << alignmentMethod;
break;
case 'e':
eventDisplay = true;
LOG(INFO) << "Event display flagged to be run";
break;
case 'g':
gui = true;
LOG(INFO) << "GUI flagged to be run";
break;
case 'm':
produceMask = true;
LOG(INFO) << "Will update masked pixel files";
......
......@@ -46,36 +46,34 @@ namespace corryvreckan {
void readDutMask();
void maskDutColumn(int);
void maskDutRow(int);
void registerDetector(string detectorID) {
void registerDetector(std::string detectorID) {
nDetectors++;
detectors.push_back(detectorID);
}
// Member variables
string conditionsFile;
string inputTupleFile;
string inputDirectory;
string outputTupleFile;
string histogramFile;
string dutMaskFile;
vector<string> detectors;
std::string conditionsFile;
std::string inputTupleFile;
std::string inputDirectory;
std::string outputTupleFile;
std::string histogramFile;
std::string dutMaskFile;
std::vector<std::string> detectors;
int nDetectors;
string reference;
string dut;
std::string reference;
std::string dut;
double currentTime;
double eventLength;
bool align;
bool eventDisplay;
bool gui;
bool produceMask;
string DUT;
map<string, bool> excludedFromTracking;
map<string, bool> masked;
string detectorToAlign;
std::string DUT;
std::map<std::string, bool> excludedFromTracking;
std::map<std::string, bool> masked;
std::string detectorToAlign;
int alignmentMethod;
// Parameters for each detector (stored by detector ID)
map<string, DetectorParameters*> detector;
std::map<std::string, DetectorParameters*> detector;
};
}
#endif // PARAMETERS_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