Commit 25a3cbbc authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Rename GenericAlgorithm -> Dummy

parent 6050dab8
......@@ -3,7 +3,7 @@ CORRYVRECKAN_MODULE(MODULE_NAME)
# Add source files to library
CORRYVRECKAN_MODULE_SOURCES(${MODULE_NAME}
GenericAlgorithm.cpp
Dummy.cpp
# ADD SOURCE FILES HERE...
)
......
#include "GenericAlgorithm.h"
#include "Dummy.h"
using namespace corryvreckan;
using namespace std;
GenericAlgorithm::GenericAlgorithm(Configuration config, std::vector<Detector*> detectors)
: Module(std::move(config), std::move(detectors)) {}
Dummy::Dummy(Configuration config, std::vector<Detector*> detectors) : Module(std::move(config), std::move(detectors)) {}
void GenericAlgorithm::initialise() {
void Dummy::initialise() {
// Initialise histograms per device
for(auto& detector : get_detectors()) {
// Check if they are a Timepix3
if(detector->type() != "Timepix3")
continue;
// Simple histogram per device
string name = "plotForDevice_" + detector->name();
plotPerDevice[detector->name()] = new TH2F(name.c_str(), name.c_str(), 256, 0, 256, 256, 0, 256);
......@@ -28,15 +22,11 @@ void GenericAlgorithm::initialise() {
m_eventNumber = 0;
}
StatusCode GenericAlgorithm::run(Clipboard* clipboard) {
StatusCode Dummy::run(Clipboard* clipboard) {
// Loop over all Timepix3 and make plots
for(auto& detector : get_detectors()) {
// Check if they are a Timepix3
if(detector->type() != "Timepix3")
continue;
// Get the pixels
Pixels* pixels = (Pixels*)clipboard->get(detector->name(), "pixels");
if(pixels == NULL) {
......@@ -68,7 +58,7 @@ StatusCode GenericAlgorithm::run(Clipboard* clipboard) {
return Success;
}
void GenericAlgorithm::finalise() {
void Dummy::finalise() {
LOG(DEBUG) << "Analysed " << m_eventNumber << " events";
}
#ifndef GenericAlgorithm_H
#define GenericAlgorithm_H 1
#ifndef Dummy_H
#define Dummy_H 1
#include <iostream>
#include "TCanvas.h"
......@@ -13,12 +13,12 @@
namespace corryvreckan {
/** @ingroup Modules
*/
class GenericAlgorithm : public Module {
class Dummy : public Module {
public:
// Constructors and destructors
GenericAlgorithm(Configuration config, std::vector<Detector*> detectors);
~GenericAlgorithm() {}
Dummy(Configuration config, std::vector<Detector*> detectors);
~Dummy() {}
// Functions
void initialise();
......@@ -35,4 +35,4 @@ namespace corryvreckan {
int m_eventNumber;
};
} // namespace corryvreckan
#endif // GenericAlgorithm_H
#endif // Dummy_H
# GenericAlgorithm
# Dummy
**Maintainer**: Daniel Hynds (<daniel.hynds@cern.ch>)
**Status**: Functional
### Description
This module takes data from a Timepix3 device from the clipboard and plots the pixel hit positions. This is to be a template to easy create other modules for Corryvreckan.
This is a demonstrator module only, taking data every detector on the clipboard and plots the pixel hit positions.
It serves as template to create new modules.
### Parameters
No parameters are used from the configuration file.
......@@ -16,7 +17,7 @@ For each detector the following plots are produced:
### Usage
```toml
[GenericAlgorithm]
[Dummy]
```
Parameters to be used in multiple modules can also be defined globally at the top of the configuration file. This is highly encouraged for parameters such as `DUT` and `reference`.
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