Commit 34e62ba3 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Make StatusCode a class to require prefix

parent f8f3986e
Pipeline #583969 passed with stages
in 8 minutes and 7 seconds
......@@ -106,7 +106,7 @@ namespace corryvreckan {
*
* Does nothing if not overloaded.
*/
virtual StatusCode run(std::shared_ptr<Clipboard>) { return Success; }
virtual StatusCode run(std::shared_ptr<Clipboard>) { return StatusCode::Success; }
/**
* @brief Finalise the module after the event sequence
......
......@@ -596,7 +596,7 @@ void ModuleManager::run() {
auto end = std::chrono::steady_clock::now();
module_execution_time_[module.get()] += static_cast<std::chrono::duration<long double>>(end - start).count();
if(check == Failure) {
if(check == StatusCode::Failure) {
run = false;
}
}
......
......@@ -61,7 +61,7 @@ StatusCode AlignmentDUTResidual::run(std::shared_ptr<Clipboard> clipboard) {
// Get the tracks
Tracks* tracks = reinterpret_cast<Tracks*>(clipboard->get("tracks"));
if(tracks == nullptr) {
return Success;
return StatusCode::Success;
}
// Make a local copy and store it
......@@ -127,11 +127,11 @@ StatusCode AlignmentDUTResidual::run(std::shared_ptr<Clipboard> clipboard) {
if(m_discardedtracks > 0) {
LOG(STATUS) << "Discarded " << m_discardedtracks << " input tracks.";
}
return Failure;
return StatusCode::Failure;
}
// Otherwise keep going
return Success;
return StatusCode::Success;
}
// METHOD 1
......
......@@ -71,7 +71,7 @@ StatusCode AlignmentMillepede::run(std::shared_ptr<Clipboard> clipboard) {
// Get the tracks
Tracks* tracks = reinterpret_cast<Tracks*>(clipboard->get("tracks"));
if(tracks == nullptr) {
return Success;
return StatusCode::Success;
}
// Make a local copy and store it
......@@ -83,11 +83,11 @@ StatusCode AlignmentMillepede::run(std::shared_ptr<Clipboard> clipboard) {
// If we have enough tracks for the alignment, tell the event loop to finish
if(m_alignmenttracks.size() >= m_numberOfTracksForAlignment) {
LOG(STATUS) << "Accumulated " << m_alignmenttracks.size() << " tracks, interrupting processing.";
return Failure;
return StatusCode::Failure;
}
// Otherwise keep going
return Success;
return StatusCode::Success;
}
//=============================================================================
......
......@@ -36,7 +36,7 @@ StatusCode AlignmentTrackChi2::run(std::shared_ptr<Clipboard> clipboard) {
// Get the tracks
Tracks* tracks = reinterpret_cast<Tracks*>(clipboard->get("tracks"));
if(tracks == nullptr) {
return Success;
return StatusCode::Success;
}
// Make a local copy and store it
......@@ -69,11 +69,11 @@ StatusCode AlignmentTrackChi2::run(std::shared_ptr<Clipboard> clipboard) {
if(m_discardedtracks > 0) {
LOG(INFO) << "Discarded " << m_discardedtracks << " input tracks.";
}
return Failure;
return StatusCode::Failure;
}
// Otherwise keep going
return Success;
return StatusCode::Success;
}
// ========================================
......
......@@ -222,14 +222,14 @@ StatusCode AnalysisCLICpix::run(std::shared_ptr<Clipboard> clipboard) {
Clusters* clusters = reinterpret_cast<Clusters*>(clipboard->get(m_detector->name(), "clusters"));
if(clusters == nullptr) {
LOG(DEBUG) << "No clusters for " << m_detector->name() << " on the clipboard";
return Success;
return StatusCode::Success;
}
// If this is the first or last trigger don't use the data
if((m_triggerNumber == 0 || m_triggerNumber == 19) && !timepix3Telescope) {
m_eventNumber++;
m_triggerNumber++;
return Success;
return StatusCode::Success;
}
// Fill the histograms that only need clusters/pixels
......@@ -239,7 +239,7 @@ StatusCode AnalysisCLICpix::run(std::shared_ptr<Clipboard> clipboard) {
Tracks* tracks = reinterpret_cast<Tracks*>(clipboard->get("tracks"));
if(tracks == nullptr) {
LOG(DEBUG) << "No tracks on the clipboard";
return Success;
return StatusCode::Success;
}
// Set counters
......@@ -443,7 +443,7 @@ StatusCode AnalysisCLICpix::run(std::shared_ptr<Clipboard> clipboard) {
m_triggerNumber++;
// Return value telling analysis to keep running
return Success;
return StatusCode::Success;
}
void AnalysisCLICpix::finalise() {
......
......@@ -190,7 +190,7 @@ StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
Tracks* tracks = reinterpret_cast<Tracks*>(clipboard->get("tracks"));
if(tracks == nullptr) {
LOG(DEBUG) << "No tracks on the clipboard";
return Success;
return StatusCode::Success;
}
// Loop over all tracks
......@@ -366,5 +366,5 @@ StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
}
// Return value telling analysis to keep running
return Success;
return StatusCode::Success;
}
......@@ -70,7 +70,7 @@ StatusCode AnalysisEfficiency::run(std::shared_ptr<Clipboard> clipboard) {
Tracks* tracks = reinterpret_cast<Tracks*>(clipboard->get("tracks"));
if(tracks == nullptr) {
LOG(DEBUG) << "No tracks on the clipboard";
return Success;
return StatusCode::Success;
}
// Loop over all tracks
......@@ -158,7 +158,7 @@ StatusCode AnalysisEfficiency::run(std::shared_ptr<Clipboard> clipboard) {
}
}
return Success;
return StatusCode::Success;
}
void AnalysisEfficiency::finalise() {
......
......@@ -138,7 +138,7 @@ StatusCode AnalysisPowerPulsing::run(std::shared_ptr<Clipboard> clipboard) {
auto clusters = reinterpret_cast<Clusters*>(clipboard->get(m_detector->name(), "clusters"));
if(clusters == nullptr) {
LOG(DEBUG) << "No DUT clusters on the clipboard!";
return Success;
return StatusCode::Success;
}
double minTimePerEvent = 99999.;
......@@ -179,5 +179,5 @@ StatusCode AnalysisPowerPulsing::run(std::shared_ptr<Clipboard> clipboard) {
}
// Return value telling analysis to keep running
return Success;
return StatusCode::Success;
}
......@@ -77,7 +77,7 @@ StatusCode AnalysisTelescope::run(std::shared_ptr<Clipboard> clipboard) {
Tracks* tracks = reinterpret_cast<Tracks*>(clipboard->get("tracks"));
if(tracks == nullptr) {
LOG(DEBUG) << "No tracks on the clipboard";
return Success;
return StatusCode::Success;
}
for(auto& track : (*tracks)) {
......@@ -137,5 +137,5 @@ StatusCode AnalysisTelescope::run(std::shared_ptr<Clipboard> clipboard) {
}
// Return value telling analysis to keep running
return Success;
return StatusCode::Success;
}
......@@ -35,14 +35,14 @@ StatusCode Clustering4D::run(std::shared_ptr<Clipboard> clipboard) {
// Check if they are a Timepix3
if(m_detector->type() != "Timepix3") {
return Success;
return StatusCode::Success;
}
// Get the pixels
Pixels* pixels = reinterpret_cast<Pixels*>(clipboard->get(m_detector->name(), "pixels"));
if(pixels == nullptr) {
LOG(DEBUG) << "Detector " << m_detector->name() << " does not have any pixels on the clipboard";
return Success;
return StatusCode::Success;
}
LOG(DEBUG) << "Picked up " << pixels->size() << " pixels for device " << m_detector->name();
......@@ -128,7 +128,7 @@ StatusCode Clustering4D::run(std::shared_ptr<Clipboard> clipboard) {
}
LOG(DEBUG) << "Made " << deviceClusters->size() << " clusters for device " << m_detector->name();
return Success;
return StatusCode::Success;
}
// Check if a pixel touches any of the pixels in a cluster
......
......@@ -45,7 +45,7 @@ StatusCode ClusteringSpatial::run(std::shared_ptr<Clipboard> clipboard) {
Pixels* pixels = reinterpret_cast<Pixels*>(clipboard->get(m_detector->name(), "pixels"));
if(pixels == nullptr) {
LOG(DEBUG) << "Detector " << m_detector->name() << " does not have any pixels on the clipboard";
return Success;
return StatusCode::Success;
}
// Make the cluster container and the maps for clustering
......@@ -131,7 +131,7 @@ StatusCode ClusteringSpatial::run(std::shared_ptr<Clipboard> clipboard) {
<< ". From " << pixels->size() << " pixels";
// Return value telling analysis to keep running
return Success;
return StatusCode::Success;
}
/*
......
......@@ -16,14 +16,14 @@ StatusCode DUTAssociation::run(std::shared_ptr<Clipboard> clipboard) {
Tracks* tracks = reinterpret_cast<Tracks*>(clipboard->get("tracks"));
if(tracks == nullptr) {
LOG(DEBUG) << "No tracks on the clipboard";
return Success;
return StatusCode::Success;
}
// Get the DUT clusters from the clipboard
Clusters* clusters = reinterpret_cast<Clusters*>(clipboard->get(m_detector->name(), "clusters"));
if(clusters == nullptr) {
LOG(DEBUG) << "No DUT clusters on the clipboard";
return Success;
return StatusCode::Success;
}
// Loop over all tracks
......@@ -50,5 +50,5 @@ StatusCode DUTAssociation::run(std::shared_ptr<Clipboard> clipboard) {
}
// Return value telling analysis to keep running
return Success;
return StatusCode::Success;
}
......@@ -37,7 +37,7 @@ StatusCode Dummy::run(std::shared_ptr<Clipboard>) {
m_eventNumber++;
// Return value telling analysis to keep running
return Success;
return StatusCode::Success;
}
void Dummy::finalise() {
......
......@@ -72,7 +72,7 @@ StatusCode EtaCalculation::run(std::shared_ptr<Clipboard> clipboard) {
Tracks* tracks = reinterpret_cast<Tracks*>(clipboard->get("tracks"));
if(tracks == nullptr) {
LOG(DEBUG) << "No tracks on the clipboard";
return Success;
return StatusCode::Success;
}
// Loop over all tracks and look at the associated clusters to plot the eta distribution
......@@ -100,7 +100,7 @@ StatusCode EtaCalculation::run(std::shared_ptr<Clipboard> clipboard) {
}
// Return value telling analysis to keep running
return Success;
return StatusCode::Success;
}
std::string EtaCalculation::fit(TF1* function, std::string fname, TProfile* profile) {
......
......@@ -84,7 +84,7 @@ StatusCode EtaCorrection::run(std::shared_ptr<Clipboard> clipboard) {
Clusters* clusters = reinterpret_cast<Clusters*>(clipboard->get(m_detector->name(), "clusters"));
if(clusters == nullptr) {
LOG(DEBUG) << "Detector " << m_detector->name() << " does not have any clusters on the clipboard";
return Success;
return StatusCode::Success;
}
for(auto& cluster : (*clusters)) {
......@@ -92,5 +92,5 @@ StatusCode EtaCorrection::run(std::shared_ptr<Clipboard> clipboard) {
}
// Return value telling analysis to keep running
return Success;
return StatusCode::Success;
}
......@@ -166,7 +166,7 @@ StatusCode EventLoaderATLASpix::run(std::shared_ptr<Clipboard> clipboard) {
// If have reached the end of file, close it and exit program running
if(m_file.eof()) {
m_file.close();
return Failure;
return StatusCode::Failure;
}
double start_time = clipboard->get_persistent("eventStart");
......@@ -193,11 +193,11 @@ StatusCode EventLoaderATLASpix::run(std::shared_ptr<Clipboard> clipboard) {
if(!pixels->empty()) {
clipboard->put(m_detector->name(), "pixels", reinterpret_cast<Objects*>(pixels));
} else {
return NoData;
return StatusCode::NoData;
}
// Return value telling analysis to keep running
return Success;
return StatusCode::Success;
}
Pixels* EventLoaderATLASpix::read_caribou_data(double start_time, double end_time) {
......
......@@ -51,7 +51,7 @@ StatusCode EventLoaderCLICpix::run(std::shared_ptr<Clipboard> clipboard) {
// If have reached the end of file, close it and exit program running
if(m_file.eof()) {
m_file.close();
return Failure;
return StatusCode::Failure;
}
// Otherwise load a new frame
......@@ -129,7 +129,7 @@ StatusCode EventLoaderCLICpix::run(std::shared_ptr<Clipboard> clipboard) {
hShutterLength->Fill(shutterStopTime - shutterStartTime);
// Return value telling analysis to keep running
return Success;
return StatusCode::Success;
}
void EventLoaderCLICpix::finalise() {
......
......@@ -182,7 +182,7 @@ StatusCode EventLoaderCLICpix2::run(std::shared_ptr<Clipboard> clipboard) {
// If have reached the end of file, close it and exit program running
if(m_file.eof()) {
m_file.close();
return Failure;
return StatusCode::Failure;
}
// Pixel container, shutter information
......@@ -310,13 +310,14 @@ StatusCode EventLoaderCLICpix2::run(std::shared_ptr<Clipboard> clipboard) {
clipboard->put(m_detector->name(), "pixels", reinterpret_cast<Objects*>(pixels));
} else {
delete pixels;
return StatusCode::NoData;
}
// Fill histograms
hPixelsPerFrame->Fill(npixels);
// Return value telling analysis to keep running
return Success;
return StatusCode::Success;
}
void EventLoaderCLICpix2::finalise() {
......
......@@ -89,11 +89,11 @@ StatusCode EventLoaderEUDAQ::run(std::shared_ptr<Clipboard> clipboard) {
// Advance to next event if possible, otherwise end this run:
if(!reader->NextEvent()) {
LOG(INFO) << "No more events in data stream.";
return Failure;
return StatusCode::Failure;
};
// Return value telling analysis to keep running
return Success;
return StatusCode::Success;
}
void EventLoaderEUDAQ::finalise() {
......
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