Commit 61907fe6 authored by Tomas Vanat's avatar Tomas Vanat
Browse files
parents 28e9e1b7 2ebd9c04
......@@ -26,8 +26,8 @@ void ClusteringSpatial::initialise() {
clusterWidthRow = new TH1F("clusterWidthRow", title.c_str(), 25, 0, 25);
title = m_detector->name() + " Cluster Width - Columns;cluster width [columns];events";
clusterWidthColumn = new TH1F("clusterWidthColumn", title.c_str(), 100, 0, 100);
title = m_detector->name() + " Cluster Charge;cluster charge [e];events";
clusterTot = new TH1F("clusterTot", title.c_str(), 10000, 0, 100000);
title = m_detector->name() + " Cluster Charge;cluster charge [ke];events";
clusterTot = new TH1F("clusterTot", title.c_str(), 300, 0, 300);
title = m_detector->name() + " Cluster Position (Global);x [mm];y [mm];events";
clusterPositionGlobal = new TH2F("clusterPositionGlobal",
title.c_str(),
......@@ -58,10 +58,12 @@ StatusCode ClusteringSpatial::run(std::shared_ptr<Clipboard> clipboard) {
int nRows = m_detector->nPixelsY();
int nCols = m_detector->nPixelsX();
// Fill the hitmap with pixels
for(auto& pixel : (*pixels)) {
// Pre-fill the hitmap with pixels
for(auto pixel : (*pixels)) {
hitmap[pixel->row()][pixel->column()] = pixel;
}
for(auto pixel : (*pixels)) {
if(used[pixel]) {
continue;
}
......@@ -75,8 +77,7 @@ StatusCode ClusteringSpatial::run(std::shared_ptr<Clipboard> clipboard) {
// Somewhere to store found neighbours
Pixels neighbours;
// Now we check the neighbours and keep adding more hits while there are
// connected pixels
// Now we check the neighbours and keep adding more hits while there are connected pixels
while(addedPixel) {
addedPixel = false;
......@@ -89,8 +90,7 @@ StatusCode ClusteringSpatial::run(std::shared_ptr<Clipboard> clipboard) {
if(col < 0 || col >= nCols)
continue;
// If no pixel in this position, or is already in a cluster, do
// nothing
// If no pixel in this position, or is already in a cluster, do nothing
if(!hitmap[row][col])
continue;
if(used[hitmap[row][col]])
......@@ -120,7 +120,7 @@ StatusCode ClusteringSpatial::run(std::shared_ptr<Clipboard> clipboard) {
clusterSize->Fill(static_cast<double>(cluster->size()));
clusterWidthRow->Fill(cluster->rowWidth());
clusterWidthColumn->Fill(cluster->columnWidth());
clusterTot->Fill(cluster->tot());
clusterTot->Fill(cluster->tot() * 1e-3);
clusterPositionGlobal->Fill(cluster->global().x(), cluster->global().y());
deviceClusters->push_back(cluster);
......
......@@ -112,26 +112,29 @@ void EventLoaderCLICpix2::initialise() {
}
// Make histograms for debugging
std::string title = m_detector->name() + " Hit map;x [px];y [px];pixels";
hHitMap = new TH2F("hitMap",
"hitMap",
title.c_str(),
m_detector->nPixelsX(),
0,
m_detector->nPixelsX(),
m_detector->nPixelsY(),
0,
m_detector->nPixelsY());
title = m_detector->name() + " Map of discarded hits;x [px];y [px];pixels";
hHitMapDiscarded = new TH2F("hitMapDiscarded",
"hitMapDiscarded",
title.c_str(),
m_detector->nPixelsX(),
0,
m_detector->nPixelsX(),
m_detector->nPixelsY(),
0,
m_detector->nPixelsY());
hPixelToT = new TH1F("pixelToT", "pixelToT", 32, 0, 31);
title = m_detector->name() + " TOT spectrum;TOT;pixels";
hPixelToT = new TH1F("pixelToT", title.c_str(), 32, 0, 31);
title = m_detector->name() + " TOT map;x [px];y [px];TOT";
hPixelToTMap = new TProfile2D("pixelToTMap",
"pixelToTMap",
title.c_str(),
m_detector->nPixelsX(),
0,
m_detector->nPixelsX(),
......@@ -140,12 +143,19 @@ void EventLoaderCLICpix2::initialise() {
m_detector->nPixelsY(),
0,
maxcounter - 1);
hPixelToA = new TH1F("pixelToA", "pixelToA", maxcounter, 0, maxcounter - 1);
hPixelCnt = new TH1F("pixelCnt", "pixelCnt", maxcounter, 0, maxcounter - 1);
hPixelsPerFrame = new TH1F("pixelsPerFrame", "pixelsPerFrame", 1000, 0, 1000);
title = m_detector->name() + " TOA spectrum;TOA;pixels";
hPixelToA = new TH1F("pixelToA", title.c_str(), maxcounter, 0, maxcounter - 1);
title = m_detector->name() + " CNT spectrum;CNT;pixels";
hPixelCnt = new TH1F("pixelCnt", title.c_str(), maxcounter, 0, maxcounter - 1);
title = m_detector->name() + " Pixel multiplicity;pixels;frames";
hPixelsPerFrame = new TH1F("pixelsPerFrame", title.c_str(), 1000, 0, 1000);
title = m_detector->name() + " Timewalk;TOA;TOT;pixels";
hTimeWalk = new TH2F("timewalk", title.c_str(), maxcounter, 0, maxcounter - 1, 32, 0, 31);
title = m_detector->name() + " Map of masked pixels;x [px];y [px];mask code";
hMaskMap = new TH2F("maskMap",
"maskMap",
title.c_str(),
m_detector->nPixelsX(),
0,
m_detector->nPixelsX(),
......@@ -156,7 +166,8 @@ void EventLoaderCLICpix2::initialise() {
for(int row = 0; row < m_detector->nPixelsY(); row++) {
if(m_detector->masked(column, row)) {
hMaskMap->Fill(column, row, 2);
} else if(matrix_config[std::make_pair(row, column)].GetMask()) {
}
if(matrix_config[std::make_pair(row, column)].GetMask()) {
hMaskMap->Fill(column, row, 1);
}
}
......@@ -238,28 +249,41 @@ StatusCode EventLoaderCLICpix2::run(std::shared_ptr<Clipboard> clipboard) {
}
// Disentangle data types from pixel:
int tot, toa = -1, cnt = -1;
int tot = -1, toa = -1, cnt = -1;
// ToT will throw if longcounter is enabled:
try {
tot = cp2_pixel->GetTOT();
hPixelToT->Fill(tot);
hPixelToTMap->Fill(col, row, tot);
if(!discardZeroToT || tot > 0) {
hPixelToT->Fill(tot);
hPixelToTMap->Fill(col, row, tot);
}
} catch(caribou::WrongDataFormat&) {
// Set ToT to one of not defined.
// Set ToT to one if not defined.
tot = 1;
}
// Time defaults ot rising shutter edge:
double timestamp = shutterStartTime;
// Decide whether information is counter of ToA
if(matrix_config[std::make_pair(row, col)].GetCountingMode()) {
cnt = cp2_pixel->GetCounter();
hPixelCnt->Fill(cnt);
if(!discardZeroToT || tot > 0) {
hPixelCnt->Fill(cnt);
}
} else {
toa = cp2_pixel->GetTOA();
hPixelToA->Fill(toa);
// Convert ToA form 100MHz clk into ns and sutract from shutterStopTime. Then add configured detector time
// offset
timestamp = shutterStopTime - static_cast<double>(toa) / 0.1 + m_detector->timingOffset();
if(!discardZeroToT || tot > 0) {
hPixelToA->Fill(toa);
hTimeWalk->Fill(toa, tot);
}
}
Pixel* pixel = new Pixel(m_detector->name(), row, col, tot, shutterStartTime);
Pixel* pixel = new Pixel(m_detector->name(), row, col, tot, timestamp);
if(tot == 0 && discardZeroToT) {
hHitMapDiscarded->Fill(col, row);
......
......@@ -53,6 +53,7 @@ namespace corryvreckan {
TH2F* hHitMap;
TH2F* hMaskMap;
TH2F* hTimeWalk;
TH2F* hHitMapDiscarded;
TProfile2D* hPixelToTMap;
TH1F* hPixelToT;
......
......@@ -14,7 +14,7 @@ The data is decoded using the CLICpix2 data decoder shipped with the Peary DAQ f
### Dependencies
This module is not built by default since it requires an installation of [Peary](https://gitlab.cern.ch/Caribou/peary) with its CLICPix2 component built.
This module is not built by default since it requires an installation of [Peary](https://gitlab.cern.ch/Caribou/peary) with its CLICPix2 component built.
This is used for on-the-fly decoding of raw data.
In order to build this module, Peary should be made available and the module should be explicitely switched on:
......@@ -29,7 +29,7 @@ cmake -DBUILD_eventLoaderCLICpix2=ON ..
### Plots produced
* 2D Hit map
* 2D maps of masked pixels, encoded with online masked (value 1) and offline masked (value 2)
* 2D maps of masked pixels, encoded with online masked (value 1) and offline masked (value 2), or in both (value 3)
* 1D Pixel ToT histogram (if value is available)
* 1D Pixel ToA histogram (if value is available)
* 1D Pixel particle count histogram (if value is available)
......
......@@ -182,8 +182,8 @@ void OnlineMonitor::AddHisto(string canvasName, string histoName, string style,
TH1* histogram = static_cast<TH1*>(gDirectory->Get(histoName.c_str()));
if(histogram) {
gui->histograms[canvasName].push_back(static_cast<TH1*>(gDirectory->Get(histoName.c_str())));
gui->styles[gui->histograms[canvasName].back()] = style;
gui->logarithmic[gui->histograms[canvasName].back()] = logy;
gui->styles[gui->histograms[canvasName].back()] = style;
} else {
LOG(WARNING) << "Histogram " << histoName << " does not exist";
}
......
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