Commit 4cde8e17 authored by Jens Kroeger's avatar Jens Kroeger
Browse files

EventLoaderATLASpix: resolved merge conflict (doesn't compile yet)

parents 5dbb1d51 0a057690
......@@ -29,7 +29,7 @@ As soon as there exists something in your branch, a merge request can be opened
1. Retrieve the latest changes from the upstream version as explained above.
2. Optionally format the code if you did not add the git-hook from the beginning, this can be done manually by running `make format` from the build directory.
3. Go to [merge request](https://gitlab.cern.ch/simonspa/corryvreckan/merge_requests) and click on 'New merge request'.
3. Go to [merge request](https://gitlab.cern.ch/corryvreckan/corryvreckan/merge_requests) and click on 'New merge request'.
4. Follow the instructions. Do not forget to use the 'WIP:' prefix if your code is only partially ready. Then submit the merge request.
5. Please wait for the maintainers to give you access to the continuous integration (CI) runners that will check your code if you do not already have it.
6. Add all the specific runners on your local repository at https://gitlab.cern.ch/your-username/corryvreckan/settings/ci_cd.
......
......@@ -50,7 +50,7 @@ void AnalysisCLICpix::initialise() {
0,
maxcounter - 1);
hClusterSizeAll = new TH1F("hClusterSizeAll", "hClusterSizeAll", 20, 0, 20);
hClusterTOTAll = new TH1F("hClusterTOTAll", "hClusterTOTAll", 50, 0, 50);
hClusterChargeAll = new TH1F("hClusterChargeAll", "hClusterChargeAll", 50, 0, 50);
hClustersPerEvent = new TH1F("hClustersPerEvent", "hClustersPerEvent", 500, 0, 500);
hClustersVersusEventNo = new TH1F("hClustersVersusEventNo", "hClustersVersusEventNo", 60000, 0, 60000);
hGlobalClusterPositions = new TH2F("hGlobalClusterPositions", "hGlobalClusterPositions", 200, -2.0, 2.0, 300, -1., 2);
......@@ -108,11 +108,11 @@ void AnalysisCLICpix::initialise() {
hClusterWidthRowAssociated = new TH1F("hClusterWidthRowAssociated", "hClusterWidthRowAssociated", 20, 0, 20);
hClusterWidthColAssociated = new TH1F("hClusterWidthColAssociated", "hClusterWidthColAssociated", 20, 0, 20);
hClusterTOTAssociated = new TH1F("hClusterTOTAssociated", "hClusterTOTAssociated", 50, 0, 50);
hClusterTOTAssociated1pix = new TH1F("hClusterTOTAssociated1pix", "hClusterTOTAssociated1pix", 50, 0, 50);
hClusterTOTAssociated2pix = new TH1F("hClusterTOTAssociated2pix", "hClusterTOTAssociated2pix", 50, 0, 50);
hClusterTOTAssociated3pix = new TH1F("hClusterTOTAssociated3pix", "hClusterTOTAssociated3pix", 50, 0, 50);
hClusterTOTAssociated4pix = new TH1F("hClusterTOTAssociated4pix", "hClusterTOTAssociated4pix", 50, 0, 50);
hClusterChargeAssociated = new TH1F("hClusterChargeAssociated", "hClusterChargeAssociated", 50, 0, 50);
hClusterChargeAssociated1pix = new TH1F("hClusterChargeAssociated1pix", "hClusterChargeAssociated1pix", 50, 0, 50);
hClusterChargeAssociated2pix = new TH1F("hClusterChargeAssociated2pix", "hClusterChargeAssociated2pix", 50, 0, 50);
hClusterChargeAssociated3pix = new TH1F("hClusterChargeAssociated3pix", "hClusterChargeAssociated3pix", 50, 0, 50);
hClusterChargeAssociated4pix = new TH1F("hClusterChargeAssociated4pix", "hClusterChargeAssociated4pix", 50, 0, 50);
hPixelResponseX = new TH1F("hPixelResponseX", "hPixelResponseX", 600, -0.3, 0.3);
hPixelResponseY = new TH1F("hPixelResponseY", "hPixelResponseY", 600, -0.3, 0.3);
......@@ -130,10 +130,10 @@ void AnalysisCLICpix::initialise() {
hResidualsLocalRow2pix = new TH1F("hResidualsLocalRow2pix", "hResidualsLocalRow2pix", 600, -0.3, 0.3);
hResidualsLocalCol2pix = new TH1F("hResidualsLocalCol2pix", "hResidualsLocalCol2pix", 600, -0.3, 0.3);
hClusterTOTRow2pix = new TH1F("hClusterTOTRow2pix", "hClusterTOTRow2pix", 50, 0, 50);
hClusterTOTCol2pix = new TH1F("hClusterTOTCol2pix", "hClusterTOTCol2pix", 50, 0, 50);
hClusterTOTRatioRow2pix = new TH1F("hClusterTOTRatioRow2pix", "hClusterTOTRatioRow2pix", 100, 0, 1);
hClusterTOTRatioCol2pix = new TH1F("hClusterTOTRatioCol2pix", "hClusterTOTRatioCol2pix", 100, 0, 1);
hClusterChargeRow2pix = new TH1F("hClusterChargeRow2pix", "hClusterChargeRow2pix", 50, 0, 50);
hClusterChargeCol2pix = new TH1F("hClusterChargeCol2pix", "hClusterChargeCol2pix", 50, 0, 50);
hClusterChargeRatioRow2pix = new TH1F("hClusterChargeRatioRow2pix", "hClusterChargeRatioRow2pix", 100, 0, 1);
hClusterChargeRatioCol2pix = new TH1F("hClusterChargeRatioCol2pix", "hClusterChargeRatioCol2pix", 100, 0, 1);
hPixelTOTRow2pix = new TH1F("hPixelTOTRow2pix", "hPixelTOTRow2pix", 50, 0, 50);
hPixelTOTCol2pix = new TH1F("hPixelTOTCol2pix", "hPixelTOTCol2pix", 50, 0, 50);
......@@ -209,9 +209,9 @@ void AnalysisCLICpix::initialise() {
for(int x = 0; x < m_nBinsX; x++) {
for(int y = 0; y < m_nBinsY; y++) {
int id = x + y * m_nBinsX;
std::string name = "hMapClusterTOTAssociated1pix" + convertToString(id);
TH1F* hMapEntryClusterTOTAssociated1pix = new TH1F(name.c_str(), name.c_str(), 50, 0, 50);
hMapClusterTOTAssociated1pix[id] = hMapEntryClusterTOTAssociated1pix;
std::string name = "hMapClusterChargeAssociated1pix" + convertToString(id);
TH1F* hMapEntryClusterChargeAssociated1pix = new TH1F(name.c_str(), name.c_str(), 50, 0, 50);
hMapClusterChargeAssociated1pix[id] = hMapEntryClusterChargeAssociated1pix;
}
}
}
......@@ -362,35 +362,35 @@ StatusCode AnalysisCLICpix::run(std::shared_ptr<Clipboard> clipboard) {
pixelInterceptX, pixelInterceptY, sqrt(xresidualBest * xresidualBest + yresidualBest * yresidualBest));
hXresidualVersusYresidual->Fill(xresidualBest, yresidualBest);
hAbsoluteResiduals->Fill(sqrt(xresidualBest * xresidualBest + yresidualBest * yresidualBest));
hClusterTOTAssociated->Fill((bestCluster)->tot());
hClusterChargeAssociated->Fill((bestCluster)->charge());
hClusterSizeAssociated->Fill(static_cast<double>(bestCluster->size()));
// hClusterWidthColAssociated->Fill((*bestCluster)->colWidth());
// hClusterWidthRowAssociated->Fill((*bestCluster)->rowWidth());
hMapClusterSizeAssociated->Fill(chipInterceptCol, chipInterceptRow, (bestCluster)->tot());
hMapClusterSizeAssociated->Fill(chipInterceptCol, chipInterceptRow, (bestCluster)->charge());
if((bestCluster)->size() == 1) {
hClusterTOTAssociated1pix->Fill((bestCluster)->tot());
hClusterChargeAssociated1pix->Fill((bestCluster)->charge());
hInterceptClusterSize1->Fill(pixelInterceptX, pixelInterceptY);
int id = static_cast<int>(floor(chipInterceptCol * m_nBinsX / m_detector->nPixels().X()) +
floor(chipInterceptRow * m_nBinsY / m_detector->nPixels().Y()) * m_nBinsX);
hMapClusterTOTAssociated1pix[id]->Fill((bestCluster)->tot());
hMapClusterChargeAssociated1pix[id]->Fill((bestCluster)->charge());
}
if((bestCluster)->size() == 2) {
hClusterTOTAssociated2pix->Fill((bestCluster)->tot());
hClusterChargeAssociated2pix->Fill((bestCluster)->charge());
hInterceptClusterSize2->Fill(pixelInterceptX, pixelInterceptY);
}
if((bestCluster)->size() == 3) {
hClusterTOTAssociated3pix->Fill((bestCluster)->tot());
hClusterChargeAssociated3pix->Fill((bestCluster)->charge());
hInterceptClusterSize3->Fill(pixelInterceptX, pixelInterceptY);
}
if((bestCluster)->size() == 4) {
hClusterTOTAssociated4pix->Fill((bestCluster)->tot());
hClusterChargeAssociated4pix->Fill((bestCluster)->charge());
hInterceptClusterSize4->Fill(pixelInterceptX, pixelInterceptY);
}
Pixels* pixels = bestCluster->pixels();
for(auto& pixel : (*pixels)) {
hPixelToTMap->Fill(pixel->column(), pixel->row(), pixel->adc());
hPixelToTMap->Fill(pixel->column(), pixel->row(), pixel->raw());
}
} else {
......@@ -546,13 +546,13 @@ void AnalysisCLICpix::fillClusterHistos(Clusters* clusters) {
for(itp = pixels->begin(); itp != pixels->end(); itp++) {
// Check if this clicpix frame is still the current
int pixelID = (*itp)->column() + nCols * (*itp)->row();
if(m_hitPixels[pixelID] != (*itp)->adc()) {
if(m_hitPixels[pixelID] != (*itp)->raw()) {
// New frame! Reset the stored pixels and trigger number
if(!newFrame) {
m_hitPixels.clear();
newFrame = true;
}
m_hitPixels[pixelID] = (*itp)->adc();
m_hitPixels[pixelID] = (*itp)->raw();
m_triggerNumber = 0;
}
hHitPixels->Fill((*itp)->column(), (*itp)->row());
......@@ -562,7 +562,7 @@ void AnalysisCLICpix::fillClusterHistos(Clusters* clusters) {
// Fill cluster histograms
hClusterSizeAll->Fill(static_cast<double>((*itc)->size()));
hClusterTOTAll->Fill((*itc)->tot());
hClusterChargeAll->Fill((*itc)->charge());
hGlobalClusterPositions->Fill((*itc)->global().x(), (*itc)->global().y());
}
......
......@@ -36,7 +36,7 @@ namespace corryvreckan {
TH1F* hRowHits;
TH1F* hClusterSizeAll;
TH1F* hClusterTOTAll;
TH1F* hClusterChargeAll;
TH1F* hClustersPerEvent;
TH1F* hClustersVersusEventNo;
TH1F* hClusterWidthRow;
......@@ -71,11 +71,11 @@ namespace corryvreckan {
TH1F* hClusterSizeAssociated;
TH1F* hClusterWidthRowAssociated;
TH1F* hClusterWidthColAssociated;
TH1F* hClusterTOTAssociated;
TH1F* hClusterTOTAssociated1pix;
TH1F* hClusterTOTAssociated2pix;
TH1F* hClusterTOTAssociated3pix;
TH1F* hClusterTOTAssociated4pix;
TH1F* hClusterChargeAssociated;
TH1F* hClusterChargeAssociated1pix;
TH1F* hClusterChargeAssociated2pix;
TH1F* hClusterChargeAssociated3pix;
TH1F* hClusterChargeAssociated4pix;
TH1F* hPixelResponseX;
TH1F* hPixelResponseGlobalX;
TH1F* hPixelResponseXOddCol;
......@@ -88,12 +88,12 @@ namespace corryvreckan {
TH2F* hEtaDistributionY;
TH1F* hResidualsLocalRow2pix;
TH1F* hResidualsLocalCol2pix;
TH1F* hClusterTOTRow2pix;
TH1F* hClusterTOTCol2pix;
TH1F* hClusterChargeRow2pix;
TH1F* hClusterChargeCol2pix;
TH1F* hPixelTOTRow2pix;
TH1F* hPixelTOTCol2pix;
TH1F* hClusterTOTRatioRow2pix;
TH1F* hClusterTOTRatioCol2pix;
TH1F* hClusterChargeRatioRow2pix;
TH1F* hClusterChargeRatioCol2pix;
// Maps
TH2F* hTrackIntercepts;
......@@ -118,7 +118,7 @@ namespace corryvreckan {
TH2F* hMapClusterSizeAssociated;
int m_nBinsX;
int m_nBinsY;
std::map<int, TH1F*> hMapClusterTOTAssociated1pix;
std::map<int, TH1F*> hMapClusterChargeAssociated1pix;
// Member variables
int m_eventNumber;
......
......@@ -13,20 +13,20 @@ This module associates CLICpix2 DUT clusters to tracks using a spatial cut (devi
* `timepix3_telescope`: Boolean to set whether the Timepix3 telescope is being used. Default value is `false`.
### Plots produced
The following plots are produced:
The following plots are produced: (Quite many of them are not filled currently!)
* 2D hitmap
* Column hits histogram
* Row hits histogram
* Cluster size histogram
* CLuster ToT histogram
* Cluster charge histogram
* Clusters per event histogram
* Clusters vs event number
* Cluster width histogram (rows, Y-axis)
* Cluster width histogram (columns, X-axis)
* Global track difference
* Global track difference in X
* Global track difference in Y
* Global residuals in X
* Global residuals in Y
......@@ -55,10 +55,10 @@ The following plots are produced:
* Associated cluster size
* Associated cluster width (row)
* Associated cluster width (column)
* Associated 1-pixel cluster ToT
* Associated 2-pixel cluster ToT
* Associated 3-pixel cluster ToT
* Associated 4-pixel cluster ToT
* Associated 1-pixel cluster charge
* Associated 2-pixel cluster charge
* Associated 3-pixel cluster charge
* Associated 4-pixel cluster charge
* Pixel response in X
* Pixel response in X in global coordinates
* Pixel response in X for odd columns
......@@ -72,12 +72,12 @@ The following plots are produced:
* Local residual for rows for 2-pixel clusters
* Local residual for columns for 2-pixel clusters
* Cluster ToT for rows for 2-pixel clusters
* Cluster ToT for columns for 2-pixel clusters
* Cluster charge for rows for 2-pixel clusters
* Cluster charge for columns for 2-pixel clusters
* Pixel ToT for rows for 2-pixel clusters
* Pixel ToT for columns for 2-pixel clusters
* Cluster ToT ratio for rows for 2-pixel clusters
* Cluster ToT ratio for rows for 2-pixel clusters
* Cluster charge ratio for rows for 2-pixel clusters
* Cluster charge ratio for rows for 2-pixel clusters
* Local residuals for rows for 2-pixel clusters
* 2D track intercepts
......
......@@ -17,7 +17,7 @@ AnalysisDUT::AnalysisDUT(Configuration config, std::shared_ptr<Detector> detecto
void AnalysisDUT::initialise() {
hClusterMapAssoc = new TH2F("clusterMapAssoc",
"clusterMapAssoc",
"clusterMapAssoc; cluster col; cluster row",
m_detector->nPixels().X(),
0,
m_detector->nPixels().X(),
......@@ -25,7 +25,7 @@ void AnalysisDUT::initialise() {
0,
m_detector->nPixels().Y());
hClusterSizeMapAssoc = new TProfile2D("clusterSizeMapAssoc",
"clusterSizeMapAssoc",
"clusterSizeMapAssoc; cluster size; #entries",
m_detector->nPixels().X(),
0,
m_detector->nPixels().X(),
......@@ -34,21 +34,20 @@ void AnalysisDUT::initialise() {
m_detector->nPixels().Y(),
0,
100);
hClusterToTMapAssoc = new TProfile2D("clusterSizeToTAssoc",
"clusterToTMapAssoc",
m_detector->nPixels().X(),
0,
m_detector->nPixels().X(),
m_detector->nPixels().Y(),
0,
m_detector->nPixels().Y(),
0,
1000);
hClusterChargeMapAssoc = new TProfile2D("clusterChargeMapAssoc",
"clusterSizeChargeAssoc; cluster charge [e]; #entries",
m_detector->nPixels().X(),
0,
m_detector->nPixels().X(),
m_detector->nPixels().Y(),
0,
m_detector->nPixels().Y(),
0,
500);
// Per-pixel histograms
hHitMapAssoc = new TH2F("hitMapAssoc",
"hitMapAssoc",
"hitMapAssoc; hit column; hit row",
m_detector->nPixels().X(),
0,
m_detector->nPixels().X(),
......@@ -56,24 +55,24 @@ void AnalysisDUT::initialise() {
0,
m_detector->nPixels().Y());
hHitMapROI = new TH2F("hitMapROI",
"hitMapROI",
"hitMapROI; hit column; hit row",
m_detector->nPixels().X(),
0,
m_detector->nPixels().X(),
m_detector->nPixels().Y(),
0,
m_detector->nPixels().Y());
hPixelToTAssoc = new TH1F("pixelToTAssoc", "pixelToTAssoc", 32, 0, 31);
hPixelToTMapAssoc = new TProfile2D("pixelToTMapAssoc",
"pixelToTMapAssoc",
m_detector->nPixels().X(),
0,
m_detector->nPixels().X(),
m_detector->nPixels().Y(),
0,
m_detector->nPixels().Y(),
0,
255);
hPixelRawValueAssoc = new TH1F("pixelRawValueAssoc", "pixelRawValueAssoc", 32, 0, 31);
hPixelRawValueMapAssoc = new TProfile2D("pixelRawValueMapAssoc",
"pixelRawValueMapAssoc",
m_detector->nPixels().X(),
0,
m_detector->nPixels().X(),
m_detector->nPixels().Y(),
0,
m_detector->nPixels().Y(),
0,
255);
associatedTracksVersusTime = new TH1F("associatedTracksVersusTime", "associatedTracksVersusTime", 300000, 0, 300);
residualsX = new TH1F("residualsX", "residualsX", 800, -0.1, 0.1);
......@@ -84,8 +83,7 @@ void AnalysisDUT::initialise() {
residualsX2pix = new TH1F("residualsX2pix", "residualsX2pix", 400, -0.2, 0.2);
residualsY2pix = new TH1F("residualsY2pix", "residualsY2pix", 400, -0.2, 0.2);
clusterTotAssoc = new TH1F("clusterTotAssociated", "clusterTotAssociated", 10000, 0, 10000);
clusterTotAssocNorm = new TH1F("clusterTotAssociatedNormalized", "clusterTotAssociatedNormalized", 10000, 0, 10000);
clusterChargeAssoc = new TH1F("clusterChargeAssociated", "clusterChargeAssociated [e]", 10000, 0, 10000);
clusterSizeAssoc = new TH1F("clusterSizeAssociated", "clusterSizeAssociated", 30, 0, 30);
clusterSizeAssocNorm = new TH1F("clusterSizeAssociatedNormalized", "clusterSizeAssociatedNormalized", 30, 0, 30);
......@@ -305,15 +303,16 @@ StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
hClusterSizeMapAssoc->Fill(m_detector->getColumn(clusterLocal),
m_detector->getRow(clusterLocal),
static_cast<double>(cluster->size()));
hClusterToTMapAssoc->Fill(
m_detector->getColumn(clusterLocal), m_detector->getRow(clusterLocal), cluster->tot());
clusterTotAssoc->Fill(cluster->tot());
// Cluster charge normalized to path length in sensor:
double norm = 1; // FIXME fabs(cos( turn*wt )) * fabs(cos( tilt*wt ));
auto normalized_charge = cluster->tot() * norm;
clusterTotAssocNorm->Fill(normalized_charge);
// FIXME: what does this mean? To my understanding we have the correct charge here already...
auto normalized_charge = cluster->charge() * norm;
// clusterChargeAssoc->Fill(normalized_charge);
clusterChargeAssoc->Fill(cluster->charge());
hClusterChargeMapAssoc->Fill(
m_detector->getColumn(clusterLocal), m_detector->getRow(clusterLocal), cluster->charge());
// Fill per-pixel histograms
for(auto& pixel : (*cluster->pixels())) {
......@@ -321,8 +320,8 @@ StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
if(is_within_roi) {
hHitMapROI->Fill(pixel->column(), pixel->row());
}
hPixelToTAssoc->Fill(pixel->tot());
hPixelToTMapAssoc->Fill(pixel->column(), pixel->row(), pixel->tot());
hPixelRawValueAssoc->Fill(pixel->raw());
hPixelRawValueMapAssoc->Fill(pixel->column(), pixel->row(), pixel->raw());
}
associatedTracksVersusTime->Fill(static_cast<double>(Units::convert(track->timestamp(), "s")));
......@@ -343,14 +342,14 @@ StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
// Time residuals
residualsTime->Fill(tdistance);
residualsTimeVsTime->Fill(tdistance, track->timestamp());
residualsTimeVsSignal->Fill(tdistance, cluster->tot());
residualsTimeVsSignal->Fill(tdistance, cluster->charge());
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) {
qvsxmym->Fill(xmod, ymod, cluster->tot()); // cluster charge profile
qvsxmym->Fill(xmod, ymod, cluster->charge()); // cluster charge profile
qMoyalvsxmym->Fill(xmod, ymod, exp(-normalized_charge / 3.5)); // norm. cluster charge profile
// mean charge of cluster seed
......
......@@ -28,10 +28,10 @@ namespace corryvreckan {
// Histograms
TH2F *hClusterMapAssoc, *hHitMapAssoc, *hHitMapROI;
TProfile2D *hClusterSizeMapAssoc, *hClusterToTMapAssoc;
TProfile2D *hClusterSizeMapAssoc, *hClusterChargeMapAssoc;
TH1F* hPixelToTAssoc;
TProfile2D* hPixelToTMapAssoc;
TH1F* hPixelRawValueAssoc;
TProfile2D* hPixelRawValueMapAssoc;
TH1F* associatedTracksVersusTime;
TH1F *residualsX, *residualsY;
......@@ -39,7 +39,7 @@ namespace corryvreckan {
TH1F *residualsX1pix, *residualsY1pix;
TH1F *residualsX2pix, *residualsY2pix;
TH1F *clusterTotAssoc, *clusterTotAssocNorm;
TH1F* clusterChargeAssoc;
TH1F* clusterSizeAssoc;
TH1F* clusterSizeAssocNorm;
......
......@@ -5,7 +5,7 @@
**Status**: Work in progress
### Description
Analysis module for CLICpix2 prototypes. This module is still work in progress, changes to functionality and behaviour are to be expected.
Generic analysis module for all prototypes. This module is still work in progress, changes to functionality and behaviour are to be expected.
### Parameters
* `time_cut_frameedge`: Parameter to discard telescope tracks at the frame edges (start and end of the current CLICpix2 frame). Defaults to `20ns`.
......@@ -15,16 +15,16 @@ Analysis module for CLICpix2 prototypes. This module is still work in progress,
### Plots produced
* 2D Map of associated cluster positions
* 2D Map of cluster sizes for associated clusters
* 2D Map of cluster ToT values from associated clusters
* 2D Map of cluster charge values from associated clusters
* 2D Map of associated hits
* 2D Map of tracks not associated to a cluster
* 2D Map of associated hits within the defined region-of-interest
* Distribution of pixel ToT values from associated clusters
* 2D Map of pixel ToT values from associated clusters
* Distribution of pixel raw value (ToT, ADC, ...) values from associated clusters
* 2D Map of pixel raw value (ToT, ADC, ...) values from associated clusters
* Track residuals in X and Y
* Track residuals for 1-pixel-clusters in X and Y
* Track residuals for 2-pixel-clusters in X and Y
* Distribution of cluster Tot values from associated clusters
* Distribution of cluster charge values from associated clusters
* Distribution of sizes from associated clusters
* Normalised distribution of sizes from associated clusters
* 2D Map of in-pixel efficiency
......
......@@ -27,21 +27,21 @@ AnalysisEfficiency::AnalysisEfficiency(Configuration config, std::shared_ptr<Det
void AnalysisEfficiency::initialise() {
hPixelEfficiency = new TH1D(
"hPixelEfficiency", "hPixelEfficiency; single pixel efficiency; # entries", 201, 0, 1.005); // get 0.5%-wide bins
auto pitch_x = static_cast<double>(Units::convert(m_detector->pitch().X(), "um"));
auto pitch_y = static_cast<double>(Units::convert(m_detector->pitch().Y(), "um"));
auto nbins_x = static_cast<int>(std::ceil(m_detector->pitch().X() / m_inpixelBinSize));
auto nbins_y = static_cast<int>(std::ceil(m_detector->pitch().Y() / m_inpixelBinSize));
if(nbins_x > 1e4 || nbins_y > 1e4) {
throw InvalidValueError(m_config, "inpixel_bin_size", "Too many bins for in-pixel histograms.");
}
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_trackPos = new TProfile2D("pixelEfficiencyMap_trackPos",
title.c_str(),
static_cast<int>(ceil(pitch_x / m_inpixelBinSize)),
0,
pitch_x,
static_cast<int>(ceil(pitch_y / m_inpixelBinSize)),
0,
pitch_y,
0,
1);
hPixelEfficiencyMap_trackPos =
new TProfile2D("pixelEfficiencyMap_trackPos", title.c_str(), nbins_x, 0, pitch_x, nbins_y, 0, pitch_y, 0, 1);
title = m_detector->name() + " Chip efficiency map;x [px];y [px];efficiency";
hChipEfficiencyMap_trackPos = new TProfile2D("chipEfficiencyMap_trackPos",
title.c_str(),
......@@ -86,6 +86,80 @@ void AnalysisEfficiency::initialise() {
1.5 * m_detector->size().Y(),
0,
1);
eTotalEfficiency =
new TEfficiency("eTotalEfficiency", "totalEfficiency; axis has no meaning; total chip efficiency", 1, 0, 1);
totalEfficiency = new TNamed("totalEffiency", "totalEffiency");
hTrackTimeToPrevHit_matched =
new TH1D("trackTimeToPrevHit_matched", "trackTimeToPrevHit_matched;time to prev hit [us];# events", 1e6, 0, 1e6);
hTrackTimeToPrevHit_notmatched = new TH1D(
"trackTimeToPrevHit_notmatched", "trackTimeToPrevHit_notmatched;time to prev hit [us];# events", 1e6, 0, 1e6);
title = m_detector->name() + "time difference to previous track (if this has assoc cluster)";
hTimeDiffPrevTrack_assocCluster = new TH1D("timeDiffPrevTrack_assocCluster", title.c_str(), 11000, -1000, 10000);
hTimeDiffPrevTrack_assocCluster->GetXaxis()->SetTitle("time diff [#mus]");
hTimeDiffPrevTrack_assocCluster->GetYaxis()->SetTitle("events");
title = m_detector->name() + "time difference to previous track (if this has no assoc cluster)";
hTimeDiffPrevTrack_noAssocCluster = new TH1D("timeDiffPrevTrack_noAssocCluster", title.c_str(), 11000, -1000, 10000);
hTimeDiffPrevTrack_noAssocCluster->GetXaxis()->SetTitle("time diff [#mus]");
hTimeDiffPrevTrack_noAssocCluster->GetYaxis()->SetTitle("events");
hRowDiffPrevTrack_assocCluster = new TH1D("rowDiffPrevTrack_assocCluster",
"rowDiffPrevTrack_assocCluster",
2 * m_detector->nPixels().Y(),
-m_detector->nPixels().Y(),
m_detector->nPixels().Y());
hRowDiffPrevTrack_assocCluster->GetXaxis()->SetTitle("row difference (matched track to prev track) [px]");
hRowDiffPrevTrack_assocCluster->GetYaxis()->SetTitle("# events");
hColDiffPrevTrack_assocCluster = new TH1D("colDiffPrevTrack_assocCluster",
"colDiffPrevTrack_assocCluster",
2 * m_detector->nPixels().X(),
-m_detector->nPixels().X(),
m_detector->nPixels().X());
hColDiffPrevTrack_assocCluster->GetXaxis()->SetTitle("column difference (matched track to prev track) [px]");
hColDiffPrevTrack_assocCluster->GetYaxis()->SetTitle("# events");
hRowDiffPrevTrack_noAssocCluster = new TH1D("rowDiffPrevTrack_noAssocCluster",
"rowDiffPrevTrack_noAssocCluster",
2 * m_detector->nPixels().Y(),
-m_detector->nPixels().Y(),
m_detector->nPixels().Y());
hRowDiffPrevTrack_noAssocCluster->GetXaxis()->SetTitle("row difference (non-matched track - prev track) [px]");
hRowDiffPrevTrack_noAssocCluster->GetYaxis()->SetTitle("events");
hColDiffPrevTrack_noAssocCluster = new TH1D("colDiffPrevTrack_noAassocCluster",
"colDiffPrevTrack_noAssocCluster",
2 * m_detector->nPixels().X(),
-m_detector->nPixels().X(),
m_detector->nPixels().X());
hColDiffPrevTrack_noAssocCluster->GetXaxis()->SetTitle("column difference (non-matched track - prev track) [px]");
hColDiffPrevTrack_noAssocCluster->GetYaxis()->SetTitle("events");
hPosDiffPrevTrack_assocCluster = new TH2D("posDiffPrevTrack_assocCluster",
"posDiffPrevTrack_assocCluster",
2 * m_detector->nPixels().X(),
-m_detector->nPixels().X(),
m_detector->nPixels().X(),
2 * m_detector->nPixels().Y(),
-m_detector->nPixels().Y(),
m_detector->nPixels().Y());
hPosDiffPrevTrack_assocCluster->GetXaxis()->SetTitle("column difference (matched track - prev track) [px]");
hPosDiffPrevTrack_assocCluster->GetYaxis()->SetTitle("row difference (matched track - prev track) [px]");
hPosDiffPrevTrack_noAssocCluster = new TH2D("posDiffPrevTrack_noAssocCluster",
"posDiffPrevTrack_noAssocCluster",
2 * m_detector->nPixels().X(),
-m_detector->nPixels().X(),
m_detector->nPixels().X(),
2 * m_detector->nPixels().Y(),
-m_detector->nPixels().Y(),
m_detector->nPixels().Y());
hPosDiffPrevTrack_noAssocCluster->GetXaxis()->SetTitle("column difference (non-matched track - prev track) [px]");
hPosDiffPrevTrack_noAssocCluster->GetYaxis()->SetTitle("row difference (non-matched track - prev track) [px]");
// initialize matrix with hit timestamps to all 0:
auto nRows = static_cast<size_t>(m_detector->nPixels().Y());
auto nCols = static_cast<size_t>(m_detector->nPixels().X());
std::vector<double> v_row(nRows, 0.); // create vector will zeros of length <nRows>
prev_hit_ts.assign(nCols, v_row); // use vector v_row to construct matrix
}
StatusCode AnalysisEfficiency::run(std::shared_ptr<Clipboard> clipboard) {
......@@ -122,6 +196,7 @@ StatusCode AnalysisEfficiency::run(std::shared_ptr<Clipboard> clipboard) {
if(!m_detector->isWithinROI(track)) {
LOG(DEBUG) << " - track outside ROI";
is_within_roi = false;
// here we don't continue because only some particular histograms shall be effected
}
// Check that it doesn't go through/near a masked pixel
......@@ -186,21 +261,76 @@ StatusCode AnalysisEfficiency::run(std::shared_ptr<Clipboard> clipboard) {
// For pixels, only look at the ROI:
if(is_within_roi) {
hPixelEfficiencyMap_trackPos->Fill(xmod, ymod, has_associated_cluster);
eTotalEfficiency->Fill(has_associated_cluster, 0); // use 0th bin for total efficiency
}
if(has_associated_cluster == false) {
auto intercept_col = static_cast<size_t>(m_detector->getColumn(localIntercept));
auto intercept_row = static_cast<size_t>(m_detector->getRow(localIntercept));
if(has_associated_cluster) {
hTimeDiffPrevTrack_assocCluster->Fill(
static_cast<double>(Units::convert(track->timestamp() - last_track_timestamp, "us")));
hRowDiffPrevTrack_assocCluster->Fill(m_detector->getRow(localIntercept) - last_track_row);
hColDiffPrevTrack_assocCluster->Fill(m_detector->getColumn(localIntercept) - last_track_col);
hPosDiffPrevTrack_assocCluster->Fill(m_detector->getColumn(localIntercept) - last_track_col,
m_detector->getRow(localIntercept) - last_track_row);
if((prev_hit_ts.at(intercept_col)).at(intercept_row) != 0) {