Commit f9f981b1 authored by Nicolo Jacazio's avatar Nicolo Jacazio
Browse files

Add the TProfile efficiency back

parent 7e6c5b84
......@@ -44,6 +44,16 @@ void AnalysisEfficiency::initialize() {
}
std::string title =
m_detector->getName() + " Pixel efficiency map;in-pixel x_{track} [#mum];in-pixel y_{track} #mum;#epsilon";
hPixelEfficiencyMap_trackPos_TProfile = new TProfile2D("pixelEfficiencyMap_trackPos_TProfile",
title.c_str(),
nbins_x,
-pitch_x / 2.,
pitch_x / 2.,
nbins_y,
-pitch_y / 2.,
pitch_y / 2.,
0,
1);
hPixelEfficiencyMap_trackPos = new TEfficiency("pixelEfficiencyMap_trackPos",
title.c_str(),
nbins_x,
......@@ -54,6 +64,16 @@ void AnalysisEfficiency::initialize() {
pitch_y / 2.);
title = m_detector->getName() + " Chip efficiency map;x [px];y [px];#epsilon";
hChipEfficiencyMap_trackPos_TProfile = new TProfile2D("chipEfficiencyMap_trackPos_TProfile",
title.c_str(),
m_detector->nPixels().X(),
-0.5,
m_detector->nPixels().X() - 0.5,
m_detector->nPixels().Y(),
-0.5,
m_detector->nPixels().Y() - 0.5,
0,
1);
hChipEfficiencyMap_trackPos = new TEfficiency("chipEfficiencyMap_trackPos",
title.c_str(),
m_detector->nPixels().X(),
......@@ -62,7 +82,18 @@ void AnalysisEfficiency::initialize() {
m_detector->nPixels().Y(),
-0.5,
m_detector->nPixels().Y() - 0.5);
title = m_detector->getName() + " Global efficiency map;x [mm];y [mm];#epsilon";
hGlobalEfficiencyMap_trackPos_TProfile = new TProfile2D("globalEfficiencyMap_trackPos_TProfile",
title.c_str(),
300,
-1.5 * m_detector->getSize().X(),
1.5 * m_detector->getSize().X(),
300,
-1.5 * m_detector->getSize().Y(),
1.5 * m_detector->getSize().Y(),
0,
1);
hGlobalEfficiencyMap_trackPos = new TEfficiency("globalEfficiencyMap_trackPos",
title.c_str(),
300,
......@@ -71,7 +102,18 @@ void AnalysisEfficiency::initialize() {
300,
-1.5 * m_detector->getSize().Y(),
1.5 * m_detector->getSize().Y());
title = m_detector->getName() + " Chip efficiency map;x [px];y [px];#epsilon";
hChipEfficiencyMap_clustPos_TProfile = new TProfile2D("chipEfficiencyMap_clustPos_TProfile",
title.c_str(),
m_detector->nPixels().X(),
-0.5,
m_detector->nPixels().X() - 0.5,
m_detector->nPixels().Y(),
-0.5,
m_detector->nPixels().Y() - 0.5,
0,
1);
hChipEfficiencyMap_clustPos = new TEfficiency("chipEfficiencyMap_clustPos",
title.c_str(),
m_detector->nPixels().X(),
......@@ -80,7 +122,18 @@ void AnalysisEfficiency::initialize() {
m_detector->nPixels().Y(),
-0.5,
m_detector->nPixels().Y() - 0.5);
title = m_detector->getName() + " Global efficiency map;x [mm];y [mm];#epsilon";
hGlobalEfficiencyMap_clustPos_TProfile = new TProfile2D("globalEfficiencyMap_clustPos_TProfile",
title.c_str(),
300,
-1.5 * m_detector->getSize().X(),
1.5 * m_detector->getSize().X(),
300,
-1.5 * m_detector->getSize().Y(),
1.5 * m_detector->getSize().Y(),
0,
1);
hGlobalEfficiencyMap_clustPos = new TEfficiency("globalEfficiencyMap_clustPos",
title.c_str(),
300,
......@@ -89,6 +142,7 @@ void AnalysisEfficiency::initialize() {
300,
-1.5 * m_detector->getSize().Y(),
1.5 * m_detector->getSize().Y());
hDistanceCluster = new TH1D("distanceTrackHit",
"distance between track and hit; | #vec{track} - #vec{dut} | [mm]",
static_cast<int>(std::sqrt(m_detector->getPitch().x() * m_detector->getPitch().y())),
......@@ -273,17 +327,27 @@ StatusCode AnalysisEfficiency::run(const std::shared_ptr<Clipboard>& clipboard)
hDistanceCluster_track->Fill(distance.X(), distance.Y());
hDistanceCluster->Fill(std::sqrt(distance.Mag2()));
hGlobalEfficiencyMap_clustPos_TProfile->Fill(
cluster->global().x(), cluster->global().y(), has_associated_cluster);
hGlobalEfficiencyMap_clustPos->Fill(has_associated_cluster, cluster->global().x(), cluster->global().y());
hChipEfficiencyMap_clustPos_TProfile->Fill(
m_detector->getColumn(clusterLocal), m_detector->getRow(clusterLocal), has_associated_cluster);
hChipEfficiencyMap_clustPos->Fill(
has_associated_cluster, m_detector->getColumn(clusterLocal), m_detector->getRow(clusterLocal));
}
hGlobalEfficiencyMap_trackPos_TProfile->Fill(globalIntercept.X(), globalIntercept.Y(), has_associated_cluster);
hGlobalEfficiencyMap_trackPos->Fill(has_associated_cluster, globalIntercept.X(), globalIntercept.Y());
hChipEfficiencyMap_trackPos_TProfile->Fill(
m_detector->getColumn(localIntercept), m_detector->getRow(localIntercept), has_associated_cluster);
hChipEfficiencyMap_trackPos->Fill(
has_associated_cluster, m_detector->getColumn(localIntercept), m_detector->getRow(localIntercept));
// For pixels, only look at the ROI:
if(is_within_roi) {
hPixelEfficiencyMap_trackPos_TProfile->Fill(xmod, ymod, has_associated_cluster);
hPixelEfficiencyMap_trackPos->Fill(has_associated_cluster, xmod, ymod);
eTotalEfficiency->Fill(has_associated_cluster, 0); // use 0th bin for total efficiency
efficiencyColumns->Fill(has_associated_cluster, m_detector->getColumn(localIntercept));
......@@ -305,7 +369,11 @@ StatusCode AnalysisEfficiency::run(const std::shared_ptr<Clipboard>& clipboard)
Units::convert(track->timestamp() - prev_hit_ts.at(intercept_col).at(intercept_row), "us")));
}
} else {
hGlobalEfficiencyMap_clustPos_TProfile->Fill(globalIntercept.X(), globalIntercept.Y(), has_associated_cluster);
hGlobalEfficiencyMap_clustPos->Fill(has_associated_cluster, globalIntercept.X(), globalIntercept.Y());
hChipEfficiencyMap_clustPos_TProfile->Fill(
m_detector->getColumn(localIntercept), m_detector->getRow(localIntercept), has_associated_cluster);
hChipEfficiencyMap_clustPos->Fill(
has_associated_cluster, m_detector->getColumn(localIntercept), m_detector->getRow(localIntercept));
......
......@@ -45,6 +45,13 @@ namespace corryvreckan {
TH1D* hPixelEfficiency;
// Profile version
TProfile2D* hPixelEfficiencyMap_trackPos_TProfile;
TProfile2D* hChipEfficiencyMap_trackPos_TProfile;
TProfile2D* hGlobalEfficiencyMap_trackPos_TProfile;
TProfile2D* hChipEfficiencyMap_clustPos_TProfile;
TProfile2D* hGlobalEfficiencyMap_clustPos_TProfile;
// TEfficiency version
TEfficiency* hPixelEfficiencyMap_trackPos;
TEfficiency* hChipEfficiencyMap_trackPos;
TEfficiency* hGlobalEfficiencyMap_trackPos;
......
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