Commit 580aacb8 authored by Jens Kroeger's avatar Jens Kroeger
Browse files

Merge branch 'EventLoaderEUDAQ-hitmaps' into 'master'

EventLoaderEUDAQ: added hitmaps

See merge request !421
parents 3d980a26 5dde632c
Pipeline #2589432 passed with stages
in 29 minutes and 38 seconds
......@@ -33,8 +33,35 @@ void EventLoaderEUDAQ::initialize() {
} catch(...) {
throw ModuleError("Unable to read input file \"" + m_filename + "\"");
}
}
// Loop over all planes
for(auto& detector : get_detectors()) {
auto detectorID = detector->getName();
// Do not created plots for auxiliary detectors:
if(detector->isAuxiliary()) {
continue;
}
TDirectory* directory = getROOTDirectory();
TDirectory* local_directory = directory->mkdir(detectorID.c_str());
if(local_directory == nullptr) {
throw RuntimeError("Cannot create or access local ROOT directory for module " + this->getUniqueName());
}
local_directory->cd();
// Create a hitmap for each detector
std::string title = detectorID + ": hitmap;x [px];y [px];events";
hitmap[detectorID] = new TH2F("hitmap",
title.c_str(),
detector->nPixels().X(),
-0.5,
detector->nPixels().X() - 0.5,
detector->nPixels().Y(),
-0.5,
detector->nPixels().Y() - 0.5);
}
}
StatusCode EventLoaderEUDAQ::run(const std::shared_ptr<Clipboard>& clipboard) {
// Read next event from EUDAQ reader:
......@@ -100,6 +127,9 @@ StatusCode EventLoaderEUDAQ::run(const std::shared_ptr<Clipboard>& clipboard) {
// Pixel gets timestamp of trigger assigned:
pixel->timestamp(timestamp);
deviceData.push_back(pixel);
// Fill the hitmap
hitmap[detectorID]->Fill(pixel->column(), pixel->row());
}
// Store on clipboard
......
......@@ -11,6 +11,9 @@
#ifndef EventLoaderEUDAQ_H
#define EventLoaderEUDAQ_H 1
#include <TCanvas.h>
#include <TH1F.h>
#include <TH2F.h>
#include <iostream>
#include "core/module/Module.hpp"
#include "eudaq/FileReader.hh"
......@@ -38,6 +41,8 @@ namespace corryvreckan {
// Member variables
std::string m_filename{};
bool m_longID;
std::map<std::string, TH2F*> hitmap;
};
} // namespace corryvreckan
#endif // EventLoaderEUDAQ_H
......@@ -25,3 +25,8 @@ for CMake to find the library link against and headers to include.
file_name = "rawdata/eudaq/run020808.raw"
long_detector_id = true
```
### Plots produced
For each detector the following plots are produced:
* 2D hitmaps on pixel-level
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