Commit d680b8f4 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Merge branch 'add_plots_to_clustering4d' into 'master'

Add plots to Clustering4D

See merge request corryvreckan/corryvreckan!295
parents e5746ef4 98c7c138
......@@ -45,12 +45,22 @@ void Clustering4D::initialise() {
clusterWidthColumn = new TH1F("clusterWidthColumn", title.c_str(), 100, -0.5, 99.5);
title = m_detector->getName() + " Cluster Charge;cluster charge [e];events";
clusterCharge = new TH1F("clusterCharge", title.c_str(), 5000, -0.5, 49999.5);
title = m_detector->getName() + " Cluster Charge (1px clusters);cluster charge [e];events";
clusterCharge_1px = new TH1F("clusterCharge_1px", title.c_str(), 256, -0.5, 255.5);
title = m_detector->getName() + " Cluster Charge (2px clusters);cluster charge [e];events";
clusterCharge_2px = new TH1F("clusterCharge_2px", title.c_str(), 256, -0.5, 255.5);
title = m_detector->getName() + " Cluster Charge (3px clusters);cluster charge [e];events";
clusterCharge_3px = new TH1F("clusterCharge_3px", title.c_str(), 256, -0.5, 255.5);
title = m_detector->getName() + " Cluster Position (Global);x [mm];y [mm];events";
clusterPositionGlobal = new TH2F("clusterPositionGlobal", title.c_str(), 400, -10., 10., 400, -10., 10.);
title = ";cluster timestamp [ns]; # events";
clusterTimes = new TH1F("clusterTimes", title.c_str(), 3e6, 0, 3e9);
title = m_detector->getName() + " Cluster multiplicity;clusters;events";
clusterMultiplicity = new TH1F("clusterMultiplicity", title.c_str(), 50, -0.5, 49.5);
title = m_detector->getName() +
" pixel - cluster timestamp;ts_{pixel} - ts_{cluster} [ns] (all pixels from cluster (if clusterSize>1));events";
pixelTimeMinusClusterTime = new TH1F("pixelTimeMinusClusterTime", title.c_str(), 1000, -0.5, 999.5);
// Get resolution in time of detector and calculate time cut to be applied
LOG(DEBUG) << "Time cut to be applied for " << m_detector->getName() << " is "
<< Units::display(timeCut, {"ns", "us", "ms"});
......@@ -135,10 +145,25 @@ StatusCode Clustering4D::run(std::shared_ptr<Clipboard> clipboard) {
clusterWidthRow->Fill(cluster->rowWidth());
clusterWidthColumn->Fill(cluster->columnWidth());
clusterCharge->Fill(cluster->charge());
if(cluster->size() == 1) {
clusterCharge_1px->Fill(cluster->charge());
} else if(cluster->size() == 2) {
clusterCharge_2px->Fill(cluster->charge());
} else if(cluster->size() == 3) {
clusterCharge_3px->Fill(cluster->charge());
}
clusterSeedCharge->Fill(cluster->getSeedPixel()->charge());
clusterPositionGlobal->Fill(cluster->global().x(), cluster->global().y());
clusterTimes->Fill(static_cast<double>(Units::convert(cluster->timestamp(), "ns")));
// to check that cluster timestamp = earliest pixel timestamp
if(cluster->size() > 1) {
for(auto& px : cluster->pixels()) {
pixelTimeMinusClusterTime->Fill(
static_cast<double>(Units::convert(px->timestamp() - cluster->timestamp(), "ns")));
}
}
deviceClusters->push_back(cluster);
}
......
......@@ -46,9 +46,13 @@ namespace corryvreckan {
TH1F* clusterWidthRow;
TH1F* clusterWidthColumn;
TH1F* clusterCharge;
TH1F* clusterCharge_1px;
TH1F* clusterCharge_2px;
TH1F* clusterCharge_3px;
TH2F* clusterPositionGlobal;
TH1F* clusterTimes;
TH1F* clusterMultiplicity;
TH1F* pixelTimeMinusClusterTime;
double timeCut;
int neighbourRadiusRow;
......
......@@ -24,10 +24,11 @@ Split clusters can be recovered using a larger search radius for neighbouring pi
For each detector the following plots are produced:
* Histograms for cluster size, seed charge, width (columns/X and rows/Y)
* Cluster charge histogram
* Cluster charge histogram for all clusters as well as 1-px, 2-px, 3-px clusters
* 2D cluster positions in global coordinates
* Cluster times
* Cluster multiplicity
* Histogram with time difference of pixel time and cluster time for all pixels in a cluster
### Usage
```toml
......
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