Commit 2118e2fe authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Remove cout from objects

parent 79f9d4cb
......@@ -3,6 +3,7 @@
// Local includes
#include "TestBeamObject.h"
#include "core/utils/log.h"
// Global includes
#include <iostream>
......@@ -35,17 +36,17 @@ public:
// Graphics associated with GUI
TGMainFrame* m_mainFrame;
TRootEmbeddedCanvas* canvas;
map<string, vector<TH1*>> histograms;
map<TH1*, string> styles;
map<string, TGTextButton*> buttons;
map<TRootEmbeddedCanvas*, bool> stackedCanvas;
std::map<std::string, std::vector<TH1*>> histograms;
std::map<TH1*, std::string> styles;
std::map<std::string, TGTextButton*> buttons;
std::map<TRootEmbeddedCanvas*, bool> stackedCanvas;
TGHorizontalFrame* buttonMenu;
// Button functions
inline void Display(char* canvasNameC) {
string canvasName(canvasNameC);
std::string canvasName(canvasNameC);
if(histograms[canvasName].size() == 0) {
cout << "Canvas does not have any histograms, exiting" << endl;
LOG(ERROR) << "Canvas does not have any histograms, exiting";
return;
}
int nHistograms = histograms[canvasName].size();
......@@ -60,7 +61,7 @@ public:
for(int i = 0; i < nHistograms; i++) {
if(!stackedCanvas[canvas])
canvas->GetCanvas()->cd(i + 1);
string style = styles[histograms[canvasName][i]];
std::string style = styles[histograms[canvasName][i]];
if(stackedCanvas[canvas]) {
style = "same";
histograms[canvasName][i]->SetLineColor(i + 1);
......
......@@ -5,7 +5,7 @@
#include "Cluster.h"
#include "TKDTree.h"
#include "TestBeamObject.h"
#include "core/utils/log.h"
/*
This class is effectively just a wrapper for the root TKDTree class that
......@@ -79,9 +79,7 @@ public:
// Function to get back all clusters within a given time period
Clusters getAllClustersInTimeWindow(Cluster* cluster, double timeWindow) {
// std::cout<<"Getting all clusters in time window"<<std::endl;
// std::cout<<" -- time window: "<<timeWindow<<std::endl;
LOG(TRACE) << "Getting all clusters in time window" << timeWindow;
// Find out which iterator number this cluster corresponds to
// int iterator = iteratorNumber[cluster];
......@@ -93,7 +91,7 @@ public:
double time = double(cluster->timestamp()) / (4096. * 40000000.);
timeKdtree->FindInRange(&time, timeWindow, results);
// std::cout<<" -- found: "<<results.size()<<std::endl;
LOG(TRACE) <<" -- found: "<<results.size();
// Turn this into a vector of clusters
Clusters resultClusters;
......
......@@ -5,7 +5,7 @@
#include "TKDTree.h"
#include "TestBeamObject.h"
#include "Timepix3Cluster.h"
#include "core/utils/log.h"
// This class is effectively just a wrapper for the root TKDTree class that
// handles Timepix3 clusters and converts them into the format needed by
// ROOT.
......@@ -55,9 +55,7 @@ public:
// Function to get back all clusters within a given time period
Timepix3Clusters getAllClustersInTimeWindow(Timepix3Cluster* cluster, double timeWindow) {
// std::cout<<"Getting all clusters in time window"<<std::endl;
// std::cout<<" -- time window: "<<timeWindow<<std::endl;
LOG(TRACE) <<"Getting all clusters in time window" << timeWindow;
// Find out which iterator number this cluster corresponds to
// int iterator = iteratorNumber[cluster];
......@@ -67,7 +65,7 @@ public:
time[0] = double(cluster->timestamp()) / (4096. * 40000000.);
timeKdtree->FindInRange(time, timeWindow, results);
// std::cout<<" -- found: "<<results.size()<<std::endl;
LOG(TRACE) << " -- found: "<<results.size();
// Turn this into a vector of clusters
Timepix3Clusters resultClusters;
......
......@@ -6,7 +6,7 @@ class SpidrSignal : public TestBeamObject {
public:
// Constructors and destructors
SpidrSignal() {}
SpidrSignal(string type, long long int timestamp) {
SpidrSignal(std::string type, long long int timestamp) {
m_type = type;
m_timestamp = timestamp;
}
......@@ -16,11 +16,11 @@ public:
// Set properties
void timestamp(long long int timestamp) { m_timestamp = timestamp; }
void type(string type) { m_type = type; }
void type(std::string type) { m_type = type; }
// Retrieve properties
long long int timestamp() { return m_timestamp; }
string type() { return m_type; }
std::string type() { return m_type; }
// Member variables
long long int m_timestamp;
......
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