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

Merge branch 'master' into 'master'

AnalysisEfficiency and AnalysisDUT: adding additional plots

See merge request corryvreckan/corryvreckan!97
parents b919b21c 99d5e39a
Pipeline #772848 passed with stages
in 20 minutes and 24 seconds
......@@ -87,6 +87,7 @@ void AnalysisDUT::initialise() {
clusterTotAssoc = new TH1F("clusterTotAssociated", "clusterTotAssociated", 10000, 0, 10000);
clusterTotAssocNorm = new TH1F("clusterTotAssociatedNormalized", "clusterTotAssociatedNormalized", 10000, 0, 10000);
clusterSizeAssoc = new TH1F("clusterSizeAssociated", "clusterSizeAssociated", 30, 0, 30);
clusterSizeAssocNorm = new TH1F("clusterSizeAssociatedNormalized", "clusterSizeAssociatedNormalized", 30, 0, 30);
// In-pixel studies:
auto pitch_x = static_cast<double>(Units::convert(m_detector->pitch().X(), "um"));
......@@ -336,6 +337,7 @@ StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
residualsTimeVsSignal->Fill(tdistance, cluster->tot());
clusterSizeAssoc->Fill(static_cast<double>(cluster->size()));
clusterSizeAssocNorm->Fill(static_cast<double>(cluster->size()));
// Fill in-pixel plots: (all as function of track position within pixel cell)
if(is_within_roi) {
......@@ -382,7 +384,10 @@ StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
hPixelEfficiencyMap->Fill(xmod, ymod, has_associated_cluster);
}
}
// Return value telling analysis to keep running
return StatusCode::Success;
}
void AnalysisDUT::finalise() {
clusterSizeAssocNorm->Scale(1 / clusterSizeAssoc->Integral());
}
......@@ -21,6 +21,7 @@ namespace corryvreckan {
// Functions
void initialise();
StatusCode run(std::shared_ptr<Clipboard> clipboard);
void finalise();
private:
std::shared_ptr<Detector> m_detector;
......@@ -40,6 +41,7 @@ namespace corryvreckan {
TH1F *clusterTotAssoc, *clusterTotAssocNorm;
TH1F* clusterSizeAssoc;
TH1F* clusterSizeAssocNorm;
TProfile2D *rmsxvsxmym, *rmsyvsxmym, *rmsxyvsxmym;
TProfile2D *qvsxmym, *qMoyalvsxmym, *pxqvsxmym;
......
......@@ -25,6 +25,7 @@ Analysis module for CLICpix2 prototypes. This module is still work in progress,
* Track residuals for 2-pixel-clusters in X and Y
* Distribution of cluster Tot values from associated clusters
* Distribution of sizes from associated clusters
* Normalised distribution of sizes from associated clusters
* 2D Map of in-pixel efficiency
* 2D Map of the chip efficiency in local coordinates
* 2D Map of the chip efficiency on global coordinates
......
......@@ -30,38 +30,60 @@ void AnalysisEfficiency::initialise() {
std::string title = m_detector->name() + " Pixel efficiency map;x_{track} mod " + std::to_string(pitch_x) +
"#mum;y_{track} mod " + std::to_string(pitch_y) + "#mum;efficiency";
hPixelEfficiencyMap = new TProfile2D("pixelEfficiencyMap",
title.c_str(),
static_cast<int>(pitch_x),
0,
pitch_x,
static_cast<int>(pitch_y),
0,
pitch_y,
0,
1);
hPixelEfficiencyMap_trackPos = new TProfile2D("pixelEfficiencyMap_trackPos",
title.c_str(),
static_cast<int>(pitch_x),
0,
pitch_x,
static_cast<int>(pitch_y),
0,
pitch_y,
0,
1);
title = m_detector->name() + " Chip efficiency map;x [px];y [px];efficiency";
hChipEfficiencyMap = new TProfile2D("chipEfficiencyMap",
title.c_str(),
m_detector->nPixels().X(),
0,
m_detector->nPixels().X(),
m_detector->nPixels().Y(),
0,
m_detector->nPixels().Y(),
0,
1);
hChipEfficiencyMap_trackPos = new TProfile2D("chipEfficiencyMap_trackPos",
title.c_str(),
m_detector->nPixels().X(),
0,
m_detector->nPixels().X(),
m_detector->nPixels().Y(),
0,
m_detector->nPixels().Y(),
0,
1);
title = m_detector->name() + " Global efficiency map;x [mm];y [mm];efficiency";
hGlobalEfficiencyMap = new TProfile2D("globalEfficiencyMap",
title.c_str(),
300,
-1.5 * m_detector->size().X(),
1.5 * m_detector->size().X(),
300,
-1.5 * m_detector->size().Y(),
1.5 * m_detector->size().Y(),
0,
1);
hGlobalEfficiencyMap_trackPos = new TProfile2D("globalEfficiencyMap_trackPos",
title.c_str(),
300,
-1.5 * m_detector->size().X(),
1.5 * m_detector->size().X(),
300,
-1.5 * m_detector->size().Y(),
1.5 * m_detector->size().Y(),
0,
1);
title = m_detector->name() + " Chip efficiency map;x [px];y [px];efficiency";
hChipEfficiencyMap_clustPos = new TProfile2D("chipEfficiencyMap_clustPos",
title.c_str(),
m_detector->nPixels().X(),
0,
m_detector->nPixels().X(),
m_detector->nPixels().Y(),
0,
m_detector->nPixels().Y(),
0,
1);
title = m_detector->name() + " Global efficiency map;x [mm];y [mm];efficiency";
hGlobalEfficiencyMap_clustPos = new TProfile2D("globalEfficiencyMap_clustPos",
title.c_str(),
300,
-1.5 * m_detector->size().X(),
1.5 * m_detector->size().X(),
300,
-1.5 * m_detector->size().Y(),
1.5 * m_detector->size().Y(),
0,
1);
}
StatusCode AnalysisEfficiency::run(std::shared_ptr<Clipboard> clipboard) {
......@@ -147,18 +169,26 @@ StatusCode AnalysisEfficiency::run(std::shared_ptr<Clipboard> clipboard) {
LOG(DEBUG) << "Found associated cluster " << (*cluster);
has_associated_cluster = true;
matched_tracks++;
auto clusterLocal = m_detector->globalToLocal(cluster->global());
hGlobalEfficiencyMap_clustPos->Fill(
cluster->global().x(), cluster->global().y(), has_associated_cluster);
hChipEfficiencyMap_clustPos->Fill(
m_detector->getColumn(clusterLocal), m_detector->getRow(clusterLocal), has_associated_cluster);
break;
}
}
}
hGlobalEfficiencyMap->Fill(globalIntercept.X(), globalIntercept.Y(), has_associated_cluster);
hChipEfficiencyMap->Fill(
hGlobalEfficiencyMap_trackPos->Fill(globalIntercept.X(), globalIntercept.Y(), has_associated_cluster);
hChipEfficiencyMap_trackPos->Fill(
m_detector->getColumn(localIntercept), m_detector->getRow(localIntercept), has_associated_cluster);
// For pixels, only look at the ROI:
if(is_within_roi) {
hPixelEfficiencyMap->Fill(xmod, ymod, has_associated_cluster);
hPixelEfficiencyMap_trackPos->Fill(xmod, ymod, has_associated_cluster);
}
if(has_associated_cluster == false) {
hGlobalEfficiencyMap_clustPos->Fill(globalIntercept.X(), globalIntercept.Y(), has_associated_cluster);
hChipEfficiencyMap_clustPos->Fill(
m_detector->getColumn(localIntercept), m_detector->getRow(localIntercept), has_associated_cluster);
}
}
......@@ -166,6 +196,8 @@ StatusCode AnalysisEfficiency::run(std::shared_ptr<Clipboard> clipboard) {
}
void AnalysisEfficiency::finalise() {
LOG(INFO) << "No. matched tracks=" << matched_tracks;
LOG(INFO) << "Total no. tracks=" << total_tracks;
LOG(STATUS) << "Total efficiency of detector " << m_detector->name() << ": "
<< (100 * matched_tracks / (total_tracks > 0 ? total_tracks : 1)) << "%, measured with " << total_tracks
<< " tracks";
......
......@@ -39,9 +39,11 @@ namespace corryvreckan {
private:
std::shared_ptr<Detector> m_detector;
TProfile2D* hPixelEfficiencyMap;
TProfile2D* hChipEfficiencyMap;
TProfile2D* hGlobalEfficiencyMap;
TProfile2D* hPixelEfficiencyMap_trackPos;
TProfile2D* hChipEfficiencyMap_trackPos;
TProfile2D* hGlobalEfficiencyMap_trackPos;
TProfile2D* hChipEfficiencyMap_clustPos;
TProfile2D* hGlobalEfficiencyMap_clustPos;
double m_chi2ndofCut, m_timeCutFrameEdge;
int total_tracks, matched_tracks;
......
......@@ -13,8 +13,10 @@ This module measures the efficiency of the device under test by comparing its cl
### Plots produced
* 2D Map of in-pixel efficiency
* 2D Map of the chip efficiency in local coordinates
* 2D Map of the chip efficiency on global coordinates
* 2D Map of the chip efficiency in local coordinates, filled at the position of the track intercept point
* 2D Map of the chip efficiency on global coordinates, filled at the position of the track intercept point
* 2D Map of the chip efficiency in local coordinates, filled at the position of the associated cluster centre
* 2D Map of the chip efficiency on global coordinates, filled at the position of the associated cluster centre
### 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