Commit 3c3caa6f authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Share Clipboard as std::shared_ptr

parent 35c01965
......@@ -110,7 +110,7 @@ namespace corryvreckan {
*
* Does nothing if not overloaded.
*/
virtual StatusCode run(Clipboard*) { return Success; }
virtual StatusCode run(std::shared_ptr<Clipboard>) { return Success; }
/**
* @brief Finalise the module after the event sequence
......
......@@ -96,7 +96,7 @@ ModuleManager::ModuleManager(std::string config_file_name, std::vector<std::stri
LOG(TRACE) << "Global log format is set to " << log_format_string;
// New clipboard for storage:
m_clipboard = new Clipboard();
m_clipboard = std::make_shared<Clipboard>();
}
void ModuleManager::load() {
......
......@@ -55,7 +55,7 @@ namespace corryvreckan {
protected:
// Member variables
Clipboard* m_clipboard;
std::shared_ptr<Clipboard> m_clipboard;
Configuration global_config;
std::vector<std::shared_ptr<Detector>> m_detectors;
......
......@@ -56,7 +56,7 @@ void AlignmentDUTResidual::initialise() {
profile_dX_Y = new TProfile("profile_dX_Y", title.c_str(), 1000, -500, 500);
}
StatusCode AlignmentDUTResidual::run(Clipboard* clipboard) {
StatusCode AlignmentDUTResidual::run(std::shared_ptr<Clipboard> clipboard) {
// Get the tracks
Tracks* tracks = reinterpret_cast<Tracks*>(clipboard->get("tracks"));
......
......@@ -44,7 +44,7 @@ namespace corryvreckan {
/**
* @brief [Run the function of this module]
*/
StatusCode run(Clipboard* clipboard);
StatusCode run(std::shared_ptr<Clipboard> clipboard);
/**
* @brief [Finalise module]
......
......@@ -66,7 +66,7 @@ void AlignmentMillepede::initialise() {
}
// During run, just pick up tracks and save them till the end
StatusCode AlignmentMillepede::run(Clipboard* clipboard) {
StatusCode AlignmentMillepede::run(std::shared_ptr<Clipboard> clipboard) {
// Get the tracks
Tracks* tracks = reinterpret_cast<Tracks*>(clipboard->get("tracks"));
......
......@@ -22,7 +22,7 @@ namespace corryvreckan {
void initialise();
void finalise();
StatusCode run(Clipboard*);
StatusCode run(std::shared_ptr<Clipboard>);
virtual void updateGeometry();
......
......@@ -31,7 +31,7 @@ AlignmentTrackChi2::AlignmentTrackChi2(Configuration config, std::vector<std::sh
}
// During run, just pick up tracks and save them till the end
StatusCode AlignmentTrackChi2::run(Clipboard* clipboard) {
StatusCode AlignmentTrackChi2::run(std::shared_ptr<Clipboard> clipboard) {
// Get the tracks
Tracks* tracks = reinterpret_cast<Tracks*>(clipboard->get("tracks"));
......
......@@ -25,7 +25,7 @@ namespace corryvreckan {
~AlignmentTrackChi2() {}
// Functions
StatusCode run(Clipboard* clipboard);
StatusCode run(std::shared_ptr<Clipboard> clipboard);
void finalise();
private:
......
......@@ -216,7 +216,7 @@ void AnalysisCLICpix::initialise() {
}
}
StatusCode AnalysisCLICpix::run(Clipboard* clipboard) {
StatusCode AnalysisCLICpix::run(std::shared_ptr<Clipboard> clipboard) {
// Get the clicpix clusters in this event
Clusters* clusters = reinterpret_cast<Clusters*>(clipboard->get(m_detector->name(), "clusters"));
......
......@@ -20,7 +20,7 @@ namespace corryvreckan {
// Functions
void initialise();
StatusCode run(Clipboard* clipboard);
StatusCode run(std::shared_ptr<Clipboard> clipboard);
void finalise();
private:
......
......@@ -184,7 +184,7 @@ void AnalysisDUT::initialise() {
new TH2F("hUnassociatedTracksGlobalPosition", "hUnassociatedTracksGlobalPosition", 200, -10, 10, 200, -10, 10);
}
StatusCode AnalysisDUT::run(Clipboard* clipboard) {
StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
// Get the telescope tracks from the clipboard
Tracks* tracks = reinterpret_cast<Tracks*>(clipboard->get("tracks"));
......
......@@ -20,7 +20,7 @@ namespace corryvreckan {
// Functions
void initialise();
StatusCode run(Clipboard* clipboard);
StatusCode run(std::shared_ptr<Clipboard> clipboard);
private:
std::shared_ptr<Detector> m_detector;
......
......@@ -61,7 +61,7 @@ void AnalysisEfficiency::initialise() {
1);
}
StatusCode AnalysisEfficiency::run(Clipboard* clipboard) {
StatusCode AnalysisEfficiency::run(std::shared_ptr<Clipboard> clipboard) {
// Get the telescope tracks from the clipboard
Tracks* tracks = reinterpret_cast<Tracks*>(clipboard->get("tracks"));
......
......@@ -33,7 +33,7 @@ namespace corryvreckan {
*/
AnalysisEfficiency(Configuration config, std::shared_ptr<Detector> detector);
void initialise();
StatusCode run(Clipboard* clipboard);
StatusCode run(std::shared_ptr<Clipboard> clipboard);
void finalise();
private:
......
......@@ -42,7 +42,7 @@ void AnalysisPowerPulsing::initialise() {
v_minTime.clear();
}
StatusCode AnalysisPowerPulsing::run(Clipboard* clipboard) {
StatusCode AnalysisPowerPulsing::run(std::shared_ptr<Clipboard> clipboard) {
LOG(TRACE) << "Power on time: " << static_cast<double>(m_powerOnTime) / (4096. * 40000000.);
LOG(TRACE) << "Power off time: " << static_cast<double>(m_powerOffTime) / (4096. * 40000000.);
......
......@@ -37,7 +37,7 @@ namespace corryvreckan {
// Functions
void initialise();
StatusCode run(Clipboard* clipboard);
StatusCode run(std::shared_ptr<Clipboard> clipboard);
private:
std::shared_ptr<Detector> m_detector;
......
......@@ -71,7 +71,7 @@ ROOT::Math::XYZPoint AnalysisTelescope::closestApproach(ROOT::Math::XYZPoint pos
return particlePosition;
}
StatusCode AnalysisTelescope::run(Clipboard* clipboard) {
StatusCode AnalysisTelescope::run(std::shared_ptr<Clipboard> clipboard) {
// Get the tracks from the clipboard
Tracks* tracks = reinterpret_cast<Tracks*>(clipboard->get("tracks"));
......
......@@ -18,7 +18,7 @@ namespace corryvreckan {
// Functions
void initialise();
StatusCode run(Clipboard* clipboard);
StatusCode run(std::shared_ptr<Clipboard> clipboard);
private:
ROOT::Math::XYZPoint closestApproach(ROOT::Math::XYZPoint position, MCParticles* particles);
......
......@@ -31,7 +31,7 @@ bool Clustering4D::sortByTime(Pixel* pixel1, Pixel* pixel2) {
return (pixel1->timestamp() < pixel2->timestamp());
}
StatusCode Clustering4D::run(Clipboard* clipboard) {
StatusCode Clustering4D::run(std::shared_ptr<Clipboard> clipboard) {
// Check if they are a Timepix3
if(m_detector->type() != "Timepix3") {
......
Markdown is supported
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