Commit 50b65bd1 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Merge branch 'master' into clipboard

parents 8530e5ab 5b9b1f82
......@@ -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(std::shared_ptr<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(std::shared_ptr<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
......
This diff is collapsed.
/**
* @file
* @brief Definition of [AnalysisTimingATLASpix] module
* @copyright Copyright (c) 2018 CERN and the Allpix Squared authors.
* This software is distributed under the terms of the MIT License, copied verbatim in the file "LICENSE.md".
* In applying this license, CERN does not waive the privileges and immunities granted to it by virtue of its status as an
* Intergovernmental Organization or submit itself to any jurisdiction.
* *
* Refer to the User's Manual for more details.
*/
#include <iostream>
#include "TGraphErrors.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TProfile2D.h"
#include "core/module/Module.hpp"
namespace corryvreckan {
/** @ingroup Modules
* @brief Module to do function
*
* More detailed explanation of module
*/
class AnalysisTimingATLASpix : public Module {
public:
/**
* @brief Constructor for this unique module
* @param config Configuration object for this module as retrieved from the steering file
* @param detector Pointer to the detector for this module instance
*/
AnalysisTimingATLASpix(Configuration config, std::shared_ptr<Detector> detector);
void initialise();
StatusCode run(std::shared_ptr<Clipboard> clipboard);
void finalise();
private:
std::shared_ptr<Detector> m_detector;
// timing correction functions:
void correctClusterTimestamp(Cluster*, int mode);
// 1D histograms:
TH1F* hTrackCorrelationTime;
TH1F* hTrackCorrelationTimeAssoc;
TH1F* hTrackCorrelationTime_rowCorr;
TH1F* hTrackCorrelationTime_rowAndTimeWalkCorr;
TH1F* hTrackCorrelationTime_rowAndTimeWalkCorr_l25;
TH1F* hTrackCorrelationTime_rowAndTimeWalkCorr_l40;
TH1F* hTrackCorrelationTime_rowAndTimeWalkCorr_g40;
TH1D* hTrackCorrelationTime_example;
TH1F* hClusterTimeMinusPixelTime;
// 2D histograms:
TH2F* hTrackCorrelationTimeVsCol; // control plot only
TH2F* hTrackCorrelationTimeVsRow;
TH2F* hTrackCorrelationTimeVsRow_1px;
TH2F* hTrackCorrelationTimeVsRow_npx;
TH2F* hTrackCorrelationTimeVsRow_rowCorr;
TH2F* hTrackCorrelationTimeVsTot;
TH2F* hTrackCorrelationTimeVsTot_1px;
TH2F* hTrackCorrelationTimeVsTot_npx;
TH2F* hTrackCorrelationTimeVsTot_rowCorr;
TH2F* hTrackCorrelationTimeVsTot_rowCorr_1px;
TH2F* hTrackCorrelationTimeVsTot_rowCorr_npx;
TH2F* hTrackCorrelationTimeVsRow_rowAndTimeWalkCorr;
TH2F* hTrackCorrelationTimeVsTot_rowAndTimeWalkCorr;
TH2F* hClusterSizeVsTot_Assoc;
TH2F* hHitMapAssoc;
TH2F* hHitMapAssoc_highCharge;
TH2F* hHitMapAssoc_inPixel;
TH2F* hHitMapAssoc_inPixel_highCharge;
TH2F* hClusterMapAssoc;
TH2F* hTotVsTime;
TH2F* hTotVsTime_high;
// Control Plots for "left tail" and "main peak" of time correlation
TH2F* hClusterMap_leftTail;
TH2F* hClusterMap_mainPeak;
TH1F* hTot_leftTail;
TH1F* hTot_mainPeak;
TH1F* hPixelTimestamp_leftTail;
TH1F* hPixelTimestamp_mainPeak;
TH1F* hClusterSize_leftTail;
TH1F* hClusterSize_mainPeak;
// TGraphErrors:
TGraphErrors* gTimeCorrelationVsRow;
TGraphErrors* gTimeCorrelationVsTot_rowCorr;
TGraphErrors* gTimeCorrelationVsTot_rowCorr_1px;
TGraphErrors* gTimeCorrelationVsTot_rowCorr_npx;
TGraphErrors* gRowCorr;
TGraphErrors* gTimeWalkCorr;
// Member Variables:
std::string m_DUT;
double m_timingCut;
double m_chi2ndofCut;
double m_timeCutFrameEdge;
double m_clusterChargeCut;
size_t m_clusterSizeCut;
int m_highTotCut; // for pixel->tot()
double m_highChargeCut; // for cluster->charge()
double m_leftTailCut;
std::string m_correctionFile_row;
std::string m_correctionGraph_row;
std::string m_correctionFile_timewalk;
std::string m_correctionGraph_timewalk;
bool m_calcCorrections;
bool m_pointwise_correction_row;
bool m_pointwise_correction_timewalk;
int m_totBinExample;
int total_tracks_uncut;
int tracks_afterChi2Cut;
int tracks_hasIntercept;
int tracks_isWithinROI;
int tracks_afterMasking;
int total_tracks;
int matched_tracks;
int tracks_afterClusterChargeCut;
int tracks_afterClusterSizeCut;
};
} // namespace corryvreckan
# Define module and return the generated name as MODULE_NAME
CORRYVRECKAN_DETECTOR_MODULE(MODULE_NAME)
CORRYVRECKAN_DETECTOR_TYPE(${MODULE_NAME} "ATLASpix")
# Add source files to library
CORRYVRECKAN_MODULE_SOURCES(${MODULE_NAME}
AnalysisTimingATLASpix.cpp
# ADD SOURCE FILES HERE...
)
# Provide standard install target
CORRYVRECKAN_MODULE_INSTALL(${MODULE_NAME})