Newer
Older
/**
* @file

Jens Kroeger
committed
* @brief Definition of [AnalysisTimingATLASpix] module
*
* @copyright Copyright (c) 2018-2020 CERN and the Corryvreckan 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
*/

Jens Kroeger
committed
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
*/

Jens Kroeger
committed
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;

Jens Kroeger
committed
TH1F* hTrackCorrelationTime_rowAndTWCorr;
TH1F* hTrackCorrelationTime_rowAndTWCorr_l25;
TH1F* hTrackCorrelationTime_rowAndTWCorr_l40;
TH1F* hTrackCorrelationTime_rowAndTWCorr_g40;
TH1D* hTrackCorrelationTime_example;

Jens Kroeger
committed
TH1F* hClusterTimeMinusPixelTime;
// 2D histograms:
TH2F* hTrackCorrelationTimeAssocVsTime;
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;

Jens Kroeger
committed
TH2F* hTrackCorrelationTimeVsRow_rowAndTWCorr;
TH2F* hTrackCorrelationTimeVsTot_rowAndTWCorr;
TProfile2D* hPixelTrackCorrelationTimeMap;
TH2F* hClusterSizeVsTot_Assoc;
TH2F* hHitMapAssoc;

Jens Kroeger
committed
TH2F* hHitMapAssoc_highToT;
TH2F* hHitMapAssoc_inPixel;

Jens Kroeger
committed
TH2F* hHitMapAssoc_inPixel_highToT;
TH2F* hClusterMapAssoc;

Jens Kroeger
committed
TH2F* hTotVsTime;
TH2F* hTotVsTime_high;

Jens Kroeger
committed
// Control Plots for "left/right tail" and "main peak" of time correlation

Jens Kroeger
committed
TH2F* hInPixelMap_leftTail;

Jens Kroeger
committed
TH2F* hInPixelMap_rightTail;
TH2F* hInPixelMap_mainPeak;
TH2F* hClusterMap_leftTail;

Jens Kroeger
committed
TH2F* hClusterMap_rightTail;

Jens Kroeger
committed
TH2F* hClusterMap_mainPeak;
TH1F* hTot_leftTail;

Jens Kroeger
committed
TH1F* hTot_rightTail;

Jens Kroeger
committed
TH1F* hTot_mainPeak;

Jens Kroeger
committed
TH1F* hTot_leftTail_1px;
TH1F* hTot_rightTail_1px;
TH1F* hTot_mainPeak_1px;
TH1F* hPixelTimestamp_leftTail;

Jens Kroeger
committed
TH1F* hPixelTimestamp_rightTail;

Jens Kroeger
committed
TH1F* hPixelTimestamp_mainPeak;
TH1F* hClusterSize_leftTail;

Jens Kroeger
committed
TH1F* hClusterSize_rightTail;

Jens Kroeger
committed
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_timeCut;
double m_chi2ndofCut;
double m_timeCutFrameEdge;

Jens Kroeger
committed
double m_clusterChargeCut;
size_t m_clusterSizeCut;

Jens Kroeger
committed
int m_highTotCut; // for pixel->tot()
int m_lowTotCut; // for pixel->tot()
double m_timingTailCut;
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;

Jens Kroeger
committed
XYVector m_inpixelBinSize;
int total_tracks_uncut;
int tracks_afterChi2Cut;
int tracks_hasIntercept;
int tracks_isWithinROI;
int tracks_afterMasking;
int total_tracks;
int matched_tracks;

Jens Kroeger
committed
int tracks_afterClusterChargeCut;
int tracks_afterClusterSizeCut;
};
} // namespace corryvreckan