Commit 32f010c8 authored by Morag Jean Williams's avatar Morag Jean Williams
Browse files

AnalysisEfficiency: Adding global and chip efficiency plots filled with the...

AnalysisEfficiency: Adding global and chip efficiency plots filled with the associated cluster position
parent b919b21c
......@@ -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,12 @@ 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* hPixelEfficiencyMap_clustPos;
TProfile2D* hChipEfficiencyMap_clustPos;
TProfile2D* hGlobalEfficiencyMap_clustPos;
double m_chi2ndofCut, m_timeCutFrameEdge;
int total_tracks, matched_tracks;
......
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